reslib 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/auth/errors.js +2 -2
  2. package/build/auth/index.js +1 -1
  3. package/build/exception/index.js +2 -2
  4. package/build/inputFormatter/index.js +2 -2
  5. package/build/resources/ResourcePaginationHelper.js +1 -1
  6. package/build/session/index.js +1 -1
  7. package/build/utils/defaultStr.js +1 -1
  8. package/build/utils/image.js +1 -1
  9. package/build/utils/index.js +3 -3
  10. package/build/utils/interpolate.js +1 -1
  11. package/build/utils/isEmail.d.ts +1 -1
  12. package/build/utils/isEmail.js +1 -1
  13. package/build/utils/isEmpty.d.ts +2 -2
  14. package/build/utils/isEmpty.js +1 -1
  15. package/build/utils/isNonNullString.d.ts +2 -2
  16. package/build/utils/isNumber.d.ts +1 -1
  17. package/build/utils/isNumber.js +1 -1
  18. package/build/utils/isPrimitive.d.ts +2 -2
  19. package/build/utils/isPrimitive.js +1 -1
  20. package/build/utils/isPromise.d.ts +2 -2
  21. package/build/utils/isPromise.js +1 -1
  22. package/build/utils/isRegex.d.ts +2 -2
  23. package/build/utils/isRegex.js +1 -1
  24. package/build/utils/isTime.js +1 -1
  25. package/build/utils/numbers.js +2 -2
  26. package/build/utils/object.js +1 -1
  27. package/build/utils/string.js +1 -1
  28. package/build/utils/stringify.js +1 -1
  29. package/build/utils/uri/index.d.ts +1 -1
  30. package/build/validator/rules/array.js +2 -2
  31. package/build/validator/rules/boolean.js +2 -2
  32. package/build/validator/rules/date.js +2 -2
  33. package/build/validator/rules/default.js +2 -2
  34. package/build/validator/rules/enum.js +2 -2
  35. package/build/validator/rules/file.js +2 -2
  36. package/build/validator/rules/format.js +2 -2
  37. package/build/validator/rules/ifRule.js +2 -2
  38. package/build/validator/rules/index.js +3 -3
  39. package/build/validator/rules/multiRules.js +2 -2
  40. package/build/validator/rules/numeric.js +2 -2
  41. package/build/validator/rules/object.js +2 -2
  42. package/build/validator/rules/string.js +2 -2
  43. package/build/validator/rules/target.js +2 -2
  44. package/build/validator/rules/utils.js +1 -1
  45. package/build/validator/validator.js +2 -2
  46. package/package.json +8 -11
