Comparing version 6.1.3 to 6.1.4
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
12
_get.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -10,6 +10,6 @@ * Released under the MIT License. | ||
var isString = require('./isString.js'); | ||
var __chunk_1 = require('./chunk-ef885f48.js'); | ||
var regexp = require('./regexp-4b37f4e8.js'); | ||
function get (object, path) { | ||
if (!isString(path) || !__chunk_1.IS_DEEP_PROP_REGEX.test(path)) { | ||
if (!isString(path) || !regexp.IS_DEEP_PROP_REGEX.test(path)) { | ||
return object[path]; | ||
@@ -19,4 +19,4 @@ } | ||
var part; | ||
__chunk_1.PROP_NAME_REGEX.lastIndex = 0; | ||
while (!isNil(object) && (part = __chunk_1.PROP_NAME_REGEX.exec(path))) { | ||
regexp.PROP_NAME_REGEX.lastIndex = 0; | ||
while (!isNil(object) && (part = regexp.PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -26,3 +26,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(__chunk_1.ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
var prop = quote ? subString.replace(regexp.ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -29,0 +29,0 @@ } |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
40
amd.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -173,2 +173,10 @@ * Released under the MIT License. | ||
function max(a, b) { | ||
return a > b ? a : b; | ||
} | ||
function transIndex (fromIndex, length) { | ||
return fromIndex < 0 ? max(0, length + fromIndex) : fromIndex; | ||
} | ||
function isObject (value) { | ||
@@ -332,2 +340,8 @@ return value !== null && typeof value === 'object'; | ||
function forEach$1 (arr, cb, ctx) { | ||
if (arr) { | ||
forSlice(arr, 0, arr.length, cb, ctx); | ||
} | ||
} | ||
function forIn$1 (value, iterator, context) { | ||
@@ -337,2 +351,23 @@ !isNil(value) && forIn(value, iterator, context); | ||
function forSlice$1 (value, start, end, iterator, context) { | ||
if (value) { | ||
var len = value.length; | ||
if (isFunction(start)) { // forEach like | ||
context = end; | ||
iterator = start; | ||
end = len; | ||
start = 0; | ||
} else if (isFunction(end)) { | ||
context = iterator; | ||
iterator = end; | ||
end = len; | ||
} | ||
// 如果是负数,就需要转成长度对应的正数 | ||
start = transIndex(start, len); | ||
end = transIndex(end, len); | ||
forSlice(value, start, end, iterator, context); | ||
} | ||
} | ||
var BY_INDEX = /\{\s*(\d+)\s*\}/g; | ||
@@ -648,2 +683,3 @@ var BY_KEY = /\{\s*(\w+)\s*\}/g; | ||
exports._repeat = _repeat; | ||
exports._transIndex = transIndex; | ||
exports.afterCall = afterCall; | ||
@@ -662,4 +698,6 @@ exports.alias = alias; | ||
exports.flattenDeep = flattenDeep; | ||
exports.forEach = forEach$1; | ||
exports.forIn = forIn$1; | ||
exports.forOwn = each; | ||
exports.forSlice = forSlice$1; | ||
exports.formatString = formatString; | ||
@@ -666,0 +704,0 @@ exports.get = get$1; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
define(["exports"],function(n){"use strict";function u(n,r){return n[n.length]=r,n}function v(n){return null==n}function e(n,r,t,e){for(;r<t;r++)e(n[r],r,n)}function c(n,r){return r?n.bind(r):n}function i(n,r,t){r=c(r,t);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===r(n[u=e[i]],u,n)&&(i=o)}function r(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,r){t[r]=n})}),t}var o=Array.isArray;function f(n,r,t){return e(n,0,n.length,function(n){0<t?o(n)?f(n,r,--t):u(r,n):o(n)?e(n,0,n.length,function(n){u(r,n)}):u(r,n)}),r}function a(n,r,t,e,o){e=c(e,o);for(var i=r;i<t;i++)!1===e(n[i],i,n)&&(i=t)}function l(n,r,t){a(n,0,n.length,r,t)}function s(n,r,t){for(var e in r=c(r,t),n)if(!1===r(n[e],e))break}function p(n,r,t){r=c(r,t);for(var e=0;e<n;e++)!1===r(e,e,n)&&(e=n)}function g(n){return"string"==typeof n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function d(n,r){if(!g(r)||!h.test(r))return n[r];var t;for(y.lastIndex=0;!v(n)&&(t=y.exec(r));){var e=t[0],o=t[1],i=t[2],u=t[3];n=n[i?u.replace(b,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function t(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,r,t,e){var o=[],i=c(t,e);return n(r,function(n,r){v(n=i(n,r))||u(o,n)}),o}function A(n,r){return n.splice(r,1)[0]||null}function O(n,r){var t=n.indexOf(r);return-1<t?A(n,t):null}function _(n){return null!==n&&"object"==typeof n}function w(n,r,t){v(n)||i(n,r,t)}var E=Array.isArray;var x=Object.assign||r;var C=/[-_. ]+([a-z])/g,S=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function I(n){return!v(n)&&j(n.length)&&!F(n)}function k(n,r,t){I(n)?l(n,r,t):j(n)?p(n,r,t):v(n)||i(n,r,t)}function P(n,r){return n?f(n,[],r||1):[]}var U=/\{\s*(\d+)\s*\}/g,z=/\{\s*(\w+)\s*\}/g;var D="celia_uid_"+(1e9*Math.random()>>>0),L=0;function T(n){return n[D]||(++L,Object.defineProperty(n,D,{configurable:!0,value:L}),L)}var R=Object.prototype.hasOwnProperty;var $=/^([a-z][a-z\d+\-.]*:)?\/\//i;var B=Object.prototype.toString;function M(n){return B.call(n)}function q(n){return n instanceof Date}var H={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var V=Number.isInteger||t;function W(n){return n instanceof RegExp}var X=Array.isArray;var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Q["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=r,n._bindContext=c,n._flatten=f,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=d,n._isInteger=t,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,r,t){for(;n<r;n++)t(n,r)},n.afterCall=function(n,r,e){if(_(n)){var o=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var t=o.apply(this,n);return e.apply(this,n,t)}}},n.alias=function(t,n){_(t)&&w(n,function(n,r){r=t[r],E(n)?n.forEach(function(n){return t[n]=r}):t[n]=r})},n.aroundCall=function(n,r,t){if(_(n)){var e=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t.call(this,e,n)}}},n.assert=function(n,r){if(!n)throw new Error(r)},n.assign=x,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){!function t(e,n){var o;v(n)||i(n,function(n,r){_(o=e[r])&&_(n)?t(o,n):e[r]=n})}(r,n)}),r},n.beforeCall=function(n,r,t){if(_(n)){var e=n[r];n[r]=function(){return t.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return g(n)?S[n]||(S[n]=n.replace(C,function(n,r){return r.toUpperCase()})):n},n.capitalize=function(n){return g(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,r){var t=null;function e(){null!==t&&(clearTimeout(t),t=null)}function o(){e(),t=setTimeout(n,r)}return o.cancel=e,o},n.each=k,n.flatten=P,n.flattenDeep=function(n){return P(n,Number.MAX_VALUE)},n.forIn=function(n,r,t){v(n)||s(n,r,t)},n.forOwn=w,n.formatString=function(n,e){var r=arguments;if(n&&!v(e)){var t=z;if(!_(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=r[o];t=U}n=n.replace(t,function(n,r){var t=e[r];return v(t)?n:t})}return n},n.get=function(n,r,t){var e=v(n)?void 0:d(n,r);return void 0===e?t:e},n.getEasyHash=function(n){return _(n)?"o"+T(n):(typeof n)[0]+n},n.getUid=T,n.hasOwn=function(n,r){return R.call(n,r)},n.isAbsoluteURL=function(n){return $.test(n)},n.isArrayLike=I,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===M(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=q,n.isFalsy=function(n){return!!H[n]},n.isFunction=F,n.isInteger=V,n.isNil=v,n.isNumber=j,n.isObject=_,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===M(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=W,n.isString=g,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var r=arguments.length;if(!r||v(n))return".";var t="";return e(arguments,1,r,function(n){n&&(t+="/",t+=n)}),t&&(n=n.replace(/\/+$/,"")+t.replace(/\/+/g,"/")),n},n.looseClone=function(n,r){return r?function t(n){var e=n;return X(n)?(e=[],n.forEach(function(n,r){e[r]=t(n)})):_(n)&&(e={},i(n,function(n,r){e[r]=t(n)})),e}(n):function(n){return _(n)?x({},n):n}(n)},n.looseEqual=function t(r,e){if(r===e)return!0;if(_(r)&&_(e)){if(G(r)&&G(e))return r.length===e.length&&r.every(function(n,r){return t(n,e[r])});if(q(r)&&q(e))return+r==+e;if(W(r)&&W(e))return r.toString()===e.toString();var n=Object.keys(r),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return t(r[n],e[n])})}return!1},n.map=function(n,r,t){return m(k,n,r,t)},n.mapObject=function(n,r,t){var e={},o=c(r,t);return w(n,function(n,r){v(n=o(n,r))||(e[r]=n)}),e},n.noop=function(){},n.remove=function(n,r){return J(n)?O(n,r):null},n.removeAt=function(n,r){return K(n)?A(n,r):null},n.set=function(n,r,t){if(!v(n)){if(!g(r)||!h.test(r))return void(n[r]=t);var e,o,i=[],u=0;for(y.lastIndex=0;e=y.exec(r);){var c=e[0],f=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(b,"$1")])&&(s=n[o]={}):f?v(s=n[o=f])&&(s=n[f]=[]):v(s=n[o=c])&&(s=n[c]={}),n=s,i[u++]=s}(n=i[u-2])[o]=t}},n.sleep=function(r){return new Promise(function(n){setTimeout(n,r)})},n.toString=M,n.transform=function(n,e,o){return k(n,function(n,r,t){return e(o,n,r,t)}),o},n.type=function(n){return v(n)?n+"":_(n)||F(n)?Q[M(n)]||"object":typeof n}}); | ||
define(["exports"],function(n){"use strict";function u(n,r){return n[n.length]=r,n}function v(n){return null==n}function e(n,r,t,e){for(;r<t;r++)e(n[r],r,n)}function c(n,r){return r?n.bind(r):n}function i(n,r,t){r=c(r,t);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===r(n[u=e[i]],u,n)&&(i=o)}function r(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,r){t[r]=n})}),t}var o=Array.isArray;function f(n,r,t){return e(n,0,n.length,function(n){0<t?o(n)?f(n,r,--t):u(r,n):o(n)?e(n,0,n.length,function(n){u(r,n)}):u(r,n)}),r}function a(n,r,t,e,o){e=c(e,o);for(var i=r;i<t;i++)!1===e(n[i],i,n)&&(i=t)}function l(n,r,t){a(n,0,n.length,r,t)}function s(n,r,t){for(var e in r=c(r,t),n)if(!1===r(n[e],e))break}function p(n,r,t){r=c(r,t);for(var e=0;e<n;e++)!1===r(e,e,n)&&(e=n)}function g(n){return"string"==typeof n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,b=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function d(n,r){if(!g(r)||!b.test(r))return n[r];var t;for(y.lastIndex=0;!v(n)&&(t=y.exec(r));){var e=t[0],o=t[1],i=t[2],u=t[3];n=n[i?u.replace(h,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function t(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,r,t,e){var o=[],i=c(t,e);return n(r,function(n,r){v(n=i(n,r))||u(o,n)}),o}function A(n,r){return n.splice(r,1)[0]||null}function O(n,r){var t=n.indexOf(r);return-1<t?A(n,t):null}function _(n,r){return n<0?function(n,r){return r<n?n:r}(0,r+n):n}function w(n){return null!==n&&"object"==typeof n}function E(n,r,t){v(n)||i(n,r,t)}var x=Array.isArray;var C=Object.assign||r;var S=/[-_. ]+([a-z])/g,I=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function k(n){return!v(n)&&j(n.length)&&!F(n)}function P(n,r,t){k(n)?l(n,r,t):j(n)?p(n,r,t):v(n)||i(n,r,t)}function U(n,r){return n?f(n,[],r||1):[]}var z=/\{\s*(\d+)\s*\}/g,D=/\{\s*(\w+)\s*\}/g;var L="celia_uid_"+(1e9*Math.random()>>>0),T=0;function R(n){return n[L]||(++T,Object.defineProperty(n,L,{configurable:!0,value:T}),T)}var $=Object.prototype.hasOwnProperty;var B=/^([a-z][a-z\d+\-.]*:)?\/\//i;var M=Object.prototype.toString;function q(n){return M.call(n)}function H(n){return n instanceof Date}var V={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var W=Number.isInteger||t;function X(n){return n instanceof RegExp}var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q=Array.isArray;var Y={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Y["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=r,n._bindContext=c,n._flatten=f,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=d,n._isInteger=t,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,r,t){for(;n<r;n++)t(n,r)},n._transIndex=_,n.afterCall=function(n,r,e){if(w(n)){var o=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var t=o.apply(this,n);return e.apply(this,n,t)}}},n.alias=function(t,n){w(t)&&E(n,function(n,r){r=t[r],x(n)?n.forEach(function(n){return t[n]=r}):t[n]=r})},n.aroundCall=function(n,r,t){if(w(n)){var e=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t.call(this,e,n)}}},n.assert=function(n,r){if(!n)throw new Error(r)},n.assign=C,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){!function t(e,n){var o;v(n)||i(n,function(n,r){w(o=e[r])&&w(n)?t(o,n):e[r]=n})}(r,n)}),r},n.beforeCall=function(n,r,t){if(w(n)){var e=n[r];n[r]=function(){return t.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return g(n)?I[n]||(I[n]=n.replace(S,function(n,r){return r.toUpperCase()})):n},n.capitalize=function(n){return g(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,r){var t=null;function e(){null!==t&&(clearTimeout(t),t=null)}function o(){e(),t=setTimeout(n,r)}return o.cancel=e,o},n.each=P,n.flatten=U,n.flattenDeep=function(n){return U(n,Number.MAX_VALUE)},n.forEach=function(n,r,t){n&&a(n,0,n.length,r,t)},n.forIn=function(n,r,t){v(n)||s(n,r,t)},n.forOwn=E,n.forSlice=function(n,r,t,e,o){if(n){var i=n.length;F(r)?(o=t,e=r,t=i,r=0):F(t)&&(o=e,e=t,t=i),a(n,r=_(r,i),t=_(t,i),e,o)}},n.formatString=function(n,e){var r=arguments;if(n&&!v(e)){var t=D;if(!w(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=r[o];t=z}n=n.replace(t,function(n,r){var t=e[r];return v(t)?n:t})}return n},n.get=function(n,r,t){var e=v(n)?void 0:d(n,r);return void 0===e?t:e},n.getEasyHash=function(n){return w(n)?"o"+R(n):(typeof n)[0]+n},n.getUid=R,n.hasOwn=function(n,r){return $.call(n,r)},n.isAbsoluteURL=function(n){return B.test(n)},n.isArrayLike=k,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===q(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=H,n.isFalsy=function(n){return!!V[n]},n.isFunction=F,n.isInteger=W,n.isNil=v,n.isNumber=j,n.isObject=w,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===q(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=X,n.isString=g,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var r=arguments.length;if(!r||v(n))return".";var t="";return e(arguments,1,r,function(n){n&&(t+="/",t+=n)}),t&&(n=n.replace(/\/+$/,"")+t.replace(/\/+/g,"/")),n},n.looseClone=function(n,r){return r?function t(n){var e=n;return G(n)?(e=[],n.forEach(function(n,r){e[r]=t(n)})):w(n)&&(e={},i(n,function(n,r){e[r]=t(n)})),e}(n):function(n){return w(n)?C({},n):n}(n)},n.looseEqual=function t(r,e){if(r===e)return!0;if(w(r)&&w(e)){if(J(r)&&J(e))return r.length===e.length&&r.every(function(n,r){return t(n,e[r])});if(H(r)&&H(e))return+r==+e;if(X(r)&&X(e))return r.toString()===e.toString();var n=Object.keys(r),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return t(r[n],e[n])})}return!1},n.map=function(n,r,t){return m(P,n,r,t)},n.mapObject=function(n,r,t){var e={},o=c(r,t);return E(n,function(n,r){v(n=o(n,r))||(e[r]=n)}),e},n.noop=function(){},n.remove=function(n,r){return K(n)?O(n,r):null},n.removeAt=function(n,r){return Q(n)?A(n,r):null},n.set=function(n,r,t){if(!v(n)){if(!g(r)||!b.test(r))return void(n[r]=t);var e,o,i=[],u=0;for(y.lastIndex=0;e=y.exec(r);){var c=e[0],f=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(h,"$1")])&&(s=n[o]={}):f?v(s=n[o=f])&&(s=n[f]=[]):v(s=n[o=c])&&(s=n[c]={}),n=s,i[u++]=s}(n=i[u-2])[o]=t}},n.sleep=function(r){return new Promise(function(n){setTimeout(n,r)})},n.toString=q,n.transform=function(n,e,o){return P(n,function(n,r,t){return e(o,n,r,t)}),o},n.type=function(n){return v(n)?n+"":w(n)||F(n)?Y[q(n)]||"object":typeof n}}); |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
40
cjs.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -173,2 +173,10 @@ * Released under the MIT License. | ||
function max(a, b) { | ||
return a > b ? a : b; | ||
} | ||
function transIndex (fromIndex, length) { | ||
return fromIndex < 0 ? max(0, length + fromIndex) : fromIndex; | ||
} | ||
function isObject (value) { | ||
@@ -332,2 +340,8 @@ return value !== null && typeof value === 'object'; | ||
function forEach$1 (arr, cb, ctx) { | ||
if (arr) { | ||
forSlice(arr, 0, arr.length, cb, ctx); | ||
} | ||
} | ||
function forIn$1 (value, iterator, context) { | ||
@@ -337,2 +351,23 @@ !isNil(value) && forIn(value, iterator, context); | ||
function forSlice$1 (value, start, end, iterator, context) { | ||
if (value) { | ||
var len = value.length; | ||
if (isFunction(start)) { // forEach like | ||
context = end; | ||
iterator = start; | ||
end = len; | ||
start = 0; | ||
} else if (isFunction(end)) { | ||
context = iterator; | ||
iterator = end; | ||
end = len; | ||
} | ||
// 如果是负数,就需要转成长度对应的正数 | ||
start = transIndex(start, len); | ||
end = transIndex(end, len); | ||
forSlice(value, start, end, iterator, context); | ||
} | ||
} | ||
var BY_INDEX = /\{\s*(\d+)\s*\}/g; | ||
@@ -648,2 +683,3 @@ var BY_KEY = /\{\s*(\w+)\s*\}/g; | ||
exports._repeat = _repeat; | ||
exports._transIndex = transIndex; | ||
exports.afterCall = afterCall; | ||
@@ -662,4 +698,6 @@ exports.alias = alias; | ||
exports.flattenDeep = flattenDeep; | ||
exports.forEach = forEach$1; | ||
exports.forIn = forIn$1; | ||
exports.forOwn = each; | ||
exports.forSlice = forSlice$1; | ||
exports.formatString = formatString; | ||
@@ -666,0 +704,0 @@ exports.get = get$1; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
39
es.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -171,2 +171,10 @@ * Released under the MIT License. | ||
function max(a, b) { | ||
return a > b ? a : b; | ||
} | ||
function transIndex (fromIndex, length) { | ||
return fromIndex < 0 ? max(0, length + fromIndex) : fromIndex; | ||
} | ||
function isObject (value) { | ||
@@ -330,2 +338,8 @@ return value !== null && typeof value === 'object'; | ||
function forEach$1 (arr, cb, ctx) { | ||
if (arr) { | ||
forSlice(arr, 0, arr.length, cb, ctx); | ||
} | ||
} | ||
function forIn$1 (value, iterator, context) { | ||
@@ -335,2 +349,23 @@ !isNil(value) && forIn(value, iterator, context); | ||
function forSlice$1 (value, start, end, iterator, context) { | ||
if (value) { | ||
var len = value.length; | ||
if (isFunction(start)) { // forEach like | ||
context = end; | ||
iterator = start; | ||
end = len; | ||
start = 0; | ||
} else if (isFunction(end)) { | ||
context = iterator; | ||
iterator = end; | ||
end = len; | ||
} | ||
// 如果是负数,就需要转成长度对应的正数 | ||
start = transIndex(start, len); | ||
end = transIndex(end, len); | ||
forSlice(value, start, end, iterator, context); | ||
} | ||
} | ||
var BY_INDEX = /\{\s*(\d+)\s*\}/g; | ||
@@ -630,2 +665,2 @@ var BY_KEY = /\{\s*(\w+)\s*\}/g; | ||
export { append as _append, _assign, bindContext as _bindContext, flatten as _flatten, forEach as _forEach, forIn as _forIn, forNumber as _forNumber, forOwn as _forOwn, forSlice as _forSlice, get as _get, _isInteger, loop as _loop, map as _map, remove as _remove, removeAt as _removeAt, _repeat, afterCall, alias, aroundCall, assert, assign, assignDeep, beforeCall, camelize, capitalize, debounce, each$1 as each, flatten$1 as flatten, flattenDeep, forIn$1 as forIn, each as forOwn, formatString, get$1 as get, getEasyHash, getUid, hasOwn, isAbsoluteURL, isArrayLike, isAsyncFunction, isBoolean, isDate, isFalsy, isFunction, isInteger, isNil, isNumber, isObject, isPlainObject, isPromiseLike, isRegExp, isString, isUndefined, isWindow, joinPath, looseClone, looseEqual, map$1 as map, mapObject, noop, remove$1 as remove, removeAt$1 as removeAt, set, sleep, toString$1 as toString, transform, type }; | ||
export { append as _append, _assign, bindContext as _bindContext, flatten as _flatten, forEach as _forEach, forIn as _forIn, forNumber as _forNumber, forOwn as _forOwn, forSlice as _forSlice, get as _get, _isInteger, loop as _loop, map as _map, remove as _remove, removeAt as _removeAt, _repeat, transIndex as _transIndex, afterCall, alias, aroundCall, assert, assign, assignDeep, beforeCall, camelize, capitalize, debounce, each$1 as each, flatten$1 as flatten, flattenDeep, forEach$1 as forEach, forIn$1 as forIn, each as forOwn, forSlice$1 as forSlice, formatString, get$1 as get, getEasyHash, getUid, hasOwn, isAbsoluteURL, isArrayLike, isAsyncFunction, isBoolean, isDate, isFalsy, isFunction, isInteger, isNil, isNumber, isObject, isPlainObject, isPromiseLike, isRegExp, isString, isUndefined, isWindow, joinPath, looseClone, looseEqual, map$1 as map, mapObject, noop, remove$1 as remove, removeAt$1 as removeAt, set, sleep, toString$1 as toString, transform, type }; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -8,3 +8,3 @@ * Released under the MIT License. | ||
import isString from './isString.js'; | ||
import { I as IS_DEEP_PROP_REGEX, P as PROP_NAME_REGEX, E as ESCAPE_CHAR_REGEX } from './chunk-bde59ef5.js'; | ||
import { I as IS_DEEP_PROP_REGEX, P as PROP_NAME_REGEX, E as ESCAPE_CHAR_REGEX } from './regexp-d9fa732b.js'; | ||
@@ -11,0 +11,0 @@ function get (object, path) { |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -8,3 +8,3 @@ * Released under the MIT License. | ||
import './isString.js'; | ||
import './chunk-bde59ef5.js'; | ||
import './regexp-d9fa732b.js'; | ||
import get$1 from './_get.js'; | ||
@@ -11,0 +11,0 @@ |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -18,3 +18,3 @@ * Released under the MIT License. | ||
export { default as isString } from './isString.js'; | ||
import './chunk-bde59ef5.js'; | ||
import './regexp-d9fa732b.js'; | ||
export { default as _get } from './_get.js'; | ||
@@ -27,2 +27,3 @@ export { default as isNumber } from './isNumber.js'; | ||
export { default as _repeat } from './_repeat.js'; | ||
export { default as _transIndex } from './_transIndex.js'; | ||
export { default as isObject } from './isObject.js'; | ||
@@ -45,3 +46,5 @@ export { default as afterCall } from './afterCall.js'; | ||
export { default as flattenDeep } from './flattenDeep.js'; | ||
export { default as forEach } from './forEach.js'; | ||
export { default as forIn } from './forIn.js'; | ||
export { default as forSlice } from './forSlice.js'; | ||
export { default as formatString } from './formatString.js'; | ||
@@ -48,0 +51,0 @@ export { default as get } from './get.js'; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -8,3 +8,3 @@ * Released under the MIT License. | ||
import isString from './isString.js'; | ||
import { I as IS_DEEP_PROP_REGEX, P as PROP_NAME_REGEX, E as ESCAPE_CHAR_REGEX } from './chunk-bde59ef5.js'; | ||
import { I as IS_DEEP_PROP_REGEX, P as PROP_NAME_REGEX, E as ESCAPE_CHAR_REGEX } from './regexp-d9fa732b.js'; | ||
@@ -11,0 +11,0 @@ function set (object, path, value) { |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -10,3 +10,3 @@ * Released under the MIT License. | ||
require('./isString.js'); | ||
require('./chunk-ef885f48.js'); | ||
require('./regexp-4b37f4e8.js'); | ||
var _get = require('./_get.js'); | ||
@@ -13,0 +13,0 @@ |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
40
iife.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -174,2 +174,10 @@ * Released under the MIT License. | ||
function max(a, b) { | ||
return a > b ? a : b; | ||
} | ||
function transIndex (fromIndex, length) { | ||
return fromIndex < 0 ? max(0, length + fromIndex) : fromIndex; | ||
} | ||
function isObject (value) { | ||
@@ -333,2 +341,8 @@ return value !== null && typeof value === 'object'; | ||
function forEach$1 (arr, cb, ctx) { | ||
if (arr) { | ||
forSlice(arr, 0, arr.length, cb, ctx); | ||
} | ||
} | ||
function forIn$1 (value, iterator, context) { | ||
@@ -338,2 +352,23 @@ !isNil(value) && forIn(value, iterator, context); | ||
function forSlice$1 (value, start, end, iterator, context) { | ||
if (value) { | ||
var len = value.length; | ||
if (isFunction(start)) { // forEach like | ||
context = end; | ||
iterator = start; | ||
end = len; | ||
start = 0; | ||
} else if (isFunction(end)) { | ||
context = iterator; | ||
iterator = end; | ||
end = len; | ||
} | ||
// 如果是负数,就需要转成长度对应的正数 | ||
start = transIndex(start, len); | ||
end = transIndex(end, len); | ||
forSlice(value, start, end, iterator, context); | ||
} | ||
} | ||
var BY_INDEX = /\{\s*(\d+)\s*\}/g; | ||
@@ -649,2 +684,3 @@ var BY_KEY = /\{\s*(\w+)\s*\}/g; | ||
exports._repeat = _repeat; | ||
exports._transIndex = transIndex; | ||
exports.afterCall = afterCall; | ||
@@ -663,4 +699,6 @@ exports.alias = alias; | ||
exports.flattenDeep = flattenDeep; | ||
exports.forEach = forEach$1; | ||
exports.forIn = forIn$1; | ||
exports.forOwn = each; | ||
exports.forSlice = forSlice$1; | ||
exports.formatString = formatString; | ||
@@ -667,0 +705,0 @@ exports.get = get$1; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
!function(n){"use strict";function u(n,r){return n[n.length]=r,n}function v(n){return null==n}function e(n,r,t,e){for(;r<t;r++)e(n[r],r,n)}function c(n,r){return r?n.bind(r):n}function i(n,r,t){r=c(r,t);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===r(n[u=e[i]],u,n)&&(i=o)}function r(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,r){t[r]=n})}),t}var o=Array.isArray;function f(n,r,t){return e(n,0,n.length,function(n){0<t?o(n)?f(n,r,--t):u(r,n):o(n)?e(n,0,n.length,function(n){u(r,n)}):u(r,n)}),r}function a(n,r,t,e,o){e=c(e,o);for(var i=r;i<t;i++)!1===e(n[i],i,n)&&(i=t)}function l(n,r,t){a(n,0,n.length,r,t)}function s(n,r,t){for(var e in r=c(r,t),n)if(!1===r(n[e],e))break}function p(n,r,t){r=c(r,t);for(var e=0;e<n;e++)!1===r(e,e,n)&&(e=n)}function g(n){return"string"==typeof n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function d(n,r){if(!g(r)||!h.test(r))return n[r];var t;for(y.lastIndex=0;!v(n)&&(t=y.exec(r));){var e=t[0],o=t[1],i=t[2],u=t[3];n=n[i?u.replace(b,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function t(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,r,t,e){var o=[],i=c(t,e);return n(r,function(n,r){v(n=i(n,r))||u(o,n)}),o}function A(n,r){return n.splice(r,1)[0]||null}function O(n,r){var t=n.indexOf(r);return-1<t?A(n,t):null}function _(n){return null!==n&&"object"==typeof n}function w(n,r,t){v(n)||i(n,r,t)}var E=Array.isArray;var C=Object.assign||r;var x=/[-_. ]+([a-z])/g,S=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function I(n){return!v(n)&&j(n.length)&&!F(n)}function k(n,r,t){I(n)?l(n,r,t):j(n)?p(n,r,t):v(n)||i(n,r,t)}function P(n,r){return n?f(n,[],r||1):[]}var U=/\{\s*(\d+)\s*\}/g,z=/\{\s*(\w+)\s*\}/g;var D="celia_uid_"+(1e9*Math.random()>>>0),L=0;function T(n){return n[D]||(++L,Object.defineProperty(n,D,{configurable:!0,value:L}),L)}var R=Object.prototype.hasOwnProperty;var $=/^([a-z][a-z\d+\-.]*:)?\/\//i;var B=Object.prototype.toString;function M(n){return B.call(n)}function q(n){return n instanceof Date}var H={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var V=Number.isInteger||t;function W(n){return n instanceof RegExp}var X=Array.isArray;var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Q["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=r,n._bindContext=c,n._flatten=f,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=d,n._isInteger=t,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,r,t){for(;n<r;n++)t(n,r)},n.afterCall=function(n,r,e){if(_(n)){var o=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var t=o.apply(this,n);return e.apply(this,n,t)}}},n.alias=function(t,n){_(t)&&w(n,function(n,r){r=t[r],E(n)?n.forEach(function(n){return t[n]=r}):t[n]=r})},n.aroundCall=function(n,r,t){if(_(n)){var e=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t.call(this,e,n)}}},n.assert=function(n,r){if(!n)throw new Error(r)},n.assign=C,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){!function t(e,n){var o;v(n)||i(n,function(n,r){_(o=e[r])&&_(n)?t(o,n):e[r]=n})}(r,n)}),r},n.beforeCall=function(n,r,t){if(_(n)){var e=n[r];n[r]=function(){return t.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return g(n)?S[n]||(S[n]=n.replace(x,function(n,r){return r.toUpperCase()})):n},n.capitalize=function(n){return g(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,r){var t=null;function e(){null!==t&&(clearTimeout(t),t=null)}function o(){e(),t=setTimeout(n,r)}return o.cancel=e,o},n.each=k,n.flatten=P,n.flattenDeep=function(n){return P(n,Number.MAX_VALUE)},n.forIn=function(n,r,t){v(n)||s(n,r,t)},n.forOwn=w,n.formatString=function(n,e){var r=arguments;if(n&&!v(e)){var t=z;if(!_(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=r[o];t=U}n=n.replace(t,function(n,r){var t=e[r];return v(t)?n:t})}return n},n.get=function(n,r,t){var e=v(n)?void 0:d(n,r);return void 0===e?t:e},n.getEasyHash=function(n){return _(n)?"o"+T(n):(typeof n)[0]+n},n.getUid=T,n.hasOwn=function(n,r){return R.call(n,r)},n.isAbsoluteURL=function(n){return $.test(n)},n.isArrayLike=I,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===M(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=q,n.isFalsy=function(n){return!!H[n]},n.isFunction=F,n.isInteger=V,n.isNil=v,n.isNumber=j,n.isObject=_,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===M(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=W,n.isString=g,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var r=arguments.length;if(!r||v(n))return".";var t="";return e(arguments,1,r,function(n){n&&(t+="/",t+=n)}),t&&(n=n.replace(/\/+$/,"")+t.replace(/\/+/g,"/")),n},n.looseClone=function(n,r){return r?function t(n){var e=n;return X(n)?(e=[],n.forEach(function(n,r){e[r]=t(n)})):_(n)&&(e={},i(n,function(n,r){e[r]=t(n)})),e}(n):function(n){return _(n)?C({},n):n}(n)},n.looseEqual=function t(r,e){if(r===e)return!0;if(_(r)&&_(e)){if(G(r)&&G(e))return r.length===e.length&&r.every(function(n,r){return t(n,e[r])});if(q(r)&&q(e))return+r==+e;if(W(r)&&W(e))return r.toString()===e.toString();var n=Object.keys(r),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return t(r[n],e[n])})}return!1},n.map=function(n,r,t){return m(k,n,r,t)},n.mapObject=function(n,r,t){var e={},o=c(r,t);return w(n,function(n,r){v(n=o(n,r))||(e[r]=n)}),e},n.noop=function(){},n.remove=function(n,r){return J(n)?O(n,r):null},n.removeAt=function(n,r){return K(n)?A(n,r):null},n.set=function(n,r,t){if(!v(n)){if(!g(r)||!h.test(r))return void(n[r]=t);var e,o,i=[],u=0;for(y.lastIndex=0;e=y.exec(r);){var c=e[0],f=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(b,"$1")])&&(s=n[o]={}):f?v(s=n[o=f])&&(s=n[f]=[]):v(s=n[o=c])&&(s=n[c]={}),n=s,i[u++]=s}(n=i[u-2])[o]=t}},n.sleep=function(r){return new Promise(function(n){setTimeout(n,r)})},n.toString=M,n.transform=function(n,e,o){return k(n,function(n,r,t){return e(o,n,r,t)}),o},n.type=function(n){return v(n)?n+"":_(n)||F(n)?Q[M(n)]||"object":typeof n}}({}); | ||
!function(n){"use strict";function u(n,r){return n[n.length]=r,n}function v(n){return null==n}function e(n,r,t,e){for(;r<t;r++)e(n[r],r,n)}function c(n,r){return r?n.bind(r):n}function i(n,r,t){r=c(r,t);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===r(n[u=e[i]],u,n)&&(i=o)}function r(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,r){t[r]=n})}),t}var o=Array.isArray;function f(n,r,t){return e(n,0,n.length,function(n){0<t?o(n)?f(n,r,--t):u(r,n):o(n)?e(n,0,n.length,function(n){u(r,n)}):u(r,n)}),r}function a(n,r,t,e,o){e=c(e,o);for(var i=r;i<t;i++)!1===e(n[i],i,n)&&(i=t)}function l(n,r,t){a(n,0,n.length,r,t)}function s(n,r,t){for(var e in r=c(r,t),n)if(!1===r(n[e],e))break}function p(n,r,t){r=c(r,t);for(var e=0;e<n;e++)!1===r(e,e,n)&&(e=n)}function g(n){return"string"==typeof n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,b=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function d(n,r){if(!g(r)||!b.test(r))return n[r];var t;for(y.lastIndex=0;!v(n)&&(t=y.exec(r));){var e=t[0],o=t[1],i=t[2],u=t[3];n=n[i?u.replace(h,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function t(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,r,t,e){var o=[],i=c(t,e);return n(r,function(n,r){v(n=i(n,r))||u(o,n)}),o}function A(n,r){return n.splice(r,1)[0]||null}function O(n,r){var t=n.indexOf(r);return-1<t?A(n,t):null}function _(n,r){return n<0?function(n,r){return r<n?n:r}(0,r+n):n}function w(n){return null!==n&&"object"==typeof n}function E(n,r,t){v(n)||i(n,r,t)}var x=Array.isArray;var C=Object.assign||r;var S=/[-_. ]+([a-z])/g,I=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function k(n){return!v(n)&&j(n.length)&&!F(n)}function P(n,r,t){k(n)?l(n,r,t):j(n)?p(n,r,t):v(n)||i(n,r,t)}function U(n,r){return n?f(n,[],r||1):[]}var z=/\{\s*(\d+)\s*\}/g,D=/\{\s*(\w+)\s*\}/g;var L="celia_uid_"+(1e9*Math.random()>>>0),T=0;function R(n){return n[L]||(++T,Object.defineProperty(n,L,{configurable:!0,value:T}),T)}var $=Object.prototype.hasOwnProperty;var B=/^([a-z][a-z\d+\-.]*:)?\/\//i;var M=Object.prototype.toString;function q(n){return M.call(n)}function H(n){return n instanceof Date}var V={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var W=Number.isInteger||t;function X(n){return n instanceof RegExp}var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q=Array.isArray;var Y={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Y["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=r,n._bindContext=c,n._flatten=f,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=d,n._isInteger=t,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,r,t){for(;n<r;n++)t(n,r)},n._transIndex=_,n.afterCall=function(n,r,e){if(w(n)){var o=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var t=o.apply(this,n);return e.apply(this,n,t)}}},n.alias=function(t,n){w(t)&&E(n,function(n,r){r=t[r],x(n)?n.forEach(function(n){return t[n]=r}):t[n]=r})},n.aroundCall=function(n,r,t){if(w(n)){var e=n[r];n[r]=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t.call(this,e,n)}}},n.assert=function(n,r){if(!n)throw new Error(r)},n.assign=C,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){!function t(e,n){var o;v(n)||i(n,function(n,r){w(o=e[r])&&w(n)?t(o,n):e[r]=n})}(r,n)}),r},n.beforeCall=function(n,r,t){if(w(n)){var e=n[r];n[r]=function(){return t.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return g(n)?I[n]||(I[n]=n.replace(S,function(n,r){return r.toUpperCase()})):n},n.capitalize=function(n){return g(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,r){var t=null;function e(){null!==t&&(clearTimeout(t),t=null)}function o(){e(),t=setTimeout(n,r)}return o.cancel=e,o},n.each=P,n.flatten=U,n.flattenDeep=function(n){return U(n,Number.MAX_VALUE)},n.forEach=function(n,r,t){n&&a(n,0,n.length,r,t)},n.forIn=function(n,r,t){v(n)||s(n,r,t)},n.forOwn=E,n.forSlice=function(n,r,t,e,o){if(n){var i=n.length;F(r)?(o=t,e=r,t=i,r=0):F(t)&&(o=e,e=t,t=i),a(n,r=_(r,i),t=_(t,i),e,o)}},n.formatString=function(n,e){var r=arguments;if(n&&!v(e)){var t=D;if(!w(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=r[o];t=z}n=n.replace(t,function(n,r){var t=e[r];return v(t)?n:t})}return n},n.get=function(n,r,t){var e=v(n)?void 0:d(n,r);return void 0===e?t:e},n.getEasyHash=function(n){return w(n)?"o"+R(n):(typeof n)[0]+n},n.getUid=R,n.hasOwn=function(n,r){return $.call(n,r)},n.isAbsoluteURL=function(n){return B.test(n)},n.isArrayLike=k,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===q(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=H,n.isFalsy=function(n){return!!V[n]},n.isFunction=F,n.isInteger=W,n.isNil=v,n.isNumber=j,n.isObject=w,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===q(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=X,n.isString=g,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var r=arguments.length;if(!r||v(n))return".";var t="";return e(arguments,1,r,function(n){n&&(t+="/",t+=n)}),t&&(n=n.replace(/\/+$/,"")+t.replace(/\/+/g,"/")),n},n.looseClone=function(n,r){return r?function t(n){var e=n;return G(n)?(e=[],n.forEach(function(n,r){e[r]=t(n)})):w(n)&&(e={},i(n,function(n,r){e[r]=t(n)})),e}(n):function(n){return w(n)?C({},n):n}(n)},n.looseEqual=function t(r,e){if(r===e)return!0;if(w(r)&&w(e)){if(J(r)&&J(e))return r.length===e.length&&r.every(function(n,r){return t(n,e[r])});if(H(r)&&H(e))return+r==+e;if(X(r)&&X(e))return r.toString()===e.toString();var n=Object.keys(r),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return t(r[n],e[n])})}return!1},n.map=function(n,r,t){return m(P,n,r,t)},n.mapObject=function(n,r,t){var e={},o=c(r,t);return E(n,function(n,r){v(n=o(n,r))||(e[r]=n)}),e},n.noop=function(){},n.remove=function(n,r){return K(n)?O(n,r):null},n.removeAt=function(n,r){return Q(n)?A(n,r):null},n.set=function(n,r,t){if(!v(n)){if(!g(r)||!b.test(r))return void(n[r]=t);var e,o,i=[],u=0;for(y.lastIndex=0;e=y.exec(r);){var c=e[0],f=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(h,"$1")])&&(s=n[o]={}):f?v(s=n[o=f])&&(s=n[f]=[]):v(s=n[o=c])&&(s=n[c]={}),n=s,i[u++]=s}(n=i[u-2])[o]=t}},n.sleep=function(r){return new Promise(function(n){setTimeout(n,r)})},n.toString=q,n.transform=function(n,e,o){return P(n,function(n,r,t){return e(o,n,r,t)}),o},n.type=function(n){return v(n)?n+"":w(n)||F(n)?Y[q(n)]||"object":typeof n}}({}); |
10
index.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -20,3 +20,3 @@ * Released under the MIT License. | ||
var isString = require('./isString.js'); | ||
require('./chunk-ef885f48.js'); | ||
require('./regexp-4b37f4e8.js'); | ||
var _get = require('./_get.js'); | ||
@@ -29,2 +29,3 @@ var isNumber = require('./isNumber.js'); | ||
var _repeat = require('./_repeat.js'); | ||
var _transIndex = require('./_transIndex.js'); | ||
var isObject = require('./isObject.js'); | ||
@@ -47,3 +48,5 @@ var afterCall = require('./afterCall.js'); | ||
var flattenDeep = require('./flattenDeep.js'); | ||
var forEach = require('./forEach.js'); | ||
var forIn = require('./forIn.js'); | ||
var forSlice = require('./forSlice.js'); | ||
var formatString = require('./formatString.js'); | ||
@@ -100,2 +103,3 @@ var get = require('./get.js'); | ||
exports._repeat = _repeat; | ||
exports._transIndex = _transIndex; | ||
exports.isObject = isObject; | ||
@@ -118,3 +122,5 @@ exports.afterCall = afterCall; | ||
exports.flattenDeep = flattenDeep; | ||
exports.forEach = forEach; | ||
exports.forIn = forIn; | ||
exports.forSlice = forSlice; | ||
exports.formatString = formatString; | ||
@@ -121,0 +127,0 @@ exports.get = get; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
{ | ||
"name": "celia", | ||
"version": "6.1.3", | ||
"version": "6.1.4", | ||
"description": "A modern JavaScript utility library delivering modularity, performance, and extras.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
12
set.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -10,7 +10,7 @@ * Released under the MIT License. | ||
var isString = require('./isString.js'); | ||
var __chunk_1 = require('./chunk-ef885f48.js'); | ||
var regexp = require('./regexp-4b37f4e8.js'); | ||
function set (object, path, value) { | ||
if (!isNil(object)) { | ||
if (!isString(path) || !__chunk_1.IS_DEEP_PROP_REGEX.test(path)) { | ||
if (!isString(path) || !regexp.IS_DEEP_PROP_REGEX.test(path)) { | ||
object[path] = value; | ||
@@ -25,4 +25,4 @@ return; | ||
__chunk_1.PROP_NAME_REGEX.lastIndex = 0; | ||
while ((part = __chunk_1.PROP_NAME_REGEX.exec(path))) { | ||
regexp.PROP_NAME_REGEX.lastIndex = 0; | ||
while ((part = regexp.PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -34,3 +34,3 @@ var number = part[1]; | ||
if (quote) { | ||
key = subString.replace(__chunk_1.ESCAPE_CHAR_REGEX, '$1'); | ||
key = subString.replace(regexp.ESCAPE_CHAR_REGEX, '$1'); | ||
obj = object[key]; | ||
@@ -37,0 +37,0 @@ if (isNil(obj)) { |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
40
umd.js
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -177,2 +177,10 @@ * Released under the MIT License. | ||
function max(a, b) { | ||
return a > b ? a : b; | ||
} | ||
function transIndex (fromIndex, length) { | ||
return fromIndex < 0 ? max(0, length + fromIndex) : fromIndex; | ||
} | ||
function isObject (value) { | ||
@@ -336,2 +344,8 @@ return value !== null && typeof value === 'object'; | ||
function forEach$1 (arr, cb, ctx) { | ||
if (arr) { | ||
forSlice(arr, 0, arr.length, cb, ctx); | ||
} | ||
} | ||
function forIn$1 (value, iterator, context) { | ||
@@ -341,2 +355,23 @@ !isNil(value) && forIn(value, iterator, context); | ||
function forSlice$1 (value, start, end, iterator, context) { | ||
if (value) { | ||
var len = value.length; | ||
if (isFunction(start)) { // forEach like | ||
context = end; | ||
iterator = start; | ||
end = len; | ||
start = 0; | ||
} else if (isFunction(end)) { | ||
context = iterator; | ||
iterator = end; | ||
end = len; | ||
} | ||
// 如果是负数,就需要转成长度对应的正数 | ||
start = transIndex(start, len); | ||
end = transIndex(end, len); | ||
forSlice(value, start, end, iterator, context); | ||
} | ||
} | ||
var BY_INDEX = /\{\s*(\d+)\s*\}/g; | ||
@@ -652,2 +687,3 @@ var BY_KEY = /\{\s*(\w+)\s*\}/g; | ||
exports._repeat = _repeat; | ||
exports._transIndex = transIndex; | ||
exports.afterCall = afterCall; | ||
@@ -666,4 +702,6 @@ exports.alias = alias; | ||
exports.flattenDeep = flattenDeep; | ||
exports.forEach = forEach$1; | ||
exports.forIn = forIn$1; | ||
exports.forOwn = each; | ||
exports.forSlice = forSlice$1; | ||
exports.formatString = formatString; | ||
@@ -670,0 +708,0 @@ exports.get = get$1; |
/* | ||
* celia.js v6.1.3 | ||
* celia.js v6.1.4 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
var n,t;n=this,t=function(n){"use strict";function u(n,t){return n[n.length]=t,n}function v(n){return null==n}function e(n,t,r,e){for(;t<r;t++)e(n[t],t,n)}function f(n,t){return t?n.bind(t):n}function i(n,t,r){t=f(t,r);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===t(n[u=e[i]],u,n)&&(i=o)}function t(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,t){r[t]=n})}),r}var o=Array.isArray;function c(n,t,r){return e(n,0,n.length,function(n){0<r?o(n)?c(n,t,--r):u(t,n):o(n)?e(n,0,n.length,function(n){u(t,n)}):u(t,n)}),t}function a(n,t,r,e,o){e=f(e,o);for(var i=t;i<r;i++)!1===e(n[i],i,n)&&(i=r)}function l(n,t,r){a(n,0,n.length,t,r)}function s(n,t,r){for(var e in t=f(t,r),n)if(!1===t(n[e],e))break}function p(n,t,r){t=f(t,r);for(var e=0;e<n;e++)!1===t(e,e,n)&&(e=n)}function y(n){return"string"==typeof n}var g=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,d=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function h(n,t){if(!y(t)||!d.test(t))return n[t];var r;for(g.lastIndex=0;!v(n)&&(r=g.exec(t));){var e=r[0],o=r[1],i=r[2],u=r[3];n=n[i?u.replace(b,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function r(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,t,r,e){var o=[],i=f(r,e);return n(t,function(n,t){v(n=i(n,t))||u(o,n)}),o}function A(n,t){return n.splice(t,1)[0]||null}function O(n,t){var r=n.indexOf(t);return-1<r?A(n,r):null}function _(n){return null!==n&&"object"==typeof n}function w(n,t,r){v(n)||i(n,t,r)}var E=Array.isArray;var x=Object.assign||t;var C=/[-_. ]+([a-z])/g,S=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function I(n){return!v(n)&&j(n.length)&&!F(n)}function k(n,t,r){I(n)?l(n,t,r):j(n)?p(n,t,r):v(n)||i(n,t,r)}function P(n,t){return n?c(n,[],t||1):[]}var U=/\{\s*(\d+)\s*\}/g,z=/\{\s*(\w+)\s*\}/g;var D="celia_uid_"+(1e9*Math.random()>>>0),L=0;function T(n){return n[D]||(++L,Object.defineProperty(n,D,{configurable:!0,value:L}),L)}var R=Object.prototype.hasOwnProperty;var $=/^([a-z][a-z\d+\-.]*:)?\/\//i;var B=Object.prototype.toString;function M(n){return B.call(n)}function q(n){return n instanceof Date}var H={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var V=Number.isInteger||r;function W(n){return n instanceof RegExp}var X=Array.isArray;var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Q["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=t,n._bindContext=f,n._flatten=c,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=h,n._isInteger=r,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,t,r){for(;n<t;n++)r(n,t)},n.afterCall=function(n,t,e){if(_(n)){var o=n[t];n[t]=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];var r=o.apply(this,n);return e.apply(this,n,r)}}},n.alias=function(r,n){_(r)&&w(n,function(n,t){t=r[t],E(n)?n.forEach(function(n){return r[n]=t}):r[n]=t})},n.aroundCall=function(n,t,r){if(_(n)){var e=n[t];n[t]=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];return r.call(this,e,n)}}},n.assert=function(n,t){if(!n)throw new Error(t)},n.assign=x,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){!function r(e,n){var o;v(n)||i(n,function(n,t){_(o=e[t])&&_(n)?r(o,n):e[t]=n})}(t,n)}),t},n.beforeCall=function(n,t,r){if(_(n)){var e=n[t];n[t]=function(){return r.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return y(n)?S[n]||(S[n]=n.replace(C,function(n,t){return t.toUpperCase()})):n},n.capitalize=function(n){return y(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,t){var r=null;function e(){null!==r&&(clearTimeout(r),r=null)}function o(){e(),r=setTimeout(n,t)}return o.cancel=e,o},n.each=k,n.flatten=P,n.flattenDeep=function(n){return P(n,Number.MAX_VALUE)},n.forIn=function(n,t,r){v(n)||s(n,t,r)},n.forOwn=w,n.formatString=function(n,e){var t=arguments;if(n&&!v(e)){var r=z;if(!_(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=t[o];r=U}n=n.replace(r,function(n,t){var r=e[t];return v(r)?n:r})}return n},n.get=function(n,t,r){var e=v(n)?void 0:h(n,t);return void 0===e?r:e},n.getEasyHash=function(n){return _(n)?"o"+T(n):(typeof n)[0]+n},n.getUid=T,n.hasOwn=function(n,t){return R.call(n,t)},n.isAbsoluteURL=function(n){return $.test(n)},n.isArrayLike=I,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===M(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=q,n.isFalsy=function(n){return!!H[n]},n.isFunction=F,n.isInteger=V,n.isNil=v,n.isNumber=j,n.isObject=_,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===M(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=W,n.isString=y,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var t=arguments.length;if(!t||v(n))return".";var r="";return e(arguments,1,t,function(n){n&&(r+="/",r+=n)}),r&&(n=n.replace(/\/+$/,"")+r.replace(/\/+/g,"/")),n},n.looseClone=function(n,t){return t?function r(n){var e=n;return X(n)?(e=[],n.forEach(function(n,t){e[t]=r(n)})):_(n)&&(e={},i(n,function(n,t){e[t]=r(n)})),e}(n):function(n){return _(n)?x({},n):n}(n)},n.looseEqual=function r(t,e){if(t===e)return!0;if(_(t)&&_(e)){if(G(t)&&G(e))return t.length===e.length&&t.every(function(n,t){return r(n,e[t])});if(q(t)&&q(e))return+t==+e;if(W(t)&&W(e))return t.toString()===e.toString();var n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return r(t[n],e[n])})}return!1},n.map=function(n,t,r){return m(k,n,t,r)},n.mapObject=function(n,t,r){var e={},o=f(t,r);return w(n,function(n,t){v(n=o(n,t))||(e[t]=n)}),e},n.noop=function(){},n.remove=function(n,t){return J(n)?O(n,t):null},n.removeAt=function(n,t){return K(n)?A(n,t):null},n.set=function(n,t,r){if(!v(n)){if(!y(t)||!d.test(t))return void(n[t]=r);var e,o,i=[],u=0;for(g.lastIndex=0;e=g.exec(t);){var f=e[0],c=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(b,"$1")])&&(s=n[o]={}):c?v(s=n[o=c])&&(s=n[c]=[]):v(s=n[o=f])&&(s=n[f]={}),n=s,i[u++]=s}(n=i[u-2])[o]=r}},n.sleep=function(t){return new Promise(function(n){setTimeout(n,t)})},n.toString=M,n.transform=function(n,e,o){return k(n,function(n,t,r){return e(o,n,t,r)}),o},n.type=function(n){return v(n)?n+"":_(n)||F(n)?Q[M(n)]||"object":typeof n}},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).celia={}); | ||
var n,t;n=this,t=function(n){"use strict";function u(n,t){return n[n.length]=t,n}function v(n){return null==n}function e(n,t,r,e){for(;t<r;t++)e(n[t],t,n)}function f(n,t){return t?n.bind(t):n}function i(n,t,r){t=f(t,r);for(var e=Object.keys(n),o=e.length,i=0,u=void 0;i<o;i++)!1===t(n[u=e[i]],u,n)&&(i=o)}function t(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var r=Object(n);return e(arguments,1,arguments.length,function(n){v(n)||i(n,function(n,t){r[t]=n})}),r}var o=Array.isArray;function c(n,t,r){return e(n,0,n.length,function(n){0<r?o(n)?c(n,t,--r):u(t,n):o(n)?e(n,0,n.length,function(n){u(t,n)}):u(t,n)}),t}function a(n,t,r,e,o){e=f(e,o);for(var i=t;i<r;i++)!1===e(n[i],i,n)&&(i=r)}function l(n,t,r){a(n,0,n.length,t,r)}function s(n,t,r){for(var e in t=f(t,r),n)if(!1===t(n[e],e))break}function p(n,t,r){t=f(t,r);for(var e=0;e<n;e++)!1===t(e,e,n)&&(e=n)}function g(n){return"string"==typeof n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function b(n,t){if(!g(t)||!d.test(t))return n[t];var r;for(y.lastIndex=0;!v(n)&&(r=y.exec(t));){var e=r[0],o=r[1],i=r[2],u=r[3];n=n[i?u.replace(h,"$1"):o||e]}return n}function j(n){return"number"==typeof n}function r(n){return j(n)&&isFinite(n)&&n>>0===n}function m(n,t,r,e){var o=[],i=f(r,e);return n(t,function(n,t){v(n=i(n,t))||u(o,n)}),o}function A(n,t){return n.splice(t,1)[0]||null}function O(n,t){var r=n.indexOf(t);return-1<r?A(n,r):null}function _(n,t){return n<0?function(n,t){return t<n?n:t}(0,t+n):n}function w(n){return null!==n&&"object"==typeof n}function E(n,t,r){v(n)||i(n,t,r)}var x=Array.isArray;var C=Object.assign||t;var S=/[-_. ]+([a-z])/g,I=Object.create(null);var N=Object.create(null);function F(n){return"function"==typeof n}function k(n){return!v(n)&&j(n.length)&&!F(n)}function P(n,t,r){k(n)?l(n,t,r):j(n)?p(n,t,r):v(n)||i(n,t,r)}function U(n,t){return n?c(n,[],t||1):[]}var z=/\{\s*(\d+)\s*\}/g,D=/\{\s*(\w+)\s*\}/g;var L="celia_uid_"+(1e9*Math.random()>>>0),T=0;function R(n){return n[L]||(++T,Object.defineProperty(n,L,{configurable:!0,value:T}),T)}var $=Object.prototype.hasOwnProperty;var B=/^([a-z][a-z\d+\-.]*:)?\/\//i;var M=Object.prototype.toString;function q(n){return M.call(n)}function H(n){return n instanceof Date}var V={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};var W=Number.isInteger||r;function X(n){return n instanceof RegExp}var G=Array.isArray;var J=Array.isArray;var K=Array.isArray;var Q=Array.isArray;var Y={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){Y["[object "+n+"]"]=n.toLowerCase()}),n._append=u,n._assign=t,n._bindContext=f,n._flatten=c,n._forEach=l,n._forIn=s,n._forNumber=p,n._forOwn=i,n._forSlice=a,n._get=b,n._isInteger=r,n._loop=e,n._map=m,n._remove=O,n._removeAt=A,n._repeat=function(n,t,r){for(;n<t;n++)r(n,t)},n._transIndex=_,n.afterCall=function(n,t,e){if(w(n)){var o=n[t];n[t]=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];var r=o.apply(this,n);return e.apply(this,n,r)}}},n.alias=function(r,n){w(r)&&E(n,function(n,t){t=r[t],x(n)?n.forEach(function(n){return r[n]=t}):r[n]=t})},n.aroundCall=function(n,t,r){if(w(n)){var e=n[t];n[t]=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];return r.call(this,e,n)}}},n.assert=function(n,t){if(!n)throw new Error(t)},n.assign=C,n.assignDeep=function(n){if(v(n))throw new TypeError("Cannot convert undefined or null to object");var t=Object(n);return e(arguments,1,arguments.length,function(n){!function r(e,n){var o;v(n)||i(n,function(n,t){w(o=e[t])&&w(n)?r(o,n):e[t]=n})}(t,n)}),t},n.beforeCall=function(n,t,r){if(w(n)){var e=n[t];n[t]=function(){return r.apply(this,arguments),e.apply(this,arguments)}}},n.camelize=function(n){return g(n)?I[n]||(I[n]=n.replace(S,function(n,t){return t.toUpperCase()})):n},n.capitalize=function(n){return g(n)?N[n]||(N[n]=n.charAt(0).toUpperCase()+n.slice(1)):n},n.debounce=function(n,t){var r=null;function e(){null!==r&&(clearTimeout(r),r=null)}function o(){e(),r=setTimeout(n,t)}return o.cancel=e,o},n.each=P,n.flatten=U,n.flattenDeep=function(n){return U(n,Number.MAX_VALUE)},n.forEach=function(n,t,r){n&&a(n,0,n.length,t,r)},n.forIn=function(n,t,r){v(n)||s(n,t,r)},n.forOwn=E,n.forSlice=function(n,t,r,e,o){if(n){var i=n.length;F(t)?(o=r,e=t,r=i,t=0):F(r)&&(o=e,e=r,r=i),a(n,t=_(t,i),r=_(r,i),e,o)}},n.formatString=function(n,e){var t=arguments;if(n&&!v(e)){var r=D;if(!w(e)){var o=arguments.length;for(e=[];--o;)e[o-1]=t[o];r=z}n=n.replace(r,function(n,t){var r=e[t];return v(r)?n:r})}return n},n.get=function(n,t,r){var e=v(n)?void 0:b(n,t);return void 0===e?r:e},n.getEasyHash=function(n){return w(n)?"o"+R(n):(typeof n)[0]+n},n.getUid=R,n.hasOwn=function(n,t){return $.call(n,t)},n.isAbsoluteURL=function(n){return B.test(n)},n.isArrayLike=k,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===q(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=H,n.isFalsy=function(n){return!!V[n]},n.isFunction=F,n.isInteger=W,n.isNil=v,n.isNumber=j,n.isObject=w,n.isPlainObject=function(n){return!v(n)&&"[object Object]"===q(n)},n.isPromiseLike=function(n){return!!n&&F(n.then)&&F(n.catch)},n.isRegExp=X,n.isString=g,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.joinPath=function(n){var t=arguments.length;if(!t||v(n))return".";var r="";return e(arguments,1,t,function(n){n&&(r+="/",r+=n)}),r&&(n=n.replace(/\/+$/,"")+r.replace(/\/+/g,"/")),n},n.looseClone=function(n,t){return t?function r(n){var e=n;return G(n)?(e=[],n.forEach(function(n,t){e[t]=r(n)})):w(n)&&(e={},i(n,function(n,t){e[t]=r(n)})),e}(n):function(n){return w(n)?C({},n):n}(n)},n.looseEqual=function r(t,e){if(t===e)return!0;if(w(t)&&w(e)){if(J(t)&&J(e))return t.length===e.length&&t.every(function(n,t){return r(n,e[t])});if(H(t)&&H(e))return+t==+e;if(X(t)&&X(e))return t.toString()===e.toString();var n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&n.every(function(n){return r(t[n],e[n])})}return!1},n.map=function(n,t,r){return m(P,n,t,r)},n.mapObject=function(n,t,r){var e={},o=f(t,r);return E(n,function(n,t){v(n=o(n,t))||(e[t]=n)}),e},n.noop=function(){},n.remove=function(n,t){return K(n)?O(n,t):null},n.removeAt=function(n,t){return Q(n)?A(n,t):null},n.set=function(n,t,r){if(!v(n)){if(!g(t)||!d.test(t))return void(n[t]=r);var e,o,i=[],u=0;for(y.lastIndex=0;e=y.exec(t);){var f=e[0],c=e[1],a=e[2],l=e[3],s=void 0;a?v(s=n[o=l.replace(h,"$1")])&&(s=n[o]={}):c?v(s=n[o=c])&&(s=n[c]=[]):v(s=n[o=f])&&(s=n[f]={}),n=s,i[u++]=s}(n=i[u-2])[o]=r}},n.sleep=function(t){return new Promise(function(n){setTimeout(n,t)})},n.toString=q,n.transform=function(n,e,o){return P(n,function(n,t,r){return e(o,n,t,r)}),o},n.type=function(n){return v(n)?n+"":w(n)||F(n)?Y[q(n)]||"object":typeof n}},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).celia={}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175840
152
5588