Comparing version 2.1.0-1 to 2.1.0
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";function append(e,n){e&&(e[e.length]=n)}module.exports=append; | ||
"use strict";function append(e,n){if(e)return e[e.length]=n}module.exports=append; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_1=require("./chunk-c9bee550.js");function forEach(r,c,e){return r&&__chunk_1.forEach(r,c,e)}module.exports=forEach; | ||
"use strict";var __chunk_1=require("./chunk-7ad506f8.js");function forEach(r,c,u){return r&&__chunk_1.forEach(r,c,u)}module.exports=forEach; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var join=require("./join.js"),__chunk_2=require("./chunk-5065610b.js");function isString(r){return"string"==typeof r}var ref=Array.prototype,push=ref.push;function makeArray(r,e){var u=e||[];return r&&(__chunk_2.isArrayLike(Object(r))?join(u,isString(r)?[r]:r):u.push?u.push(r):push.call(u,r)),u}module.exports=makeArray; | ||
"use strict";var join=require("./join.js"),__chunk_2=require("./chunk-2a0959ac.js");function isString(r){return"string"==typeof r}var ref=Array.prototype,push=ref.push;function makeArray(r,e){var u=e||[];return r&&(__chunk_2.isArrayLike(Object(r))?join(u,isString(r)?[r]:r):u.push?u.push(r):push.call(u,r)),u}module.exports=makeArray; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_1=require("./chunk-c9bee550.js"),__chunk_2=require("./chunk-5065610b.js");function isNumber(r){return"number"==typeof r}function forIn(r,n,u){var e=__chunk_1.iteratorCallback(n,u);for(var c in r)if(!1===e(r[c],c,r))break}function forNumber(r,n,u){for(var e=__chunk_1.iteratorCallback(n,u),c=0,_=void 0;!1!==_&&c<r;c++)_=e(c,c,c)}function each(r,n,u){r&&(__chunk_2.isArrayLike(r)?__chunk_1.forEach(r,n,u):isNumber(r)?forNumber(r,n,u):forIn(r,n,u))}function append(r,n){return r[r.length]=n}function map(r,n,u){var e=[],c=__chunk_1.iteratorCallback(n,u);return each(r,function(r){r=c(r),__chunk_2.isNil(r)||append(e,r)}),e}module.exports=map; | ||
"use strict";var __chunk_1=require("./chunk-7ad506f8.js"),__chunk_2=require("./chunk-2a0959ac.js");function forIn(r,n,_){var a=__chunk_1.iteratorCallback(n,_);for(var c in r)if(!1===a(r[c],c,r))break}function forNumber(r,n,_){for(var a=__chunk_1.iteratorCallback(n,_),c=0,u=void 0;!1!==u&&c<r;c++)u=a(c,c,c)}function each(r,n,_){r&&(__chunk_2.isArrayLike(r)?__chunk_1.forEach(r,n,_):__chunk_2.isNumber(r)?forNumber(r,n,_):forIn(r,n,_))}function append(r,n){r[r.length]=n}function map(r,n,_){var a=[],c=__chunk_1.iteratorCallback(n,_);return each(r,function(r){r=c(r),__chunk_2.isNil(r)||append(a,r)}),a}module.exports=map; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_1=require("./chunk-78a5d470.js"),__chunk_2=require("./chunk-9356120a.js"),__chunk_3=require("./chunk-1af9fb56.js"),__chunk_4=require("./chunk-55ad1914.js");function isObject(n){return!__chunk_1.isNil(n)&&"object"==typeof n}function forIn(n,e,_){var i=__chunk_2.iteratorCallback(e,_);for(var t in n)if(!1===i(n[t],t,n))break}var indexOfUnits={};function getIndex(n){return n=n?__chunk_4.normalizeUnit(n):__chunk_3.MILLISECOND,indexOfUnits[n]}function add(n,e,_){var i=[n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()];if(isObject(e))forIn(e,function(n,e){var _=getIndex(e);i[_]+=n});else{var t=getIndex(_);i[t]+=e}return n.setTime(+__chunk_1.parseArray(i)),n}indexOfUnits[__chunk_3.YEAR]=0,indexOfUnits[__chunk_3.MONTH]=1,indexOfUnits[__chunk_3.DAY]=2,indexOfUnits[__chunk_3.HOUR]=3,indexOfUnits[__chunk_3.MINUTE]=4,indexOfUnits[__chunk_3.SECOND]=5,indexOfUnits[__chunk_3.MILLISECOND]=6,module.exports=add; | ||
"use strict";var __chunk_1=require("./chunk-0cb3fc16.js"),__chunk_2=require("./chunk-5ac2012c.js"),__chunk_3=require("./chunk-6fce3905.js");function isObject(e){return!__chunk_1.isNil(e)&&"object"==typeof e}function forIn(e,n,t){var r=__chunk_2.iteratorCallback(n,t);for(var c in e)if(!1===r(e[c],c,e))break}var indexOfUnits={Y:0,M:1,d:2,h:3,m:4,s:5,ms:6};function getIndex(e){return e=__chunk_3.normalizeUnit(e,"ms"),indexOfUnits[e]}function add(e,n,t){var r=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()];if(isObject(n))forIn(n,function(e,n){var t=getIndex(n);r[t]+=e});else{var c=getIndex(t);r[c]+=n}return e.setTime(+__chunk_1.parseArray(r)),e}module.exports=add; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./isLeapYear.js");var __chunk_5=require("./chunk-ebf43211.js"),__chunk_6=require("./chunk-d25e655c.js"),__chunk_7=require("./chunk-d01286bf.js");function dayOfYear(e,r){var u=__chunk_5.daysInYear(e),n=e.getMonth(),_=0;return __chunk_6.forNumber(n,function(e){_+=u[e]}),_+=e.getDate(),__chunk_7.isUndefined(r)?_:(e.setTime(+e+864e5*(r-_)),e)}module.exports=dayOfYear; | ||
"use strict";require("./chunk-5ac2012c.js"),require("./isLeapYear.js");var __chunk_4=require("./chunk-1060fd37.js"),__chunk_5=require("./chunk-a0229133.js");function isUndefined(e){return void 0===e}function dayOfYear(e,r){var n=__chunk_4.daysInYear(e),u=e.getMonth(),i=0;return __chunk_5.forNumber(u,function(e){i+=n[e]}),i+=e.getDate(),isUndefined(r)?i:(e.setTime(+e+864e5*(r-i)),e)}module.exports=dayOfYear; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./isLeapYear.js");var __chunk_5=require("./chunk-ebf43211.js");function daysInMonth(e){return __chunk_5.daysInYear(e)[e.getMonth()]}module.exports=daysInMonth; | ||
"use strict";require("./isLeapYear.js");var __chunk_4=require("./chunk-1060fd37.js");function daysInMonth(e){return __chunk_4.daysInYear(e)[e.getMonth()]}module.exports=daysInMonth; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js");var add=require("./add.js");require("./chunk-9356120a.js");var __chunk_3=require("./chunk-1af9fb56.js"),__chunk_4=require("./chunk-55ad1914.js"),clone=require("./clone.js");require("./chunk-d25e655c.js"),require("./chunk-3705080c.js");var parse=require("./parse.js");function monthDiff(e,r){var n=12*(r.getFullYear()-e.getFullYear())+(r.getMonth()-e.getMonth()),a=add(clone(e),n,"months");return-(n+(r-a<0?(r-a)/(a-add(clone(e),n-1,"months")):(r-a)/(add(clone(e),n+1,"months")-a)))||0}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function diff(e,r,n,a){var u;switch(r=parse(r),n=__chunk_4.normalizeUnit(n)){case __chunk_3.YEAR:u=monthDiff(e,r)/12;break;case __chunk_3.MONTH:u=monthDiff(e,r);break;case __chunk_3.SECOND:u=(e-r)/1e3;break;case __chunk_3.MINUTE:u=(e-r)/6e4;break;case __chunk_3.HOUR:u=(e-r)/36e5;break;case __chunk_3.DAY:u=(e-r)/864e5;break;default:u=e-r}return a?u:absFloor(u)}module.exports=diff; | ||
"use strict";require("./chunk-0cb3fc16.js");var add=require("./add.js");require("./chunk-5ac2012c.js");var __chunk_3=require("./chunk-6fce3905.js"),clone=require("./clone.js");require("./chunk-a0229133.js"),require("./chunk-fbabc482.js");var parse=require("./parse.js");function monthDiff(e,r){var a=12*(r.getFullYear()-e.getFullYear())+(r.getMonth()-e.getMonth()),n=add(clone(e),a,"months");return-(a+(r<n?(r-n)/(n-add(clone(e),a-1,"months")):(r-n)/(add(clone(e),a+1,"months")-n)))||0}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function diff(e,r,a,n){var c;switch(r=parse(r),a=__chunk_3.normalizeUnit(a)){case"Y":c=monthDiff(e,r)/12;break;case"M":c=monthDiff(e,r);break;case"s":c=(e-r)/1e3;break;case"m":c=(e-r)/6e4;break;case"h":c=(e-r)/36e5;break;case"d":c=(e-r)/864e5;break;default:c=e-r}return n?c:absFloor(c)}module.exports=diff; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js");var add=require("./add.js");require("./chunk-9356120a.js");var __chunk_3=require("./chunk-1af9fb56.js"),__chunk_4=require("./chunk-55ad1914.js"),startOf=require("./startOf.js");function endOf(r,e){return(e=__chunk_4.normalizeUnit(e))&&e!==__chunk_3.MILLISECOND&&(startOf(r,e),add(r,1,e),add(r,-1,__chunk_3.MILLISECOND)),r}module.exports=endOf; | ||
"use strict";require("./chunk-0cb3fc16.js");var add=require("./add.js");require("./chunk-5ac2012c.js");var __chunk_3=require("./chunk-6fce3905.js"),startOf=require("./startOf.js");function endOf(r,e){return"ms"===(e=__chunk_3.normalizeUnit(e,"ms"))||(startOf(r,e),add(r,1,e),add(r,-1,"ms")),r}module.exports=endOf; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_8=require("./chunk-3705080c.js");function padLeft(e,t){return void 0===t&&(t=2),("000000"+e).slice(-t)}function timezone(e,t){var r;return e<0?(r="+",e=Math.abs(e)):r="-",""+r+padLeft(Math.floor(e/60))+(t?"":":")+padLeft(Math.floor(e%60))}function h12(e){return 12<(e=e||24)?e-12:e}function format(t,e){return e?e.replace(__chunk_8.FORMAT_REGEX,function(e){switch(e){case"YY":return String(t.getFullYear()).slice(-2);case"YYYY":case"yyyy":return t.getFullYear();case"M":return t.getMonth()+1;case"MM":return padLeft(t.getMonth()+1);case"D":case"d":return t.getDate();case"DD":case"dd":return padLeft(t.getDate());case"H":return t.getHours();case"HH":return padLeft(t.getHours());case"h":return h12(t.getHours());case"hh":return padLeft(h12(t.getHours()));case"m":return t.getMinutes();case"mm":return padLeft(t.getMinutes());case"s":return t.getSeconds();case"ss":return padLeft(t.getSeconds());case"SSS":return padLeft(t.getMilliseconds(),3);case"Z":return timezone(t.getTimezoneOffset());case"ZZ":return timezone(t.getTimezoneOffset(),!0);default:return e}}):t.toISOString()}module.exports=format; | ||
"use strict";var __chunk_6=require("./chunk-fbabc482.js");function padLeft(e,t){return void 0===t&&(t=2),("000000"+e).slice(-t)}function timezone(e,t){var r;return e<0?(r="+",e=Math.abs(e)):r="-",""+r+padLeft(Math.floor(e/60))+(t?"":":")+padLeft(Math.floor(e%60))}function h12(e){return 12<(e=e||24)?e-12:e}function format(t,e){return e&&"UTC"!==e?e.replace(__chunk_6.FORMAT_REGEX,function(e){switch(e){case"YY":return String(t.getFullYear()).slice(-2);case"YYYY":case"yyyy":return t.getFullYear();case"M":return t.getMonth()+1;case"MM":return padLeft(t.getMonth()+1);case"D":case"d":return t.getDate();case"DD":case"dd":return padLeft(t.getDate());case"H":return t.getHours();case"HH":return padLeft(t.getHours());case"h":return h12(t.getHours());case"hh":return padLeft(h12(t.getHours()));case"m":return t.getMinutes();case"mm":return padLeft(t.getMinutes());case"s":return t.getSeconds();case"ss":return padLeft(t.getSeconds());case"SSS":return padLeft(t.getMilliseconds(),3);case"Z":return timezone(__chunk_6.TIMEZONE_OFFSET);case"ZZ":return timezone(__chunk_6.TIMEZONE_OFFSET,!0);default:return e}}):t.toISOString()}module.exports=format; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_9=require("./chunk-2a4b214f.js");function isAfter(e,r,u){return __chunk_9.compare(e,r,u,"after")}module.exports=isAfter; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_7=require("./chunk-7073ab4e.js");function isAfter(e,r,u){return __chunk_7.compare(e,r,u,"after")}module.exports=isAfter; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_9=require("./chunk-2a4b214f.js");function isBefore(e,r,u){return __chunk_9.compare(e,r,u,"before")}module.exports=isBefore; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_7=require("./chunk-7073ab4e.js");function isBefore(e,r,u){return __chunk_7.compare(e,r,u,"before")}module.exports=isBefore; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-2a4b214f.js");var isAfter=require("./isAfter.js"),isBefore=require("./isBefore.js");function isBetween(e,r,s,i,u){return("("===(u=u||"()").charAt(0)?isAfter(e,r,i):!isBefore(e,r,i))&&(")"===u.charAt(1)?isBefore(e,s,i):!isAfter(e,s,i))}module.exports=isBetween; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-7073ab4e.js");var isAfter=require("./isAfter.js"),isBefore=require("./isBefore.js");function isBetween(e,r,s,i,u){return("("===(u=u||"()").charAt(0)?isAfter(e,r,i):!isBefore(e,r,i))&&(")"===u.charAt(1)?isBefore(e,s,i):!isAfter(e,s,i))}module.exports=isBetween; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_9=require("./chunk-2a4b214f.js");function isSame(e,r,u){return __chunk_9.compare(e,r,u)}module.exports=isSame; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js");var __chunk_7=require("./chunk-7073ab4e.js");function isSame(e,r,u){return __chunk_7.compare(e,r,u)}module.exports=isSame; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-2a4b214f.js");var isBefore=require("./isBefore.js");function isSameOrAfter(e,r,u){return!isBefore(e,r,u)}module.exports=isSameOrAfter; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-7073ab4e.js");var isBefore=require("./isBefore.js");function isSameOrAfter(e,r,s){return!isBefore(e,r,s)}module.exports=isSameOrAfter; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js"),require("./add.js"),require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),require("./clone.js"),require("./chunk-d25e655c.js"),require("./chunk-d01286bf.js"),require("./chunk-3705080c.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-2a4b214f.js");var isAfter=require("./isAfter.js");function isSameOrBefore(e,r,u){return!isAfter(e,r,u)}module.exports=isSameOrBefore; | ||
"use strict";require("./chunk-0cb3fc16.js"),require("./add.js"),require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),require("./clone.js"),require("./chunk-a0229133.js"),require("./chunk-fbabc482.js"),require("./parse.js"),require("./startOf.js"),require("./endOf.js"),require("./chunk-7073ab4e.js");var isAfter=require("./isAfter.js");function isSameOrBefore(e,r,s){return!isAfter(e,r,s)}module.exports=isSameOrBefore; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_1=require("./chunk-78a5d470.js"),__chunk_2=require("./chunk-9356120a.js"),__chunk_3=require("./chunk-1af9fb56.js"),__chunk_6=require("./chunk-d25e655c.js"),__chunk_8=require("./chunk-3705080c.js");function forEach(r,e,n){for(var _=__chunk_2.iteratorCallback(e,n),t=0,c=r.length,a=void 0;!1!==a&&t<c;t++)a=_(r[t],t,r)}function isNumber(r){return"number"==typeof r}var toString=Object.prototype.toString;function toString$1(r){return toString.call(r)}function isDate(r){return"[object Date]"===toString$1(r)}function extractFrom(r){var n,_,t=[],c=__chunk_8.EXTENDED_ISO_REGEX.exec(r)||__chunk_8.BASIC_ISO_REGEX.exec(r);if(c){if(forEach(__chunk_8.DATES_REGEX,function(r,e){if(_=r[1].exec(c[1]))return __chunk_6.forNumber(3,function(r){t[r]=parseInt(_[r+1]||1,10)}),t[1]-=1,n=!1!==r[2],!1}),r.indexOf(t[0]))return r;if(_=null,c[3]&&forEach(__chunk_8.TIMES_REGEX,function(r){if(_=r[1].exec(c[3]))return t=t.concat(_.slice(1).map(function(r){return parseInt(r,10)})),!1}),!n&&_)return t;if(_=null,c[4]){_=__chunk_8.TZ_REGEX.exec(c[4]);var e=__chunk_3.TIMEZONE_OFFSET;_[1]||(t[3]-=_[2],t[4]-=_[3]||0),t[4]-=e}return t}return 4===r.length&&__chunk_8.DATES_REGEX[4][1].test(r)?((t=[parseInt(r,10),0,1]).isUTC=!0,t):r}function parseFromFormat(n,_){var r,e=_.length,t=[],c=!1;if(__chunk_6.forNumber(e,function(r){var e=n.charAt(r);switch(_.charAt(r)){case"Y":case"y":t[0]=(t[0]||"")+e;break;case"M":t[1]=(t[1]||"")+e;break;case"D":case"d":t[2]=(t[2]||"")+e;break;case"H":case"h":t[3]=(t[3]||"")+e;break;case"m":t[4]=(t[4]||"")+e;break;case"s":t[5]=(t[5]||"")+e;break;case"S":t[6]=(t[6]||"")+e;break;case"Z":c=!0}}),t=t.map(function(r){return parseInt(r,10)}),c)if(r=__chunk_8.TZ_REGEX.exec(n.slice(-1<_.indexOf("ZZ")?-5:-6))){var a=__chunk_3.TIMEZONE_OFFSET;if(!r[1]){var u="+"===r[0].charAt(0)?1:-1;t[3]-=r[2]*u,t[4]-=(r[3]||0)*u}t[4]-=a}else t.isUTC=c&-1<n.indexOf("Z");return __chunk_1.isNil(t[1])||(t[1]-=1),t}function parseStringOrArray(r,e,n){if(!__chunk_3.isString(r))return __chunk_1.parseArray(r,!0===e);if(__chunk_3.isString(e))return __chunk_1.parseArray(parseFromFormat(r,e),n);var _=extractFrom(r);if(_!==r)return __chunk_1.parseArray(_,_.isUTC||!0===e);var t=__chunk_8.ASP_NET_JSON_REGEX.exec(r);return new Date(null!==t?+t[1]:r)}function parse(r,e,n){return r=__chunk_1.isNil(r)?new Date:r.length?parseStringOrArray(r,e,n):isNumber(r)?new Date(r):isDate(r)?new Date(+r):r._i&&r.isValid()?new Date(+r):new Date}module.exports=parse; | ||
"use strict";var __chunk_1=require("./chunk-0cb3fc16.js"),__chunk_2=require("./chunk-5ac2012c.js"),__chunk_5=require("./chunk-a0229133.js"),__chunk_6=require("./chunk-fbabc482.js");function isString(r){return"string"==typeof r}function forEach(r,e,n){for(var t=__chunk_2.iteratorCallback(e,n),c=0,_=r.length,a=void 0;!1!==a&&c<_;c++)a=t(r[c],c,r)}function isNumber(r){return"number"==typeof r}var toString=Object.prototype.toString;function toString$1(r){return toString.call(r)}function isDate(r){return"[object Date]"===toString$1(r)}function extractFrom(r){var n,t,c=[],_=__chunk_6.EXTENDED_ISO_REGEX.exec(r)||__chunk_6.BASIC_ISO_REGEX.exec(r);if(_){if(forEach(__chunk_6.DATES_REGEX,function(r,e){if(t=r[1].exec(_[1]))return __chunk_5.forNumber(3,function(r){c[r]=parseInt(t[r+1]||1,10)}),c[1]-=1,n=!1!==r[2],!1}),r.indexOf(c[0]))return r;if(t=null,_[3]&&forEach(__chunk_6.TIMES_REGEX,function(r){if(t=r[1].exec(_[3]))return c=c.concat(t.slice(1).map(function(r){return parseInt(r,10)})),!1}),!n&&t)return c;if(t=null,_[4]){t=__chunk_6.TZ_REGEX.exec(_[4]);var e=__chunk_6.TIMEZONE_OFFSET;t[1]||(c[3]-=t[2],c[4]-=t[3]||0),c[4]-=e}return c}return 4===r.length&&__chunk_6.DATES_REGEX[4][1].test(r)?((c=[parseInt(r,10),0,1]).isUTC=!0,c):r}function parseFromFormat(n,t){var r,e=t.length,c=[],_=!1;if(__chunk_5.forNumber(e,function(r){var e=n.charAt(r);switch(t.charAt(r)){case"Y":case"y":c[0]=(c[0]||"")+e;break;case"M":c[1]=(c[1]||"")+e;break;case"D":case"d":c[2]=(c[2]||"")+e;break;case"H":case"h":c[3]=(c[3]||"")+e;break;case"m":c[4]=(c[4]||"")+e;break;case"s":c[5]=(c[5]||"")+e;break;case"S":c[6]=(c[6]||"")+e;break;case"Z":_=!0}}),c=c.map(function(r){return parseInt(r,10)}),_)if(r=__chunk_6.TZ_REGEX.exec(n.slice(-1<t.indexOf("ZZ")?-5:-6))){var a=__chunk_6.TIMEZONE_OFFSET;if(!r[1]){var u="+"===r[0].charAt(0)?1:-1;c[3]-=r[2]*u,c[4]-=(r[3]||0)*u}c[4]-=a}else c.isUTC=_&-1<n.indexOf("Z");return __chunk_1.isNil(c[1])||(c[1]-=1),c}function parseStringOrArray(r,e,n){if(!isString(r))return __chunk_1.parseArray(r,!0===e);if(isString(e))return __chunk_1.parseArray(parseFromFormat(r,e),n);var t=extractFrom(r);if(t!==r)return __chunk_1.parseArray(t,t.isUTC||!0===e);var c=__chunk_6.ASP_NET_JSON_REGEX.exec(r);return new Date(null!==c?+c[1]:r)}function parse(r,e,n){return r=__chunk_1.isNil(r)?new Date:r.length?parseStringOrArray(r,e,n):isNumber(r)?new Date(r):isDate(r)?new Date(+r):r._i&&r.isValid()?new Date(+r):new Date}module.exports=parse; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";var __chunk_3=require("./chunk-1af9fb56.js"),__chunk_4=require("./chunk-55ad1914.js");function startOf(_,e){switch(e=__chunk_4.normalizeUnit(e)){case __chunk_3.YEAR:_.setMonth(0);case __chunk_3.MONTH:_.setDate(1);case __chunk_3.DAY:_.setHours(0);case __chunk_3.HOUR:_.setMinutes(0);case __chunk_3.MINUTE:_.setSeconds(0);case __chunk_3.SECOND:_.setMilliseconds(0)}return _}module.exports=startOf; | ||
"use strict";var __chunk_3=require("./chunk-6fce3905.js");function startOf(s,e){switch(e=__chunk_3.normalizeUnit(e)){case"Y":s.setMonth(0);case"M":s.setDate(1);case"D":case"d":s.setHours(0);case"h":s.setMinutes(0);case"m":s.setSeconds(0);case"s":s.setMilliseconds(0)}return s}module.exports=startOf; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-78a5d470.js");var add=require("./add.js");function subtract(r,u,e){return add(r,-u,e)}require("./chunk-9356120a.js"),require("./chunk-1af9fb56.js"),require("./chunk-55ad1914.js"),module.exports=subtract; | ||
"use strict";require("./chunk-0cb3fc16.js");var add=require("./add.js");function subtract(r,e,u){return add(r,-e,u)}require("./chunk-5ac2012c.js"),require("./chunk-6fce3905.js"),module.exports=subtract; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js"),require("./chunk-8ffc9b80.js");var __chunk_4=require("./chunk-0807035c.js");function after(e){for(var r=[],n=arguments.length-1;0<n--;)r[n]=arguments[n+1];return __chunk_4.domManip(e,r,"after",function(e,r){var n=e.parentNode;n&&n.insertBefore(r,e.nextSibling)})}module.exports=after; | ||
"use strict";require("./chunk-e37cb146.js"),require("./chunk-fc07047e.js"),require("./chunk-619deb81.js"),require("./chunk-7ad506f8.js"),require("./chunk-56b022d1.js"),require("./chunk-d577de8f.js");var __chunk_9=require("./chunk-0d387eab.js");function after(e){for(var r=[],u=arguments.length-1;0<u--;)r[u]=arguments[u+1];return __chunk_9.domManip(e,r,"after",function(e,r){var u=e.parentNode;u&&u.insertBefore(r,e.nextSibling)})}require("./chunk-f2d50846.js"),require("./chunk-8a200498.js"),require("./chunk-baef53ec.js"),module.exports=after; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js"),require("./chunk-8ffc9b80.js");var __chunk_4=require("./chunk-0807035c.js");function append(e){for(var r=[],n=arguments.length-1;0<n--;)r[n]=arguments[n+1];return __chunk_4.domManip(e,r,"appendChild")}module.exports=append; | ||
"use strict";require("./chunk-e37cb146.js"),require("./chunk-fc07047e.js"),require("./chunk-619deb81.js"),require("./chunk-7ad506f8.js"),require("./chunk-56b022d1.js"),require("./chunk-d577de8f.js");var __chunk_9=require("./chunk-0d387eab.js");function append(e){for(var r=[],u=arguments.length-1;0<u--;)r[u]=arguments[u+1];return __chunk_9.domManip(e,r,"appendChild")}require("./chunk-f2d50846.js"),require("./chunk-8a200498.js"),require("./chunk-baef53ec.js"),module.exports=append; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js"),require("./chunk-8ffc9b80.js");var __chunk_4=require("./chunk-0807035c.js");function before(e){for(var r=[],n=arguments.length-1;0<n--;)r[n]=arguments[n+1];return __chunk_4.domManip(e,r,"before",function(e,r){var n=e.parentNode;n&&n.insertBefore(r,e)})}module.exports=before; | ||
"use strict";require("./chunk-e37cb146.js"),require("./chunk-fc07047e.js"),require("./chunk-619deb81.js"),require("./chunk-7ad506f8.js"),require("./chunk-56b022d1.js"),require("./chunk-d577de8f.js");var __chunk_9=require("./chunk-0d387eab.js");function before(e){for(var r=[],u=arguments.length-1;0<u--;)r[u]=arguments[u+1];return __chunk_9.domManip(e,r,"before",function(e,r){var u=e.parentNode;u&&u.insertBefore(r,e)})}require("./chunk-f2d50846.js"),require("./chunk-8a200498.js"),require("./chunk-baef53ec.js"),module.exports=before; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js");var __chunk_3=require("./chunk-8ffc9b80.js"),__chunk_5=require("./chunk-277e12b2.js");function isObject(e){return!__chunk_3.isNil(e)&&"object"==typeof e}function data(e,n,_){var u=__chunk_5.expandoStore(e,"data"),c=!__chunk_5.isUndefined(_),r=!c&&!__chunk_5.isUndefined(n),t=r&&!isObject(n);if(u||t||__chunk_5.expandoStore(e,"data",u={}),c)u[n]=_;else{if(!r)return u;if(t)return u&&u[n];__chunk_3.forIn(n,function(e,n){u[n]=e})}}module.exports=data; | ||
"use strict";require("./chunk-7ad506f8.js");var __chunk_6=require("./chunk-cf5dc476.js"),__chunk_8=require("./chunk-d577de8f.js"),__chunk_10=require("./chunk-f2d50846.js"),__chunk_13=require("./chunk-13089cd6.js"),__chunk_16=require("./chunk-f2d48995.js");function isObject(_){return!__chunk_8.isNil(_)&&"object"==typeof _}function data(n,u,e){if(isObject(u))return __chunk_6.checkDom(n,function(_){var e=__chunk_16.expandoStore(_,"data");e||__chunk_16.expandoStore(n,"data",e={}),__chunk_10.forIn(u,function(_,n){e[n]=_})}),n;if(__chunk_8.isNil(u))return(n=__chunk_6.firstNode(n))&&__chunk_16.expandoStore(n,"data");if(__chunk_13.isUndefined(e)){var _=__chunk_16.expandoStore(n,"data");return _&&_[u]}return __chunk_6.checkDom(n,function(_){var n=__chunk_16.expandoStore(_,"data");n||__chunk_16.expandoStore(_,"data",n={}),n[u]=e}),n}module.exports=data; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js");var __chunk_5=require("./chunk-277e12b2.js"),__chunk_6=require("./chunk-2db4c193.js");function inArray(e,n,r){if(n){if(n.indexOf)return n.indexOf(e,r);for(var t=n.length,i=r?r<0?Math.max(0,t+r):r:0;i<t;i++)if(i in n&&n[i]===e)return i}return-1}function removeAt(e,n){return e.splice(n,1),n}function remove(e,n){var r=inArray(n,e);return 0<=r?(removeAt(e,r),n):null}var removeEventListenerFn=window.removeEventListener?function(e,n,r){e.removeEventListener(n,r,!1)}:function(e,n,r){e.detachEvent("on"+n,r)};function off(r,e,n){var t=__chunk_5.expandoStore(r,"events");__chunk_5.expandoStore(r,"handle")&&(__chunk_5.isUndefined(e)?__chunk_6.forEach(t,function(e,n){removeEventListenerFn(r,n,e),delete t[n]}):__chunk_6.forEach(e.split(" "),function(e){__chunk_5.isUndefined(n)?(removeEventListenerFn(r,e,t[e]),delete t[e]):remove(t[e],n)}))}module.exports=off; | ||
"use strict";require("./chunk-7ad506f8.js");var __chunk_6=require("./chunk-cf5dc476.js"),__chunk_13=require("./chunk-13089cd6.js"),__chunk_16=require("./chunk-f2d48995.js"),__chunk_20=require("./chunk-a836d813.js");function inArray(e,n,r){if(n){if(n.indexOf)return n.indexOf(e,r);for(var t=n.length,u=r?r<0?Math.max(0,t+r):r:0;u<t;u++)if(u in n&&n[u]===e)return u}return-1}function removeAt(e,n){return e.splice(n,1),n}function remove(e,n){var r=inArray(n,e);return 0<=r?(removeAt(e,r),n):null}var removeEventListenerFn=window.removeEventListener?function(e,n,r){e.removeEventListener(n,r,!1)}:function(e,n,r){e.detachEvent("on"+n,r)};function off(e,n,u){return __chunk_6.checkDom(e,function(r){var t=__chunk_16.expandoStore(r,"events");__chunk_16.expandoStore(r,"handle")&&(__chunk_13.isUndefined(n)?__chunk_20.forEach(t,function(e,n){removeEventListenerFn(r,n,e),delete t[n]}):__chunk_20.forEach(n.split(" "),function(e){__chunk_13.isUndefined(u)?(removeEventListenerFn(r,e,t[e]),delete t[e]):remove(t[e],u)}))}),e}module.exports=off; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js");var __chunk_5=require("./chunk-277e12b2.js"),__chunk_6=require("./chunk-2db4c193.js"),addEventListenerFn=window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1)}:function(e,n,t){e.attachEvent("on"+n,t)};function createEventHandler(t,r){var e=function(n){if(n.preventDefault||(n.preventDefault=function(){n.returnValue=!1}),n.stopPropagation||(n.stopPropagation=function(){n.cancelBubble=!0}),n.target||(n.target=n.srcElement||document),__chunk_5.isUndefined(n.defaultPrevented)){var e=n.preventDefault;e=e.bind(n),n.preventDefault=function(){n.defaultPrevented=!0,e()},n.defaultPrevented=!1}n.isDefaultPrevented=function(){return n.defaultPrevented||!1===n.returnValue},__chunk_6.forEach(r[n.type],function(e){return e.call(t,n)});try{delete n.preventDefault,delete n.stopPropagation,delete n.isDefaultPrevented}catch(e){n.preventDefault=null,n.stopPropagation=null,n.isDefaultPrevented=null}};return e.elem=t,e}function on(t,e,r){var u=__chunk_5.expandoStore(t,"events"),a=__chunk_5.expandoStore(t,"handle");return u||__chunk_5.expandoStore(t,"events",u={}),a||__chunk_5.expandoStore(t,"handle",a=createEventHandler(t,u)),e.split(" ").forEach(function(e){var n=u[e];n||(addEventListenerFn(t,e,a),n=u[e]=[]),n[n.length]=r}),t}module.exports=on; | ||
"use strict";require("./chunk-7ad506f8.js");var __chunk_6=require("./chunk-cf5dc476.js"),__chunk_13=require("./chunk-13089cd6.js"),__chunk_16=require("./chunk-f2d48995.js"),__chunk_20=require("./chunk-a836d813.js"),addEventListenerFn=window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1)}:function(e,n,t){e.attachEvent("on"+n,t)};function createEventHandler(t,r){var e=function(n){if(n.preventDefault||(n.preventDefault=function(){n.returnValue=!1}),n.stopPropagation||(n.stopPropagation=function(){n.cancelBubble=!0}),n.target||(n.target=n.srcElement||document),__chunk_13.isUndefined(n.defaultPrevented)){var e=n.preventDefault;e=e.bind(n),n.preventDefault=function(){n.defaultPrevented=!0,e()},n.defaultPrevented=!1}n.isDefaultPrevented=function(){return n.defaultPrevented||!1===n.returnValue},__chunk_20.forEach(r[n.type],function(e){return e.call(t,n)});try{delete n.preventDefault,delete n.stopPropagation,delete n.isDefaultPrevented}catch(e){n.preventDefault=null,n.stopPropagation=null,n.isDefaultPrevented=null}};return e.elem=t,e}function on(e,n,a){return __chunk_6.checkDom(e,function(t){var r=__chunk_16.expandoStore(t,"events"),u=__chunk_16.expandoStore(t,"handle");r||__chunk_16.expandoStore(t,"events",r={}),u||__chunk_16.expandoStore(t,"handle",u=createEventHandler(t,r)),n.split(" ").forEach(function(e){var n=r[e];n||(addEventListenerFn(t,e,u),n=r[e]=[]),n[n.length]=a})}),e}module.exports=on; |
/*! | ||
* celia.js v2.1.0-0 | ||
* celia.js v2.1.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";require("./chunk-9356120a.js"),require("./chunk-476cbb18.js"),require("./chunk-8ffc9b80.js");var __chunk_4=require("./chunk-0807035c.js");function prepend(e){for(var r=[],n=arguments.length-1;0<n--;)r[n]=arguments[n+1];return __chunk_4.domManip(e,r,"prepend",function(e,r){1!==e.nodeType&&11!==e.nodeType&&9!==e.nodeType||e.insertBefore(r,e.firstChild)})}module.exports=prepend; | ||
"use strict";require("./chunk-e37cb146.js"),require("./chunk-fc07047e.js"),require("./chunk-619deb81.js"),require("./chunk-7ad506f8.js"),require("./chunk-56b022d1.js"),require("./chunk-d577de8f.js");var __chunk_9=require("./chunk-0d387eab.js");function prepend(e){for(var r=[],u=arguments.length-1;0<u--;)r[u]=arguments[u+1];return __chunk_9.domManip(e,r,"prepend",function(e,r){e.insertBefore(r,e.firstChild)})}require("./chunk-f2d50846.js"),require("./chunk-8a200498.js"),require("./chunk-baef53ec.js"),module.exports=prepend; |
{ | ||
"name": "celia", | ||
"version": "2.1.0-1", | ||
"version": "2.1.0", | ||
"description": "A modern JavaScript utility library delivering modularity, performance, & extras.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
133
README.md
@@ -58,56 +58,77 @@ # celia | ||
- camelCase | ||
- each | ||
- forEach | ||
- forIn | ||
- forNumber | ||
- index | ||
- isArrayLike | ||
- isAsyncFunction | ||
- isBoolean | ||
- isDate | ||
- isFunction | ||
- isNil | ||
- isNumber | ||
- isObject | ||
- isPromiseLike | ||
- isString | ||
- isUndefined | ||
- type | ||
- array/append | ||
- array/forEach | ||
- array/grep | ||
- array/inArray | ||
- array/includes | ||
- array/join | ||
- array/makeArray | ||
- array/map | ||
- array/remove | ||
- array/removeAt | ||
- array/toArray | ||
- date/add | ||
- date/clone | ||
- date/dayOfYear | ||
- date/daysInMonth | ||
- date/diff | ||
- date/endOf | ||
- date/format | ||
- date/isAfter | ||
- date/isBefore | ||
- date/isBetween | ||
- date/isLeapYear | ||
- date/isSame | ||
- date/isSameOrAfter | ||
- date/isSameOrBefore | ||
- date/isValid | ||
- date/parse | ||
- date/startOf | ||
- date/subtract | ||
- dom/after | ||
- dom/append | ||
- dom/before | ||
- dom/data | ||
- dom/off | ||
- dom/on | ||
- dom/prepend | ||
- error/NotImplementedError | ||
- each | ||
- forEach | ||
- forIn | ||
- forNumber | ||
- index | ||
- isArrayLike | ||
- isAsyncFunction | ||
- isBoolean | ||
- isDate | ||
- isFunction | ||
- isNil | ||
- isNumber | ||
- isObject | ||
- isPromiseLike | ||
- isString | ||
- isUndefined | ||
- sleep | ||
- type | ||
- array/append | ||
- array/forEach | ||
- array/grep | ||
- array/inArray | ||
- array/includes | ||
- array/join | ||
- array/makeArray | ||
- array/map | ||
- array/remove | ||
- array/removeAt | ||
- array/toArray | ||
- date/add | ||
- date/clone | ||
- date/dayOfYear | ||
- date/daysInMonth | ||
- date/diff | ||
- date/endOf | ||
- date/format | ||
- date/isAfter | ||
- date/isBefore | ||
- date/isBetween | ||
- date/isLeapYear | ||
- date/isSame | ||
- date/isSameOrAfter | ||
- date/isSameOrBefore | ||
- date/isValid | ||
- date/parse | ||
- date/startOf | ||
- date/subtract | ||
- dom/addClass | ||
- dom/after | ||
- dom/append | ||
- dom/attr | ||
- dom/before | ||
- dom/children | ||
- dom/css | ||
- dom/data | ||
- dom/empty | ||
- dom/hasClass | ||
- dom/hide | ||
- dom/html | ||
- dom/next | ||
- dom/nextAll | ||
- dom/off | ||
- dom/on | ||
- dom/parent | ||
- dom/prepend | ||
- dom/prev | ||
- dom/prevAll | ||
- dom/prop | ||
- dom/remove | ||
- dom/removeAttr | ||
- dom/removeClass | ||
- dom/removeData | ||
- dom/removeProp | ||
- dom/show | ||
- dom/wrap | ||
@@ -137,1 +158,5 @@ ## Release History | ||
- rebuild | ||
### 2.1.0 | ||
- added manipulation for dom |
@@ -1,2 +0,2 @@ | ||
import iteratorCallback from './_iteratorCB'; | ||
import iteratorCallback from './_array/_iteratorCB'; | ||
@@ -3,0 +3,0 @@ export default function (value, iterator, context) { |
@@ -1,2 +0,2 @@ | ||
import iteratorCallback from './_iteratorCB'; | ||
import iteratorCallback from './_array/_iteratorCB'; | ||
@@ -3,0 +3,0 @@ export default function (value, iterator, context) { |
@@ -1,2 +0,2 @@ | ||
import iteratorCallback from './_iteratorCB'; | ||
import iteratorCallback from './_array/_iteratorCB'; | ||
@@ -3,0 +3,0 @@ export default function (value, iterator, context) { |
export default function (arr, obj) { | ||
if (arr) { | ||
arr[arr.length] = obj; | ||
return obj; | ||
} | ||
} |
import each from '../each'; | ||
import isNil from '../isNil'; | ||
import iteratorCallback from '../_internal/_iteratorCB'; | ||
import append from '../_internal/_append'; | ||
import iteratorCallback from '../_internal/_array/_iteratorCB'; | ||
import append from '../_internal/_array/_append'; | ||
@@ -6,0 +6,0 @@ export default function (elems, callback, context) { |
import isObject from '../isObject'; | ||
import forIn from '../_internal/_forIn'; | ||
import parseArray from '../_internal/_parseArray'; | ||
import normalizeUnit from '../_internal/_normalizeUnit'; | ||
import { | ||
YEAR, | ||
MONTH, | ||
DAY, | ||
HOUR, | ||
MINUTE, | ||
SECOND, | ||
MILLISECOND | ||
} from '../_internal/_dateConsts'; | ||
import parseArray from '../_internal/_date/_parseArray'; | ||
import normalizeUnit from '../_internal/_date/_normalizeUnit'; | ||
const indexOfUnits = { | ||
[YEAR]: 0, | ||
[MONTH]: 1, | ||
[DAY]: 2, | ||
[HOUR]: 3, | ||
[MINUTE]: 4, | ||
[SECOND]: 5, | ||
[MILLISECOND]: 6 | ||
Y: 0, | ||
M: 1, | ||
d: 2, | ||
h: 3, | ||
m: 4, | ||
s: 5, | ||
ms: 6 | ||
}; | ||
function getIndex(units) { | ||
units = units ? normalizeUnit(units) : MILLISECOND; | ||
units = normalizeUnit(units, 'ms'); | ||
return indexOfUnits[units]; | ||
@@ -28,0 +19,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import daysInYear from '../_internal/_daysInYear'; | ||
import daysInYear from '../_internal/_date/_daysInYear'; | ||
import forNumber from '../_internal/_forNumber'; | ||
@@ -3,0 +3,0 @@ import isUndefined from '../isUndefined'; |
@@ -1,2 +0,2 @@ | ||
import daysInYear from '../_internal/_daysInYear'; | ||
import daysInYear from '../_internal/_date/_daysInYear'; | ||
@@ -3,0 +3,0 @@ export default function (date) { |
import parse from './parse'; | ||
import add from './add'; | ||
import clone from './clone'; | ||
import normalizeUnit from '../_internal/_normalizeUnit'; | ||
import { | ||
YEAR, | ||
MONTH, | ||
DAY, | ||
HOUR, | ||
MINUTE, | ||
SECOND | ||
} from '../_internal/_dateConsts'; | ||
import normalizeUnit from '../_internal/_date/_normalizeUnit'; | ||
@@ -19,3 +11,3 @@ function monthDiff(a, b) { | ||
if (b - anchor < 0) { | ||
if (b < anchor) { | ||
anchor2 = add(clone(a), wholeMonthDiff - 1, 'months'); | ||
@@ -40,18 +32,19 @@ adjust = (b - anchor) / (anchor - anchor2); | ||
switch (units) { | ||
case YEAR: | ||
case 'Y': | ||
output = monthDiff(date, input) / 12; | ||
break; | ||
case MONTH: | ||
case 'M': | ||
output = monthDiff(date, input); | ||
break; | ||
case SECOND: | ||
case 's': | ||
output = (date - input) / 1000; | ||
break; | ||
case MINUTE: | ||
case 'm': | ||
output = (date - input) / 60000; | ||
break; | ||
case HOUR: | ||
case 'h': | ||
output = (date - input) / 3600000; | ||
break; | ||
case DAY: | ||
// case 'D': | ||
case 'd': | ||
output = (date - input) / 86400000; | ||
@@ -58,0 +51,0 @@ break; |
@@ -1,3 +0,2 @@ | ||
import normalizeUnit from '../_internal/_normalizeUnit'; | ||
import { MILLISECOND } from '../_internal/_dateConsts'; | ||
import normalizeUnit from '../_internal/_date/_normalizeUnit'; | ||
import startOf from './startOf'; | ||
@@ -7,4 +6,4 @@ import add from './add'; | ||
export default function (date, units) { | ||
units = normalizeUnit(units); | ||
if (!units || units === MILLISECOND) { | ||
units = normalizeUnit(units, 'ms'); | ||
if (units === 'ms') { | ||
return date; | ||
@@ -14,4 +13,4 @@ } | ||
add(date, 1, units); | ||
add(date, -1, MILLISECOND); | ||
add(date, -1, 'ms'); | ||
return date; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { FORMAT_REGEX } from '../_internal/_dateRegex'; | ||
import { FORMAT_REGEX } from '../_internal/_date/_dateRegex'; | ||
import { TIMEZONE_OFFSET } from '../_internal/_date/_dateConsts'; | ||
@@ -24,3 +25,3 @@ function padLeft(val, len = 2) { | ||
export default function (date, inputString) { | ||
if (!inputString) { | ||
if (!inputString || inputString === 'UTC') { | ||
return date.toISOString(); | ||
@@ -66,5 +67,5 @@ } | ||
case 'Z': | ||
return timezone(date.getTimezoneOffset()); | ||
return timezone(TIMEZONE_OFFSET); | ||
case 'ZZ': | ||
return timezone(date.getTimezoneOffset(), true); | ||
return timezone(TIMEZONE_OFFSET, true); | ||
default: | ||
@@ -71,0 +72,0 @@ return matched; |
@@ -1,2 +0,2 @@ | ||
import compare from '../_internal/_compare'; | ||
import compare from '../_internal/_date/_compare'; | ||
@@ -3,0 +3,0 @@ export default function (date, input, units) { |
@@ -1,2 +0,2 @@ | ||
import compare from '../_internal/_compare'; | ||
import compare from '../_internal/_date/_compare'; | ||
@@ -3,0 +3,0 @@ export default function (date, input, units) { |
@@ -1,2 +0,2 @@ | ||
import compare from '../_internal/_compare'; | ||
import compare from '../_internal/_date/_compare'; | ||
@@ -3,0 +3,0 @@ export default function (date, input, units) { |
@@ -8,5 +8,5 @@ import { | ||
TZ_REGEX | ||
} from '../_internal/_dateRegex'; | ||
import { TIMEZONE_OFFSET } from '../_internal/_dateConsts'; | ||
import parseArray from '../_internal/_parseArray'; | ||
} from '../_internal/_date/_dateRegex'; | ||
import { TIMEZONE_OFFSET } from '../_internal/_date/_dateConsts'; | ||
import parseArray from '../_internal/_date/_parseArray'; | ||
import isString from '../isString'; | ||
@@ -13,0 +13,0 @@ import forEach from '../_internal/_forEach'; |
@@ -1,10 +0,2 @@ | ||
import normalizeUnit from '../_internal/_normalizeUnit'; | ||
import { | ||
YEAR, | ||
MONTH, | ||
DAY, | ||
HOUR, | ||
MINUTE, | ||
SECOND | ||
} from '../_internal/_dateConsts'; | ||
import normalizeUnit from '../_internal/_date/_normalizeUnit'; | ||
@@ -14,18 +6,19 @@ export default function (date, units) { | ||
switch (units) { | ||
case YEAR: | ||
case 'Y': | ||
date.setMonth(0); | ||
/* falls through */ | ||
case MONTH: | ||
case 'M': | ||
date.setDate(1); | ||
/* falls through */ | ||
case DAY: | ||
case 'D': | ||
case 'd': | ||
date.setHours(0); | ||
/* falls through */ | ||
case HOUR: | ||
case 'h': | ||
date.setMinutes(0); | ||
/* falls through */ | ||
case MINUTE: | ||
case 'm': | ||
date.setSeconds(0); | ||
/* falls through */ | ||
case SECOND: | ||
case 's': | ||
date.setMilliseconds(0); | ||
@@ -32,0 +25,0 @@ } |
@@ -1,10 +0,15 @@ | ||
import domManip from '../_internal/_domManip'; | ||
import domManip from '../_internal/_dom/_domManip'; | ||
export default function (nodeList, ...args) { | ||
return domManip(nodeList, args, 'after', (dom, node) => { | ||
const parentNode = dom.parentNode; | ||
/** | ||
* 在node节点之后添加新元素 | ||
* @param {Node|NodeList} dom | ||
* @param {...any} args | ||
*/ | ||
export default function (dom, ...args) { | ||
return domManip(dom, args, 'after', (elem, node) => { | ||
const parentNode = elem.parentNode; | ||
if (parentNode) { | ||
parentNode.insertBefore(node, dom.nextSibling); | ||
parentNode.insertBefore(node, elem.nextSibling); | ||
} | ||
}); | ||
} |
@@ -1,5 +0,10 @@ | ||
import domManip from '../_internal/_domManip'; | ||
import domManip from '../_internal/_dom/_domManip'; | ||
export default function (nodeList, ...args) { | ||
return domManip(nodeList, args, 'appendChild'); | ||
/** | ||
* 向node节点添加新元素 | ||
* @param {Node|Node} dom | ||
* @param {...any} args | ||
*/ | ||
export default function (dom, ...args) { | ||
return domManip(dom, args, 'appendChild'); | ||
} |
@@ -1,10 +0,15 @@ | ||
import domManip from '../_internal/_domManip'; | ||
import domManip from '../_internal/_dom/_domManip'; | ||
export default function (nodeList, ...args) { | ||
return domManip(nodeList, args, 'before', (dom, node) => { | ||
const parentNode = dom.parentNode; | ||
/** | ||
* 在node节点之前添加新元素 | ||
* @param {Node|Node} dom | ||
* @param {...any} args | ||
*/ | ||
export default function (dom, ...args) { | ||
return domManip(dom, args, 'before', (elem, node) => { | ||
const parentNode = elem.parentNode; | ||
if (parentNode) { | ||
parentNode.insertBefore(node, dom); | ||
parentNode.insertBefore(node, elem); | ||
} | ||
}); | ||
} |
import isUndefined from '../isUndefined'; | ||
import isNil from '../isNil'; | ||
import isObject from '../isObject'; | ||
import forIn from '../forIn'; | ||
import expandoStore from '../_internal/_expandoStore'; | ||
import forIn from '../_internal/_forIn'; | ||
import checkDom, { firstNode } from '../_internal/_dom/_checkDom'; | ||
import expandoStore from '../_internal/_dom/_expandoStore'; | ||
export default function (element, key, value) { | ||
let data = expandoStore(element, 'data'); | ||
const isSetter = !isUndefined(value); | ||
const keyDefined = !isSetter && !isUndefined(key); | ||
const isSimpleGetter = keyDefined && !isObject(key); | ||
if (!data && !isSimpleGetter) { | ||
expandoStore(element, 'data', data = {}); | ||
} | ||
if (isSetter) { | ||
data[key] = value; | ||
/** | ||
* 缓存数据 | ||
* @param {Node|NodeList} dom | ||
* @param {String} key | ||
* @param {*} value | ||
*/ | ||
export default function (dom, key, value) { | ||
if (isObject(key)) { // setter | ||
checkDom(dom, (element) => { | ||
let data = expandoStore(element, 'data'); | ||
if (!data) { | ||
expandoStore(dom, 'data', data = {}); | ||
} | ||
forIn(key, (n, k) => { | ||
data[k] = n; | ||
}); | ||
}); | ||
return dom; | ||
} else if (isNil(key)) { // get all | ||
dom = firstNode(dom); | ||
return dom && expandoStore(dom, 'data'); | ||
} else if (isUndefined(value)) { // getter | ||
let data = expandoStore(dom, 'data'); | ||
return data && data[key]; | ||
} else { | ||
if (keyDefined) { | ||
if (isSimpleGetter) { | ||
return data && data[key]; | ||
} else { | ||
forIn(key, (n, k) => { | ||
data[k] = n; | ||
}); | ||
checkDom(dom, (element) => { | ||
let data = expandoStore(element, 'data'); | ||
if (!data) { | ||
expandoStore(element, 'data', data = {}); | ||
} | ||
} else { | ||
return data; | ||
} | ||
data[key] = value; | ||
}); | ||
return dom; | ||
} | ||
} |
import isUndefined from '../isUndefined'; | ||
import expandoStore from '../_internal/_expandoStore'; | ||
import expandoStore from '../_internal/_dom/_expandoStore'; | ||
import checkDom from '../_internal/_dom/_checkDom'; | ||
import forEach from '../forEach'; | ||
@@ -14,24 +15,33 @@ import remove from '../array/remove'; | ||
export default function (element, types, fn) { | ||
let events = expandoStore(element, 'events'); | ||
let handle = expandoStore(element, 'handle'); | ||
/** | ||
* 移除dom事件 | ||
* @param {Node|NodeList} dom | ||
* @param {String} types | ||
* @param {Function} fn | ||
*/ | ||
export default function (dom, types, fn) { | ||
checkDom(dom, (element) => { | ||
let events = expandoStore(element, 'events'); | ||
let handle = expandoStore(element, 'handle'); | ||
if (!handle) { | ||
return; // 没有注册事件 | ||
} | ||
if (isUndefined(types)) { | ||
forEach(events, (eventHandler, type) => { | ||
removeEventListenerFn(element, type, eventHandler); | ||
delete events[type]; | ||
}); | ||
} else { | ||
forEach(types.split(' '), (type) => { | ||
if (isUndefined(fn)) { | ||
removeEventListenerFn(element, type, events[type]); | ||
if (!handle) { | ||
return; // 没有注册事件 | ||
} | ||
if (isUndefined(types)) { | ||
forEach(events, (eventHandler, type) => { | ||
removeEventListenerFn(element, type, eventHandler); | ||
delete events[type]; | ||
} else { | ||
remove(events[type], fn); | ||
} | ||
}); | ||
} | ||
}); | ||
} else { | ||
forEach(types.split(' '), (type) => { | ||
if (isUndefined(fn)) { | ||
removeEventListenerFn(element, type, events[type]); | ||
delete events[type]; | ||
} else { | ||
remove(events[type], fn); | ||
} | ||
}); | ||
} | ||
}); | ||
return dom; | ||
} |
import isUndefined from '../isUndefined'; | ||
import expandoStore from '../_internal/_expandoStore'; | ||
import expandoStore from '../_internal/_dom/_expandoStore'; | ||
import checkDom from '../_internal/_dom/_checkDom'; | ||
import forEach from '../forEach'; | ||
@@ -62,22 +63,30 @@ | ||
export default function (element, types, fn) { | ||
let events = expandoStore(element, 'events'); | ||
let handle = expandoStore(element, 'handle'); | ||
/** | ||
* 添加dom事件 | ||
* @param {Node|NodeList} dom | ||
* @param {String} types | ||
* @param {Function} fn | ||
*/ | ||
export default function (dom, types, fn) { | ||
checkDom(dom, (element) => { | ||
let events = expandoStore(element, 'events'); | ||
let handle = expandoStore(element, 'handle'); | ||
if (!events) { | ||
expandoStore(element, 'events', events = {}); | ||
}; | ||
if (!handle) { | ||
expandoStore(element, 'handle', handle = createEventHandler(element, events)); | ||
}; | ||
types.split(' ').forEach((type) => { | ||
let eventFns = events[type]; | ||
// 减少事件绑定 | ||
if (!eventFns) { | ||
addEventListenerFn(element, type, handle); | ||
eventFns = events[type] = []; | ||
} | ||
eventFns[eventFns.length] = fn; | ||
if (!events) { | ||
expandoStore(element, 'events', events = {}); | ||
}; | ||
if (!handle) { | ||
expandoStore(element, 'handle', handle = createEventHandler(element, events)); | ||
}; | ||
types.split(' ').forEach((type) => { | ||
let eventFns = events[type]; | ||
// 减少事件绑定 | ||
if (!eventFns) { | ||
addEventListenerFn(element, type, handle); | ||
eventFns = events[type] = []; | ||
} | ||
eventFns[eventFns.length] = fn; | ||
}); | ||
}); | ||
return element; | ||
return dom; | ||
} |
@@ -1,9 +0,14 @@ | ||
import domManip from '../_internal/_domManip'; | ||
import domManip from '../_internal/_dom/_domManip'; | ||
export default function (nodeList, ...args) { | ||
return domManip(nodeList, args, 'prepend', (elem, node) => { | ||
if (elem.nodeType === 1 || elem.nodeType === 11 || elem.nodeType === 9) { | ||
elem.insertBefore(node, elem.firstChild); | ||
} | ||
/** | ||
* 向node节点添加新元素 | ||
* @param {Node|Node} dom | ||
* @param {...any} args | ||
*/ | ||
export default function (dom, ...args) { | ||
return domManip(dom, args, 'prepend', (elem, node) => { | ||
// if ([1, 11, 9].indexOf() > -1) { | ||
elem.insertBefore(node, elem.firstChild); | ||
// } | ||
}); | ||
} |
import isNil from './isNil'; | ||
import isFunction from './isFunction'; | ||
import isNumber from './isNumber'; | ||
const isArray = Array.isArray; | ||
export default function (value) { | ||
if (isNil(value) || isFunction(value)) { | ||
return false; | ||
} | ||
const length = value.length; | ||
return isArray(value) || length === 0 || (+length > 0 && (length - 1) in value); | ||
return !isNil(value) && isNumber(value.length) && !isFunction(value); | ||
}; |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances 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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 5 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
255352
312
6196
13
161