maishu-toolkit
Advanced tools
Comparing version 1.1.1 to 1.1.2
/*! | ||
* ~ | ||
* maishu-toolkit v1.1.1 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -151,12 +151,11 @@ * | ||
key: "fire", | ||
value: function fire(args) { | ||
value: function fire() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
this.funcs.forEach(function (o) { | ||
return o(args); | ||
return o.apply(void 0, args); | ||
}); | ||
} | ||
}], [{ | ||
key: "create", | ||
value: function create() { | ||
return new Callback(); | ||
} | ||
}]); | ||
@@ -168,2 +167,8 @@ | ||
exports.Callback = Callback; | ||
function Callbacks() { | ||
return new Callback(); | ||
} | ||
exports.Callbacks = Callbacks; | ||
//# sourceMappingURL=callback.js.map | ||
@@ -301,6 +306,7 @@ | ||
exports.Errors = errors_1.Errors; | ||
exports.errors = errors_1.errors; | ||
var callback_1 = __webpack_require__(/*! ./callback */ "./out-es5/callback.js"); | ||
exports.Callback = callback_1.Callback; | ||
exports.Callbacks = callback_1.Callbacks; | ||
//# sourceMappingURL=index.js.map | ||
@@ -307,0 +313,0 @@ |
/*! | ||
* ~ | ||
* maishu-toolkit v1.1.1 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -10,3 +10,3 @@ * | ||
*/ | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r=n();for(var t in r)("object"==typeof exports?exports:e)[t]=r[t]}}("undefined"==typeof window?global:window,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(1);n.guid=t.guid;var o=r(2);n.pathContact=o.pathContact;var u=r(3);n.Errors=u.Errors;var a=r(4);n.Callback=a.Callback},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.pathContact=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(0==(n=n||[]).length)return"";if(1==n.length)return n[0];var t=n.join("");return t=t.replace(/\/+/g,"/")}},function(e,n,r){"use strict";function t(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r,o;return n=e,(r=[{key:"argumentNull",value:function(e){var n=new Error("Argument ".concat(e," cannt be null or emtpy."));return n.name="argumentNull",n}},{key:"routeDataFieldNull",value:function(e){var n="The ".concat(e," field of route data cannt be null."),r=new Error(n);return r.name="routeDataFieldNull",r}},{key:"argumentFieldNull",value:function(e,n){var r="The ".concat(e," field of ").concat(n," cannt be null."),t=new Error(r);return t.name="argumentFieldNull",t}},{key:"argumentTypeIncorrect",value:function(e,n){var r="Argument ".concat(e," type error, expected type is ").concat(n,"."),t=new Error(r);return t.name="argumentTypeIncorrect",t}}])&&t(n.prototype,r),o&&t(n,o),e}();n.Errors=o,n.errors=new o},function(e,n,r){"use strict";function t(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.funcs=new Array}var n,r,o;return n=e,o=[{key:"create",value:function(){return new e}}],(r=[{key:"add",value:function(e){this.funcs.push(e)}},{key:"remove",value:function(e){this.funcs=this.funcs.filter((function(n){return n!=e}))}},{key:"fire",value:function(e){this.funcs.forEach((function(n){return n(e)}))}}])&&t(n.prototype,r),o&&t(n,o),e}();n.Callback=o}])})); | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r=n();for(var t in r)("object"==typeof exports?exports:e)[t]=r[t]}}("undefined"==typeof window?global:window,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(1);n.guid=t.guid;var o=r(2);n.pathContact=o.pathContact;var u=r(3);n.Errors=u.Errors,n.errors=u.errors;var a=r(4);n.Callbacks=a.Callbacks},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.pathContact=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(0==(n=n||[]).length)return"";if(1==n.length)return n[0];var t=n.join("");return t=t.replace(/\/+/g,"/")}},function(e,n,r){"use strict";function t(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r,o;return n=e,(r=[{key:"argumentNull",value:function(e){var n=new Error("Argument ".concat(e," cannt be null or emtpy."));return n.name="argumentNull",n}},{key:"routeDataFieldNull",value:function(e){var n="The ".concat(e," field of route data cannt be null."),r=new Error(n);return r.name="routeDataFieldNull",r}},{key:"argumentFieldNull",value:function(e,n){var r="The ".concat(e," field of ").concat(n," cannt be null."),t=new Error(r);return t.name="argumentFieldNull",t}},{key:"argumentTypeIncorrect",value:function(e,n){var r="Argument ".concat(e," type error, expected type is ").concat(n,"."),t=new Error(r);return t.name="argumentTypeIncorrect",t}}])&&t(n.prototype,r),o&&t(n,o),e}();n.Errors=o,n.errors=new o},function(e,n,r){"use strict";function t(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.funcs=new Array}var n,r,o;return n=e,(r=[{key:"add",value:function(e){this.funcs.push(e)}},{key:"remove",value:function(e){this.funcs=this.funcs.filter((function(n){return n!=e}))}},{key:"fire",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.funcs.forEach((function(e){return e.apply(void 0,n)}))}}])&&t(n.prototype,r),o&&t(n,o),e}();n.Callback=o,n.Callbacks=function(){return new o}}])})); | ||
//# sourceMappingURL=index.es5.min.js.map |
/*! | ||
* ~ | ||
* maishu-toolkit v1.1.1 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -128,10 +128,11 @@ * | ||
} | ||
fire(args) { | ||
this.funcs.forEach(o => o(args)); | ||
fire(...args) { | ||
this.funcs.forEach(o => o(...args)); | ||
} | ||
static create() { | ||
return new Callback(); | ||
} | ||
} | ||
exports.Callback = Callback; | ||
function Callbacks() { | ||
return new Callback(); | ||
} | ||
exports.Callbacks = Callbacks; | ||
@@ -226,4 +227,5 @@ | ||
exports.Errors = errors_1.Errors; | ||
exports.errors = errors_1.errors; | ||
var callback_1 = __webpack_require__(/*! ./callback */ "./out/callback.js"); | ||
exports.Callback = callback_1.Callback; | ||
exports.Callbacks = callback_1.Callbacks; | ||
@@ -230,0 +232,0 @@ |
/*! | ||
* ~ | ||
* maishu-toolkit v1.1.1 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -10,3 +10,3 @@ * | ||
*/ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"==typeof window?global:window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.guid=n.guid;var o=r(2);t.pathContact=o.pathContact;var u=r(3);t.Errors=u.Errors;var l=r(4);t.Callback=l.Callback},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathContact=function(...e){if(0==(e=e||[]).length)return"";if(1==e.length)return e[0];let t=e.join("");return t=t.replace(/\/+/g,"/"),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{argumentNull(e){let t=new Error(`Argument ${e} cannt be null or emtpy.`);return t.name="argumentNull",t}routeDataFieldNull(e){let t=new Error(`The ${e} field of route data cannt be null.`);return t.name="routeDataFieldNull",t}argumentFieldNull(e,t){let r=new Error(`The ${e} field of ${t} cannt be null.`);return r.name="argumentFieldNull",r}argumentTypeIncorrect(e,t){let r=new Error(`Argument ${e} type error, expected type is ${t}.`);return r.name="argumentTypeIncorrect",r}}t.Errors=n,t.errors=new n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(){this.funcs=new Array}add(e){this.funcs.push(e)}remove(e){this.funcs=this.funcs.filter(t=>t!=e)}fire(e){this.funcs.forEach(t=>t(e))}static create(){return new n}}t.Callback=n}])})); | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}("undefined"==typeof window?global:window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(1);r.guid=n.guid;var o=t(2);r.pathContact=o.pathContact;var u=t(3);r.Errors=u.Errors,r.errors=u.errors;var l=t(4);r.Callbacks=l.Callbacks},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.pathContact=function(...e){if(0==(e=e||[]).length)return"";if(1==e.length)return e[0];let r=e.join("");return r=r.replace(/\/+/g,"/"),r}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});class n{argumentNull(e){let r=new Error(`Argument ${e} cannt be null or emtpy.`);return r.name="argumentNull",r}routeDataFieldNull(e){let r=new Error(`The ${e} field of route data cannt be null.`);return r.name="routeDataFieldNull",r}argumentFieldNull(e,r){let t=new Error(`The ${e} field of ${r} cannt be null.`);return t.name="argumentFieldNull",t}argumentTypeIncorrect(e,r){let t=new Error(`Argument ${e} type error, expected type is ${r}.`);return t.name="argumentTypeIncorrect",t}}r.Errors=n,r.errors=new n},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});class n{constructor(){this.funcs=new Array}add(e){this.funcs.push(e)}remove(e){this.funcs=this.funcs.filter(r=>r!=e)}fire(...e){this.funcs.forEach(r=>r(...e))}}r.Callback=n,r.Callbacks=function(){return new n}}])})); | ||
//# sourceMappingURL=index.min.js.map |
@@ -1,7 +0,25 @@ | ||
export declare class Callback<Arguments> { | ||
export declare class Callback { | ||
private funcs; | ||
add(func: (args: Arguments) => void): void; | ||
remove(func: (args: Arguments) => any): void; | ||
fire(args: Arguments): void; | ||
static create<Argument>(): Callback<Argument>; | ||
constructor(); | ||
add(func: (...args: Array<any>) => any): void; | ||
remove(func: (...args: Array<any>) => any): void; | ||
fire(...args: Array<any>): void; | ||
} | ||
export interface Callback0<A> extends Callback { | ||
add(func: (arg: A) => any): void; | ||
remove(func: (arg: A) => any): void; | ||
fire(arg: A): void; | ||
} | ||
export interface Callback1<S, A> extends Callback { | ||
add(func: (sender: S, arg: A) => any): void; | ||
remove(func: (sender: S, arg: A) => any): void; | ||
fire(sender: S, arg: A): void; | ||
} | ||
export interface Callback2<S, A, A1> extends Callback { | ||
add(func: (sender: S, arg: A, arg1: A1) => any): void; | ||
remove(func: (sender: S, arg: A, arg1: A1) => any): void; | ||
fire(sender: S, arg: A, arg1: A1): void; | ||
} | ||
export declare function Callbacks<S, A, A1>(): Callback2<S, A, A1>; | ||
export declare function Callbacks<S, A>(): Callback1<S, A>; | ||
export declare function Callbacks<A>(): Callback0<A>; |
@@ -0,0 +0,0 @@ declare module "lessjs" { |
@@ -0,0 +0,0 @@ export declare class Errors { |
export declare function guid(): string; |
export { guid } from "./guid"; | ||
export { pathContact } from "./path"; | ||
export { Errors } from "./errors"; | ||
export { Callback } from "./callback"; | ||
export { Errors, errors } from "./errors"; | ||
export { Callbacks } from "./callback"; |
/** 连接多个路径 */ | ||
export declare function pathContact(...paths: string[]): string; |
@@ -36,12 +36,11 @@ "use strict"; | ||
key: "fire", | ||
value: function fire(args) { | ||
value: function fire() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
this.funcs.forEach(function (o) { | ||
return o(args); | ||
return o.apply(void 0, args); | ||
}); | ||
} | ||
}], [{ | ||
key: "create", | ||
value: function create() { | ||
return new Callback(); | ||
} | ||
}]); | ||
@@ -53,2 +52,8 @@ | ||
exports.Callback = Callback; | ||
function Callbacks() { | ||
return new Callback(); | ||
} | ||
exports.Callbacks = Callbacks; | ||
//# sourceMappingURL=callback.js.map |
@@ -18,6 +18,7 @@ "use strict"; | ||
exports.Errors = errors_1.Errors; | ||
exports.errors = errors_1.errors; | ||
var callback_1 = require("./callback"); | ||
exports.Callback = callback_1.Callback; | ||
exports.Callbacks = callback_1.Callbacks; | ||
//# sourceMappingURL=index.js.map |
@@ -13,9 +13,10 @@ "use strict"; | ||
} | ||
fire(args) { | ||
this.funcs.forEach(o => o(args)); | ||
fire(...args) { | ||
this.funcs.forEach(o => o(...args)); | ||
} | ||
static create() { | ||
return new Callback(); | ||
} | ||
} | ||
exports.Callback = Callback; | ||
function Callbacks() { | ||
return new Callback(); | ||
} | ||
exports.Callbacks = Callbacks; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -9,3 +9,4 @@ "use strict"; | ||
exports.Errors = errors_1.Errors; | ||
exports.errors = errors_1.errors; | ||
var callback_1 = require("./callback"); | ||
exports.Callback = callback_1.Callback; | ||
exports.Callbacks = callback_1.Callbacks; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "maishu-toolkit", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/typings/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
0
89475
33
872