-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to package.json and rollup.config
rollup.config now has named exports "Emitter", dist/emitter.umd.js is now "main" property in package.json
- Loading branch information
1 parent
ef8d588
commit 3a8324d
Showing
9 changed files
with
13 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"use strict";const e={string:function(e){return"string"==typeof e},object:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},array:function(e){return Array.isArray(e)},bool:function(e){return"boolean"==typeof e},number:function(e){return"number"==typeof e},func:function(e){return"function"==typeof e},nul:function(e){return null===e},undef:function(e){return void 0===e||void 0===e}};function t(t,n,r,i){this.name=t,this.namespace=n,this.func=r,this.priority=e.number(i)?i:1}function n(n){this.config={},Object.defineProperty(this.config,"maxListeners",{value:n&&"number"==typeof n.maxListeners?n.maxListeners:50,writable:!1,enumerable:!0}),Object.defineProperty(this.config,"maxOnceListeners",{value:n&&"number"==typeof n.maxOnceListeners?n.maxOnceListeners:50,writable:!1,enumerable:!0});const r=[],i=[],s=e=>r.filter((t=>t.name===e)).length>=this.config.maxListeners,o=e=>i.filter((t=>t.name===e)).length>=this.config.maxListeners,a=(e,t)=>{let n=r.length;for(;n;)if(n-=1,r[n].name===e&&r[n].namespace===t)return n;return-1};this.register=(n,i,o,f)=>{if(!n)return;if(void 0!==f&&!e.number(f))throw new Error("priority must be a number");if(e.func(i))if(e.string(o)){const e=o;o=i,i=e}else e.number(o)&&(f=o),o=i,i="all";const u=a(n,i),l=new t(n,i,o,f);-1===u?s(n)?console.warn(`Max listeners reached for event ${n}`):r.push(l):r[u]=l,r.sort(((e,t)=>e.priority===t.priority?0:e.priority<t.priority?1:-1))},this.on=this.register,this.subscribe=this.register,this.once=(e,n,r)=>{if(!e)return;const s=new t(e,"",n,r);o(e)?console.warn(`Max once listeners reached for event ${e}`):i.push(s),i.sort(((e,t)=>e.priority===t.priority?0:e.priority>t.priority?1:-1))},this.onMany=(e,t)=>{t&&Object.keys(t).forEach((n=>{this.on(n,e,t[n])}))},this.unregister=(e,t)=>{if(!e)return;let n=0;if("all"!==(t=t||"all"))n=a(e,t),-1!==n&&r.splice(n,1);else{for(n=r.length;n;)n-=1,r[n].name===e&&"all"===r[n].namespace&&r.splice(n,1);for(n=i.length;n;)n-=1,i[n].name===e&&i.splice(n,1)}},this.off=this.unregister,this.unsubscribe=this.unregister,this.offAll=e=>{let t=r.length;for(;t;)t-=1,r[t].namespace===e&&r.splice(t,1)};this.trigger=(e,t)=>{const n=(e=>{const t=[];for(let n=0,i=r.length;n<i;n+=1)((r[n].name.indexOf("*")>-1||r[n].name.indexOf("?")>-1)&&new RegExp(r[n].name.replace(/\*/g,".*")).test(e)||r[n].name===e)&&t.push(r[n]);return t})(e);for(let r=0,i=n.length;r<i;r+=1)n[r].func(t,e);((e,t)=>{let n=i.length;for(;n;)n-=1,((i[n].name.indexOf("*")>-1||i[n].name.indexOf("?")>-1)&&new RegExp(i[n].name.replace(/\*/g,".*").replace(/\?/g,".")).test(e)||i[n].name===e)&&(i[n].func(t,e),i.splice(n,1))})(e,t)},this.emit=this.trigger,this.publish=this.trigger,this.propagate=(e,t)=>{this.trigger(t,e)},this.isRegistered=(e,t)=>{t=t||"all";let n=r.length;for(;n;)if(n-=1,r[n].namespace===t&&r[n].name===e)return!0;for(n=i.length;n;)if(n-=1,i[n].name===e)return!0;return!1}}n.HIGH_PRIORITY=2,n.NORMAL_PRIORITY=1,n.LOW_PRIORITY=0,module.exports=n; | ||
"use strict";const e={string:function(e){return"string"==typeof e},object:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},array:function(e){return Array.isArray(e)},bool:function(e){return"boolean"==typeof e},number:function(e){return"number"==typeof e},func:function(e){return"function"==typeof e},nul:function(e){return null===e},undef:function(e){return void 0===e||void 0===e}};function n(n,t,r,i){this.name=n,this.namespace=t,this.func=r,this.priority=e.number(i)?i:1}function t(t){this.config={},Object.defineProperty(this.config,"maxListeners",{value:t&&"number"==typeof t.maxListeners?t.maxListeners:50,writable:!1,enumerable:!0}),Object.defineProperty(this.config,"maxOnceListeners",{value:t&&"number"==typeof t.maxOnceListeners?t.maxOnceListeners:50,writable:!1,enumerable:!0});const r=[],i=[],s=e=>r.filter((n=>n.name===e)).length>=this.config.maxListeners,o=e=>i.filter((n=>n.name===e)).length>=this.config.maxListeners,a=(e,n)=>{let t=r.length;for(;t;)if(t-=1,r[t].name===e&&r[t].namespace===n)return t;return-1};this.register=(t,i,o,f)=>{if(!t)return;if(void 0!==f&&!e.number(f))throw new Error("priority must be a number");if(e.func(i))if(e.string(o)){const e=o;o=i,i=e}else e.number(o)&&(f=o),o=i,i="all";const u=a(t,i),l=new n(t,i,o,f);-1===u?s(t)?console.warn(`Max listeners reached for event ${t}`):r.push(l):r[u]=l,r.sort(((e,n)=>e.priority===n.priority?0:e.priority<n.priority?1:-1))},this.on=this.register,this.subscribe=this.register,this.once=(e,t)=>{if(!e)return;const r=new n(e,"",t);o(e)?console.warn(`Max once listeners reached for event ${e}`):i.push(r)},this.onMany=(e,n)=>{n&&Object.keys(n).forEach((t=>{this.on(t,e,n[t])}))},this.unregister=(e,n)=>{if(!e)return;let t=0;if("all"!==(n=n||"all"))t=a(e,n),-1!==t&&r.splice(t,1);else{for(t=r.length;t;)t-=1,r[t].name===e&&"all"===r[t].namespace&&r.splice(t,1);for(t=i.length;t;)t-=1,i[t].name===e&&i.splice(t,1)}},this.off=this.unregister,this.unsubscribe=this.unregister,this.offAll=e=>{let n=r.length;for(;n;)n-=1,r[n].namespace===e&&r.splice(n,1)};this.trigger=(e,n)=>{const t=(e=>{const n=[];for(let t=0,i=r.length;t<i;t+=1)((r[t].name.indexOf("*")>-1||r[t].name.indexOf("?")>-1)&&new RegExp(r[t].name.replace(/\*/g,".*")).test(e)||r[t].name===e)&&n.push(r[t]);return n})(e);for(let r=0,i=t.length;r<i;r+=1)t[r].func(n,e);((e,n)=>{let t=i.length;for(;t;)t-=1,((i[t].name.indexOf("*")>-1||i[t].name.indexOf("?")>-1)&&new RegExp(i[t].name.replace(/\*/g,".*").replace(/\?/g,".")).test(e)||i[t].name===e)&&(i[t].func(n,e),i.splice(t,1))})(e,n)},this.emit=this.trigger,this.publish=this.trigger,this.propagate=(e,n)=>{this.trigger(n,e)},this.isRegistered=(e,n)=>{n=n||"all";let t=r.length;for(;t;)if(t-=1,r[t].namespace===n&&r[t].name===e)return!0;for(t=i.length;t;)if(t-=1,i[t].name===e)return!0;return!1}}t.HIGH_PRIORITY=2,t.NORMAL_PRIORITY=1,t.LOW_PRIORITY=0,module.exports=t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
declare module '@mdaemon/emitter/dist/emitter.cjs'; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const e={string:function(e){return"string"==typeof e},object:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},array:function(e){return Array.isArray(e)},bool:function(e){return"boolean"==typeof e},number:function(e){return"number"==typeof e},func:function(e){return"function"==typeof e},nul:function(e){return null===e},undef:function(e){return void 0===e||void 0===e}};function t(t,n,r,i){this.name=t,this.namespace=n,this.func=r,this.priority=e.number(i)?i:1}function n(n){this.config={},Object.defineProperty(this.config,"maxListeners",{value:n&&"number"==typeof n.maxListeners?n.maxListeners:50,writable:!1,enumerable:!0}),Object.defineProperty(this.config,"maxOnceListeners",{value:n&&"number"==typeof n.maxOnceListeners?n.maxOnceListeners:50,writable:!1,enumerable:!0});const r=[],i=[],s=e=>r.filter((t=>t.name===e)).length>=this.config.maxListeners,o=e=>i.filter((t=>t.name===e)).length>=this.config.maxListeners,a=(e,t)=>{let n=r.length;for(;n;)if(n-=1,r[n].name===e&&r[n].namespace===t)return n;return-1};this.register=(n,i,o,f)=>{if(!n)return;if(void 0!==f&&!e.number(f))throw new Error("priority must be a number");if(e.func(i))if(e.string(o)){const e=o;o=i,i=e}else e.number(o)&&(f=o),o=i,i="all";const l=a(n,i),u=new t(n,i,o,f);-1===l?s(n)?console.warn(`Max listeners reached for event ${n}`):r.push(u):r[l]=u,r.sort(((e,t)=>e.priority===t.priority?0:e.priority<t.priority?1:-1))},this.on=this.register,this.subscribe=this.register,this.once=(e,n,r)=>{if(!e)return;const s=new t(e,"",n,r);o(e)?console.warn(`Max once listeners reached for event ${e}`):i.push(s),i.sort(((e,t)=>e.priority===t.priority?0:e.priority>t.priority?1:-1))},this.onMany=(e,t)=>{t&&Object.keys(t).forEach((n=>{this.on(n,e,t[n])}))},this.unregister=(e,t)=>{if(!e)return;let n=0;if("all"!==(t=t||"all"))n=a(e,t),-1!==n&&r.splice(n,1);else{for(n=r.length;n;)n-=1,r[n].name===e&&"all"===r[n].namespace&&r.splice(n,1);for(n=i.length;n;)n-=1,i[n].name===e&&i.splice(n,1)}},this.off=this.unregister,this.unsubscribe=this.unregister,this.offAll=e=>{let t=r.length;for(;t;)t-=1,r[t].namespace===e&&r.splice(t,1)};this.trigger=(e,t)=>{const n=(e=>{const t=[];for(let n=0,i=r.length;n<i;n+=1)((r[n].name.indexOf("*")>-1||r[n].name.indexOf("?")>-1)&&new RegExp(r[n].name.replace(/\*/g,".*")).test(e)||r[n].name===e)&&t.push(r[n]);return t})(e);for(let r=0,i=n.length;r<i;r+=1)n[r].func(t,e);((e,t)=>{let n=i.length;for(;n;)n-=1,((i[n].name.indexOf("*")>-1||i[n].name.indexOf("?")>-1)&&new RegExp(i[n].name.replace(/\*/g,".*").replace(/\?/g,".")).test(e)||i[n].name===e)&&(i[n].func(t,e),i.splice(n,1))})(e,t)},this.emit=this.trigger,this.publish=this.trigger,this.propagate=(e,t)=>{this.trigger(t,e)},this.isRegistered=(e,t)=>{t=t||"all";let n=r.length;for(;n;)if(n-=1,r[n].namespace===t&&r[n].name===e)return!0;for(n=i.length;n;)if(n-=1,i[n].name===e)return!0;return!1}}n.HIGH_PRIORITY=2,n.NORMAL_PRIORITY=1,n.LOW_PRIORITY=0;export{n as default}; | ||
const e={string:function(e){return"string"==typeof e},object:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},array:function(e){return Array.isArray(e)},bool:function(e){return"boolean"==typeof e},number:function(e){return"number"==typeof e},func:function(e){return"function"==typeof e},nul:function(e){return null===e},undef:function(e){return void 0===e||void 0===e}};function n(n,t,r,i){this.name=n,this.namespace=t,this.func=r,this.priority=e.number(i)?i:1}function t(t){this.config={},Object.defineProperty(this.config,"maxListeners",{value:t&&"number"==typeof t.maxListeners?t.maxListeners:50,writable:!1,enumerable:!0}),Object.defineProperty(this.config,"maxOnceListeners",{value:t&&"number"==typeof t.maxOnceListeners?t.maxOnceListeners:50,writable:!1,enumerable:!0});const r=[],i=[],s=e=>r.filter((n=>n.name===e)).length>=this.config.maxListeners,o=e=>i.filter((n=>n.name===e)).length>=this.config.maxListeners,a=(e,n)=>{let t=r.length;for(;t;)if(t-=1,r[t].name===e&&r[t].namespace===n)return t;return-1};this.register=(t,i,o,f)=>{if(!t)return;if(void 0!==f&&!e.number(f))throw new Error("priority must be a number");if(e.func(i))if(e.string(o)){const e=o;o=i,i=e}else e.number(o)&&(f=o),o=i,i="all";const l=a(t,i),u=new n(t,i,o,f);-1===l?s(t)?console.warn(`Max listeners reached for event ${t}`):r.push(u):r[l]=u,r.sort(((e,n)=>e.priority===n.priority?0:e.priority<n.priority?1:-1))},this.on=this.register,this.subscribe=this.register,this.once=(e,t)=>{if(!e)return;const r=new n(e,"",t);o(e)?console.warn(`Max once listeners reached for event ${e}`):i.push(r)},this.onMany=(e,n)=>{n&&Object.keys(n).forEach((t=>{this.on(t,e,n[t])}))},this.unregister=(e,n)=>{if(!e)return;let t=0;if("all"!==(n=n||"all"))t=a(e,n),-1!==t&&r.splice(t,1);else{for(t=r.length;t;)t-=1,r[t].name===e&&"all"===r[t].namespace&&r.splice(t,1);for(t=i.length;t;)t-=1,i[t].name===e&&i.splice(t,1)}},this.off=this.unregister,this.unsubscribe=this.unregister,this.offAll=e=>{let n=r.length;for(;n;)n-=1,r[n].namespace===e&&r.splice(n,1)};this.trigger=(e,n)=>{const t=(e=>{const n=[];for(let t=0,i=r.length;t<i;t+=1)((r[t].name.indexOf("*")>-1||r[t].name.indexOf("?")>-1)&&new RegExp(r[t].name.replace(/\*/g,".*")).test(e)||r[t].name===e)&&n.push(r[t]);return n})(e);for(let r=0,i=t.length;r<i;r+=1)t[r].func(n,e);((e,n)=>{let t=i.length;for(;t;)t-=1,((i[t].name.indexOf("*")>-1||i[t].name.indexOf("?")>-1)&&new RegExp(i[t].name.replace(/\*/g,".*").replace(/\?/g,".")).test(e)||i[t].name===e)&&(i[t].func(n,e),i.splice(t,1))})(e,n)},this.emit=this.trigger,this.publish=this.trigger,this.propagate=(e,n)=>{this.trigger(n,e)},this.isRegistered=(e,n)=>{n=n||"all";let t=r.length;for(;t;)if(t-=1,r[t].namespace===n&&r[t].name===e)return!0;for(t=i.length;t;)if(t-=1,i[t].name===e)return!0;return!1}}t.HIGH_PRIORITY=2,t.NORMAL_PRIORITY=1,t.LOW_PRIORITY=0;export{t as default}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
declare module '@mdaemon/emitter/dist/emitter.mjs'; | ||
declare module '@mdaemon/emitter/dist/emitter.mjs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
declare module '@mdaemon/emitter/dist/emitter.umd.js'; | ||
declare module '@mdaemon/emitter/dist/emitter.umd.js' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters