Comparing version 7.0.0-beta.0 to 7.0.0-beta.1
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
14
celia.js
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
(function (global, factory) { | ||
@@ -80,3 +80,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
return isObject(value) | ||
? 'o' + uid(value) | ||
? `o${uid(value)}` | ||
: (typeof value)[0] + value; | ||
@@ -396,2 +396,6 @@ } | ||
function isLeapYear (year) { | ||
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; | ||
} | ||
function isPlainObject (value) { | ||
@@ -415,2 +419,6 @@ return !isNil(value) && toString$1(value) === '[object Object]'; | ||
function isValidDate (date) { | ||
return isDate(date) && date.toString() !== 'Invalid Date'; | ||
} | ||
function isWindow (elem) { | ||
@@ -650,2 +658,3 @@ return !!elem && elem === elem.window; | ||
exports.isInteger = isInteger; | ||
exports.isLeapYear = isLeapYear; | ||
exports.isNil = isNil; | ||
@@ -659,2 +668,3 @@ exports.isNumber = isNumber; | ||
exports.isUndefined = isUndefined; | ||
exports.isValidDate = isValidDate; | ||
exports.isWindow = isWindow; | ||
@@ -661,0 +671,0 @@ exports.looseClone = looseClone; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).celia={})}(this,(function(n){"use strict";function t(n){return null==n}function e(n){return"function"==typeof n}function r(n){return"number"==typeof n}function o(n){return!t(n)&&r(n.length)&&!e(n)}function i(n,t,e,r){for(;t<e;)!1===r(n[t],t,n)?t=e:t++}function u(n,t){const e=Object.keys(n);i(e,0,e.length,e=>t(n[e],e,n))}function c(n,t){for(let e=0;e<n;)!1===t(e,e,n)?e=n:e++}function f(n,e){o(n)?i(n,0,n.length,e):r(n)?c(n,e):t(n)||u(n,e)}function s(n){return null!==n&&"object"==typeof n}const l="celia_uid_"+(1e9*Math.random()>>>0);let a=0;function p(n){return n[l]||(++a,Object.defineProperty(n,l,{configurable:!0,value:a}),a)}const{hasOwnProperty:_}=Object.prototype;function y(n,t,e,r){for(;t<e;t++)r(n[t],t,n)}function d(n){if(t(n))throw new TypeError("Cannot convert undefined or null to object");const e=Object(n);return y(arguments,1,arguments.length,n=>{!t(n)&&u(n,(n,t)=>{e[t]=n})}),e}var g=Object.assign||d;const{isArray:h}=Array;function E(n){return n instanceof Date}function b(n){return n instanceof RegExp}const{isArray:A}=Array;function O(n,t){return n[n.length]=t,n}const P=Object.prototype.toString;function m(n){return P.call(n)}const{isArray:j}=Array;function R(n,t,e){return y(n,0,n.length,n=>{e>0?j(n)?R(n,t,--e):O(t,n):j(n)?y(n,0,n.length,n=>{O(t,n)}):O(t,n)}),t}function v(n,t){return n?R(n,[],t||1):[]}function w(n,t){return n<0?(e=0)>(r=t+n)?e:r:n;var e,r}function C(n,t){return n.splice(t,1)[0]||null}function x(n,t){let e=n.indexOf(t);return e>-1?C(n,e):null}const{isArray:I}=Array;const{isArray:S}=Array;const N=/^([a-z][a-z\d+\-.]*:)?\/\//i;const F={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};function k(n){return r(n)&&isFinite(n)&&n>>0===n}var M=Number.isInteger||k;function z(n){return"string"==typeof n}function D(n,e,r){!t(n)&&u(n,e)}const{isArray:T}=Array;function U(n,e){let r;!t(e)&&u(e,(t,e)=>{r=n[e],s(r)&&s(t)?U(r,t):n[e]=t})}function H(n,t){for(let e in n)if(!1===t(n[e],e))break}var L={PROP_NAME_RE:/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ESCAPE_CHAR_RE:/\\(\\)?/g,IS_DEEP_PROP_RE:/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/};const{PROP_NAME_RE:$,ESCAPE_CHAR_RE:q,IS_DEEP_PROP_RE:B}=L;function J(n,e){if(!z(e)||!B.test(e))return n[e];let r;for($.lastIndex=0;!t(n)&&(r=$.exec(e));){const[t,e,o,i]=r;n=n[o?i.replace(q,"$1"):e||t]}return n}const{PROP_NAME_RE:V,ESCAPE_CHAR_RE:W,IS_DEEP_PROP_RE:X}=L;const G=/[-_. ]+([a-z])/g,K=Object.create(null);const Q=Object.create(null);const Y=/\{\s*(\w+)\s*\}/g;n._append=O,n._assign=d,n._flatten=R,n._forEach=i,n._forIn=H,n._forNumber=c,n._forOwn=u,n._get=J,n._isInteger=k,n._iterate=y,n._loop=function(n,t,e){for(;n<t;n++)e(n,t)},n._ore=L,n._remove=x,n._removeAt=C,n._some=function(n,t,e,r){for(;t<e;t++)if(r(n[t],t,n))return!0;return!1},n._transIndex=w,n.afterCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){const t=r.apply(this,n);return e.call(this,n,t)}}},n.alias=function(n,t){s(n)&&D(t,(t,e)=>{const r=n[e];T(t)?t.forEach(t=>{n[t]=r}):n[t]=r})},n.aroundCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){return e.call(this,n,r)}}},n.assert=function(n,t){if(!n)throw new Error(t)},n.assign=g,n.beforeCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){const t=e.apply(this,n);return r.call(this,n,t)}}},n.camelize=function(n){if(z(n)){return K[n]||(K[n]=n.replace(G,(n,t)=>t.toUpperCase()))}return n},n.capitalize=function(n){if(z(n)){return Q[n]||(Q[n]=n.charAt(0).toUpperCase()+n.slice(1))}return n},n.debounce=function(n,t){let e=null;function r(){null!==e&&(clearTimeout(e),e=null)}function o(){r(),e=setTimeout(n,t)}return o.cancel=r,o},n.deepAssign=function(n){if(t(n))throw new TypeError("Cannot convert undefined or null to object");const e=Object(n);return y(arguments,1,arguments.length,n=>{U(e,n)}),e},n.deepFlat=function(n){return v(n,Number.MAX_VALUE)},n.each=f,n.easyHash=function(n){return s(n)?"o"+p(n):(typeof n)[0]+n},n.flat=v,n.forEach=function(n,t,r,o){if(n){const u=n.length;e(t)?i(n,0,u,t):e(r)?i(n,w(t,u),u,r):i(n,w(t,u),w(r,u),o)}},n.forIn=function(n,e,r){!t(n)&&H(n,e)},n.forOwn=D,n.get=function(n,e,r){const o=t(n)?void 0:J(n,e);return void 0===o?r:o},n.hasOwn=function(n,t){return _.call(n,t)},n.isAbsoluteURL=function(n){return N.test(n)},n.isArrayLike=o,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===m(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=E,n.isFalsy=function(n){return!!F[n]},n.isFunction=e,n.isInteger=M,n.isNil=t,n.isNumber=r,n.isObject=s,n.isPlainObject=function(n){return!t(n)&&"[object Object]"===m(n)},n.isPromiseLike=function(n){return!!n&&e(n.then)&&e(n.catch)},n.isRegExp=b,n.isString=z,n.isUndefined=function(n){return void 0===n},n.isWindow=function(n){return!!n&&n===n.window},n.looseClone=function(n,t){return t?function n(t){let e=t;return h(t)?(e=[],t.forEach((t,r)=>{e[r]=n(t)})):s(t)&&(e={},u(t,(t,r)=>{e[r]=n(t)})),e}(n):function(n){return s(n)?g({},n):n}(n)},n.looseEqual=function n(t,e){if(t===e)return!0;if(s(t)&&s(e)){if(A(t)&&A(e))return t.length===e.length&&t.every((t,r)=>n(t,e[r]));if(E(t)&&E(e))return+t==+e;if(b(t)&&b(e))return t.toString()===e.toString();{const r=Object.keys(t),o=Object.keys(e);return r.length===o.length&&r.every(r=>n(t[r],e[r]))}}return!1},n.map=function(n,e){const r=[];return f(n,(n,o)=>{!t(n=e(n,o))&&O(r,n)}),r},n.noop=function(){},n.pathJoin=function(n){const e=arguments.length;if(!e||t(n))return".";let r="";return y(arguments,1,e,n=>{n&&(r+="/",r+=n)}),r&&(n=n.replace(/\/+$/,"")+r.replace(/\/+/g,"/")),n},n.remove=function(n,t){return I(n)?x(n,t):null},n.removeAt=function(n,t){return S(n)?C(n,t):null},n.set=function(n,e,r){if(!t(n)){if(!z(e)||!X.test(e))return void(n[e]=r);let o;const i=[];let u,c=0;for(V.lastIndex=0;o=V.exec(e);){const[e,r,f,s]=o;let l;f?(u=s.replace(W,"$1"),l=n[u],t(l)&&(l=n[u]={})):r?(l=n[u=r],t(l)&&(l=n[r]=[])):(l=n[u=e],t(l)&&(l=n[e]={})),n=l,i[c++]=l}(n=i[c-2])[u]=r}},n.sleep=function(n){return new Promise(t=>{setTimeout(t,n)})},n.stringFormat=function(n,e){if(n&&!t(e)){const r=Y;n=n.replace(r,(function(n,r){const o=e[r];return t(o)?n:o}))}return n},n.toString=m,n.transform=function(n,t,e){return f(n,(function(n,r,o){return t(e,n,r,o)})),e},n.uid=p,Object.defineProperty(n,"__esModule",{value:!0})})); | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).celia={})}(this,(function(n){"use strict";function t(n){return null==n}function e(n){return"function"==typeof n}function r(n){return"number"==typeof n}function o(n){return!t(n)&&r(n.length)&&!e(n)}function i(n,t,e,r){for(;t<e;)!1===r(n[t],t,n)?t=e:t++}function u(n,t){const e=Object.keys(n);i(e,0,e.length,e=>t(n[e],e,n))}function c(n,t){for(let e=0;e<n;)!1===t(e,e,n)?e=n:e++}function f(n,e){o(n)?i(n,0,n.length,e):r(n)?c(n,e):t(n)||u(n,e)}function s(n){return null!==n&&"object"==typeof n}const l="celia_uid_"+(1e9*Math.random()>>>0);let a=0;function p(n){return n[l]||(++a,Object.defineProperty(n,l,{configurable:!0,value:a}),a)}const{hasOwnProperty:_}=Object.prototype;function d(n,t,e,r){for(;t<e;t++)r(n[t],t,n)}function y(n){if(t(n))throw new TypeError("Cannot convert undefined or null to object");const e=Object(n);return d(arguments,1,arguments.length,n=>{!t(n)&&u(n,(n,t)=>{e[t]=n})}),e}var g=Object.assign||y;const{isArray:h}=Array;function E(n){return n instanceof Date}function b(n){return n instanceof RegExp}const{isArray:A}=Array;function O(n,t){return n[n.length]=t,n}const P=Object.prototype.toString;function m(n){return P.call(n)}const{isArray:j}=Array;function R(n,t,e){return d(n,0,n.length,n=>{e>0?j(n)?R(n,t,--e):O(t,n):j(n)?d(n,0,n.length,n=>{O(t,n)}):O(t,n)}),t}function v(n,t){return n?R(n,[],t||1):[]}function w(n,t){return n<0?(e=0)>(r=t+n)?e:r:n;var e,r}function C(n,t){return n.splice(t,1)[0]||null}function I(n,t){let e=n.indexOf(t);return e>-1?C(n,e):null}const{isArray:S}=Array;const{isArray:x}=Array;const N=/^([a-z][a-z\d+\-.]*:)?\/\//i;const D={false:!0,null:!0,undefined:!0,0:!0,NaN:!0,"":!0};function F(n){return r(n)&&isFinite(n)&&n>>0===n}var k=Number.isInteger||F;function M(n){return"string"==typeof n}function z(n,e,r){!t(n)&&u(n,e)}const{isArray:L}=Array;function T(n,e){let r;!t(e)&&u(e,(t,e)=>{r=n[e],s(r)&&s(t)?T(r,t):n[e]=t})}function U(n,t){for(let e in n)if(!1===t(n[e],e))break}var $={PROP_NAME_RE:/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ESCAPE_CHAR_RE:/\\(\\)?/g,IS_DEEP_PROP_RE:/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/};const{PROP_NAME_RE:H,ESCAPE_CHAR_RE:V,IS_DEEP_PROP_RE:q}=$;function B(n,e){if(!M(e)||!q.test(e))return n[e];let r;for(H.lastIndex=0;!t(n)&&(r=H.exec(e));){const[t,e,o,i]=r;n=n[o?i.replace(V,"$1"):e||t]}return n}const{PROP_NAME_RE:J,ESCAPE_CHAR_RE:W,IS_DEEP_PROP_RE:X}=$;const Y=/[-_. ]+([a-z])/g,G=Object.create(null);const K=Object.create(null);const Q=/\{\s*(\w+)\s*\}/g;n._append=O,n._assign=y,n._flatten=R,n._forEach=i,n._forIn=U,n._forNumber=c,n._forOwn=u,n._get=B,n._isInteger=F,n._iterate=d,n._loop=function(n,t,e){for(;n<t;n++)e(n,t)},n._ore=$,n._remove=I,n._removeAt=C,n._some=function(n,t,e,r){for(;t<e;t++)if(r(n[t],t,n))return!0;return!1},n._transIndex=w,n.afterCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){const t=r.apply(this,n);return e.call(this,n,t)}}},n.alias=function(n,t){s(n)&&z(t,(t,e)=>{const r=n[e];L(t)?t.forEach(t=>{n[t]=r}):n[t]=r})},n.aroundCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){return e.call(this,n,r)}}},n.assert=function(n,t){if(!n)throw new Error(t)},n.assign=g,n.beforeCall=function(n,t,e){if(s(n)){const r=n[t];n[t]=function(...n){const t=e.apply(this,n);return r.call(this,n,t)}}},n.camelize=function(n){if(M(n)){return G[n]||(G[n]=n.replace(Y,(n,t)=>t.toUpperCase()))}return n},n.capitalize=function(n){if(M(n)){return K[n]||(K[n]=n.charAt(0).toUpperCase()+n.slice(1))}return n},n.debounce=function(n,t){let e=null;function r(){null!==e&&(clearTimeout(e),e=null)}function o(){r(),e=setTimeout(n,t)}return o.cancel=r,o},n.deepAssign=function(n){if(t(n))throw new TypeError("Cannot convert undefined or null to object");const e=Object(n);return d(arguments,1,arguments.length,n=>{T(e,n)}),e},n.deepFlat=function(n){return v(n,Number.MAX_VALUE)},n.each=f,n.easyHash=function(n){return s(n)?`o${p(n)}`:(typeof n)[0]+n},n.flat=v,n.forEach=function(n,t,r,o){if(n){const u=n.length;e(t)?i(n,0,u,t):e(r)?i(n,w(t,u),u,r):i(n,w(t,u),w(r,u),o)}},n.forIn=function(n,e,r){!t(n)&&U(n,e)},n.forOwn=z,n.get=function(n,e,r){const o=t(n)?void 0:B(n,e);return void 0===o?r:o},n.hasOwn=function(n,t){return _.call(n,t)},n.isAbsoluteURL=function(n){return N.test(n)},n.isArrayLike=o,n.isAsyncFunction=function(n){return"[object AsyncFunction]"===m(n)},n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=E,n.isFalsy=function(n){return!!D[n]},n.isFunction=e,n.isInteger=k,n.isLeapYear=function(n){return n%4==0&&n%100!=0||n%400==0},n.isNil=t,n.isNumber=r,n.isObject=s,n.isPlainObject=function(n){return!t(n)&&"[object Object]"===m(n)},n.isPromiseLike=function(n){return!!n&&e(n.then)&&e(n.catch)},n.isRegExp=b,n.isString=M,n.isUndefined=function(n){return void 0===n},n.isValidDate=function(n){return E(n)&&"Invalid Date"!==n.toString()},n.isWindow=function(n){return!!n&&n===n.window},n.looseClone=function(n,t){return t?function n(t){let e=t;return h(t)?(e=[],t.forEach((t,r)=>{e[r]=n(t)})):s(t)&&(e={},u(t,(t,r)=>{e[r]=n(t)})),e}(n):function(n){return s(n)?g({},n):n}(n)},n.looseEqual=function n(t,e){if(t===e)return!0;if(s(t)&&s(e)){if(A(t)&&A(e))return t.length===e.length&&t.every((t,r)=>n(t,e[r]));if(E(t)&&E(e))return+t==+e;if(b(t)&&b(e))return t.toString()===e.toString();{const r=Object.keys(t),o=Object.keys(e);return r.length===o.length&&r.every(r=>n(t[r],e[r]))}}return!1},n.map=function(n,e){const r=[];return f(n,(n,o)=>{!t(n=e(n,o))&&O(r,n)}),r},n.noop=function(){},n.pathJoin=function(n){const e=arguments.length;if(!e||t(n))return".";let r="";return d(arguments,1,e,n=>{n&&(r+="/",r+=n)}),r&&(n=n.replace(/\/+$/,"")+r.replace(/\/+/g,"/")),n},n.remove=function(n,t){return S(n)?I(n,t):null},n.removeAt=function(n,t){return x(n)?C(n,t):null},n.set=function(n,e,r){if(!t(n)){if(!M(e)||!X.test(e))return void(n[e]=r);let o;const i=[];let u,c=0;for(J.lastIndex=0;o=J.exec(e);){const[e,r,f,s]=o;let l;f?(u=s.replace(W,"$1"),l=n[u],t(l)&&(l=n[u]={})):r?(l=n[u=r],t(l)&&(l=n[r]=[])):(l=n[u=e],t(l)&&(l=n[e]={})),n=l,i[c++]=l}(n=i[c-2])[u]=r}},n.sleep=function(n){return new Promise(t=>{setTimeout(t,n)})},n.stringFormat=function(n,e){if(n&&!t(e)){const r=Q;n=n.replace(r,(function(n,r){const o=e[r];return t(o)?n:o}))}return n},n.toString=m,n.transform=function(n,t,e){return f(n,(function(n,r,o){return t(e,n,r,o)})),e},n.uid=p,Object.defineProperty(n,"__esModule",{value:!0})})); |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -9,3 +9,3 @@ | ||
return isObject(value) | ||
? 'o' + uid(value) | ||
? `o${uid(value)}` | ||
: (typeof value)[0] + value; | ||
@@ -12,0 +12,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function append (arr, obj) { | ||
@@ -3,0 +3,0 @@ arr[arr.length] = obj; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import iterate from './_iterate.js'; | ||
@@ -3,0 +3,0 @@ import append from './_append.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function _forEach (value, start, end, iterator) { | ||
@@ -3,0 +3,0 @@ for (; start < end;) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function forIn (value, iterator) { | ||
@@ -3,0 +3,0 @@ for (let key in value) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function forNumber (value, iterator) { | ||
@@ -3,0 +3,0 @@ for (let i = 0; i < value;) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import _forEach from './_forEach.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import isString from './isString.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNumber from './isNumber.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function iterate (arr, start, end, callback) { | ||
@@ -3,0 +3,0 @@ for (; start < end; start++) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function _loop (start, end, callback) { | ||
@@ -3,0 +3,0 @@ for (; start < end; start++) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
var ore = { | ||
@@ -3,0 +3,0 @@ PROP_NAME_RE: /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import removeAt from './_removeAt.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function removeAt (elems, index) { | ||
@@ -3,0 +3,0 @@ return elems.splice(index, 1)[0] || null; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function _some(value, start, end, iterator) { | ||
@@ -3,0 +3,0 @@ for (; start < end; start++) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function max(a, b) { | ||
@@ -3,0 +3,0 @@ return a > b ? a : b; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isObject from './isObject.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isObject from './isObject.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function assert (condition, msg) { | ||
@@ -3,0 +3,0 @@ if (!condition) { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isObject from './isObject.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isString from './isString.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isString from './isString.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function debounce (fn, wait) { | ||
@@ -3,0 +3,0 @@ let timeout = null; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './_iterate.js'; | ||
@@ -3,0 +3,0 @@ import './_append.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './isFunction.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isObject from './isObject.js'; | ||
@@ -7,3 +7,3 @@ import uid from './uid.js'; | ||
return isObject(value) | ||
? 'o' + uid(value) | ||
? `o${uid(value)}` | ||
: (typeof value)[0] + value; | ||
@@ -10,0 +10,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './_iterate.js'; | ||
@@ -3,0 +3,0 @@ import './_append.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isFunction from './isFunction.js'; | ||
@@ -3,0 +3,0 @@ import _forEach from './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import forIn$1 from './_forIn.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './isString.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
const { hasOwnProperty } = Object.prototype; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
export { default as assert } from './assert.js'; | ||
@@ -49,2 +49,3 @@ export { default as isNil } from './isNil.js'; | ||
export { default as isInteger } from './isInteger.js'; | ||
export { default as isLeapYear } from './isLeapYear.js'; | ||
export { default as isPlainObject } from './isPlainObject.js'; | ||
@@ -54,2 +55,3 @@ export { default as isPromiseLike } from './isPromiseLike.js'; | ||
export { default as isUndefined } from './isUndefined.js'; | ||
export { default as isValidDate } from './isValidDate.js'; | ||
export { default as isWindow } from './isWindow.js'; | ||
@@ -56,0 +58,0 @@ export { default as forOwn } from './forOwn.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
const PROTOCOL = /^([a-z][a-z\d+\-.]*:)?\/\//i; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import isFunction from './isFunction.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import toString from './toString.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isBoolean (value) { | ||
@@ -3,0 +3,0 @@ return typeof value === 'boolean'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
// import toString from '../toString'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
const falseLike = { | ||
@@ -3,0 +3,0 @@ false: true, |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isFunction (value) { | ||
@@ -3,0 +3,0 @@ return typeof value === 'function'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './isNumber.js'; | ||
@@ -3,0 +3,0 @@ import _isInteger from './_isInteger.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isNil (value) { | ||
@@ -3,0 +3,0 @@ /* eslint eqeqeq: 0 */ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isNumber (value) { | ||
@@ -3,0 +3,0 @@ return typeof value === 'number'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isObject (value) { | ||
@@ -3,0 +3,0 @@ return value !== null && typeof value === 'object'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import toString from './toString.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isFunction from './isFunction.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
// import toString from '../toString'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isString (value) { | ||
@@ -3,0 +3,0 @@ return typeof value === 'string'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isUndefined (value) { | ||
@@ -3,0 +3,0 @@ return typeof value === 'undefined'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function isWindow (elem) { | ||
@@ -3,0 +3,0 @@ return !!elem && elem === elem.window; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './_forEach.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isObject from './isObject.js'; | ||
@@ -3,0 +3,0 @@ import isDate from './isDate.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './isFunction.js'; |
@@ -1,4 +0,4 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function noop() { } | ||
export default noop; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import iterate from './_iterate.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './_removeAt.js'; | ||
@@ -3,0 +3,0 @@ import remove$1 from './_remove.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import removeAt$1 from './_removeAt.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ import isString from './isString.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
function sleep (ms) { | ||
@@ -3,0 +3,0 @@ return new Promise((resolve) => { |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import isNil from './isNil.js'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
const toString = Object.prototype.toString; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
import './isNil.js'; | ||
@@ -3,0 +3,0 @@ import './isFunction.js'; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
const UID_PROPERTY = 'celia_uid_' + ((Math.random() * 1e9) >>> 0); | ||
@@ -3,0 +3,0 @@ let uidCounter = 0; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -53,2 +53,3 @@ | ||
var isInteger = require('./isInteger.js'); | ||
var isLeapYear = require('./isLeapYear.js'); | ||
var isPlainObject = require('./isPlainObject.js'); | ||
@@ -58,2 +59,3 @@ var isPromiseLike = require('./isPromiseLike.js'); | ||
var isUndefined = require('./isUndefined.js'); | ||
var isValidDate = require('./isValidDate.js'); | ||
var isWindow = require('./isWindow.js'); | ||
@@ -123,2 +125,3 @@ var forOwn = require('./forOwn.js'); | ||
exports.isInteger = isInteger; | ||
exports.isLeapYear = isLeapYear; | ||
exports.isPlainObject = isPlainObject; | ||
@@ -128,2 +131,3 @@ exports.isPromiseLike = isPromiseLike; | ||
exports.isUndefined = isUndefined; | ||
exports.isValidDate = isValidDate; | ||
exports.isWindow = isWindow; | ||
@@ -130,0 +134,0 @@ exports.forOwn = forOwn; |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "celia", | ||
"version": "7.0.0-beta.0", | ||
"version": "7.0.0-beta.1", | ||
"description": "A modern JavaScript utility library delivering modularity, performance, and extras.", | ||
@@ -12,4 +12,4 @@ "main": "index.js", | ||
"test": "jest --detectOpenHandles --config jest.config.js", | ||
"docs": "./scripts/docs.sh", | ||
"gh-pages": "git subtree push --prefix=gh-pages origin gh-pages" | ||
"gh-pages": "git subtree push --prefix=gh-pages origin gh-pages", | ||
"release": "npm publish dist" | ||
}, | ||
@@ -21,4 +21,2 @@ "repository": { | ||
"keywords": [ | ||
"js", | ||
"javascript", | ||
"util", | ||
@@ -47,2 +45,3 @@ "lodash", | ||
"jest": "^25.1.0", | ||
"moment": "^2.24.0", | ||
"rollup": "^2.1.0", | ||
@@ -70,2 +69,2 @@ "rollup-plugin-combine": "^2.0.0", | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
1109
README.md
@@ -20,3 +20,3 @@ # celia | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/celia/iife.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/celia/celia.min.js"></script> | ||
<script> | ||
@@ -74,4 +74,1107 @@ // window.celia | ||
## Example | ||
## API | ||
- [Jest](test) | ||
### assert | ||
- assert(condition, msg) | ||
- `condition` `<Boolean>` | ||
- `msg` `<String>` error message | ||
- Throws | ||
- `<Error>` throws Error if `condition` is `false` | ||
```js | ||
assert(1 !== 1, 'assertion error'); | ||
// => throw Error: assertion error | ||
``` | ||
### each | ||
- each(value, callback[, context]) | ||
- `value` `<Array|ArrayLike|String|Number|Object>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` optional | ||
```js | ||
each([1, 2], (val, index)=> { | ||
}) | ||
each({ a: 1, b: 2 }, (val, key)=> { | ||
}) | ||
each(5, (index, index)=> { | ||
}) | ||
each('hello', (c, index)=> { | ||
}) | ||
``` | ||
### easyHash | ||
- easyHash(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<String>` returns an easy hash value | ||
```js | ||
easyHash('abc') | ||
// => 'sabc' | ||
easyHash(1) | ||
// => 'n1' | ||
easyHash({}) | ||
// => 'o1' | ||
``` | ||
### hasOwn | ||
- hasOwn(obj, key) | ||
- `obj` `<Object>` | ||
- `key` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
const obj = { aaa: 111 }; | ||
hasOwn(obj, 'test') | ||
// => false | ||
hasOwn(obj, 'aaa') | ||
// => true | ||
``` | ||
### looseClone | ||
- looseClone(value) | ||
- `value` `<Object>` | ||
- Returns | ||
- `<Object>` | ||
```js | ||
const a = { a: 1 }; | ||
const b = looseClone(a); | ||
// => a !== b | ||
``` | ||
### looseEqual | ||
- looseEqual(a, b) | ||
- `a` `<any>` | ||
- `b` `<any>` ,用于跟 a 比较 | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
looseEqual(null, undefined) | ||
// => false | ||
looseEqual(null, null) | ||
// => true | ||
looseEqual({ a: 1, b: 2 }, { a: 1, b: 2 }) | ||
// => true | ||
looseEqual([1, 2], [1, 2]) | ||
// => true | ||
looseEqual(/\d+/, /\d+/) | ||
// => true | ||
looseEqual(new Date(2019, 0, 1, 9, 9, 9), new Date(2019, 0, 1, 9, 9, 9)) | ||
// => true | ||
``` | ||
### noop | ||
- noop(value) | ||
- Returns | ||
- `<Function>` | ||
```js | ||
noop() | ||
// => function() {} | ||
``` | ||
### sleep | ||
- sleep(value) | ||
- `value` `<Number>` milliseconds | ||
- Returns | ||
- `<Promise>` | ||
```js | ||
async function foo() { | ||
await sleep(3000); | ||
} | ||
``` | ||
### toString | ||
- toString(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<String>` | ||
```js | ||
toString({}) | ||
// => '[object Object]' | ||
toString([]) | ||
// => '[object Array]' | ||
``` | ||
### isAbsoluteURL | ||
- isAbsoluteURL(url) | ||
- `url` `<String>` a request url | ||
- Returns | ||
- `<Boolean>` returns true if the `url` is a absolute request url | ||
```js | ||
isAbsoluteURL('/src/isAbsoluteURL.js')) | ||
// => false | ||
isAbsoluteURL('https://github.com')) | ||
// => true | ||
``` | ||
### isArrayLike | ||
- isArrayLike(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isArrayLike('123') | ||
// => true | ||
isArrayLike(() => { }) | ||
// => false | ||
isArrayLike([]) | ||
// => true | ||
isArrayLike([1, 2, 3]) | ||
// => true | ||
isArrayLike({ 0: 1, length: 1 }) | ||
// => true | ||
``` | ||
### isAsyncFunction | ||
- isAsyncFunction(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isAsyncFunction(async () => { }) | ||
// => true | ||
isAsyncFunction(() => { }) | ||
// => false | ||
``` | ||
### isBoolean | ||
- isBoolean(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isBoolean(() => { }) | ||
// => false | ||
isBoolean(true) | ||
// => true | ||
``` | ||
### isDate | ||
- isDate(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isDate(new Date()) | ||
// => true | ||
isDate({}) | ||
// => false | ||
``` | ||
### isFalsy | ||
- isFalsy(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isFalsy(false) | ||
// => true | ||
isFalsy(null) | ||
// => true | ||
isFalsy(undefined) | ||
// => true | ||
isFalsy(0) | ||
// => true | ||
isFalsy(NaN) | ||
// => true | ||
isFalsy('') | ||
// => true | ||
isFalsy({}) | ||
// => false | ||
``` | ||
### isFunction | ||
- isFunction(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isFunction(async () => { }) | ||
// => true | ||
isFunction(() => { }) | ||
// => true | ||
isFunction({}) | ||
// => false | ||
``` | ||
### isInteger | ||
- isInteger(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isInteger(2) | ||
// => true | ||
isInteger(-2) | ||
// => true | ||
isInteger(1.23) | ||
// => false | ||
isInteger(-1.23) | ||
// => false | ||
isInteger(null) | ||
// => false | ||
isInteger(undefined) | ||
// => false | ||
isInteger('2')); | ||
// => false | ||
isInteger(Infinity) | ||
// => false | ||
``` | ||
### isLeapYear | ||
- isLeapYear(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isLeapYear(1997) | ||
// => false | ||
``` | ||
### isNil | ||
- isNil(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isNil(null) | ||
// => true | ||
isNil(undefined) | ||
// => true | ||
isNil({}) | ||
// => false | ||
``` | ||
### isNumber | ||
- isNumber(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isNumber(1) | ||
// => true | ||
isNumber(undefined) | ||
// => false | ||
isNumber({}) | ||
// => false | ||
``` | ||
### isObject | ||
- isObject(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isObject(1) | ||
// => false | ||
isObject(undefined) | ||
// => false | ||
isObject({}) | ||
// => true | ||
``` | ||
### isPlainObject | ||
- isPlainObject(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isPlainObject(new Date()) | ||
// => false | ||
isPlainObject({}) | ||
// => true | ||
``` | ||
### isPromiseLike | ||
- isPromiseLike(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isPromiseLike(null) | ||
// => false | ||
isPromiseLike(undefined) | ||
// => false | ||
isPromiseLike({}) | ||
// => false | ||
isPromiseLike(new Promise(() => { })) | ||
// => true | ||
isPromiseLike({ then: () => { }, catch: () => { } }) | ||
// => true | ||
``` | ||
### isRegExp | ||
- isRegExp(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isRegExp(null) | ||
// => false | ||
isRegExp(undefined) | ||
// => false | ||
isRegExp({}) | ||
// => false | ||
isRegExp(Object.create(null)) | ||
// => false | ||
isRegExp(/\d+/) | ||
// => true | ||
``` | ||
### isString | ||
- isString(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isString(null) | ||
// => false | ||
isString({}) | ||
// => false | ||
isString(1) | ||
// => false | ||
isString(true) | ||
// => false | ||
isString('') | ||
// => true | ||
``` | ||
### isUndefined | ||
- isUndefined(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isUndefined(null) | ||
// => false | ||
isUndefined(undefined) | ||
// => true | ||
``` | ||
### isValidDate | ||
- isValidDate(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isValidDate(null) | ||
// => false | ||
isValidDate(undefined) | ||
// => false | ||
isValidDate(new Date(NaN)) | ||
// => false | ||
isValidDate(new Date()) | ||
// => true | ||
``` | ||
### isWindow | ||
- isWindow(value) | ||
- `value` `<any>` | ||
- Returns | ||
- `<Boolean>` | ||
```js | ||
isWindow(null) | ||
// => false | ||
isWindow(undefined) | ||
// => false | ||
isWindow(window) | ||
// => true | ||
``` | ||
## Collection Methods | ||
### map | ||
- map(value, callback[, context]) | ||
- `value` `<Array|ArrayLike|String|Number|Object>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` optional | ||
- Returns | ||
- `<Array>` | ||
```js | ||
map([1, 2, 3, 4, 5], n => n + 1) | ||
// => [2, 3, 4, 5, 6] | ||
map([1, null, 2, undefined, 3, 4, 5], n => n && (n + 1)) | ||
// => [2, 3, 4, 5, 6] | ||
map({ a: 1, b: 2 }, n => n && (n + 1)) | ||
// => [2, 3] | ||
``` | ||
### transform | ||
- transform(value, iterater, accumulator) | ||
- `value` `<any>` | ||
- `iterater` `<Function>` | ||
- `accumulator` `<any>` initial value | ||
- Returns | ||
- `<any>` | ||
```js | ||
const obj = { a: 1, b: 2 }; | ||
const newObj = transform(obj, (newObj, value, key) => { | ||
newObj[key] = value + 1; | ||
}, {}); | ||
// => { a: 2, b: 3 } | ||
const arr = [1, 2]; | ||
const newArr = transform(arr, (newArr, value, key) => { | ||
newArr[key] = value + 1; | ||
}, []); | ||
// => [2, 3] | ||
``` | ||
### uid | ||
- uid(obj) | ||
- `obj` `<Object>` | ||
- Returns | ||
- `<Number>` | ||
```js | ||
uid({}) | ||
// => 1 | ||
uid({}) | ||
// => 2 | ||
``` | ||
### alias | ||
- alias() | ||
- `obj` `<Object>` | ||
- `mappings` | ||
```js | ||
alias({ a: 1, b: 2 }, { | ||
a: 'c', | ||
b: ['e', 'f'] | ||
}); | ||
// => { a: 1, b: 2, c: 1, e: 2, f: 2 } | ||
``` | ||
### assign | ||
- assign(value, value2[, ...args]) | ||
- `value` `<Object>` | ||
- `value2` `<Object>` | ||
- `args` `<...Object>` | ||
- Returns | ||
- `<Object>` | ||
```js | ||
const a = { a: 1 }; | ||
const b = { b: 2 }; | ||
const c = { c: 3 }; | ||
assign(a, b, c); | ||
// => { a: 1, b: 2, c: 3 } | ||
``` | ||
### deepAssign | ||
- deepAssign(value, value2[, ...args]) | ||
- `value` `<Object>` | ||
- `value2` `<Object>` | ||
- `args` `<...Object>` | ||
- Returns | ||
- `<Object>` | ||
```js | ||
const a = { a: 1 }; | ||
const b = { b: {bb: 11} }; | ||
deepAssign(a, b); | ||
// => a.b !== b.b | ||
``` | ||
### forIn | ||
- forIn(value, callback[, context]) | ||
- `value` `<Object>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` optional | ||
```js | ||
forIn({ a: 1, b: 2 }, (val, key) => { | ||
}); | ||
``` | ||
### forOwn | ||
- forOwn(value, callback[, context]) | ||
- `value` `<Object>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` optional | ||
```js | ||
forOwn({ a: 1, b: 2 }, (val, key) => { | ||
}); | ||
``` | ||
### get | ||
- get(object, path[, defaultValue]) | ||
- `object` `<Object>` | ||
- `path` `<String>` | ||
- `defaultValue` `<any>` optional | ||
- Returns | ||
- `<any>` | ||
```js | ||
const a = { a: [{ b: { c: 3 } }], key: 'value' }; | ||
get(null, 'a[0].b.c', 3) | ||
// => 3 | ||
get(a, 'a[0].b.c') | ||
// => 3 | ||
get(a, 'a["0"].b.c') | ||
// => 3 | ||
get(a, 'a.b.c') | ||
// => undefined | ||
get(a, 'a.b.c', 'default') | ||
// => 'default' | ||
get(a, 'key') | ||
// => 'value' | ||
get({ key: null }, 'key') | ||
// => null | ||
``` | ||
### set | ||
- set(object, path, value) | ||
- `object` `<Object>` | ||
- `path` `<String>` | ||
- `value` `<any>` | ||
```js | ||
const a = { a: [{ b: { c: 3 } }], key: 'value' }; | ||
set(a, 'a[0].b.c', 1); | ||
// => { a: [{ b: { c: 1 } }], key: 'value' } | ||
``` | ||
### deepFlat | ||
- deepFlat(arr) | ||
- `arr` `<Array>` | ||
- Returns | ||
- `<Array>` | ||
```js | ||
const arr1 = [1, [2], [], 3, 4, 5]; | ||
deepFlat(arr1) | ||
// => [1, 2, 3, 4, 5] | ||
const arr2 = [1, [2, [1, 2, [2, 3]], 3], [], 3, [[1, 2], [[1, 2, 3], 3], [1, 2]], 4, 5]; | ||
deepFlat(arr2) | ||
// => [1, 2, 1, 2, 2, 3, 3, 3, 1, 2, 1, 2, 3, 3, 1, 2, 4, 5] | ||
``` | ||
### flat | ||
- flat(arr[, depth]) | ||
- `arr` `<Array>` | ||
- `depth` `<Number>` <strong>Default: 1</strong> | ||
- flat | ||
- `<Array>` | ||
```js | ||
const arr1 = [1, [2], [], 3, 4, 5]; | ||
flat(arr1) | ||
// => [1, 2, 3, 4, 5] | ||
const arr2 = [1, 2, 3, [2, 3, 4], [[1, 2, 3], [3, 4, 5]], 1, 3, 4]; | ||
flat(arr2) | ||
// => [1, 2, 3, 2, 3, 4, [1, 2, 3], [3, 4, 5], 1, 3, 4] | ||
``` | ||
### forEach | ||
- forEach(arr, callback[, context]) | ||
- `arr` `<Array>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` Optional | ||
- forEach(arr, start, callback[, context]) | ||
- `arr` `<Array>` | ||
- `start` `<Number>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` Optional | ||
- forEach(arr, start, end, callback[, context]) | ||
- `arr` `<Array>` | ||
- `start` `<Number>` | ||
- `end` `<Number>` | ||
- `callback` `<Function>` | ||
- `context` `<any>` Optional | ||
```js | ||
let i = 0; | ||
forEach([1, 2, 3], function(num) { | ||
if (num === 1) { | ||
return false; | ||
} | ||
i++; | ||
}); | ||
// i === 0 | ||
i = 0; | ||
forEach([1, 2, 3, 4, 5], 1, function(num) { | ||
if (num === 3) { | ||
return false; | ||
} | ||
i++; | ||
}); | ||
// i === 1 | ||
i = 0; | ||
forEach([1, 2, 3, 4, 5], 1, -1, function(num) { | ||
i++; | ||
}); | ||
// i === 3 | ||
``` | ||
### remove | ||
- remove(arr, value) | ||
- `arr` `<Array>` | ||
- `value` `<any>` | ||
- Returns | ||
- `<any>` returns something being removed | ||
```js | ||
const arr = [1, 2, 3, 4, 5]; | ||
remove(arr, 2) | ||
// => 2 | ||
remove(arr, 9) | ||
// => null | ||
``` | ||
### removeAt | ||
- removeAt(arr, index) | ||
- `arr` `<Array>` | ||
- `index` `<Number>` | ||
- Returns | ||
- `<any>` returns something being removed | ||
```js | ||
const arr = [1, 2, 3, 4, 5]; | ||
removeAt(arr, 2) | ||
// => 3 | ||
removeAt(arr, 9) | ||
// => null | ||
``` | ||
### camelize | ||
- camelize(value) | ||
- `value` `<String>` | ||
- Returns | ||
- `<String>` | ||
```js | ||
camelize('-value') | ||
// => 'Value' | ||
camelize('data-value') | ||
// => 'dataValue' | ||
camelize('data-------value') | ||
// => 'dataValue' | ||
camelize('data-attr-value') | ||
// => 'dataAttrValue' | ||
camelize('data--attr--value') | ||
// => 'dataAttrValue' | ||
camelize('data_value') | ||
// => 'dataValue' | ||
camelize('data_______value') | ||
// => 'dataValue' | ||
camelize('data_attr_value') | ||
// => 'dataAttrValue' | ||
camelize('data__attr__value') | ||
// => 'dataAttrValue' | ||
camelize('data value') | ||
// => 'dataValue' | ||
camelize('data value') | ||
// => 'dataValue' | ||
camelize('data attr value') | ||
// => 'dataAttrValue' | ||
camelize('data attr value') | ||
// => 'dataAttrValue' | ||
camelize('data.value') | ||
// => 'dataValue' | ||
camelize('data.......value') | ||
// => 'dataValue' | ||
camelize('data.attr.value') | ||
// => 'dataAttrValue' | ||
camelize('data..attr..value') | ||
// => 'dataAttrValue' | ||
``` | ||
### capitalize | ||
- capitalize(value) | ||
- `value` `<String>` | ||
- Returns | ||
- `<String>` | ||
```js | ||
capitalize('value') | ||
// => 'Value' | ||
``` | ||
### pathJoin | ||
- pathJoin(base, arg[, arg2, arg3]) | ||
- `base` `<String>` | ||
- `arg` `<String|Number|Boolean>` | ||
```js | ||
pathJoin('https://www.baidu.com', 'path1') | ||
// => 'https://www.baidu.com/path1' | ||
pathJoin('https://www.baidu.com/', 'path1') | ||
// => 'https://www.baidu.com/path1' | ||
pathJoin('https://www.baidu.com', 'path1', 'path2) | ||
// => 'https://www.baidu.com/path1/path2' | ||
``` | ||
### stringFormat | ||
- stringFormat(val, obj) | ||
- `val` `<String>` | ||
- `obj` `<Object>` | ||
```js | ||
stringFormat('共{ page }条记录', {}) | ||
// => '共{ page }条记录' | ||
stringFormat('共{ page }条记录', { page: 2 }) | ||
// => '共2条记录' | ||
``` | ||
### afterCall | ||
- afterCall(obj, methodName, after) | ||
- `obj` `<Object>` | ||
- `methodName` `<String>` | ||
- `after` `<Function>` | ||
```js | ||
const obj = { | ||
counter: 2, | ||
increment() { | ||
this.counter++; | ||
} | ||
}; | ||
afterCall(obj, 'increment', function (args, ret) { | ||
this.counter = 1; | ||
}); | ||
obj.increment(); | ||
// 1 | ||
``` | ||
### aroundCall | ||
- aroundCall(obj, methodName, after) | ||
- `obj` `<Object>` | ||
- `methodName` `<String>` | ||
- `after` `<Function>` | ||
```js | ||
const obj = { | ||
counter: 2, | ||
increment() { | ||
this.counter++; | ||
} | ||
}; | ||
aroundCall(obj, 'increment', function (args, fn) { | ||
this.counter = 2; | ||
fn.apply(this, args); | ||
this.counter = 2; | ||
}); | ||
obj.increment(); | ||
// 2 | ||
``` | ||
### beforeCall | ||
- beforeCall(obj, methodName, after) | ||
- `obj` `<Object>` | ||
- `methodName` `<String>` | ||
- `after` `<Function>` | ||
```js | ||
const obj = { | ||
counter: 2, | ||
increment() { | ||
this.counter++; | ||
} | ||
}; | ||
beforeCall(obj, 'increment', function () { | ||
this.counter = 1; | ||
}); | ||
obj.increment(); | ||
// 2 | ||
``` | ||
### debounce | ||
- debounce(func, wait) | ||
- `func` `<Function>` | ||
- `wait` `<Number>` | ||
- Returns | ||
- `<Function>` | ||
```js | ||
async function() { | ||
let i = 0; | ||
const counter = debounce(() => { | ||
i++; | ||
}, 200); | ||
counter(); | ||
await sleep(100); | ||
counter(); | ||
await sleep(100); | ||
counter(); | ||
await sleep(200); | ||
//=> 1 === 1 | ||
} | ||
``` | ||
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* celia.js v7.0.0-beta.0 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
/* celia.js v7.0.0-beta.1 (c) 2018-2020 Jesse Feng Released under the MIT License. */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
97338
140
2377
1179
0
19