Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yookue/ts-lang-utils

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yookue/ts-lang-utils - npm Package Compare versions

Comparing version 0.1.32 to 0.1.33

58

dist/cjs/util/ArrayUtils.d.ts

@@ -23,3 +23,3 @@ /**

*/
static firstNotNil(array?: any[]): any;
static firstNotNil(array?: any[] | readonly any[] | null): any;
/**

@@ -35,15 +35,4 @@ * Returns the first not empty element in the given array, or null if all elements are nil

*/
static firstNotEmpty(array?: any[]): any;
static firstNotEmpty(array?: any[] | readonly any[] | null): any;
/**
* Returns an array of the given element
*
* @param element the element to wrap
*
* @return an array of the given element
*
* @example
* ArrayUtils.asArray('foobar'); // ['foobar']
*/
static asArray<E>(element?: E | null): E[] | undefined;
/**
* Returns the first element of the given array

@@ -58,3 +47,3 @@ *

*/
static getFirst<E>(array?: E[] | null): E | undefined;
static getFirst<E>(array?: E[] | readonly E[] | null): E | undefined;
/**

@@ -70,3 +59,3 @@ * Returns the last element of the given array

*/
static getLast<E>(array?: E[] | null): E | undefined;
static getLast<E>(array?: E[] | readonly E[] | null): E | undefined;
/**

@@ -83,3 +72,3 @@ * Returns the length of the given array

*/
static getLength(array?: any[]): number;
static getLength(array?: any[] | readonly any[] | null): number;
/**

@@ -95,3 +84,3 @@ * Returns the element types of the given array

*/
static getTypeof(array?: any[]): string[] | undefined;
static getTypeof(array?: any[] | readonly any[] | null): string[] | undefined;
/**

@@ -107,3 +96,3 @@ * Returns whether the given array is empty

*/
static isEmpty(array?: any[]): boolean;
static isEmpty(array?: any[] | readonly any[] | null): boolean;
/**

@@ -119,3 +108,3 @@ * Returns whether the given array is not empty

*/
static isNotEmpty(array?: any[]): boolean;
static isNotEmpty(array?: any[] | readonly any[] | null): boolean;
/**

@@ -134,3 +123,3 @@ * Returns whether each element in the given array is the expected type

*/
static isTypeof(array?: any[], type?: string, relaxed?: boolean): boolean;
static isTypeof(array?: any[] | readonly any[] | null, type?: string, relaxed?: boolean): boolean;
/**

@@ -147,3 +136,3 @@ * Returns whether the given array includes the given element

*/
static includes<E>(array?: E[] | null, element?: E | null): boolean;
static includes<E>(array?: E[] | readonly E[] | null, element?: E | null): boolean;
/**

@@ -161,3 +150,3 @@ * Returns whether the given array includes all the given elements

*/
static includesAll<E>(array?: E[] | null, elements?: E[] | null): boolean;
static includesAll<E>(array?: E[] | readonly E[] | null, elements?: E[] | null): boolean;
/**

@@ -175,3 +164,3 @@ * Returns whether the given array includes any of the given elements

*/
static includesAny<E>(array?: E[] | null, elements?: E[] | null): boolean;
static includesAny<E>(array?: E[] | readonly E[] | null, elements?: E[] | null): boolean;
/**

@@ -203,3 +192,3 @@ * Returns the array that contains all the given elements at the index of the source array

*/
static maxLength(...arrays: any[][]): number;
static maxLength(...arrays: any[][] | readonly any[][]): number;
/**

@@ -215,4 +204,12 @@ * Returns the min length of the given arrays

*/
static minLength(...arrays: any[][]): number;
static minLength(...arrays: any[][] | readonly any[][]): number;
/**
* Returns a readonly instance of the given array
*
* @param array the arrays to inspect
*
* @returns a readonly instance of the given array
*/
static readonly<E>(array?: E[] | null): ReadonlyArray<E> | undefined | null;
/**
* Returns the array that excludes the given elements

@@ -240,2 +237,13 @@ *

static reverse(array?: any[], startInclusive?: number, endExclusive?: number): void;
/**
* Returns an array that only contains the given element
*
* @param element the element to wrap
*
* @return an array that only contains the given element
*
* @example
* ArrayUtils.singleton('foobar'); // ['foobar']
*/
static singleton<E>(element?: E | null): E[] | undefined;
}

@@ -62,15 +62,2 @@ var __defProp = Object.defineProperty;

/**
* Returns an array of the given element
*
* @param element the element to wrap
*
* @return an array of the given element
*
* @example
* ArrayUtils.asArray('foobar'); // ['foobar']
*/
static asArray(element) {
return !element ? void 0 : [element];
}
/**
* Returns the first element of the given array

@@ -305,2 +292,12 @@ *

/**
* Returns a readonly instance of the given array
*
* @param array the arrays to inspect
*
* @returns a readonly instance of the given array
*/
static readonly(array) {
return !array ? array : Object.freeze(array);
}
/**
* Returns the array that excludes the given elements

@@ -343,2 +340,15 @@ *

}
/**
* Returns an array that only contains the given element
*
* @param element the element to wrap
*
* @return an array that only contains the given element
*
* @example
* ArrayUtils.singleton('foobar'); // ['foobar']
*/
static singleton(element) {
return !element ? void 0 : [element];
}
};

@@ -345,0 +355,0 @@ // Annotate the CommonJS export names for ESM import in node:

