New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@yookue/ts-lang-utils

Package Overview
Dependencies
Maintainers
1
Versions
79
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.19 to 0.1.20

12

dist/cjs/util/ArrayUtils.d.ts

@@ -124,2 +124,14 @@ /**

/**
* Returns the array that excludes the given elements
*
* @param {Array<any>} array the arrays to inspect
* @param {Array<any>} excludes the elements array to exclude
*
* @return the array that excludes the given elements
*
* @example
* ArrayUtils.remove(['foo', 'bar'], ['bar']); // ['foo']
*/
static remove<T>(array?: T[], excludes?: T[]): T[] | undefined;
/**
* Reverses the given array

@@ -126,0 +138,0 @@ *

@@ -197,2 +197,16 @@ var __defProp = Object.defineProperty;

/**
* Returns the array that excludes the given elements
*
* @param {Array<any>} array the arrays to inspect
* @param {Array<any>} excludes the elements array to exclude
*
* @return the array that excludes the given elements
*
* @example
* ArrayUtils.remove(['foo', 'bar'], ['bar']); // ['foo']
*/
static remove(array, excludes) {
return !array || array.length === 0 || !excludes || excludes.length === 0 ? array : array.filter((item) => !excludes.includes(item));
}
/**
* Reverses the given array

@@ -199,0 +213,0 @@ *

22

dist/cjs/util/BooleanUtils.d.ts

@@ -13,3 +13,3 @@ /**

*
* @returns {boolean} whether the given value can be converted to true
* @return {boolean} whether the given value can be converted to true
*

@@ -28,3 +28,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to false
* @return {boolean} whether the given value is nil or can be converted to false
*

@@ -43,3 +43,3 @@ * @example

*
* @returns {boolean} whether the given value can be converted to false
* @return {boolean} whether the given value can be converted to false
*

@@ -58,3 +58,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to true
* @return {boolean} whether the given value is nil or can be converted to true
*

@@ -76,3 +76,3 @@ * @example

*
* @returns {string} a string value from the boolean value
* @return {string} a string value from the boolean value
*

@@ -88,3 +88,3 @@ * @example

*
* @returns {string} the string value of 'true'/'false' from the boolean value
* @return {string} the string value of 'true'/'false' from the boolean value
*

@@ -100,3 +100,3 @@ * @example

*
* @returns {string} the string value of 'on'/'off' from the boolean value
* @return {string} the string value of 'on'/'off' from the boolean value
*

@@ -112,3 +112,3 @@ * @example

*
* @returns {string} the string value of 'yes'/'no' from the boolean value
* @return {string} the string value of 'yes'/'no' from the boolean value
*

@@ -124,3 +124,3 @@ * @example

*
* @returns {string} the string value of 'Y'/'N' from the boolean value
* @return {string} the string value of 'Y'/'N' from the boolean value
*

@@ -136,3 +136,3 @@ * @example

*
* @returns {string} the string value of 'T'/'F' from the boolean value
* @return {string} the string value of 'T'/'F' from the boolean value
*

@@ -148,3 +148,3 @@ * @example

*
* @returns {string} the string value of '1'/'0' from the boolean value
* @return {string} the string value of '1'/'0' from the boolean value
*

@@ -151,0 +151,0 @@ * @example

@@ -33,3 +33,3 @@ var __defProp = Object.defineProperty;

*
* @returns {boolean} whether the given value can be converted to true
* @return {boolean} whether the given value can be converted to true
*

@@ -57,3 +57,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to false
* @return {boolean} whether the given value is nil or can be converted to false
*

@@ -79,3 +79,3 @@ * @example

*
* @returns {boolean} whether the given value can be converted to false
* @return {boolean} whether the given value can be converted to false
*

@@ -103,3 +103,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to true
* @return {boolean} whether the given value is nil or can be converted to true
*

@@ -128,3 +128,3 @@ * @example

*
* @returns {string} a string value from the boolean value
* @return {string} a string value from the boolean value
*

@@ -142,3 +142,3 @@ * @example

*
* @returns {string} the string value of 'true'/'false' from the boolean value
* @return {string} the string value of 'true'/'false' from the boolean value
*

@@ -156,3 +156,3 @@ * @example

*
* @returns {string} the string value of 'on'/'off' from the boolean value
* @return {string} the string value of 'on'/'off' from the boolean value
*

@@ -170,3 +170,3 @@ * @example

*
* @returns {string} the string value of 'yes'/'no' from the boolean value
* @return {string} the string value of 'yes'/'no' from the boolean value
*

@@ -184,3 +184,3 @@ * @example

*
* @returns {string} the string value of 'Y'/'N' from the boolean value
* @return {string} the string value of 'Y'/'N' from the boolean value
*

@@ -198,3 +198,3 @@ * @example

*
* @returns {string} the string value of 'T'/'F' from the boolean value
* @return {string} the string value of 'T'/'F' from the boolean value
*

@@ -212,3 +212,3 @@ * @example

*
* @returns {string} the string value of '1'/'0' from the boolean value
* @return {string} the string value of '1'/'0' from the boolean value
*

@@ -215,0 +215,0 @@ * @example

@@ -148,3 +148,3 @@ /**

*
* @returns {string} the timezone of the given date
* @return {string} the timezone of the given date
*/

