@mll-lab/js-utils 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.d.ts +11 -0
- package/dist/date.d.ts +7 -7
- package/dist/index.common.js +85 -42
- package/dist/index.common.js.map +1 -1
- package/dist/index.js +85 -42
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var lodash=createCommonjsModule(function(module,exports){(function(){/** Used as
|
|
|
30
30
|
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
31
31
|
*/var reComboMark=RegExp(rsCombo,'g');/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode=RegExp(rsFitz+'(?='+rsFitz+')|'+rsSymbol+rsSeq,'g');/** Used to match complex or compound words. */var reUnicodeWord=RegExp([rsUpper+'?'+rsLower+'+'+rsOptContrLower+'(?='+[rsBreak,rsUpper,'$'].join('|')+')',rsMiscUpper+'+'+rsOptContrUpper+'(?='+[rsBreak,rsUpper+rsMiscLower,'$'].join('|')+')',rsUpper+'?'+rsMiscLower+'+'+rsOptContrLower,rsUpper+'+'+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'),'g');/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */var reHasUnicode=RegExp('['+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+']');/** Used to detect strings that need a more robust regexp to match words. */var reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;/** Used to assign default `context` object properties. */var contextProps=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'];/** Used to make template sourceURLs easier to identify. */var templateCounter=-1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters={// Latin-1 Supplement block.
|
|
32
32
|
'\xc0':'A','\xc1':'A','\xc2':'A','\xc3':'A','\xc4':'A','\xc5':'A','\xe0':'a','\xe1':'a','\xe2':'a','\xe3':'a','\xe4':'a','\xe5':'a','\xc7':'C','\xe7':'c','\xd0':'D','\xf0':'d','\xc8':'E','\xc9':'E','\xca':'E','\xcb':'E','\xe8':'e','\xe9':'e','\xea':'e','\xeb':'e','\xcc':'I','\xcd':'I','\xce':'I','\xcf':'I','\xec':'i','\xed':'i','\xee':'i','\xef':'i','\xd1':'N','\xf1':'n','\xd2':'O','\xd3':'O','\xd4':'O','\xd5':'O','\xd6':'O','\xd8':'O','\xf2':'o','\xf3':'o','\xf4':'o','\xf5':'o','\xf6':'o','\xf8':'o','\xd9':'U','\xda':'U','\xdb':'U','\xdc':'U','\xf9':'u','\xfa':'u','\xfb':'u','\xfc':'u','\xdd':'Y','\xfd':'y','\xff':'y','\xc6':'Ae','\xe6':'ae','\xde':'Th','\xfe':'th','\xdf':'ss',// Latin Extended-A block.
|
|
33
|
-
"\u0100":'A',"\u0102":'A',"\u0104":'A',"\u0101":'a',"\u0103":'a',"\u0105":'a',"\u0106":'C',"\u0108":'C',"\u010A":'C',"\u010C":'C',"\u0107":'c',"\u0109":'c',"\u010B":'c',"\u010D":'c',"\u010E":'D',"\u0110":'D',"\u010F":'d',"\u0111":'d',"\u0112":'E',"\u0114":'E',"\u0116":'E',"\u0118":'E',"\u011A":'E',"\u0113":'e',"\u0115":'e',"\u0117":'e',"\u0119":'e',"\u011B":'e',"\u011C":'G',"\u011E":'G',"\u0120":'G',"\u0122":'G',"\u011D":'g',"\u011F":'g',"\u0121":'g',"\u0123":'g',"\u0124":'H',"\u0126":'H',"\u0125":'h',"\u0127":'h',"\u0128":'I',"\u012A":'I',"\u012C":'I',"\u012E":'I',"\u0130":'I',"\u0129":'i',"\u012B":'i',"\u012D":'i',"\u012F":'i',"\u0131":'i',"\u0134":'J',"\u0135":'j',"\u0136":'K',"\u0137":'k',"\u0138":'k',"\u0139":'L',"\u013B":'L',"\u013D":'L',"\u013F":'L',"\u0141":'L',"\u013A":'l',"\u013C":'l',"\u013E":'l',"\u0140":'l',"\u0142":'l',"\u0143":'N',"\u0145":'N',"\u0147":'N',"\u014A":'N',"\u0144":'n',"\u0146":'n',"\u0148":'n',"\u014B":'n',"\u014C":'O',"\u014E":'O',"\u0150":'O',"\u014D":'o',"\u014F":'o',"\u0151":'o',"\u0154":'R',"\u0156":'R',"\u0158":'R',"\u0155":'r',"\u0157":'r',"\u0159":'r',"\u015A":'S',"\u015C":'S',"\u015E":'S',"\u0160":'S',"\u015B":'s',"\u015D":'s',"\u015F":'s',"\u0161":'s',"\u0162":'T',"\u0164":'T',"\u0166":'T',"\u0163":'t',"\u0165":'t',"\u0167":'t',"\u0168":'U',"\u016A":'U',"\u016C":'U',"\u016E":'U',"\u0170":'U',"\u0172":'U',"\u0169":'u',"\u016B":'u',"\u016D":'u',"\u016F":'u',"\u0171":'u',"\u0173":'u',"\u0174":'W',"\u0175":'w',"\u0176":'Y',"\u0177":'y',"\u0178":'Y',"\u0179":'Z',"\u017B":'Z',"\u017D":'Z',"\u017A":'z',"\u017C":'z',"\u017E":'z',"\u0132":'IJ',"\u0133":'ij',"\u0152":'Oe',"\u0153":'oe',"\u0149":"'n","\u017F":'s'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":'''};/** Used to map HTML entities to characters. */var htmlUnescapes={'&':'&','<':'<','>':'>','"':'"',''':"'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r',"\u2028":'u2028',"\u2029":'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat=parseFloat,freeParseInt=parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal=_typeof__default[
|
|
33
|
+
"\u0100":'A',"\u0102":'A',"\u0104":'A',"\u0101":'a',"\u0103":'a',"\u0105":'a',"\u0106":'C',"\u0108":'C',"\u010A":'C',"\u010C":'C',"\u0107":'c',"\u0109":'c',"\u010B":'c',"\u010D":'c',"\u010E":'D',"\u0110":'D',"\u010F":'d',"\u0111":'d',"\u0112":'E',"\u0114":'E',"\u0116":'E',"\u0118":'E',"\u011A":'E',"\u0113":'e',"\u0115":'e',"\u0117":'e',"\u0119":'e',"\u011B":'e',"\u011C":'G',"\u011E":'G',"\u0120":'G',"\u0122":'G',"\u011D":'g',"\u011F":'g',"\u0121":'g',"\u0123":'g',"\u0124":'H',"\u0126":'H',"\u0125":'h',"\u0127":'h',"\u0128":'I',"\u012A":'I',"\u012C":'I',"\u012E":'I',"\u0130":'I',"\u0129":'i',"\u012B":'i',"\u012D":'i',"\u012F":'i',"\u0131":'i',"\u0134":'J',"\u0135":'j',"\u0136":'K',"\u0137":'k',"\u0138":'k',"\u0139":'L',"\u013B":'L',"\u013D":'L',"\u013F":'L',"\u0141":'L',"\u013A":'l',"\u013C":'l',"\u013E":'l',"\u0140":'l',"\u0142":'l',"\u0143":'N',"\u0145":'N',"\u0147":'N',"\u014A":'N',"\u0144":'n',"\u0146":'n',"\u0148":'n',"\u014B":'n',"\u014C":'O',"\u014E":'O',"\u0150":'O',"\u014D":'o',"\u014F":'o',"\u0151":'o',"\u0154":'R',"\u0156":'R',"\u0158":'R',"\u0155":'r',"\u0157":'r',"\u0159":'r',"\u015A":'S',"\u015C":'S',"\u015E":'S',"\u0160":'S',"\u015B":'s',"\u015D":'s',"\u015F":'s',"\u0161":'s',"\u0162":'T',"\u0164":'T',"\u0166":'T',"\u0163":'t',"\u0165":'t',"\u0167":'t',"\u0168":'U',"\u016A":'U',"\u016C":'U',"\u016E":'U',"\u0170":'U',"\u0172":'U',"\u0169":'u',"\u016B":'u',"\u016D":'u',"\u016F":'u',"\u0171":'u',"\u0173":'u',"\u0174":'W',"\u0175":'w',"\u0176":'Y',"\u0177":'y',"\u0178":'Y',"\u0179":'Z',"\u017B":'Z',"\u017D":'Z',"\u017A":'z',"\u017C":'z',"\u017E":'z',"\u0132":'IJ',"\u0133":'ij',"\u0152":'Oe',"\u0153":'oe',"\u0149":"'n","\u017F":'s'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":'''};/** Used to map HTML entities to characters. */var htmlUnescapes={'&':'&','<':'<','>':'>','"':'"',''':"'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r',"\u2028":'u2028',"\u2029":'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat=parseFloat,freeParseInt=parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal=_typeof__default["default"](commonjsGlobal)=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;/** Detect free variable `self`. */var freeSelf=(typeof self==="undefined"?"undefined":_typeof__default["default"](self))=='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root=freeGlobal||freeSelf||Function('return this')();/** Detect free variable `exports`. */var freeExports=exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+.
|
|
34
34
|
var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10.
|
|
35
35
|
return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();/* Node.js helper references. */var nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/*--------------------------------------------------------------------------*/ /**
|
|
36
36
|
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
@@ -1314,7 +1314,7 @@ baseFlatten(value,depth-1,predicate,isStrict,result);}else {arrayPush(result,val
|
|
|
1314
1314
|
* @returns {Function} Returns the iteratee.
|
|
1315
1315
|
*/function baseIteratee(value){// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
1316
1316
|
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
1317
|
-
if(typeof value=='function'){return value;}if(value==null){return identity;}if(_typeof__default[
|
|
1317
|
+
if(typeof value=='function'){return value;}if(value==null){return identity;}if(_typeof__default["default"](value)=='object'){return isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value);}return property(value);}/**
|
|
1318
1318
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1319
1319
|
*
|
|
1320
1320
|
* @private
|
|
@@ -2243,7 +2243,7 @@ if(length&&typeof array[0]=='string'&&hasOwnProperty.call(array,'index')){result
|
|
|
2243
2243
|
* @param {*} value The value to check.
|
|
2244
2244
|
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
2245
2245
|
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
2246
|
-
*/function isIndex(value,length){var type=_typeof__default[
|
|
2246
|
+
*/function isIndex(value,length){var type=_typeof__default["default"](value);length=length==null?MAX_SAFE_INTEGER:length;return !!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}/**
|
|
2247
2247
|
* Checks if the given arguments are from an iteratee call.
|
|
2248
2248
|
*
|
|
2249
2249
|
* @private
|
|
@@ -2252,20 +2252,20 @@ if(length&&typeof array[0]=='string'&&hasOwnProperty.call(array,'index')){result
|
|
|
2252
2252
|
* @param {*} object The potential iteratee object argument.
|
|
2253
2253
|
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
2254
2254
|
* else `false`.
|
|
2255
|
-
*/function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=_typeof__default[
|
|
2255
|
+
*/function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=_typeof__default["default"](index);if(type=='number'?isArrayLike(object)&&isIndex(index,object.length):type=='string'&&index in object){return eq(object[index],value);}return false;}/**
|
|
2256
2256
|
* Checks if `value` is a property name and not a property path.
|
|
2257
2257
|
*
|
|
2258
2258
|
* @private
|
|
2259
2259
|
* @param {*} value The value to check.
|
|
2260
2260
|
* @param {Object} [object] The object to query keys on.
|
|
2261
2261
|
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
2262
|
-
*/function isKey(value,object){if(isArray(value)){return false;}var type=_typeof__default[
|
|
2262
|
+
*/function isKey(value,object){if(isArray(value)){return false;}var type=_typeof__default["default"](value);if(type=='number'||type=='symbol'||type=='boolean'||value==null||isSymbol(value)){return true;}return reIsPlainProp.test(value)||!reIsDeepProp.test(value)||object!=null&&value in Object(object);}/**
|
|
2263
2263
|
* Checks if `value` is suitable for use as unique object key.
|
|
2264
2264
|
*
|
|
2265
2265
|
* @private
|
|
2266
2266
|
* @param {*} value The value to check.
|
|
2267
2267
|
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
2268
|
-
*/function isKeyable(value){var type=_typeof__default[
|
|
2268
|
+
*/function isKeyable(value){var type=_typeof__default["default"](value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}/**
|
|
2269
2269
|
* Checks if `func` has a lazy counterpart.
|
|
2270
2270
|
*
|
|
2271
2271
|
* @private
|
|
@@ -5968,7 +5968,7 @@ var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==
|
|
|
5968
5968
|
*
|
|
5969
5969
|
* _.isObject(null);
|
|
5970
5970
|
* // => false
|
|
5971
|
-
*/function isObject(value){var type=_typeof__default[
|
|
5971
|
+
*/function isObject(value){var type=_typeof__default["default"](value);return value!=null&&(type=='object'||type=='function');}/**
|
|
5972
5972
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
5973
5973
|
* and has a `typeof` result of "object".
|
|
5974
5974
|
*
|
|
@@ -5991,7 +5991,7 @@ var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==
|
|
|
5991
5991
|
*
|
|
5992
5992
|
* _.isObjectLike(null);
|
|
5993
5993
|
* // => false
|
|
5994
|
-
*/function isObjectLike(value){return value!=null&&_typeof__default[
|
|
5994
|
+
*/function isObjectLike(value){return value!=null&&_typeof__default["default"](value)=='object';}/**
|
|
5995
5995
|
* Checks if `value` is classified as a `Map` object.
|
|
5996
5996
|
*
|
|
5997
5997
|
* @static
|
|
@@ -6297,7 +6297,7 @@ return isNumber(value)&&value!=+value;}/**
|
|
|
6297
6297
|
*
|
|
6298
6298
|
* _.isSymbol('abc');
|
|
6299
6299
|
* // => false
|
|
6300
|
-
*/function isSymbol(value){return _typeof__default[
|
|
6300
|
+
*/function isSymbol(value){return _typeof__default["default"](value)=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}/**
|
|
6301
6301
|
* Checks if `value` is classified as a typed array.
|
|
6302
6302
|
*
|
|
6303
6303
|
* @static
|
|
@@ -9463,7 +9463,6 @@ function insertIf(condition, ...elements) {
|
|
|
9463
9463
|
return condition ? elements : [];
|
|
9464
9464
|
}
|
|
9465
9465
|
function last(array) {
|
|
9466
|
-
// @ts-expect-error too magical
|
|
9467
9466
|
return array[array.length - 1];
|
|
9468
9467
|
}
|
|
9469
9468
|
/**
|
|
@@ -9476,6 +9475,22 @@ function toggleElement(array, element) {
|
|
|
9476
9475
|
? array.filter((e) => e !== element)
|
|
9477
9476
|
: array.concat(element);
|
|
9478
9477
|
}
|
|
9478
|
+
/**
|
|
9479
|
+
* Sorts an array according to the order of the elements in a given recipe array.
|
|
9480
|
+
*
|
|
9481
|
+
* @param subject The array to sort.
|
|
9482
|
+
* @param recipe The recipe to sort by. Must be a set, an error is thrown if it contains duplicate values.
|
|
9483
|
+
*
|
|
9484
|
+
* @example array to sort [Dec, Jan, Mar]
|
|
9485
|
+
* sort by recipe [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
|
|
9486
|
+
* returns sorted array [Jan, Mar, Dec]
|
|
9487
|
+
*/
|
|
9488
|
+
function sortByArray(subject, recipe) {
|
|
9489
|
+
if (new Set(recipe).size !== recipe.length) {
|
|
9490
|
+
throw new Error('Recipe array must only consist of distinct values in order to define a valid order.');
|
|
9491
|
+
}
|
|
9492
|
+
return lodash.sortBy(subject, (value) => recipe.indexOf(value));
|
|
9493
|
+
}
|
|
9479
9494
|
|
|
9480
9495
|
function toInteger(dirtyNumber) {
|
|
9481
9496
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -9629,7 +9644,7 @@ function toDate(argument, dirtyOptions) {
|
|
|
9629
9644
|
} // Clone the date
|
|
9630
9645
|
|
|
9631
9646
|
|
|
9632
|
-
if (argument instanceof Date || _typeof__default[
|
|
9647
|
+
if (argument instanceof Date || _typeof__default["default"](argument) === 'object' && Object.prototype.toString.call(argument) === '[object Date]') {
|
|
9633
9648
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
9634
9649
|
return new Date(argument.getTime());
|
|
9635
9650
|
} else if (typeof argument === 'number' || Object.prototype.toString.call(argument) === '[object Number]') {
|
|
@@ -10354,6 +10369,7 @@ var formatLong = {
|
|
|
10354
10369
|
defaultWidth: 'full'
|
|
10355
10370
|
})
|
|
10356
10371
|
};
|
|
10372
|
+
var formatLong$1 = formatLong;
|
|
10357
10373
|
|
|
10358
10374
|
var formatRelativeLocale = {
|
|
10359
10375
|
lastWeek: "'last' eeee 'at' p",
|
|
@@ -10532,6 +10548,7 @@ var localize = {
|
|
|
10532
10548
|
defaultFormattingWidth: 'wide'
|
|
10533
10549
|
})
|
|
10534
10550
|
};
|
|
10551
|
+
var localize$1 = localize;
|
|
10535
10552
|
|
|
10536
10553
|
function buildMatchPatternFn(args) {
|
|
10537
10554
|
return function (dirtyString, dirtyOptions) {
|
|
@@ -10697,6 +10714,7 @@ var match = {
|
|
|
10697
10714
|
defaultParseWidth: 'any'
|
|
10698
10715
|
})
|
|
10699
10716
|
};
|
|
10717
|
+
var match$1 = match;
|
|
10700
10718
|
|
|
10701
10719
|
/**
|
|
10702
10720
|
* @type {Locale}
|
|
@@ -10710,10 +10728,10 @@ var match = {
|
|
|
10710
10728
|
|
|
10711
10729
|
var locale = {
|
|
10712
10730
|
formatDistance: formatDistance,
|
|
10713
|
-
formatLong: formatLong,
|
|
10731
|
+
formatLong: formatLong$1,
|
|
10714
10732
|
formatRelative: formatRelative,
|
|
10715
|
-
localize: localize,
|
|
10716
|
-
match: match,
|
|
10733
|
+
localize: localize$1,
|
|
10734
|
+
match: match$1,
|
|
10717
10735
|
options: {
|
|
10718
10736
|
weekStartsOn: 0
|
|
10719
10737
|
/* Sunday */
|
|
@@ -10721,6 +10739,7 @@ var locale = {
|
|
|
10721
10739
|
firstWeekContainsDate: 1
|
|
10722
10740
|
}
|
|
10723
10741
|
};
|
|
10742
|
+
var defaultLocale = locale;
|
|
10724
10743
|
|
|
10725
10744
|
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
|
|
10726
10745
|
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
@@ -11806,6 +11825,8 @@ function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
|
11806
11825
|
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
11807
11826
|
}
|
|
11808
11827
|
|
|
11828
|
+
var formatters$1 = formatters;
|
|
11829
|
+
|
|
11809
11830
|
function dateLongFormatter(pattern, formatLong, options) {
|
|
11810
11831
|
switch (pattern) {
|
|
11811
11832
|
case 'P':
|
|
@@ -11901,6 +11922,7 @@ var longFormatters = {
|
|
|
11901
11922
|
p: timeLongFormatter,
|
|
11902
11923
|
P: dateTimeLongFormatter
|
|
11903
11924
|
};
|
|
11925
|
+
var longFormatters$1 = longFormatters;
|
|
11904
11926
|
|
|
11905
11927
|
/**
|
|
11906
11928
|
* @name subMilliseconds
|
|
@@ -12274,8 +12296,8 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
12274
12296
|
|
|
12275
12297
|
var formatStr = String(dirtyFormatStr);
|
|
12276
12298
|
var options = dirtyOptions || {};
|
|
12277
|
-
var locale
|
|
12278
|
-
var localeFirstWeekContainsDate = locale
|
|
12299
|
+
var locale = options.locale || defaultLocale;
|
|
12300
|
+
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
|
|
12279
12301
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
12280
12302
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
12281
12303
|
|
|
@@ -12283,7 +12305,7 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
12283
12305
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
12284
12306
|
}
|
|
12285
12307
|
|
|
12286
|
-
var localeWeekStartsOn = locale
|
|
12308
|
+
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
|
|
12287
12309
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
12288
12310
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
12289
12311
|
|
|
@@ -12291,11 +12313,11 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
12291
12313
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
12292
12314
|
}
|
|
12293
12315
|
|
|
12294
|
-
if (!locale
|
|
12316
|
+
if (!locale.localize) {
|
|
12295
12317
|
throw new RangeError('locale must contain localize property');
|
|
12296
12318
|
}
|
|
12297
12319
|
|
|
12298
|
-
if (!locale
|
|
12320
|
+
if (!locale.formatLong) {
|
|
12299
12321
|
throw new RangeError('locale must contain formatLong property');
|
|
12300
12322
|
}
|
|
12301
12323
|
|
|
@@ -12313,15 +12335,15 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
12313
12335
|
var formatterOptions = {
|
|
12314
12336
|
firstWeekContainsDate: firstWeekContainsDate,
|
|
12315
12337
|
weekStartsOn: weekStartsOn,
|
|
12316
|
-
locale: locale
|
|
12338
|
+
locale: locale,
|
|
12317
12339
|
_originalDate: originalDate
|
|
12318
12340
|
};
|
|
12319
12341
|
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
|
12320
12342
|
var firstCharacter = substring[0];
|
|
12321
12343
|
|
|
12322
12344
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
12323
|
-
var longFormatter = longFormatters[firstCharacter];
|
|
12324
|
-
return longFormatter(substring, locale
|
|
12345
|
+
var longFormatter = longFormatters$1[firstCharacter];
|
|
12346
|
+
return longFormatter(substring, locale.formatLong, formatterOptions);
|
|
12325
12347
|
}
|
|
12326
12348
|
|
|
12327
12349
|
return substring;
|
|
@@ -12337,14 +12359,14 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
12337
12359
|
return cleanEscapedString$1(substring);
|
|
12338
12360
|
}
|
|
12339
12361
|
|
|
12340
|
-
var formatter = formatters[firstCharacter];
|
|
12362
|
+
var formatter = formatters$1[firstCharacter];
|
|
12341
12363
|
|
|
12342
12364
|
if (formatter) {
|
|
12343
12365
|
if (!options.awareOfUnicodeTokens && isProtectedToken(substring)) {
|
|
12344
12366
|
throwProtectedError(substring);
|
|
12345
12367
|
}
|
|
12346
12368
|
|
|
12347
|
-
return formatter(utcDate, substring, locale
|
|
12369
|
+
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
12348
12370
|
}
|
|
12349
12371
|
|
|
12350
12372
|
return substring;
|
|
@@ -13921,6 +13943,7 @@ var parsers = {
|
|
|
13921
13943
|
}
|
|
13922
13944
|
}
|
|
13923
13945
|
};
|
|
13946
|
+
var parsers$1 = parsers;
|
|
13924
13947
|
|
|
13925
13948
|
var TIMEZONE_UNIT_PRIORITY = 20; // This RegExp consists of three parts separated by `|`:
|
|
13926
13949
|
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
|
@@ -14229,13 +14252,13 @@ function parse(dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions)
|
|
|
14229
14252
|
var dateString = String(dirtyDateString);
|
|
14230
14253
|
var formatString = String(dirtyFormatString);
|
|
14231
14254
|
var options = dirtyOptions || {};
|
|
14232
|
-
var locale
|
|
14255
|
+
var locale = options.locale || defaultLocale;
|
|
14233
14256
|
|
|
14234
|
-
if (!locale
|
|
14257
|
+
if (!locale.match) {
|
|
14235
14258
|
throw new RangeError('locale must contain match property');
|
|
14236
14259
|
}
|
|
14237
14260
|
|
|
14238
|
-
var localeFirstWeekContainsDate = locale
|
|
14261
|
+
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
|
|
14239
14262
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
14240
14263
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
14241
14264
|
|
|
@@ -14243,7 +14266,7 @@ function parse(dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions)
|
|
|
14243
14266
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
14244
14267
|
}
|
|
14245
14268
|
|
|
14246
|
-
var localeWeekStartsOn = locale
|
|
14269
|
+
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
|
|
14247
14270
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
14248
14271
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
14249
14272
|
|
|
@@ -14262,7 +14285,7 @@ function parse(dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions)
|
|
|
14262
14285
|
var subFnOptions = {
|
|
14263
14286
|
firstWeekContainsDate: firstWeekContainsDate,
|
|
14264
14287
|
weekStartsOn: weekStartsOn,
|
|
14265
|
-
locale: locale
|
|
14288
|
+
locale: locale
|
|
14266
14289
|
}; // If timezone isn't specified, it will be set to the system timezone
|
|
14267
14290
|
|
|
14268
14291
|
var setters = [{
|
|
@@ -14281,10 +14304,10 @@ function parse(dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions)
|
|
|
14281
14304
|
}
|
|
14282
14305
|
|
|
14283
14306
|
var firstCharacter = token[0];
|
|
14284
|
-
var parser = parsers[firstCharacter];
|
|
14307
|
+
var parser = parsers$1[firstCharacter];
|
|
14285
14308
|
|
|
14286
14309
|
if (parser) {
|
|
14287
|
-
var parseResult = parser.parse(dateString, token, locale
|
|
14310
|
+
var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);
|
|
14288
14311
|
|
|
14289
14312
|
if (!parseResult) {
|
|
14290
14313
|
return new Date(NaN);
|
|
@@ -14557,13 +14580,15 @@ var buildFormatLongFn_1 = createCommonjsModule(function (module, exports) {
|
|
|
14557
14580
|
module.exports = exports["default"];
|
|
14558
14581
|
});
|
|
14559
14582
|
|
|
14583
|
+
var _index$3 = buildFormatLongFn_1;
|
|
14584
|
+
|
|
14560
14585
|
var formatLong_1 = createCommonjsModule(function (module, exports) {
|
|
14561
14586
|
|
|
14562
14587
|
Object.defineProperty(exports, "__esModule", {
|
|
14563
14588
|
value: true
|
|
14564
14589
|
});
|
|
14565
14590
|
|
|
14566
|
-
var _index2 = _interopRequireDefault(
|
|
14591
|
+
var _index2 = _interopRequireDefault(_index$3);
|
|
14567
14592
|
|
|
14568
14593
|
function _interopRequireDefault(obj) {
|
|
14569
14594
|
return obj && obj.__esModule ? obj : {
|
|
@@ -14657,13 +14682,15 @@ var buildLocalizeFn_1 = createCommonjsModule(function (module, exports) {
|
|
|
14657
14682
|
module.exports = exports['default'];
|
|
14658
14683
|
});
|
|
14659
14684
|
|
|
14685
|
+
var _index$2 = buildLocalizeFn_1;
|
|
14686
|
+
|
|
14660
14687
|
var localize_1 = createCommonjsModule(function (module, exports) {
|
|
14661
14688
|
|
|
14662
14689
|
Object.defineProperty(exports, "__esModule", {
|
|
14663
14690
|
value: true
|
|
14664
14691
|
});
|
|
14665
14692
|
|
|
14666
|
-
var _index2 = _interopRequireDefault(
|
|
14693
|
+
var _index2 = _interopRequireDefault(_index$2);
|
|
14667
14694
|
|
|
14668
14695
|
function _interopRequireDefault(obj) {
|
|
14669
14696
|
return obj && obj.__esModule ? obj : {
|
|
@@ -14888,15 +14915,19 @@ var buildMatchFn_1 = createCommonjsModule(function (module, exports) {
|
|
|
14888
14915
|
module.exports = exports['default'];
|
|
14889
14916
|
});
|
|
14890
14917
|
|
|
14918
|
+
var _index$1 = buildMatchPatternFn_1;
|
|
14919
|
+
|
|
14920
|
+
var _index3$1 = buildMatchFn_1;
|
|
14921
|
+
|
|
14891
14922
|
var match_1 = createCommonjsModule(function (module, exports) {
|
|
14892
14923
|
|
|
14893
14924
|
Object.defineProperty(exports, "__esModule", {
|
|
14894
14925
|
value: true
|
|
14895
14926
|
});
|
|
14896
14927
|
|
|
14897
|
-
var _index2 = _interopRequireDefault(
|
|
14928
|
+
var _index2 = _interopRequireDefault(_index$1);
|
|
14898
14929
|
|
|
14899
|
-
var _index4 = _interopRequireDefault(
|
|
14930
|
+
var _index4 = _interopRequireDefault(_index3$1);
|
|
14900
14931
|
|
|
14901
14932
|
function _interopRequireDefault(obj) {
|
|
14902
14933
|
return obj && obj.__esModule ? obj : {
|
|
@@ -15005,21 +15036,31 @@ var match_1 = createCommonjsModule(function (module, exports) {
|
|
|
15005
15036
|
module.exports = exports['default'];
|
|
15006
15037
|
});
|
|
15007
15038
|
|
|
15039
|
+
var _index = formatDistance_1;
|
|
15040
|
+
|
|
15041
|
+
var _index3 = formatLong_1;
|
|
15042
|
+
|
|
15043
|
+
var _index5 = formatRelative_1;
|
|
15044
|
+
|
|
15045
|
+
var _index7 = localize_1;
|
|
15046
|
+
|
|
15047
|
+
var _index9 = match_1;
|
|
15048
|
+
|
|
15008
15049
|
var de = createCommonjsModule(function (module, exports) {
|
|
15009
15050
|
|
|
15010
15051
|
Object.defineProperty(exports, "__esModule", {
|
|
15011
15052
|
value: true
|
|
15012
15053
|
});
|
|
15013
15054
|
|
|
15014
|
-
var _index2 = _interopRequireDefault(
|
|
15055
|
+
var _index2 = _interopRequireDefault(_index);
|
|
15015
15056
|
|
|
15016
|
-
var _index4 = _interopRequireDefault(
|
|
15057
|
+
var _index4 = _interopRequireDefault(_index3);
|
|
15017
15058
|
|
|
15018
|
-
var _index6 = _interopRequireDefault(
|
|
15059
|
+
var _index6 = _interopRequireDefault(_index5);
|
|
15019
15060
|
|
|
15020
|
-
var _index8 = _interopRequireDefault(
|
|
15061
|
+
var _index8 = _interopRequireDefault(_index7);
|
|
15021
15062
|
|
|
15022
|
-
var _index10 = _interopRequireDefault(
|
|
15063
|
+
var _index10 = _interopRequireDefault(_index9);
|
|
15023
15064
|
|
|
15024
15065
|
function _interopRequireDefault(obj) {
|
|
15025
15066
|
return obj && obj.__esModule ? obj : {
|
|
@@ -15241,9 +15282,10 @@ const isAlphanumeric = (value) => isString(value) && /^[A-Za-z0-9]+$/.test(value
|
|
|
15241
15282
|
* und klar abzugrenzen vom Institutskennzeichen (IK-Nummer) eines Krankenhauses.
|
|
15242
15283
|
*/
|
|
15243
15284
|
const isBSNR = (value) => isString(value) && /^\d{9}$/.test(value);
|
|
15244
|
-
// Taken from https://emailregex.com
|
|
15285
|
+
// Taken from https://emailregex.com
|
|
15286
|
+
const EMAIL_REGEX =
|
|
15245
15287
|
// eslint-disable-next-line no-useless-escape
|
|
15246
|
-
|
|
15288
|
+
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
15247
15289
|
const isEmail = (value) => isString(value) && EMAIL_REGEX.test(value);
|
|
15248
15290
|
const isOnlyDigits = (value) => isString(value) && /^\d+$/.test(value);
|
|
15249
15291
|
const isURL = (value) => {
|
|
@@ -15354,6 +15396,7 @@ exports.parseSecondlessDateTime = parseSecondlessDateTime;
|
|
|
15354
15396
|
exports.pluralize = pluralize;
|
|
15355
15397
|
exports.pxToNumber = pxToNumber;
|
|
15356
15398
|
exports.round = round;
|
|
15399
|
+
exports.sortByArray = sortByArray;
|
|
15357
15400
|
exports.toggleElement = toggleElement;
|
|
15358
15401
|
exports.withoutIndex = withoutIndex;
|
|
15359
15402
|
//# sourceMappingURL=index.js.map
|