maishu-toolkit
Advanced tools
Comparing version 1.0.0 to 1.1.0
/*! | ||
* ~ | ||
* maishu-toolkit v1.0.0 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -108,2 +108,66 @@ * | ||
/***/ "./out-es5/callback.js": | ||
/*!*****************************!*\ | ||
!*** ./out-es5/callback.js ***! | ||
\*****************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var Callback = | ||
/*#__PURE__*/ | ||
function () { | ||
function Callback() { | ||
_classCallCheck(this, Callback); | ||
this.funcs = new Array(); | ||
} | ||
_createClass(Callback, [{ | ||
key: "add", | ||
value: function add(func) { | ||
this.funcs.push(func); | ||
} | ||
}, { | ||
key: "remove", | ||
value: function remove(func) { | ||
this.funcs = this.funcs.filter(function (o) { | ||
return o != func; | ||
}); | ||
} | ||
}, { | ||
key: "fire", | ||
value: function fire(args) { | ||
this.funcs.forEach(function (o) { | ||
return o(args); | ||
}); | ||
} | ||
}], [{ | ||
key: "create", | ||
value: function create() { | ||
return new Callback(); | ||
} | ||
}]); | ||
return Callback; | ||
}(); | ||
exports.Callback = Callback; | ||
//# sourceMappingURL=callback.js.map | ||
/***/ }), | ||
/***/ "./out-es5/errors.js": | ||
@@ -236,2 +300,6 @@ /*!***************************!*\ | ||
exports.Errors = errors_1.Errors; | ||
var callback_1 = __webpack_require__(/*! ./callback */ "./out-es5/callback.js"); | ||
exports.Callback = callback_1.Callback; | ||
//# sourceMappingURL=index.js.map | ||
@@ -238,0 +306,0 @@ |
/*! | ||
* ~ | ||
* maishu-toolkit v1.0.0 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -10,3 +10,3 @@ * | ||
*/ | ||
!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},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(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(0==(r=r||[]).length)return"";if(1==r.length)return r[0];var n=r.join("");return n=n.replace(/\/+/g,"/")}},function(e,r,t){"use strict";function n(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e)}var r,t,o;return r=e,(t=[{key:"argumentNull",value:function(e){var r=new Error("Argument ".concat(e," cannt be null or emtpy."));return r.name="argumentNull",r}},{key:"routeDataFieldNull",value:function(e){var r="The ".concat(e," field of route data cannt be null."),t=new Error(r);return t.name="routeDataFieldNull",t}},{key:"argumentFieldNull",value:function(e,r){var t="The ".concat(e," field of ").concat(r," cannt be null."),n=new Error(t);return n.name="argumentFieldNull",n}},{key:"argumentTypeIncorrect",value:function(e,r){var t="Argument ".concat(e," type error, expected type is ").concat(r,"."),n=new Error(t);return n.name="argumentTypeIncorrect",n}}])&&n(r.prototype,t),o&&n(r,o),e}();r.Errors=o,r.errors=new 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;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}])})); | ||
//# sourceMappingURL=index.es5.min.js.map |
/*! | ||
* ~ | ||
* maishu-toolkit v1.0.0 | ||
* maishu-toolkit v1.1.0 | ||
* https://github.com/ansiboy/toolkit | ||
@@ -108,2 +108,34 @@ * | ||
/***/ "./out/callback.js": | ||
/*!*************************!*\ | ||
!*** ./out/callback.js ***! | ||
\*************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class Callback { | ||
constructor() { | ||
this.funcs = new Array(); | ||
} | ||
add(func) { | ||
this.funcs.push(func); | ||
} | ||
remove(func) { | ||
this.funcs = this.funcs.filter(o => o != func); | ||
} | ||
fire(args) { | ||
this.funcs.forEach(o => o(args)); | ||
} | ||
static create() { | ||
return new Callback(); | ||
} | ||
} | ||
exports.Callback = Callback; | ||
/***/ }), | ||
/***/ "./out/errors.js": | ||
@@ -194,2 +226,4 @@ /*!***********************!*\ | ||
exports.Errors = errors_1.Errors; | ||
var callback_1 = __webpack_require__(/*! ./callback */ "./out/callback.js"); | ||
exports.Callback = callback_1.Callback; | ||
@@ -196,0 +230,0 @@ |
/*! | ||
* ~ | ||
* maishu-toolkit v1.0.0 | ||
* 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},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){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}])})); | ||
//# sourceMappingURL=index.min.js.map |
@@ -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 declare function pathContact(...paths: string[]): string; |
@@ -18,2 +18,6 @@ "use strict"; | ||
exports.Errors = errors_1.Errors; | ||
var callback_1 = require("./callback"); | ||
exports.Callback = callback_1.Callback; | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -9,1 +9,3 @@ "use strict"; | ||
exports.Errors = errors_1.Errors; | ||
var callback_1 = require("./callback"); | ||
exports.Callback = callback_1.Callback; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "maishu-toolkit", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"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
121778
51
1340