@@ -151,0 +151,0 @@ static getTimezone(date?: Date): string;

@@ -249,3 +249,3 @@ var __defProp = Object.defineProperty;

*
* @returns {string} the timezone of the given date
* @return {string} the timezone of the given date
*/

@@ -252,0 +252,0 @@ static getTimezone(date = /* @__PURE__ */ new Date()) {

@@ -13,3 +13,3 @@ /**

*
* @returns {boolean} whether the given value is an integer
* @return {boolean} whether the given value is an integer
*

@@ -25,3 +25,3 @@ * @example

*
* @returns {number} an integer value from the string value, or undefined if the value cannot be converted
* @return {number} an integer value from the string value, or undefined if the value cannot be converted
*

@@ -37,3 +37,3 @@ * @example

*
* @returns {number} a float value from the string value, or undefined if the value cannot be converted
* @return {number} a float value from the string value, or undefined if the value cannot be converted
*

@@ -49,3 +49,3 @@ * @example

*
* @returns {number} the max value of the given array
* @return {number} the max value of the given array
*

@@ -61,3 +61,3 @@ * @example

*
* @returns {number} the min value of the given array
* @return {number} the min value of the given array
*

@@ -73,3 +73,3 @@ * @example

*
* @returns {number} the sum value of the given array
* @return {number} the sum value of the given array
*

@@ -85,3 +85,3 @@ * @example

*
* @returns {number} the average value of the given array
* @return {number} the average value of the given array
*

@@ -88,0 +88,0 @@ * @example

@@ -31,3 +31,3 @@ var __defProp = Object.defineProperty;

*
* @returns {boolean} whether the given value is an integer
* @return {boolean} whether the given value is an integer
*

@@ -48,3 +48,3 @@ * @example

*
* @returns {number} an integer value from the string value, or undefined if the value cannot be converted
* @return {number} an integer value from the string value, or undefined if the value cannot be converted
*

@@ -70,3 +70,3 @@ * @example

*
* @returns {number} a float value from the string value, or undefined if the value cannot be converted
* @return {number} a float value from the string value, or undefined if the value cannot be converted
*

@@ -92,3 +92,3 @@ * @example

*
* @returns {number} the max value of the given array
* @return {number} the max value of the given array
*

@@ -115,3 +115,3 @@ * @example

*
* @returns {number} the min value of the given array
* @return {number} the min value of the given array
*

@@ -138,3 +138,3 @@ * @example

*
* @returns {number} the sum value of the given array
* @return {number} the sum value of the given array
*

@@ -152,3 +152,3 @@ * @example

*
* @returns {number} the average value of the given array
* @return {number} the average value of the given array
*

@@ -155,0 +155,0 @@ * @example

@@ -244,3 +244,3 @@ /**

*
* @returns {any} the first none nil element in the given array, or null if all elements are nil
* @return {any} the first none nil element in the given array, or null if all elements are nil
*

@@ -292,3 +292,3 @@ * @example

*
* @returns {Array<string>} the keys of the given object
* @return {Array<string>} the keys of the given object
*

@@ -295,0 +295,0 @@ * @example

@@ -318,3 +318,3 @@ var __defProp = Object.defineProperty;

*
* @returns {any} the first none nil element in the given array, or null if all elements are nil
* @return {any} the first none nil element in the given array, or null if all elements are nil
*

@@ -391,3 +391,3 @@ * @example

*
* @returns {Array<string>} the keys of the given object
* @return {Array<string>} the keys of the given object
*

@@ -394,0 +394,0 @@ * @example

@@ -457,2 +457,50 @@ /**

/**
* Returns the array that excludes the elements which equals to any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions
*
* @example
* StringUtils.removeEquals(['foo', 'bar'], ['bar']); // ['foo']
*/
static removeEquals(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeEqualsIgnoreCase(['foo', 'bar'], ['BAR']); // ['foo']
*/
static removeEqualsIgnoreCase(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which includes any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions
*
* @example
* StringUtils.removeIncludes(['foo', 'bar'], ['ar']); // ['foo']
*/
static removeIncludes(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeIncludesIgnoreCase(['foo', 'bar'], ['AR']); // ['foo']
*/
static removeIncludesIgnoreCase(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns whether the given string starts with the prefix

@@ -459,0 +507,0 @@ *

@@ -684,2 +684,58 @@ var __defProp = Object.defineProperty;

/**
* Returns the array that excludes the elements which equals to any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions
*
* @example
* StringUtils.removeEquals(['foo', 'bar'], ['bar']); // ['foo']
*/
static removeEquals(texts, excludes) {
return import_ArrayUtils.ArrayUtils.remove(texts, excludes);
}
/**
* Returns the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeEqualsIgnoreCase(['foo', 'bar'], ['BAR']); // ['foo']
*/
static removeEqualsIgnoreCase(texts, excludes) {
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter((text) => !excludes.some((exclude) => this.equalsIgnoreCase(text, exclude)));
}
/**
* Returns the array that excludes the elements which includes any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions
*
* @example
* StringUtils.removeIncludes(['foo', 'bar'], ['ar']); // ['foo']
*/
static removeIncludes(texts, excludes) {
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter((text) => !excludes.some((exclude) => this.includes(text, exclude)));
}
/**
* Returns the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeIncludesIgnoreCase(['foo', 'bar'], ['AR']); // ['foo']
*/
static removeIncludesIgnoreCase(texts, excludes) {
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter((text) => !excludes.some((exclude) => this.includesIgnoreCase(text, exclude)));
}
/**
* Returns whether the given string starts with the prefix

@@ -686,0 +742,0 @@ *

@@ -124,2 +124,14 @@ /**

/**
* Returns the array that excludes the given elements
*
* @param {Array<any>} array the arrays to inspect
* @param {Array<any>} excludes the elements array to exclude
*
* @return the array that excludes the given elements
*
* @example
* ArrayUtils.remove(['foo', 'bar'], ['bar']); // ['foo']
*/
static remove<T>(array?: T[], excludes?: T[]): T[] | undefined;
/**
* Reverses the given array

@@ -126,0 +138,0 @@ *

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

}, {
key: "remove",
value: function remove(array, excludes) {
return !array || array.length === 0 || !excludes || excludes.length === 0 ? array : array.filter(function (item) {
return !excludes.includes(item);
});
}
}, {
key: "reverse",

@@ -114,0 +121,0 @@ value: function reverse(array, startInclusive, endExclusive) {

@@ -13,3 +13,3 @@ /**

*
* @returns {boolean} whether the given value can be converted to true
* @return {boolean} whether the given value can be converted to true
*

@@ -28,3 +28,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to false
* @return {boolean} whether the given value is nil or can be converted to false
*

@@ -43,3 +43,3 @@ * @example

*
* @returns {boolean} whether the given value can be converted to false
* @return {boolean} whether the given value can be converted to false
*

@@ -58,3 +58,3 @@ * @example

*
* @returns {boolean} whether the given value is nil or can be converted to true
* @return {boolean} whether the given value is nil or can be converted to true
*

@@ -76,3 +76,3 @@ * @example

*
* @returns {string} a string value from the boolean value
* @return {string} a string value from the boolean value
*

@@ -88,3 +88,3 @@ * @example

*
* @returns {string} the string value of 'true'/'false' from the boolean value
* @return {string} the string value of 'true'/'false' from the boolean value
*

@@ -100,3 +100,3 @@ * @example

*
* @returns {string} the string value of 'on'/'off' from the boolean value
* @return {string} the string value of 'on'/'off' from the boolean value
*

@@ -112,3 +112,3 @@ * @example

*
* @returns {string} the string value of 'yes'/'no' from the boolean value
* @return {string} the string value of 'yes'/'no' from the boolean value
*

@@ -124,3 +124,3 @@ * @example

*
* @returns {string} the string value of 'Y'/'N' from the boolean value
* @return {string} the string value of 'Y'/'N' from the boolean value
*

@@ -136,3 +136,3 @@ * @example

*
* @returns {string} the string value of 'T'/'F' from the boolean value
* @return {string} the string value of 'T'/'F' from the boolean value
*

@@ -148,3 +148,3 @@ * @example

*
* @returns {string} the string value of '1'/'0' from the boolean value
* @return {string} the string value of '1'/'0' from the boolean value
*

@@ -151,0 +151,0 @@ * @example

@@ -148,3 +148,3 @@ /**

*
* @returns {string} the timezone of the given date
* @return {string} the timezone of the given date
*/

@@ -151,0 +151,0 @@ static getTimezone(date?: Date): string;

@@ -13,3 +13,3 @@ /**

*
* @returns {boolean} whether the given value is an integer
* @return {boolean} whether the given value is an integer
*

@@ -25,3 +25,3 @@ * @example

*
* @returns {number} an integer value from the string value, or undefined if the value cannot be converted
* @return {number} an integer value from the string value, or undefined if the value cannot be converted
*

@@ -37,3 +37,3 @@ * @example

*
* @returns {number} a float value from the string value, or undefined if the value cannot be converted
* @return {number} a float value from the string value, or undefined if the value cannot be converted
*

@@ -49,3 +49,3 @@ * @example

*
* @returns {number} the max value of the given array
* @return {number} the max value of the given array
*

@@ -61,3 +61,3 @@ * @example

*
* @returns {number} the min value of the given array
* @return {number} the min value of the given array
*

@@ -73,3 +73,3 @@ * @example

*
* @returns {number} the sum value of the given array
* @return {number} the sum value of the given array
*

@@ -85,3 +85,3 @@ * @example

*
* @returns {number} the average value of the given array
* @return {number} the average value of the given array
*

@@ -88,0 +88,0 @@ * @example

@@ -244,3 +244,3 @@ /**

*
* @returns {any} the first none nil element in the given array, or null if all elements are nil
* @return {any} the first none nil element in the given array, or null if all elements are nil
*

@@ -292,3 +292,3 @@ * @example

*
* @returns {Array<string>} the keys of the given object
* @return {Array<string>} the keys of the given object
*

@@ -295,0 +295,0 @@ * @example

@@ -457,2 +457,50 @@ /**

/**
* Returns the array that excludes the elements which equals to any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions
*
* @example
* StringUtils.removeEquals(['foo', 'bar'], ['bar']); // ['foo']
*/
static removeEquals(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which equals to any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeEqualsIgnoreCase(['foo', 'bar'], ['BAR']); // ['foo']
*/
static removeEqualsIgnoreCase(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which includes any of the given exclusions
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions
*
* @example
* StringUtils.removeIncludes(['foo', 'bar'], ['ar']); // ['foo']
*/
static removeIncludes(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @param {Array<string>} texts the arrays to inspect
* @param {string} excludes the elements array to exclude
*
* @return the array that excludes the elements which includes any of the given exclusions, case-insensitive
*
* @example
* StringUtils.removeIncludesIgnoreCase(['foo', 'bar'], ['AR']); // ['foo']
*/
static removeIncludesIgnoreCase(texts?: string[], excludes?: string[]): string[] | undefined;
/**
* Returns whether the given string starts with the prefix

@@ -459,0 +507,0 @@ *

@@ -397,2 +397,37 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

}, {
key: "removeEquals",
value: function removeEquals(texts, excludes) {
return ArrayUtils.remove(texts, excludes);
}
}, {
key: "removeEqualsIgnoreCase",
value: function removeEqualsIgnoreCase(texts, excludes) {
var _this14 = this;
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter(function (text) {
return !excludes.some(function (exclude) {
return _this14.equalsIgnoreCase(text, exclude);
});
});
}
}, {
key: "removeIncludes",
value: function removeIncludes(texts, excludes) {
var _this15 = this;
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter(function (text) {
return !excludes.some(function (exclude) {
return _this15.includes(text, exclude);
});
});
}
}, {
key: "removeIncludesIgnoreCase",
value: function removeIncludesIgnoreCase(texts, excludes) {
var _this16 = this;
return !texts || texts.length === 0 || !excludes || excludes.length === 0 ? texts : texts.filter(function (text) {
return !excludes.some(function (exclude) {
return _this16.includesIgnoreCase(text, exclude);
});
});
}
}, {
key: "startsWith",

@@ -422,3 +457,3 @@ value: function startsWith(text, prefix) {

value: function startsWithAny(text, prefixes) {
var _this14 = this;
var _this17 = this;
if (!text || !prefixes || prefixes.length === 0) {

@@ -428,3 +463,3 @@ return false;

return prefixes.some(function (prefix) {
return _this14.startsWith(text, prefix);
return _this17.startsWith(text, prefix);
});

@@ -435,3 +470,3 @@ }

value: function startsWithAnyIgnoreCase(text, prefixes) {
var _this15 = this;
var _this18 = this;
if (!text || !prefixes || prefixes.length === 0) {

@@ -441,3 +476,3 @@ return false;

return prefixes.some(function (prefix) {
return _this15.startsWithIgnoreCase(text, prefix);
return _this18.startsWithIgnoreCase(text, prefix);
});

@@ -484,3 +519,3 @@ }

value: function toCamelCase(text, pattern) {
var _this16 = this;
var _this19 = this;
if (!text || text.length === 0) {

@@ -492,3 +527,3 @@ return text;

current = current.toLowerCase();
return previous + (index > 0 ? _this16.capitalizeFirst(current) : current);
return previous + (index > 0 ? _this19.capitalizeFirst(current) : current);
}, '');

@@ -495,0 +530,0 @@ }

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

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

@@ -42,6 +42,6 @@ "description": "Common Lang Utilities for TypeScript",

"dependencies": {
"@babel/runtime": "^7.23.8"
"@babel/runtime": "^7.23.9"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^5.62.0",

@@ -53,7 +53,7 @@ "@typescript-eslint/parser": "^5.62.0",

"eslint": "^7.32.0",
"father": "^4.3.8",
"father": "^4.4.0",
"gh-pages": "^6.1.1",
"jsdoc": "^4.0.2",
"prettier": "^2.8.8",
"ts-jest": "^29.1.1",
"ts-jest": "^29.1.2",
"typescript": "^4.9.5"

@@ -60,0 +60,0 @@ },

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