@@ -23,3 +23,3 @@ /**

*/
static firstNotNil(array?: any[]): any;
static firstNotNil(array?: any[] | readonly any[] | null): any;
/**

@@ -35,15 +35,4 @@ * Returns the first not empty element in the given array, or null if all elements are nil

*/
static firstNotEmpty(array?: any[]): any;
static firstNotEmpty(array?: any[] | readonly any[] | null): any;
/**
* Returns an array of the given element
*
* @param element the element to wrap
*
* @return an array of the given element
*
* @example
* ArrayUtils.asArray('foobar'); // ['foobar']
*/
static asArray<E>(element?: E | null): E[] | undefined;
/**
* Returns the first element of the given array

@@ -58,3 +47,3 @@ *

*/
static getFirst<E>(array?: E[] | null): E | undefined;
static getFirst<E>(array?: E[] | readonly E[] | null): E | undefined;
/**

@@ -70,3 +59,3 @@ * Returns the last element of the given array

*/
static getLast<E>(array?: E[] | null): E | undefined;
static getLast<E>(array?: E[] | readonly E[] | null): E | undefined;
/**

@@ -83,3 +72,3 @@ * Returns the length of the given array

*/
static getLength(array?: any[]): number;
static getLength(array?: any[] | readonly any[] | null): number;
/**

@@ -95,3 +84,3 @@ * Returns the element types of the given array

*/
static getTypeof(array?: any[]): string[] | undefined;
static getTypeof(array?: any[] | readonly any[] | null): string[] | undefined;
/**

@@ -107,3 +96,3 @@ * Returns whether the given array is empty

*/
static isEmpty(array?: any[]): boolean;
static isEmpty(array?: any[] | readonly any[] | null): boolean;
/**

@@ -119,3 +108,3 @@ * Returns whether the given array is not empty

*/
static isNotEmpty(array?: any[]): boolean;
static isNotEmpty(array?: any[] | readonly any[] | null): boolean;
/**

@@ -134,3 +123,3 @@ * Returns whether each element in the given array is the expected type

*/
static isTypeof(array?: any[], type?: string, relaxed?: boolean): boolean;
static isTypeof(array?: any[] | readonly any[] | null, type?: string, relaxed?: boolean): boolean;
/**

@@ -147,3 +136,3 @@ * Returns whether the given array includes the given element

*/
static includes<E>(array?: E[] | null, element?: E | null): boolean;
static includes<E>(array?: E[] | readonly E[] | null, element?: E | null): boolean;
/**

@@ -161,3 +150,3 @@ * Returns whether the given array includes all the given elements

*/
static includesAll<E>(array?: E[] | null, elements?: E[] | null): boolean;
static includesAll<E>(array?: E[] | readonly E[] | null, elements?: E[] | null): boolean;
/**

@@ -175,3 +164,3 @@ * Returns whether the given array includes any of the given elements

*/
static includesAny<E>(array?: E[] | null, elements?: E[] | null): boolean;
static includesAny<E>(array?: E[] | readonly E[] | null, elements?: E[] | null): boolean;
/**

@@ -203,3 +192,3 @@ * Returns the array that contains all the given elements at the index of the source array

*/
static maxLength(...arrays: any[][]): number;
static maxLength(...arrays: any[][] | readonly any[][]): number;
/**

@@ -215,4 +204,12 @@ * Returns the min length of the given arrays

*/
static minLength(...arrays: any[][]): number;
static minLength(...arrays: any[][] | readonly any[][]): number;
/**
* Returns a readonly instance of the given array
*
* @param array the arrays to inspect
*
* @returns a readonly instance of the given array
*/
static readonly<E>(array?: E[] | null): ReadonlyArray<E> | undefined | null;
/**
* Returns the array that excludes the given elements

@@ -240,2 +237,13 @@ *

static reverse(array?: any[], startInclusive?: number, endExclusive?: number): void;
/**
* Returns an array that only contains the given element
*
* @param element the element to wrap
*
* @return an array that only contains the given element
*
* @example
* ArrayUtils.singleton('foobar'); // ['foobar']
*/
static singleton<E>(element?: E | null): E[] | undefined;
}