@@ -1 +1 @@
1
- 'use strict';function w(t){return !!(t&&typeof t=="string")}function T(...t){for(var e in t){let n=t[e];if(w(n))return n}return ""}function a(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function y(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function A(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}function x(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function c(t){if(t===null||typeof t!="object"||x(t)||A(t)||y(t)||a(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let n=e.constructor;if(typeof n!="function")return false;if(n===Object)return true;let r=n.prototype;return typeof r!="object"?false:r===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function S(t){if(Array.isArray(t)){let r=[];for(var e=0;e<t.length;e++)r[e]=S(t[e]);return r}else if(c(t)&&t){let r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=S(t[n]));return r}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let n=0;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&(n++,e===true))return n;return n};function D(t,e){return g(t,"",{},e)}function g(t,e="",n={},r){if(n=c(n)?n:{},a(t)||A(t)||y(t)||Array.isArray(t)&&(r!=null&&r.skipArrays))return e&&(n[e]=t),n;if(typeof t=="function"||typeof t=="object"&&!c(t)&&!P(t))return n;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([i,s])=>{let o=e?`${e}[${String(i)}]`:String(i);g(s,o,n,r);}),n;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((s,o)=>{let l=e?`${e}[${o}]`:String(o);g(s,l,n,r);}),n;if(c(t))for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let s=t[i],o=e?e.endsWith("]")?`${e}.${i}`:`${e}.${i}`:i;g(s,o,n,r);}return n}function P(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function $(t){return Object.entries(t)}Object.typedEntries=$;Object.flatten=D;Object.clone=S;function u(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(y(t))return t.toString();if(a(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let n=t.toString();if(n!=="[object Object]")return n}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function nt(t,e,n){let r=(n==null?void 0:n.valueFormatter)||u,i=T(t);if(!c(e)||!e)return i;let s=(n==null?void 0:n.tagRegex)||/%\{([^}]+)\}/g,o=new Set,l,b=T(t);for(;(l=s.exec(b))!==null;){let f=l[1];f!==void 0&&o.add(f);}return o.forEach(f=>{if(n!=null&&n.tagRegex){let h=new RegExp(n.tagRegex.source,n.tagRegex.flags);[...b.matchAll(h)].forEach(m=>{let j=m[0];if(!m[1])return;let p=m[1],O=Object.prototype.hasOwnProperty.call(e,p)?e[p]:void 0,k=O===void 0?"":(()=>{try{return r(O,p,u)}catch(C){return u(O)}})(),M=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(M,"g"),k);});return}let N=`%{${f}}`,d=Object.prototype.hasOwnProperty.call(e,f)?e[f]:void 0,R=d===void 0?"":(()=>{try{return r(d,f,u)}catch(h){return u(d)}})(),E=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(E,"g"),R);}),i}exports.interpolate=nt;
1
+ 'use strict';function h(n){return !!(n&&typeof n=="string")}function T(...n){for(var e in n){let t=n[e];if(h(t))return t}return ""}function a(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function y(n){if(n instanceof RegExp)return true;if(!n||typeof n!="object"||!Object.prototype.toString.call(n).includes("RegExp"))return false;try{return new RegExp(n),!0}catch(e){return false}}function A(n){return !n||typeof n!="object"?false:n instanceof Date?true:typeof n.getTime!="function"?false:!(Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))}function x(n){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:n===document?true:"HTMLElement"in window?!!n&&n instanceof HTMLElement:!!n&&typeof n=="object"&&n.nodeType===1&&!!n.nodeName}function c(n){if(n===null||typeof n!="object"||x(n)||A(n)||y(n)||a(n))return false;let e=Object.getPrototypeOf(n);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let r=t.prototype;return typeof r!="object"?false:r===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function S(n){if(Array.isArray(n)){let r=[];for(var e=0;e<n.length;e++)r[e]=S(n[e]);return r}else if(c(n)&&n){let r={};for(var t in n)n.hasOwnProperty(t)&&(r[t]=S(n[t]));return r}else return n}Object.getSize=function(n,e=false){if(!n||typeof n!="object")return 0;if(Array.isArray(n))return n.length;typeof e!="boolean"&&(e=false);let t=0;for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&(t++,e===true))return t;return t};function D(n,e){return g(n,"",{},e)}function g(n,e="",t={},r){if(t=c(t)?t:{},a(n)||A(n)||y(n)||Array.isArray(n)&&(r!=null&&r.skipArrays))return e&&(t[e]=n),t;if(typeof n=="function"||typeof n=="object"&&!c(n)&&!P(n))return t;if(n instanceof Map||n instanceof WeakMap)return Array.from(n.entries()).forEach(([i,s])=>{let o=e?`${e}[${String(i)}]`:String(i);g(s,o,t,r);}),t;if(Array.isArray(n)||n instanceof Set||n instanceof WeakSet)return (Array.isArray(n)?n:Array.from(n)).forEach((s,o)=>{let l=e?`${e}[${o}]`:String(o);g(s,l,t,r);}),t;if(c(n))for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let s=n[i],o=e?e.endsWith("]")?`${e}.${i}`:`${e}.${i}`:i;g(s,o,t,r);}return t}function P(n){return Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof WeakMap||n instanceof WeakSet}function $(n){return Object.entries(n)}Object.typedEntries=$;Object.flatten=D;Object.clone=S;function u(n,e){if(n==null)return "";if(typeof n=="string")return n;if((typeof n=="number"||typeof n=="object"&&n instanceof Number)&&typeof n.formatNumber=="function")return n.formatNumber();if(n instanceof Date||typeof n=="object"&&n!==null&&n.constructor===Date)return typeof n.toFormat=="function"?n.toFormat():n.toISOString();if(n instanceof Error)return `Error: ${n.message}`;if(y(n))return n.toString();if(a(n))return String(n);if(Array.isArray(n))return JSON.stringify(n);if(typeof n=="object"&&n!==null){if(typeof n.toString=="function"&&n.toString!==Object.prototype.toString)return n.toString();if(typeof n.toString=="function"){let t=n.toString();if(t!=="[object Object]")return t}return JSON.stringify(n)}return typeof(n==null?void 0:n.toString)=="function"?n.toString():String(n)}function tn(n,e,t){let r=(t==null?void 0:t.valueFormatter)||u,i=T(n);if(!c(e)||!e)return i;let s=(t==null?void 0:t.tagRegex)||/%\{([^}]+)\}/g,o=new Set,l,b=T(n);for(;(l=s.exec(b))!==null;){let f=l[1];f!==void 0&&o.add(f);}return o.forEach(f=>{if(t!=null&&t.tagRegex){let w=new RegExp(t.tagRegex.source,t.tagRegex.flags);[...b.matchAll(w)].forEach(m=>{let k=m[0];if(!m[1])return;let p=m[1],O=Object.prototype.hasOwnProperty.call(e,p)?e[p]:void 0,j=O===void 0?"":(()=>{try{return r(O,p,u)}catch(C){return u(O)}})(),M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(M,"g"),j);});return}let N=`%{${f}}`,d=Object.prototype.hasOwnProperty.call(e,f)?e[f]:void 0,R=d===void 0?"":(()=>{try{return r(d,f,u)}catch(w){return u(d)}})(),E=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(E,"g"),R);}),i}exports.interpolate=tn;
@@ -54,4 +54,4 @@ export interface IsEmailOptions {
54
54
  * // Custom length limits
55
55
  * isEmail("very.long.email@domain.com", { maxTotalLength: 100 }) // true if under 100 chars
56
56
  */
57
- export declare function isEmail(email: string, options?: IsEmailOptions): boolean;
57
+ export declare function isEmail(email: unknown, options?: IsEmailOptions): boolean;
@@ -1 +1 @@
1
- 'use strict';function u(t){return !!(t&&typeof t=="string")}function p(t,n={}){let{maxTotalLength:e=320,maxLocalPartLength:r=64,maxDomainLength:i=255,maxDomainLabelLength:l=63}=Object.assign({},n);if(!u(t)||t.length>e)return false;let s=t.lastIndexOf("@");if(s===-1||s===0||s===t.length-1)return false;let f=t.substring(0,s),a=t.substring(s+1);return !(f.length===0||f.length>r||a.length===0||a.length>i||!o(f)||!h(a,l))}function o(t){return t.startsWith('"')&&t.endsWith('"')?g(t):!(!/^[a-zA-Z0-9.!#$%&'*+\-/=?^_`{|}~]+$/.test(t)||t.startsWith(".")||t.endsWith(".")||t.includes(".."))}function g(t){if(!t.startsWith('"')||!t.endsWith('"'))return false;let n=t.slice(1,-1),e=0;for(;e<n.length;)if(n[e]==="\\")e+=2;else {if(n[e]==='"')return false;e++;}return true}function h(t,n){if(t.startsWith("[")&&t.endsWith("]"))return m(t.slice(1,-1));if(!t.includes("."))return false;let e=t.split(".");for(let i of e)if(!c(i,n))return false;let r=e[e.length-1];return !(r.length<2||!/^[a-zA-Z]+$/.test(r))}function c(t,n){return !(t.length===0||t.length>n||!/^[a-zA-Z0-9\-]+$/.test(t)||t.startsWith("-")||t.endsWith("-"))}function m(t){return !!(b(t)||d(t))}function b(t){let n=t.split(".");if(n.length!==4)return false;for(let e of n){let r=parseInt(e,10);if(isNaN(r)||r<0||r>255||e!==r.toString())return false}return true}function d(t){if(t.includes(":::"))return false;let n=t.split(":");if(n.length>8||t.includes("::")&&n.length>=8)return false;for(let e of n)if(e!==""&&!/^[0-9a-fA-F]{1,4}$/.test(e))return false;return true}exports.isEmail=p;
1
+ 'use strict';function a(t){return !!(t&&typeof t=="string")}function p(t,n={}){let{maxTotalLength:e=320,maxLocalPartLength:r=64,maxDomainLength:i=255,maxDomainLabelLength:l=63}=Object.assign({},n);if(!a(t)||t.length>e)return false;let s=t.lastIndexOf("@");if(s===-1||s===0||s===t.length-1)return false;let f=t.substring(0,s),u=t.substring(s+1);return !(f.length===0||f.length>r||u.length===0||u.length>i||!o(f)||!h(u,l))}function o(t){return t.startsWith('"')&&t.endsWith('"')?g(t):!(!/^[a-zA-Z0-9.!#$%&'*+\-/=?^_`{|}~]+$/.test(t)||t.startsWith(".")||t.endsWith(".")||t.includes(".."))}function g(t){if(!t.startsWith('"')||!t.endsWith('"'))return false;let n=t.slice(1,-1),e=0;for(;e<n.length;)if(n[e]==="\\")e+=2;else {if(n[e]==='"')return false;e++;}return true}function h(t,n){if(t.startsWith("[")&&t.endsWith("]"))return d(t.slice(1,-1));if(!t.includes("."))return false;let e=t.split(".");for(let i of e)if(!c(i,n))return false;let r=e[e.length-1];return !(r.length<2||!/^[a-zA-Z]+$/.test(r))}function c(t,n){return !(t.length===0||t.length>n||!/^[a-zA-Z0-9\-]+$/.test(t)||t.startsWith("-")||t.endsWith("-"))}function d(t){return !!(b(t)||m(t))}function b(t){let n=t.split(".");if(n.length!==4)return false;for(let e of n){let r=parseInt(e,10);if(isNaN(r)||r<0||r>255||e!==r.toString())return false}return true}function m(t){if(t.includes(":::"))return false;let n=t.split(":");if(n.length>8||t.includes("::")&&n.length>=8)return false;for(let e of n)if(e!==""&&!/^[0-9a-fA-F]{1,4}$/.test(e))return false;return true}exports.isEmail=p;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A value is considered empty if it is null, undefined, an empty string, or an empty array.
5
5
  *
6
- * @param {any} value The value to check.
6
+ * @param {unknown} value The value to check.
7
7
  * @returns {boolean} True if the value is empty, false otherwise.
8
8
  * @example
9
9
  * ```typescript
@@ -15,4 +15,4 @@
15
15
  * console.log(isEmpty([1, 2, 3])); // Output: false
16
16
  * ```
17
17
  */
18
- export declare function isEmpty(value: any): boolean;
18
+ export declare function isEmpty(value: unknown): boolean;
@@ -1 +1 @@
1
- 'use strict';function n(r){return !!(r==null||typeof r=="undefined"||typeof r=="string"&&r===""||Array.isArray(r)&&!r.length)}exports.isEmpty=n;
1
+ 'use strict';function r(n){return !!(n==null||typeof n=="undefined"||typeof n=="string"&&n===""||Array.isArray(n)&&!n.length)}exports.isEmpty=r;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A value is considered a non-empty string if it is not null and is a string.
5
5
  *
6
- * @param {any} val The value to check.
6
+ * @param {unknown} val The value to check.
7
7
  * @returns {boolean} True if the value is a non-empty string, false otherwise.
8
8
  * @example
9
9
  * ```typescript
@@ -14,4 +14,4 @@
14
14
  * console.log(isNonNullString(123)); // Output: false
15
15
  * ```
16
16
  */
17
- export declare function isNonNullString<T = any>(val: T): val is T & string;
17
+ export declare function isNonNullString<T = unknown>(val: T): val is T & string;
@@ -33,4 +33,4 @@
33
33
  * @note This function rejects infinite values (Infinity/-Infinity) as they typically
34
34
  * represent error conditions or overflow in validation contexts.
35
35
  */
36
- export declare function isNumber(value: any): value is number;
36
+ export declare function isNumber(value: unknown): value is number;
@@ -1 +1 @@
1
- 'use strict';function n(i){return typeof i=="number"&&!isNaN(i)&&isFinite(i)}exports.isNumber=n;
1
+ 'use strict';function i(n){return typeof n=="number"&&!isNaN(n)&&isFinite(n)}exports.isNumber=i;
@@ -2,7 +2,7 @@ import { Primitive } from '../types';
2
2
  /**
3
3
  * Type guard to check if a value is a primitive type.
4
4
  *
5
- * @param {any} value - The value to check
5
+ * @param {unknown} value - The value to check
6
6
  * @returns {boolean} True if the value is a primitive, false otherwise
7
7
  *
8
8
  * @example
@@ -13,4 +13,4 @@ import { Primitive } from '../types';
13
13
  * isPrimitive({}) // returns false
14
14
  * isPrimitive([]) // returns false
15
15
  */
16
- export declare function isPrimitive(value: any): value is Primitive;
16
+ export declare function isPrimitive(value: unknown): value is Primitive;
@@ -1 +1 @@
1
- 'use strict';function t(i){return i==null||typeof i=="string"||typeof i=="number"||typeof i=="boolean"}exports.isPrimitive=t;
1
+ 'use strict';function n(i){return i==null||typeof i=="string"||typeof i=="number"||typeof i=="boolean"}exports.isPrimitive=n;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A value is considered a Promise if it is a native Promise or if it has a Promise-like interface.
5
5
  *
6
- * @param {any} value The value to check.
6
+ * @param {unknown} value The value to check.
7
7
  * @returns {boolean} True if the value is a Promise, false otherwise.
8
8
  * @example
9
9
  * ```typescript
@@ -11,4 +11,4 @@
11
11
  * console.log(isPromise({})); // Output: false
12
12
  * ```
13
13
  */
14
- export declare function isPromise(value: any): boolean;
14
+ export declare function isPromise(value: unknown): boolean;
@@ -1 +1 @@
1
- 'use strict';function o(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function n(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:o(t)}exports.isPromise=n;
1
+ 'use strict';function t(n){return typeof n=="boolean"||!n||typeof n=="number"||typeof n=="string"||typeof n=="symbol"?false:Object(n).constructor===Promise||n.constructor&&(n.constructor.name==="Promise"||n.constructor.name==="AsyncFunction")||n instanceof Promise||typeof(n==null?void 0:n.then)=="function"&&typeof(n==null?void 0:n.catch)=="function"&&typeof(n==null?void 0:n.finally)=="function"?true:n&&typeof n.constructor=="function"&&Function.prototype.toString.call(n.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function o(n){return n&&Object.prototype.toString.call(n)==="[object Promise]"?true:t(n)}exports.isPromise=o;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A value is considered a regular expression if it is an instance of the RegExp constructor, or if it can be converted to a RegExp.
5
5
  *
6
- * @param {any} regExp The value to check.
6
+ * @param {unknown} regExp The value to check.
7
7
  * @returns {boolean} True if the value is a regular expression, false otherwise.
8
8
  * @example
9
9
  * ```typescript
@@ -12,4 +12,4 @@
12
12
  * console.log(isRegExp({})); // Output: false
13
13
  * ```
14
14
  */
15
- export declare function isRegExp(regExp: any): regExp is RegExp;
15
+ export declare function isRegExp(regExp: unknown): regExp is RegExp;
@@ -1 +1 @@
1
- 'use strict';function n(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(t){return false}}exports.isRegExp=n;
1
+ 'use strict';function n(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}exports.isRegExp=n;
@@ -1 +1 @@
1
- 'use strict';function x(n){return !!(n&&typeof n=="string")}function d(n){return !n||typeof n!="object"?false:n instanceof Date?true:typeof n.getTime!="function"?false:!(Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))}function m(n){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:n===document?true:"HTMLElement"in window?!!n&&n instanceof HTMLElement:!!n&&typeof n=="object"&&n.nodeType===1&&!!n.nodeName}function T(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function O(n){if(n instanceof RegExp)return true;if(!n||typeof n!="object"||!Object.prototype.toString.call(n).includes("RegExp"))return false;try{return new RegExp(n),!0}catch(e){return false}}function c(n){if(n===null||typeof n!="object"||m(n)||d(n)||O(n)||T(n))return false;let e=Object.getPrototypeOf(n);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let r=t.prototype;return typeof r!="object"?false:r===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function A(n){if(Array.isArray(n)){let r=[];for(var e=0;e<n.length;e++)r[e]=A(n[e]);return r}else if(c(n)&&n){let r={};for(var t in n)n.hasOwnProperty(t)&&(r[t]=A(n[t]));return r}else return n}Object.getSize=function(n,e=false){if(!n||typeof n!="object")return 0;if(Array.isArray(n))return n.length;typeof e!="boolean"&&(e=false);let t=0;for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&(t++,e===true))return t;return t};function p(n,...e){let t=Array.isArray(n),r=c(n);(n==null||!t&&!r)&&(n={});for(let i=0;i<e.length;i++){let o=e[i];if(o==null)continue;let a=c(o),y=Array.isArray(o);if(!(!a&&!y)){if(t){y&&S(n,o);continue}else if(y)continue;for(let f in o){let s=o[f];if(s==null)continue;if(s===o){n[f]=n;continue}let u=n[f],b=Array.isArray(u),w=Array.isArray(s);if(b){w?S(n[f],s):n[f]=s;continue}else if(!c(u)){n[f]=s;continue}if(w||!c(s)){n[f]=s;continue}n[f]=p({},u,s);}}}return n}var S=(n,e)=>{let t=e.length,r=0;for(let i=0;i<n.length;i++){let o=n[i],a=e[i];if(i<t){let y=Array.isArray(o),f=Array.isArray(a),s=c(o),u=c(a);y&&f||s&&u?(n[r]=p(y?[]:{},o,a),r++):a!=null?(n[r]=a,r++):o!=null&&(n[r]=o,r++);}}for(let i=n.length;i<t;i++)e[i]!==void 0&&e[i]!==null&&n.push(e[i]);return n};function g(n,e){return l(n,"",{},e)}function l(n,e="",t={},r){if(t=c(t)?t:{},T(n)||d(n)||O(n)||Array.isArray(n)&&(r!=null&&r.skipArrays))return e&&(t[e]=n),t;if(typeof n=="function"||typeof n=="object"&&!c(n)&&!N(n))return t;if(n instanceof Map||n instanceof WeakMap)return Array.from(n.entries()).forEach(([i,o])=>{let a=e?`${e}[${String(i)}]`:String(i);l(o,a,t,r);}),t;if(Array.isArray(n)||n instanceof Set||n instanceof WeakSet)return (Array.isArray(n)?n:Array.from(n)).forEach((o,a)=>{let y=e?`${e}[${a}]`:String(a);l(o,y,t,r);}),t;if(c(n))for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let o=n[i],a=e?e.endsWith("]")?`${e}.${i}`:`${e}.${i}`:i;l(o,a,t,r);}return t}function N(n){return Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof WeakMap||n instanceof WeakSet}function k(n){return Object.entries(n)}Object.typedEntries=k;Object.flatten=g;Object.clone=A;var h={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/,withOptionalSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/,withOptionalSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))? (A|P)M$/}};function M(n,e){var t;return x(n)?(e=p({},{format:"hour24",mode:"default"},e),(!e.format||!h[e.format])&&(e.format="hour24"),(!e.mode||!((t=h[e.format])!=null&&t[e.mode]))&&(e.mode="default"),h[e.format][e.mode].test(n)):false}module.exports=M;
1
+ 'use strict';function x(n){return !!(n&&typeof n=="string")}function d(n){return !n||typeof n!="object"?false:n instanceof Date?true:typeof n.getTime!="function"?false:!(Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))}function m(n){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:n===document?true:"HTMLElement"in window?!!n&&n instanceof HTMLElement:!!n&&typeof n=="object"&&n.nodeType===1&&!!n.nodeName}function T(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function O(n){if(n instanceof RegExp)return true;if(!n||typeof n!="object"||!Object.prototype.toString.call(n).includes("RegExp"))return false;try{return new RegExp(n),!0}catch(e){return false}}function c(n){if(n===null||typeof n!="object"||m(n)||d(n)||O(n)||T(n))return false;let e=Object.getPrototypeOf(n);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let r=t.prototype;return typeof r!="object"?false:r===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function A(n){if(Array.isArray(n)){let r=[];for(var e=0;e<n.length;e++)r[e]=A(n[e]);return r}else if(c(n)&&n){let r={};for(var t in n)n.hasOwnProperty(t)&&(r[t]=A(n[t]));return r}else return n}Object.getSize=function(n,e=false){if(!n||typeof n!="object")return 0;if(Array.isArray(n))return n.length;typeof e!="boolean"&&(e=false);let t=0;for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&(t++,e===true))return t;return t};function p(n,...e){let t=Array.isArray(n),r=c(n);(n==null||!t&&!r)&&(n={});for(let i=0;i<e.length;i++){let o=e[i];if(o==null)continue;let a=c(o),y=Array.isArray(o);if(!(!a&&!y)){if(t){y&&S(n,o);continue}else if(y)continue;for(let f in o){let s=o[f];if(s==null)continue;if(s===o){n[f]=n;continue}let u=n[f],b=Array.isArray(u),h=Array.isArray(s);if(b){h?S(n[f],s):n[f]=s;continue}else if(!c(u)){n[f]=s;continue}if(h||!c(s)){n[f]=s;continue}n[f]=p({},u,s);}}}return n}var S=(n,e)=>{let t=e.length,r=0;for(let i=0;i<n.length;i++){let o=n[i],a=e[i];if(i<t){let y=Array.isArray(o),f=Array.isArray(a),s=c(o),u=c(a);y&&f||s&&u?(n[r]=p(y?[]:{},o,a),r++):a!=null?(n[r]=a,r++):o!=null&&(n[r]=o,r++);}}for(let i=n.length;i<t;i++)e[i]!==void 0&&e[i]!==null&&n.push(e[i]);return n};function g(n,e){return l(n,"",{},e)}function l(n,e="",t={},r){if(t=c(t)?t:{},T(n)||d(n)||O(n)||Array.isArray(n)&&(r!=null&&r.skipArrays))return e&&(t[e]=n),t;if(typeof n=="function"||typeof n=="object"&&!c(n)&&!k(n))return t;if(n instanceof Map||n instanceof WeakMap)return Array.from(n.entries()).forEach(([i,o])=>{let a=e?`${e}[${String(i)}]`:String(i);l(o,a,t,r);}),t;if(Array.isArray(n)||n instanceof Set||n instanceof WeakSet)return (Array.isArray(n)?n:Array.from(n)).forEach((o,a)=>{let y=e?`${e}[${a}]`:String(a);l(o,y,t,r);}),t;if(c(n))for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let o=n[i],a=e?e.endsWith("]")?`${e}.${i}`:`${e}.${i}`:i;l(o,a,t,r);}return t}function k(n){return Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof WeakMap||n instanceof WeakSet}function N(n){return Object.entries(n)}Object.typedEntries=N;Object.flatten=g;Object.clone=A;var w={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/,withOptionalSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/,withOptionalSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))? (A|P)M$/}};function M(n,e){var t;return x(n)?(e=p({},{format:"hour24",mode:"default"},e),(!e.format||!w[e.format])&&(e.format="hour24"),(!e.mode||!((t=w[e.format])!=null&&t[e.mode]))&&(e.mode="default"),w[e.format][e.mode].test(n)):false}module.exports=M;