@@ -26,7 +26,2 @@ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";

}, {
key: "asArray",
value: function asArray(element) {
return !element ? undefined : [element];
}
}, {
key: "getFirst",

@@ -164,2 +159,7 @@ value: function getFirst(array) {

}, {
key: "readonly",
value: function readonly(array) {
return !array ? array : Object.freeze(array);
}
}, {
key: "remove",

@@ -187,4 +187,9 @@ value: function remove(array, elements) {

}
}, {
key: "singleton",
value: function singleton(element) {
return !element ? undefined : [element];
}
}]);
return ArrayUtils;
}();

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TsLangUtils=t():e.TsLangUtils=t()}(self,(function(){return function(){var e={317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(281);function u(e,t){for(var n=0;n<t.length;n++){var u=t[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,r(u.key),u)}}e.exports=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},746:function(e,t,n){var r=n(508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var u=0,i=function(){};return{s:i,n:function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var u=n.call(e,t||"default");if("object"!=r(u))return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},281:function(e,t,n){var r=n(944).default,u=n(224);e.exports=function(e){var t=u(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},508:function(e,t,n){var r=n(317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var u=t[r];if(void 0!==u)return u.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{ArrayUtils:function(){return y},BooleanUtils:function(){return h},DateUtils:function(){return g},JsonUtils:function(){return p},NumberUtils:function(){return d},ObjectUtils:function(){return f},RandomUtils:function(){return m},RegexUtils:function(){return c},StringUtils:function(){return v},ThreadUtils:function(){return k},TreeUtils:function(){return b}});var e=n(746),t=n.n(e),u=n(944),i=n.n(u),o=n(486),a=n.n(o),l=n(702),s=n.n(l),f=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allNil",value:function(e){var t=this;return!e||0===e.length||(null==e?void 0:e.every((function(e){return t.isNil(e)})))}},{key:"allNotNil",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotNil(e)}))}},{key:"anyNil",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNil(e)}))}},{key:"anyNotNil",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotNil(e)}))}},{key:"allEmpty",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isEmpty(e)}))}},{key:"allNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotEmpty(e)}))}},{key:"anyEmpty",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isEmpty(e)}))}},{key:"anyNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotEmpty(e)}))}},{key:"isNil",value:function(e){return null==e}},{key:"isNotNil",value:function(e){return!this.isNil(e)}},{key:"isNull",value:function(e){return null===e}},{key:"isNotNull",value:function(e){return!this.isNull(e)}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isNotUndefined",value:function(e){return!this.isUndefined(e)}},{key:"isEmpty",value:function(e){return!e||("string"==typeof e||Array.isArray(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"===i()(e)&&0===(null===(t=this.keys(e))||void 0===t?void 0:t.length));var t}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isPlainObject",value:function(e){return"object"===i()(e)&&"[object Object]"===Object.prototype.toString.call(e)}},{key:"isPromiseObject",value:function(e){return"object"===i()(e)&&"[object Promise]"===Object.prototype.toString.call(e)}},{key:"isPrototype",value:function(e){if("object"!==i()(e))return!1;var t=e.constructor;return e===("function"==typeof t?t.prototype:e.prototype)}},{key:"getProperty",value:function(e,t){if("object"===i()(e)&&t&&0!==t.length){if(!t.includes("."))return e[t];var n=t.replace(/\[/g,".").replace(/]/g,"").split(".");if(n&&0!==n.length)return 1===n.length?e[n[0]]:n.reduce((function(e,t){return(e||{})[t]}),e)}}},{key:"hasProperty",value:function(e,t){return"object"===i()(e)&&!!t&&(null==t?void 0:t.length)>0&&Object.prototype.hasOwnProperty.call(e,t)}},{key:"setProperty",value:function(e,t,n){this.isPlainObject(e)&&t&&(e[t]=n)}},{key:"keys",value:function(e){if(!e)return[];if(!this.isPrototype(e))return Object.keys(e);var t=[];for(var n in Object(e))"constructor"!==n&&this.hasProperty(e,n)&&t.push(n);return t}},{key:"toString",value:function(e,t){return e?e.toString():t}},{key:"toStringTag",value:function(e,t){return e?e[Symbol.toStringTag]:t}}]),e}(),c=function(){function e(){a()(this,e)}return s()(e,null,[{key:"extractWords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;return e&&e.match(t)||void 0}}]),e}(),v=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allEmpty",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isEmpty(e)}))}},{key:"allNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotEmpty(e)}))}},{key:"allBlank",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isBlank(e)}))}},{key:"allNotBlank",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotBlank(e)}))}},{key:"anyEmpty",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isEmpty(e)}))}},{key:"anyNotEmpty",value:function(e){var t=this;return!!e&&(null==e?void 0:e.length)>0&&e.some((function(e){return t.isNotEmpty(e)}))}},{key:"anyBlank",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isBlank(e)}))}},{key:"anyNotBlank",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotBlank(e)}))}},{key:"appendIfMissing",value:function(e,t){return!e||this.isEmpty(t)||this.endsWith(e,t)?e:e+t}},{key:"appendIfMissingIgnoreCase",value:function(e,t){return!e||this.isEmpty(t)||this.endsWithIgnoreCase(e,t)?e:e+t}},{key:"capitalizeFirst",value:function(e){return e?e.charAt(0).toUpperCase()+e.substring(1):e}},{key:"capitalizeFirstLowerTail",value:function(e){var t;return e?e.charAt(0).toUpperCase()+(null===(t=e.substring(1))||void 0===t?void 0:t.toLowerCase()):e}},{key:"defaultString",value:function(e){return e||""}},{key:"defaultIfEmpty",value:function(e,t){return this.isEmpty(e)?t:e}},{key:"defaultIfBlank",value:function(e,t){return this.isBlank(e)?t:e}},{key:"endsWith",value:function(e,t){return e&&t?!(e.length<t.length)&&e.endsWith(t):e===t}},{key:"endsWithIgnoreCase",value:function(e,t){return e&&t?!(e.length<t.length)&&e.toLowerCase().endsWith(t.toLowerCase()):e===t}},{key:"endsWithAny",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.endsWith(e,t)}))}},{key:"endsWithAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.endsWithIgnoreCase(e,t)}))}},{key:"equals",value:function(e,t){return e===t||!(!e||!t||(null==e?void 0:e.length)!==(null==t?void 0:t.length))&&e===t}},{key:"equalsIgnoreCase",value:function(e,t){return e===t||!(!e||!t||(null==e?void 0:e.length)!==(null==t?void 0:t.length))&&(null==e?void 0:e.toUpperCase())===(null==t?void 0:t.toUpperCase())}},{key:"equalsAny",value:function(e,t){return y.includes(t,e)}},{key:"equalsAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.equalsIgnoreCase(e,t)}))}},{key:"filterIgnoreEmpty",value:function(e){var t=this;if(e&&0!==e.length){var n=e.filter((function(e){return t.isNotEmpty(e)}));return n&&0!==n.length?n:void 0}}},{key:"filterIgnoreBlank",value:function(e){var t=this;if(e&&0!==e.length){var n=e.filter((function(e){return t.isNotBlank(e)}));return n&&0!==n.length?n:void 0}}},{key:"formatBrace",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!e||e.length<=2||!n||0===n.length)return e;for(var u=e,i=0,o=n;i<o.length;i++){var a=o[i];u=u.replace("{}",f.toString(a,""))}return u}},{key:"formatPercent",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!e||e.length<=2||!n||0===n.length)return e;var u=e.match(/%[bcdfjosxX]/g)||[],i=y.minLength(u,n);if(0===i)return e;for(var o=e,a=0;a<i;a++){var l=n[a],s=u[a].substring(1);switch(s){case"b":case"c":case"d":case"o":case"x":case"X":try{var c=void 0;"string"==typeof l?c=Number.parseInt(l):l instanceof String?c=Number.parseInt(l.toString()):"number"==typeof l&&(c=l),c&&("b"===s?o=o.replace("%".concat(s),c.toString(2)):"c"===s?o=o.replace("%".concat(s),String.fromCharCode(c)):"d"===s?o=o.replace("%".concat(s),c.toString(10)):"o"===s?o=o.replace("%".concat(s),"0"+c.toString(8)):"x"===s?o=o.replace("%".concat(s),"0x"+c.toString(16)):"X"===s&&(o=o.replace("%".concat(s),"0x"+c.toString(16).toUpperCase())))}catch(e){throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a))}break;case"f":try{var v=void 0;"string"==typeof l?v=Number.parseFloat(l):l instanceof String?v=Number.parseFloat(l.toString()):"number"==typeof l&&(v=l),v&&(o=o.replace("%".concat(s),"0x"+v.toString()))}catch(e){throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a))}break;case"j":if(null==l){o=o.replace("%".concat(s),"");break}if(f.isPlainObject(l)){o=o.replace("%".concat(s),JSON.stringify(l));break}throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a));case"s":o=o.replace("%".concat(s),f.toString(l,""))}}return o}},{key:"formatPlaceholder",value:function(e,t){if(!e||e.length<=2||!t)return e;var n=e;for(var r in t){var u=new RegExp("\\{".concat(r,"\\}"),"g"),i=t[r];n=n.replace(u,i?i.toString():"")}return n}},{key:"getLength",value:function(e){return e?e.length:0}},{key:"isEmpty",value:function(e){return!e||0===e.length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isBlank",value:function(e){return!e||0===(null==e?void 0:e.length)||/^\s*$/.test(e)}},{key:"isNotBlank",value:function(e){return!this.isBlank(e)}},{key:"includes",value:function(e,t){return e===t||!!e&&!!t&&e.includes(t)}},{key:"includesIgnoreCase",value:function(e,t){var n;return e===t||!!e&&!!t&&(null==e||null===(n=e.toUpperCase())||void 0===n?void 0:n.includes(null==t?void 0:t.toUpperCase()))}},{key:"includesAny",value:function(e,t){var n=this;return!(!e||!t)&&(null==t?void 0:t.some((function(t){return n.includes(e,t)})))}},{key:"includesAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&(null==t?void 0:t.some((function(t){return n.includesIgnoreCase(e,t)})))}},{key:"joinWith",value:function(e,t,n){if(e&&(!Array.isArray(e)||0!==e.length)){if(Array.isArray(e)){if(!n)return e.join(this.defaultString(t));var r=e.filter(n);return r&&0!==r.length?r.join(this.defaultString(t)):void 0}return n?n(e)?e:void 0:e}}},{key:"prependIfMissing",value:function(e,t){return!e||this.isEmpty(t)||this.startsWith(e,t)?e:t+e}},{key:"prependIfMissingIgnoreCase",value:function(e,t){return!e||this.isEmpty(t)||this.startsWithIgnoreCase(e,t)?e:t+e}},{key:"removeAll",value:function(e,t){return this.replaceAll(e,t,"")}},{key:"removeAllIgnoreCase",value:function(e,t){return this.replaceAllIgnoreCase(e,t,"")}},{key:"removeFirst",value:function(e,t){return this.replaceFirst(e,t,"")}},{key:"removeFirstIgnoreCase",value:function(e,t){return this.replaceFirstIgnoreCase(e,t,"")}},{key:"removeEquals",value:function(e,t){return y.remove(e,t)}},{key:"removeEqualsIgnoreCase",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.equalsIgnoreCase(e,t)}))})):e}},{key:"removeIncludes",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.includes(e,t)}))})):e}},{key:"removeIncludesIgnoreCase",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.includesIgnoreCase(e,t)}))})):e}},{key:"replaceAll",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"g"),null!=n?n:"")}},{key:"replaceAllIgnoreCase",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"gi"),null!=n?n:"")}},{key:"replaceFirst",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(t,null!=n?n:"")}},{key:"replaceFirstIgnoreCase",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"i"),null!=n?n:"")}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e){var u=e.split(t,n);if(u&&0!==u.length)return r?u.map((function(e){return e?e.trim():e})):u}}},{key:"startsWith",value:function(e,t){return e&&t?!(e.length<t.length)&&e.startsWith(t):e===t}},{key:"startsWithIgnoreCase",value:function(e,t){return e&&t?!(e.length<t.length)&&e.toLowerCase().startsWith(t.toLowerCase()):e===t}},{key:"startsWithAny",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.startsWith(e,t)}))}},{key:"startsWithAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.startsWithIgnoreCase(e,t)}))}},{key:"substringAfter",value:function(e,t){if(e&&t&&0!==t.length){var n=e.indexOf(t);return-1===n?void 0:e.substring(n+t.length)}}},{key:"substringAfterLast",value:function(e,t){if(e&&t&&0!==t.length){var n=e.lastIndexOf(t);return-1===n?void 0:e.substring(n+t.length)}}},{key:"substringBefore",value:function(e,t){if(e&&t&&0!==t.length){var n=e.indexOf(t);return-1===n?void 0:e.substring(0,n)}}},{key:"substringBeforeLast",value:function(e,t){if(e&&t&&0!==t.length){var n=e.lastIndexOf(t);return-1===n?void 0:e.substring(0,n)}}},{key:"toCamelCase",value:function(e,t){var n=this;if(!e||0===e.length)return e;var r=c.extractWords(e,t);return r?r.reduce((function(e,t,r){return t=t.toLowerCase(),e+(r>0?n.capitalizeFirst(t):t)}),""):void 0}},{key:"toKebabCase",value:function(e,t){if(!e||0===e.length)return e;var n=c.extractWords(e,t);return n?n.reduce((function(e,t,n){return e+(n>0?"-":"")+t.toLowerCase()}),""):void 0}},{key:"trim",value:function(e,t){if(!e)return e;var n=e.trim();return t&&this.isEmpty(n)?null:n}}]),e}(),y=function(){function e(){a()(this,e)}return s()(e,null,[{key:"firstNotNil",value:function(e){return this.isEmpty(e)?void 0:e.find((function(e){return f.isNotNil(e)}))}},{key:"firstNotEmpty",value:function(e){return this.isEmpty(e)?void 0:e.find((function(e){return f.isNotEmpty(e)}))}},{key:"asArray",value:function(e){return e?[e]:void 0}},{key:"getFirst",value:function(e){return e&&0!==e.length?e[0]:void 0}},{key:"getLast",value:function(e){return e&&0!==e.length?e[e.length-1]:void 0}},{key:"getLength",value:function(e){return e?e.length:0}},{key:"getTypeof",value:function(e){if(!this.isEmpty(e))return null==e?void 0:e.map((function(e){return Array.isArray(e)?"array":"object"===i()(e)?null===e?"null":"object":i()(e)}))}},{key:"isEmpty",value:function(e){return!e||0===e.length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isTypeof",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!this.isEmpty(e)&&!v.isBlank(t)&&(null==e?void 0:e.every((function(e){return i()(e)===t||n&&null===e&&v.equalsAny(t,["string","object"])})))}},{key:"includes",value:function(e,t){return!!e&&!!t&&e.includes(t)}},{key:"includesAll",value:function(e,t){return!!e&&!!t&&t.every((function(t){return e.includes(t)}))}},{key:"includesAny",value:function(e,t){return!!e&&!!t&&t.some((function(t){return e.includes(t)}))}},{key:"insert",value:function(e,t,n){if(void 0===t||!n||0===n.length)return e;if(!e||0===e.length)return n;if(t<0||t>=e.length)return e.concat(n);if(0===t)return n.concat(e);var r=Math.min(t,e.length);return e.slice(0,r).concat(n).concat(e.slice(r))}},{key:"maxLength",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.isEmpty(t))return 0;for(var r=0,u=0,i=t;u<i.length;u++){var o=i[u];r=Math.max(r,this.getLength(o))}return r}},{key:"minLength",value:function(){for(var e,n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];if(this.isEmpty(r))return 0;var i,o=null===(e=r[0])||void 0===e?void 0:e.length,a=t()(r.slice(1));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(0===(o=Math.min(o,this.getLength(l))))break}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"remove",value:function(e,t){return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.includes(e)})):e}},{key:"reverse",value:function(e,t,n){if(!this.isEmpty(e))for(var r=Math.max(t||0,0),u=Math.min(n||this.getLength(e),this.getLength(e))-1;e&&u>r;){var i=e[u];e[u]=e[r],e[r]=i,u--,r++}}}]),e}(),h=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allTrue",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isTrue(e)}))}},{key:"allNotTrue",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isNotTrue(e)}))}},{key:"allFalse",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isFalse(e)}))}},{key:"allNotFalse",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isNotFalse(e)}))}},{key:"anyTrue",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isTrue(e)}))}},{key:"anyNotTrue",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNotTrue(e)}))}},{key:"anyFalse",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isFalse(e)}))}},{key:"anyNotFalse",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNotFalse(e)}))}},{key:"isTrue",value:function(e){return"boolean"==typeof e?e:"number"==typeof e?e>0:"string"==typeof e&&v.equalsAnyIgnoreCase(e,["true","yes","on","y","t","1"])}},{key:"isNotTrue",value:function(e){return null==e||("boolean"==typeof e?!e:this.isFalse(e))}},{key:"isFalse",value:function(e){return"boolean"==typeof e?!e:"number"==typeof e?e<=0:"string"==typeof e&&v.equalsAnyIgnoreCase(e,["false","no","off","n","f","0"])}},{key:"isNotFalse",value:function(e){return null==e||("boolean"==typeof e?e:this.isTrue(e))}},{key:"toString",value:function(e,t,n,r){return f.isNil(e)?r:e?t:n}},{key:"toStringTrueFalse",value:function(e){return this.toString(e,"true","false",void 0)}},{key:"toStringOnOff",value:function(e){return this.toString(e,"on","off",void 0)}},{key:"toStringYesNo",value:function(e){return this.toString(e,"yes","no",void 0)}},{key:"toStringYN",value:function(e){return this.toString(e,"Y","N",void 0)}},{key:"toStringTF",value:function(e){return this.toString(e,"T","F",void 0)}},{key:"toString10",value:function(e){return this.toString(e,"1","0",void 0)}}]),e}(),g=function(){function e(){a()(this,e)}return s()(e,null,[{key:"addYear",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setFullYear(e.getFullYear()+t),n}},{key:"addMonth",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setMonth(e.getMonth()+t),n}},{key:"addDay",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setDate(e.getDate()+t),n}},{key:"formatDateTime",value:function(e,t){if(!v.isBlank(t)){var n={"y+":e.getFullYear(),"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours()%12==0?12:e.getHours()%12,"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()},r=t;for(var u in n){var i=new RegExp("(".concat(u,")")).exec(r);i&&(r=/(y+)/.test(u)?r.replace(i[1],n[u].toString().substring(4-i[1].length)):r.replace(i[1],1===i[1].length?n[u].toString():n[u].toString().padStart(i[1].length,"0")))}return r}}},{key:"getCurrentDate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"yyyy-MM-dd";return this.formatDateTime(new Date,e)}},{key:"getCurrentDateTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"yyyy-MM-dd hh:mm:ss";return this.formatDateTime(new Date,e)}},{key:"getCurrentTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hh:mm:ss";return this.formatDateTime(new Date,e)}},{key:"getStartOfYear",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}},{key:"getStartOfMonth",value:function(e){var t=new Date(e);return t.setDate(1),t.setHours(0,0,0,0),t}},{key:"getStartOfDay",value:function(e){var t=new Date(e);return t.setHours(0,0,0,0),t}},{key:"getEndOfYear",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear()+1,0,0),t.setHours(23,59,59,999),t}},{key:"getEndOfMonth",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t.setHours(23,59,59,999),t}},{key:"getEndOfDay",value:function(e){var t=new Date(e);return t.setHours(23,59,59,999),t}},{key:"getTimezone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getTimezoneOffset(),n=Math.abs(t),r=Math.floor(n/60),u=n%60,i=u>0?":"+("0"+u).slice(-2):"";return(t<0?"+":"-")+r+i}},{key:"isFirstDayOfMonth",value:function(e){return 1===e.getDate()}},{key:"isLastDayOfMonth",value:function(e){return this.isSameDay(this.getEndOfDay(e),this.getEndOfMonth(e))}},{key:"isLeapYear",value:function(e){var t=e instanceof Date?e.getFullYear():e;return!((t%4||!(t%100))&&t%400)}},{key:"isSameYear",value:function(e,t){return e.getFullYear()===t.getFullYear()}},{key:"isSameMonth",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.getMonth()===t.getMonth()&&(!n||e.getFullYear()===t.getFullYear())}},{key:"isSameDay",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.getDate()===t.getDate()&&(!n||e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}},{key:"isWeekend",value:function(e){return 0===e.getDay()||6===e.getDay()}},{key:"isYesterday",value:function(e){return this.isSameDay(new Date,this.addDay(e,1))}},{key:"isTomorrow",value:function(e){return this.isSameDay(new Date,this.addDay(e,-1))}}]),e}(),p=function(){function e(){a()(this,e)}return s()(e,null,[{key:"isJsonString",value:function(e){if(v.isBlank(e))return!1;try{if("string"==typeof e&&"object"===i()(JSON.parse(e)))return!0}catch(e){}return!1}},{key:"toJsonString",value:function(e){if("string"==typeof e&&e.length>0)try{var t=JSON.parse(e);if("object"===i()(t))return JSON.stringify(t)}catch(e){}if(f.isPlainObject(e))return JSON.stringify(e)}}]),e}(),d=function(){function e(){a()(this,e)}return s()(e,null,[{key:"isInteger",value:function(e){return!!e&&Math.floor(e)===Math.ceil(e)}},{key:"toInteger",value:function(e){if(e)try{var t=Number.parseInt(e);return Number.isNaN(t)?void 0:t}catch(e){}}},{key:"toFloat",value:function(e){if(e)try{var t=Number.parseFloat(e);return Number.isNaN(t)?void 0:t}catch(e){}}},{key:"max",value:function(e){if(e&&0!==(null==e?void 0:e.length)){for(var t=e[0],n=1;n<e.length;n++)t<e[n]&&(t=e[n]);return t}}},{key:"min",value:function(e){if(e&&0!==(null==e?void 0:e.length)){for(var t=e[0],n=1;n<e.length;n++)t>e[n]&&(t=e[n]);return t}}},{key:"sum",value:function(e){return e.reduce((function(e,t){return e+t}))}},{key:"average",value:function(e){return this.sum(e)/e.length}}]),e}(),m=function(){function e(){a()(this,e)}return s()(e,null,[{key:"randomBoolean",value:function(){return Math.random()>=.5}},{key:"randomElement",value:function(e){return y.isNotEmpty(e)?e.at(this.randomInteger(0,e.length)):void 0}},{key:"randomElements",value:function(e,t){if(y.isEmpty(e)||t<=0)return[];if(y.getLength(e)<=t)return e;for(var n=new Set;n.size<t;)n.add(this.randomInteger(0,e.length));return e.filter((function(e,t){return n.has(t)}))}},{key:"randomInteger",value:function(e,t){return Math.floor(this.randomNumber(e,t))}},{key:"randomIntegers",value:function(e,t,n){if(e<=0)return[];for(var r=[],u=0;u<e;u++)r.push(this.randomInteger(t,n));return r}},{key:"randomNumber",value:function(e,t){var n=e||0,r=t||Number.MAX_SAFE_INTEGER-1;if(n>r)throw SyntaxError("The min value must not be greater than max value");return n===r?n:n+(r-n)*Math.random()}},{key:"randomNumbers",value:function(e,t,n){if(e<=0)return[];for(var r=[],u=0;u<e;u++)r.push(this.randomNumber(t,n));return r}}]),e}(),k=function(){function e(){a()(this,e)}return s()(e,null,[{key:"sleep",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return new Promise((function(t){setTimeout(t,e)}))}}]),e}(),b=function(){function e(){a()(this,e)}return s()(e,null,[{key:"forEach",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";if(e&&0!==e.length&&n&&r){var u,i=t()(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;n(o,e);var a=f.getProperty(o,r);a&&Array.isArray(a)&&this.forEach(a,n,r)}}catch(e){i.e(e)}finally{i.f()}}}}]),e}()}(),r}()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TsLangUtils=t():e.TsLangUtils=t()}(self,(function(){return function(){var e={317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(281);function u(e,t){for(var n=0;n<t.length;n++){var u=t[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,r(u.key),u)}}e.exports=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},746:function(e,t,n){var r=n(508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var u=0,i=function(){};return{s:i,n:function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var u=n.call(e,t||"default");if("object"!=r(u))return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},281:function(e,t,n){var r=n(944).default,u=n(224);e.exports=function(e){var t=u(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},508:function(e,t,n){var r=n(317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var u=t[r];if(void 0!==u)return u.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{ArrayUtils:function(){return y},BooleanUtils:function(){return h},DateUtils:function(){return g},JsonUtils:function(){return p},NumberUtils:function(){return d},ObjectUtils:function(){return f},RandomUtils:function(){return m},RegexUtils:function(){return c},StringUtils:function(){return v},ThreadUtils:function(){return k},TreeUtils:function(){return b}});var e=n(746),t=n.n(e),u=n(944),i=n.n(u),o=n(486),a=n.n(o),l=n(702),s=n.n(l),f=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allNil",value:function(e){var t=this;return!e||0===e.length||(null==e?void 0:e.every((function(e){return t.isNil(e)})))}},{key:"allNotNil",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotNil(e)}))}},{key:"anyNil",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNil(e)}))}},{key:"anyNotNil",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotNil(e)}))}},{key:"allEmpty",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isEmpty(e)}))}},{key:"allNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotEmpty(e)}))}},{key:"anyEmpty",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isEmpty(e)}))}},{key:"anyNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotEmpty(e)}))}},{key:"isNil",value:function(e){return null==e}},{key:"isNotNil",value:function(e){return!this.isNil(e)}},{key:"isNull",value:function(e){return null===e}},{key:"isNotNull",value:function(e){return!this.isNull(e)}},{key:"isUndefined",value:function(e){return void 0===e}},{key:"isNotUndefined",value:function(e){return!this.isUndefined(e)}},{key:"isEmpty",value:function(e){return!e||("string"==typeof e||Array.isArray(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"===i()(e)&&0===(null===(t=this.keys(e))||void 0===t?void 0:t.length));var t}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isPlainObject",value:function(e){return"object"===i()(e)&&"[object Object]"===Object.prototype.toString.call(e)}},{key:"isPromiseObject",value:function(e){return"object"===i()(e)&&"[object Promise]"===Object.prototype.toString.call(e)}},{key:"isPrototype",value:function(e){if("object"!==i()(e))return!1;var t=e.constructor;return e===("function"==typeof t?t.prototype:e.prototype)}},{key:"getProperty",value:function(e,t){if("object"===i()(e)&&t&&0!==t.length){if(!t.includes("."))return e[t];var n=t.replace(/\[/g,".").replace(/]/g,"").split(".");if(n&&0!==n.length)return 1===n.length?e[n[0]]:n.reduce((function(e,t){return(e||{})[t]}),e)}}},{key:"hasProperty",value:function(e,t){return"object"===i()(e)&&!!t&&(null==t?void 0:t.length)>0&&Object.prototype.hasOwnProperty.call(e,t)}},{key:"setProperty",value:function(e,t,n){this.isPlainObject(e)&&t&&(e[t]=n)}},{key:"keys",value:function(e){if(!e)return[];if(!this.isPrototype(e))return Object.keys(e);var t=[];for(var n in Object(e))"constructor"!==n&&this.hasProperty(e,n)&&t.push(n);return t}},{key:"toString",value:function(e,t){return e?e.toString():t}},{key:"toStringTag",value:function(e,t){return e?e[Symbol.toStringTag]:t}}]),e}(),c=function(){function e(){a()(this,e)}return s()(e,null,[{key:"extractWords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;return e&&e.match(t)||void 0}}]),e}(),v=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allEmpty",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isEmpty(e)}))}},{key:"allNotEmpty",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotEmpty(e)}))}},{key:"allBlank",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isBlank(e)}))}},{key:"allNotBlank",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isNotBlank(e)}))}},{key:"anyEmpty",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isEmpty(e)}))}},{key:"anyNotEmpty",value:function(e){var t=this;return!!e&&(null==e?void 0:e.length)>0&&e.some((function(e){return t.isNotEmpty(e)}))}},{key:"anyBlank",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isBlank(e)}))}},{key:"anyNotBlank",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isNotBlank(e)}))}},{key:"appendIfMissing",value:function(e,t){return!e||this.isEmpty(t)||this.endsWith(e,t)?e:e+t}},{key:"appendIfMissingIgnoreCase",value:function(e,t){return!e||this.isEmpty(t)||this.endsWithIgnoreCase(e,t)?e:e+t}},{key:"capitalizeFirst",value:function(e){return e?e.charAt(0).toUpperCase()+e.substring(1):e}},{key:"capitalizeFirstLowerTail",value:function(e){var t;return e?e.charAt(0).toUpperCase()+(null===(t=e.substring(1))||void 0===t?void 0:t.toLowerCase()):e}},{key:"defaultString",value:function(e){return e||""}},{key:"defaultIfEmpty",value:function(e,t){return this.isEmpty(e)?t:e}},{key:"defaultIfBlank",value:function(e,t){return this.isBlank(e)?t:e}},{key:"endsWith",value:function(e,t){return e&&t?!(e.length<t.length)&&e.endsWith(t):e===t}},{key:"endsWithIgnoreCase",value:function(e,t){return e&&t?!(e.length<t.length)&&e.toLowerCase().endsWith(t.toLowerCase()):e===t}},{key:"endsWithAny",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.endsWith(e,t)}))}},{key:"endsWithAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.endsWithIgnoreCase(e,t)}))}},{key:"equals",value:function(e,t){return e===t||!(!e||!t||(null==e?void 0:e.length)!==(null==t?void 0:t.length))&&e===t}},{key:"equalsIgnoreCase",value:function(e,t){return e===t||!(!e||!t||(null==e?void 0:e.length)!==(null==t?void 0:t.length))&&(null==e?void 0:e.toUpperCase())===(null==t?void 0:t.toUpperCase())}},{key:"equalsAny",value:function(e,t){return y.includes(t,e)}},{key:"equalsAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.equalsIgnoreCase(e,t)}))}},{key:"filterIgnoreEmpty",value:function(e){var t=this;if(e&&0!==e.length){var n=e.filter((function(e){return t.isNotEmpty(e)}));return n&&0!==n.length?n:void 0}}},{key:"filterIgnoreBlank",value:function(e){var t=this;if(e&&0!==e.length){var n=e.filter((function(e){return t.isNotBlank(e)}));return n&&0!==n.length?n:void 0}}},{key:"formatBrace",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!e||e.length<=2||!n||0===n.length)return e;for(var u=e,i=0,o=n;i<o.length;i++){var a=o[i];u=u.replace("{}",f.toString(a,""))}return u}},{key:"formatPercent",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!e||e.length<=2||!n||0===n.length)return e;var u=e.match(/%[bcdfjosxX]/g)||[],i=y.minLength(u,n);if(0===i)return e;for(var o=e,a=0;a<i;a++){var l=n[a],s=u[a].substring(1);switch(s){case"b":case"c":case"d":case"o":case"x":case"X":try{var c=void 0;"string"==typeof l?c=Number.parseInt(l):l instanceof String?c=Number.parseInt(l.toString()):"number"==typeof l&&(c=l),c&&("b"===s?o=o.replace("%".concat(s),c.toString(2)):"c"===s?o=o.replace("%".concat(s),String.fromCharCode(c)):"d"===s?o=o.replace("%".concat(s),c.toString(10)):"o"===s?o=o.replace("%".concat(s),"0"+c.toString(8)):"x"===s?o=o.replace("%".concat(s),"0x"+c.toString(16)):"X"===s&&(o=o.replace("%".concat(s),"0x"+c.toString(16).toUpperCase())))}catch(e){throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a))}break;case"f":try{var v=void 0;"string"==typeof l?v=Number.parseFloat(l):l instanceof String?v=Number.parseFloat(l.toString()):"number"==typeof l&&(v=l),v&&(o=o.replace("%".concat(s),"0x"+v.toString()))}catch(e){throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a))}break;case"j":if(null==l){o=o.replace("%".concat(s),"");break}if(f.isPlainObject(l)){o=o.replace("%".concat(s),JSON.stringify(l));break}throw new TypeError("Invalid parameter type of '".concat(l,"', index ").concat(a));case"s":o=o.replace("%".concat(s),f.toString(l,""))}}return o}},{key:"formatPlaceholder",value:function(e,t){if(!e||e.length<=2||!t)return e;var n=e;for(var r in t){var u=new RegExp("\\{".concat(r,"\\}"),"g"),i=t[r];n=n.replace(u,i?i.toString():"")}return n}},{key:"getLength",value:function(e){return e?e.length:0}},{key:"isEmpty",value:function(e){return!e||0===e.length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isBlank",value:function(e){return!e||0===(null==e?void 0:e.length)||/^\s*$/.test(e)}},{key:"isNotBlank",value:function(e){return!this.isBlank(e)}},{key:"includes",value:function(e,t){return e===t||!!e&&!!t&&e.includes(t)}},{key:"includesIgnoreCase",value:function(e,t){var n;return e===t||!!e&&!!t&&(null==e||null===(n=e.toUpperCase())||void 0===n?void 0:n.includes(null==t?void 0:t.toUpperCase()))}},{key:"includesAny",value:function(e,t){var n=this;return!(!e||!t)&&(null==t?void 0:t.some((function(t){return n.includes(e,t)})))}},{key:"includesAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&(null==t?void 0:t.some((function(t){return n.includesIgnoreCase(e,t)})))}},{key:"joinWith",value:function(e,t,n){if(e&&(!Array.isArray(e)||0!==e.length)){if(Array.isArray(e)){if(!n)return e.join(this.defaultString(t));var r=e.filter(n);return r&&0!==r.length?r.join(this.defaultString(t)):void 0}return n?n(e)?e:void 0:e}}},{key:"prependIfMissing",value:function(e,t){return!e||this.isEmpty(t)||this.startsWith(e,t)?e:t+e}},{key:"prependIfMissingIgnoreCase",value:function(e,t){return!e||this.isEmpty(t)||this.startsWithIgnoreCase(e,t)?e:t+e}},{key:"removeAll",value:function(e,t){return this.replaceAll(e,t,"")}},{key:"removeAllIgnoreCase",value:function(e,t){return this.replaceAllIgnoreCase(e,t,"")}},{key:"removeFirst",value:function(e,t){return this.replaceFirst(e,t,"")}},{key:"removeFirstIgnoreCase",value:function(e,t){return this.replaceFirstIgnoreCase(e,t,"")}},{key:"removeEquals",value:function(e,t){return y.remove(e,t)}},{key:"removeEqualsIgnoreCase",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.equalsIgnoreCase(e,t)}))})):e}},{key:"removeIncludes",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.includes(e,t)}))})):e}},{key:"removeIncludesIgnoreCase",value:function(e,t){var n=this;return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.some((function(t){return n.includesIgnoreCase(e,t)}))})):e}},{key:"replaceAll",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"g"),null!=n?n:"")}},{key:"replaceAllIgnoreCase",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"gi"),null!=n?n:"")}},{key:"replaceFirst",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(t,null!=n?n:"")}},{key:"replaceFirstIgnoreCase",value:function(e,t,n){return this.isEmpty(e)||!t?e:null==e?void 0:e.replace(new RegExp(t,"i"),null!=n?n:"")}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e){var u=e.split(t,n);if(u&&0!==u.length)return r?u.map((function(e){return e?e.trim():e})):u}}},{key:"startsWith",value:function(e,t){return e&&t?!(e.length<t.length)&&e.startsWith(t):e===t}},{key:"startsWithIgnoreCase",value:function(e,t){return e&&t?!(e.length<t.length)&&e.toLowerCase().startsWith(t.toLowerCase()):e===t}},{key:"startsWithAny",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.startsWith(e,t)}))}},{key:"startsWithAnyIgnoreCase",value:function(e,t){var n=this;return!(!e||!t||0===t.length)&&t.some((function(t){return n.startsWithIgnoreCase(e,t)}))}},{key:"substringAfter",value:function(e,t){if(e&&t&&0!==t.length){var n=e.indexOf(t);return-1===n?void 0:e.substring(n+t.length)}}},{key:"substringAfterLast",value:function(e,t){if(e&&t&&0!==t.length){var n=e.lastIndexOf(t);return-1===n?void 0:e.substring(n+t.length)}}},{key:"substringBefore",value:function(e,t){if(e&&t&&0!==t.length){var n=e.indexOf(t);return-1===n?void 0:e.substring(0,n)}}},{key:"substringBeforeLast",value:function(e,t){if(e&&t&&0!==t.length){var n=e.lastIndexOf(t);return-1===n?void 0:e.substring(0,n)}}},{key:"toCamelCase",value:function(e,t){var n=this;if(!e||0===e.length)return e;var r=c.extractWords(e,t);return r?r.reduce((function(e,t,r){return t=t.toLowerCase(),e+(r>0?n.capitalizeFirst(t):t)}),""):void 0}},{key:"toKebabCase",value:function(e,t){if(!e||0===e.length)return e;var n=c.extractWords(e,t);return n?n.reduce((function(e,t,n){return e+(n>0?"-":"")+t.toLowerCase()}),""):void 0}},{key:"trim",value:function(e,t){if(!e)return e;var n=e.trim();return t&&this.isEmpty(n)?null:n}}]),e}(),y=function(){function e(){a()(this,e)}return s()(e,null,[{key:"firstNotNil",value:function(e){return this.isEmpty(e)?void 0:e.find((function(e){return f.isNotNil(e)}))}},{key:"firstNotEmpty",value:function(e){return this.isEmpty(e)?void 0:e.find((function(e){return f.isNotEmpty(e)}))}},{key:"getFirst",value:function(e){return e&&0!==e.length?e[0]:void 0}},{key:"getLast",value:function(e){return e&&0!==e.length?e[e.length-1]:void 0}},{key:"getLength",value:function(e){return e?e.length:0}},{key:"getTypeof",value:function(e){if(!this.isEmpty(e))return null==e?void 0:e.map((function(e){return Array.isArray(e)?"array":"object"===i()(e)?null===e?"null":"object":i()(e)}))}},{key:"isEmpty",value:function(e){return!e||0===e.length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isTypeof",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!this.isEmpty(e)&&!v.isBlank(t)&&(null==e?void 0:e.every((function(e){return i()(e)===t||n&&null===e&&v.equalsAny(t,["string","object"])})))}},{key:"includes",value:function(e,t){return!!e&&!!t&&e.includes(t)}},{key:"includesAll",value:function(e,t){return!!e&&!!t&&t.every((function(t){return e.includes(t)}))}},{key:"includesAny",value:function(e,t){return!!e&&!!t&&t.some((function(t){return e.includes(t)}))}},{key:"insert",value:function(e,t,n){if(void 0===t||!n||0===n.length)return e;if(!e||0===e.length)return n;if(t<0||t>=e.length)return e.concat(n);if(0===t)return n.concat(e);var r=Math.min(t,e.length);return e.slice(0,r).concat(n).concat(e.slice(r))}},{key:"maxLength",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.isEmpty(t))return 0;for(var r=0,u=0,i=t;u<i.length;u++){var o=i[u];r=Math.max(r,this.getLength(o))}return r}},{key:"minLength",value:function(){for(var e,n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];if(this.isEmpty(r))return 0;var i,o=null===(e=r[0])||void 0===e?void 0:e.length,a=t()(r.slice(1));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(0===(o=Math.min(o,this.getLength(l))))break}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"readonly",value:function(e){return e?Object.freeze(e):e}},{key:"remove",value:function(e,t){return e&&0!==e.length&&t&&0!==t.length?e.filter((function(e){return!t.includes(e)})):e}},{key:"reverse",value:function(e,t,n){if(!this.isEmpty(e))for(var r=Math.max(t||0,0),u=Math.min(n||this.getLength(e),this.getLength(e))-1;e&&u>r;){var i=e[u];e[u]=e[r],e[r]=i,u--,r++}}},{key:"singleton",value:function(e){return e?[e]:void 0}}]),e}(),h=function(){function e(){a()(this,e)}return s()(e,null,[{key:"allTrue",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isTrue(e)}))}},{key:"allNotTrue",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isNotTrue(e)}))}},{key:"allFalse",value:function(e){var t=this;return!!e&&e.length>0&&e.every((function(e){return t.isFalse(e)}))}},{key:"allNotFalse",value:function(e){var t=this;return!e||0===e.length||e.every((function(e){return t.isNotFalse(e)}))}},{key:"anyTrue",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isTrue(e)}))}},{key:"anyNotTrue",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNotTrue(e)}))}},{key:"anyFalse",value:function(e){var t=this;return!!e&&e.length>0&&e.some((function(e){return t.isFalse(e)}))}},{key:"anyNotFalse",value:function(e){var t=this;return!e||0===e.length||e.some((function(e){return t.isNotFalse(e)}))}},{key:"isTrue",value:function(e){return"boolean"==typeof e?e:"number"==typeof e?e>0:"string"==typeof e&&v.equalsAnyIgnoreCase(e,["true","yes","on","y","t","1"])}},{key:"isNotTrue",value:function(e){return null==e||("boolean"==typeof e?!e:this.isFalse(e))}},{key:"isFalse",value:function(e){return"boolean"==typeof e?!e:"number"==typeof e?e<=0:"string"==typeof e&&v.equalsAnyIgnoreCase(e,["false","no","off","n","f","0"])}},{key:"isNotFalse",value:function(e){return null==e||("boolean"==typeof e?e:this.isTrue(e))}},{key:"toString",value:function(e,t,n,r){return f.isNil(e)?r:e?t:n}},{key:"toStringTrueFalse",value:function(e){return this.toString(e,"true","false",void 0)}},{key:"toStringOnOff",value:function(e){return this.toString(e,"on","off",void 0)}},{key:"toStringYesNo",value:function(e){return this.toString(e,"yes","no",void 0)}},{key:"toStringYN",value:function(e){return this.toString(e,"Y","N",void 0)}},{key:"toStringTF",value:function(e){return this.toString(e,"T","F",void 0)}},{key:"toString10",value:function(e){return this.toString(e,"1","0",void 0)}}]),e}(),g=function(){function e(){a()(this,e)}return s()(e,null,[{key:"addYear",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setFullYear(e.getFullYear()+t),n}},{key:"addMonth",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setMonth(e.getMonth()+t),n}},{key:"addDay",value:function(e,t){if(!t)return e;var n=new Date(e);return n.setDate(e.getDate()+t),n}},{key:"formatDateTime",value:function(e,t){if(!v.isBlank(t)){var n={"y+":e.getFullYear(),"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours()%12==0?12:e.getHours()%12,"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()},r=t;for(var u in n){var i=new RegExp("(".concat(u,")")).exec(r);i&&(r=/(y+)/.test(u)?r.replace(i[1],n[u].toString().substring(4-i[1].length)):r.replace(i[1],1===i[1].length?n[u].toString():n[u].toString().padStart(i[1].length,"0")))}return r}}},{key:"getCurrentDate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"yyyy-MM-dd";return this.formatDateTime(new Date,e)}},{key:"getCurrentDateTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"yyyy-MM-dd hh:mm:ss";return this.formatDateTime(new Date,e)}},{key:"getCurrentTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hh:mm:ss";return this.formatDateTime(new Date,e)}},{key:"getStartOfYear",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}},{key:"getStartOfMonth",value:function(e){var t=new Date(e);return t.setDate(1),t.setHours(0,0,0,0),t}},{key:"getStartOfDay",value:function(e){var t=new Date(e);return t.setHours(0,0,0,0),t}},{key:"getEndOfYear",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear()+1,0,0),t.setHours(23,59,59,999),t}},{key:"getEndOfMonth",value:function(e){var t=new Date(e);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t.setHours(23,59,59,999),t}},{key:"getEndOfDay",value:function(e){var t=new Date(e);return t.setHours(23,59,59,999),t}},{key:"getTimezone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getTimezoneOffset(),n=Math.abs(t),r=Math.floor(n/60),u=n%60,i=u>0?":"+("0"+u).slice(-2):"";return(t<0?"+":"-")+r+i}},{key:"isFirstDayOfMonth",value:function(e){return 1===e.getDate()}},{key:"isLastDayOfMonth",value:function(e){return this.isSameDay(this.getEndOfDay(e),this.getEndOfMonth(e))}},{key:"isLeapYear",value:function(e){var t=e instanceof Date?e.getFullYear():e;return!((t%4||!(t%100))&&t%400)}},{key:"isSameYear",value:function(e,t){return e.getFullYear()===t.getFullYear()}},{key:"isSameMonth",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.getMonth()===t.getMonth()&&(!n||e.getFullYear()===t.getFullYear())}},{key:"isSameDay",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.getDate()===t.getDate()&&(!n||e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}},{key:"isWeekend",value:function(e){return 0===e.getDay()||6===e.getDay()}},{key:"isYesterday",value:function(e){return this.isSameDay(new Date,this.addDay(e,1))}},{key:"isTomorrow",value:function(e){return this.isSameDay(new Date,this.addDay(e,-1))}}]),e}(),p=function(){function e(){a()(this,e)}return s()(e,null,[{key:"isJsonString",value:function(e){if(v.isBlank(e))return!1;try{if("string"==typeof e&&"object"===i()(JSON.parse(e)))return!0}catch(e){}return!1}},{key:"toJsonString",value:function(e){if("string"==typeof e&&e.length>0)try{var t=JSON.parse(e);if("object"===i()(t))return JSON.stringify(t)}catch(e){}if(f.isPlainObject(e))return JSON.stringify(e)}}]),e}(),d=function(){function e(){a()(this,e)}return s()(e,null,[{key:"isInteger",value:function(e){return!!e&&Math.floor(e)===Math.ceil(e)}},{key:"toInteger",value:function(e){if(e)try{var t=Number.parseInt(e);return Number.isNaN(t)?void 0:t}catch(e){}}},{key:"toFloat",value:function(e){if(e)try{var t=Number.parseFloat(e);return Number.isNaN(t)?void 0:t}catch(e){}}},{key:"max",value:function(e){if(e&&0!==(null==e?void 0:e.length)){for(var t=e[0],n=1;n<e.length;n++)t<e[n]&&(t=e[n]);return t}}},{key:"min",value:function(e){if(e&&0!==(null==e?void 0:e.length)){for(var t=e[0],n=1;n<e.length;n++)t>e[n]&&(t=e[n]);return t}}},{key:"sum",value:function(e){return e.reduce((function(e,t){return e+t}))}},{key:"average",value:function(e){return this.sum(e)/e.length}}]),e}(),m=function(){function e(){a()(this,e)}return s()(e,null,[{key:"randomBoolean",value:function(){return Math.random()>=.5}},{key:"randomElement",value:function(e){return y.isNotEmpty(e)?e.at(this.randomInteger(0,e.length)):void 0}},{key:"randomElements",value:function(e,t){if(y.isEmpty(e)||t<=0)return[];if(y.getLength(e)<=t)return e;for(var n=new Set;n.size<t;)n.add(this.randomInteger(0,e.length));return e.filter((function(e,t){return n.has(t)}))}},{key:"randomInteger",value:function(e,t){return Math.floor(this.randomNumber(e,t))}},{key:"randomIntegers",value:function(e,t,n){if(e<=0)return[];for(var r=[],u=0;u<e;u++)r.push(this.randomInteger(t,n));return r}},{key:"randomNumber",value:function(e,t){var n=e||0,r=t||Number.MAX_SAFE_INTEGER-1;if(n>r)throw SyntaxError("The min value must not be greater than max value");return n===r?n:n+(r-n)*Math.random()}},{key:"randomNumbers",value:function(e,t,n){if(e<=0)return[];for(var r=[],u=0;u<e;u++)r.push(this.randomNumber(t,n));return r}}]),e}(),k=function(){function e(){a()(this,e)}return s()(e,null,[{key:"sleep",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return new Promise((function(t){setTimeout(t,e)}))}}]),e}(),b=function(){function e(){a()(this,e)}return s()(e,null,[{key:"forEach",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";if(e&&0!==e.length&&n&&r){var u,i=t()(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;n(o,e);var a=f.getProperty(o,r);a&&Array.isArray(a)&&this.forEach(a,n,r)}}catch(e){i.e(e)}finally{i.f()}}}}]),e}()}(),r}()}));
{
"name": "@yookue/ts-lang-utils",
"version": "0.1.32",
"version": "0.1.33",
"title": "TsLangUtils",

@@ -5,0 +5,0 @@ "description": "Common Lang Utilities for TypeScript",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc