@rzl-zone/utils-js 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +94 -45
  2. package/dist/assertions/index.cjs +34 -1
  3. package/dist/assertions/index.d.ts +2 -2
  4. package/dist/assertions/index.js +5 -1
  5. package/dist/chunk-2CQX5CBG.js +247 -1
  6. package/dist/chunk-2IOOEY45.cjs +20 -1
  7. package/dist/chunk-2WA36TC5.cjs +176 -0
  8. package/dist/chunk-3IBQ5MOM.js +6 -1
  9. package/dist/chunk-3VA554KW.js +23 -1
  10. package/dist/chunk-5757UBXJ.cjs +144 -1
  11. package/dist/chunk-5IGC6PBH.js +22 -1
  12. package/dist/chunk-5KJFVIQT.cjs +55 -1
  13. package/dist/chunk-6JFCSH7J.js +24 -1
  14. package/dist/chunk-6JFZL7YE.cjs +14 -1
  15. package/dist/chunk-7ODAAXX5.cjs +361 -1
  16. package/dist/chunk-BAV5T2E3.cjs +5 -1
  17. package/dist/chunk-CAH33WOQ.cjs +25 -1
  18. package/dist/chunk-CDCERIZ2.js +164 -0
  19. package/dist/chunk-CKTLUNWX.js +12 -1
  20. package/dist/chunk-CMW2TBOQ.js +522 -1
  21. package/dist/chunk-D3ENH7H6.cjs +87 -1
  22. package/dist/chunk-DEZZUYE2.js +139 -1
  23. package/dist/chunk-DVMHRLKP.cjs +6 -1
  24. package/dist/chunk-DWF2R5GD.cjs +212 -1
  25. package/dist/chunk-E55EQK2U.cjs +8 -1
  26. package/dist/chunk-E74U6CYP.cjs +8 -1
  27. package/dist/chunk-EL6A35UR.cjs +51 -1
  28. package/dist/chunk-F6IPNNSJ.cjs +531 -1
  29. package/dist/chunk-FJZGG54N.cjs +252 -1
  30. package/dist/chunk-FWCKOJZM.js +519 -1
  31. package/dist/chunk-FWHNWL2P.cjs +409 -1
  32. package/dist/chunk-GGEADHZO.js +78 -1
  33. package/dist/chunk-GQR4R5WY.js +21 -1
  34. package/dist/chunk-H66AC7GK.cjs +81 -1
  35. package/dist/chunk-HQWOFR56.cjs +23 -1
  36. package/dist/chunk-HYRQMTRH.cjs +14 -1
  37. package/dist/chunk-IRFL4MAX.js +53 -1
  38. package/dist/chunk-IVL7CKVH.cjs +26 -1
  39. package/dist/chunk-IZPBKKPO.js +6 -1
  40. package/dist/chunk-JBQMXC5I.cjs +93 -1
  41. package/dist/chunk-JEQEF5WD.js +81 -1
  42. package/dist/chunk-JMJQCN74.js +334 -1
  43. package/dist/chunk-KHO2SBNA.cjs +6 -1
  44. package/dist/chunk-KVAL5PAG.cjs +16 -1
  45. package/dist/chunk-L5RDAVVH.js +5 -1
  46. package/dist/chunk-LS6U7FAY.cjs +98 -1
  47. package/dist/chunk-NBZWMBO6.js +88 -1
  48. package/dist/chunk-NRF6LWBC.cjs +45 -1
  49. package/dist/chunk-OI5XKNZO.js +42 -1
  50. package/dist/chunk-ONZFBJVW.js +5 -1
  51. package/dist/chunk-OYTYSY7G.js +94 -1
  52. package/dist/chunk-PET42Z7W.js +107 -1
  53. package/dist/chunk-PZQ6I4JJ.cjs +559 -1
  54. package/dist/chunk-QBKAEVYG.js +102 -1
  55. package/dist/chunk-QNKGP5DY.js +5 -1
  56. package/dist/chunk-RIPKY4RU.js +407 -1
  57. package/dist/chunk-RZW35UN5.cjs +105 -1
  58. package/dist/chunk-SBFNXGTJ.js +207 -1
  59. package/dist/chunk-SBKGWRS5.js +12 -1
  60. package/dist/chunk-SIM77PU4.js +46 -1
  61. package/dist/chunk-T2T7K3KR.js +18 -1
  62. package/dist/chunk-T7PU2V7X.cjs +111 -1
  63. package/dist/chunk-UDA26MCU.cjs +6 -1
  64. package/dist/chunk-V45XJKHW.cjs +8 -1
  65. package/dist/chunk-VJDDGRIK.cjs +6 -1
  66. package/dist/chunk-W2WNBUDE.js +6 -1
  67. package/dist/chunk-WVSPXFTY.js +5 -1
  68. package/dist/chunk-XABCB3Y7.cjs +563 -1
  69. package/dist/chunk-XEDXFSGI.js +14 -1
  70. package/dist/chunk-YKPSRP5G.js +552 -1
  71. package/dist/chunk-YWHHVDT4.js +4 -1
  72. package/dist/chunk-ZETAZZLD.cjs +27 -1
  73. package/dist/conversions/index.cjs +97 -1
  74. package/dist/conversions/index.d.ts +1 -1
  75. package/dist/conversions/index.js +16 -1
  76. package/dist/events/index.cjs +25 -1
  77. package/dist/events/index.d.ts +1 -1
  78. package/dist/events/index.js +4 -1
  79. package/dist/formatters/index.cjs +55 -1
  80. package/dist/formatters/index.d.ts +1 -1
  81. package/dist/formatters/index.js +10 -1
  82. package/dist/generators/index.cjs +31 -1
  83. package/dist/generators/index.d.ts +1 -1
  84. package/dist/generators/index.js +6 -1
  85. package/dist/index.d.ts +1 -0
  86. package/dist/{isPlainObject-CEPWPiXh.d.ts → isPlainObject-FWmcJF6k.d.ts} +4 -4
  87. package/dist/next/index.cjs +205 -1
  88. package/dist/next/index.d.ts +1 -1
  89. package/dist/next/index.js +200 -1
  90. package/dist/next/server/index.cjs +34 -1
  91. package/dist/next/server/index.d.ts +1 -1
  92. package/dist/next/server/index.js +32 -1
  93. package/dist/operations/index.cjs +26 -1
  94. package/dist/operations/index.d.ts +1 -1
  95. package/dist/operations/index.js +9 -1
  96. package/dist/parsers/index.cjs +11 -1
  97. package/dist/parsers/index.d.ts +1 -1
  98. package/dist/parsers/index.js +2 -1
  99. package/dist/predicates/index.cjs +292 -1
  100. package/dist/predicates/index.d.ts +4 -4
  101. package/dist/predicates/index.js +15 -1
  102. package/dist/promises/index.cjs +18 -1
  103. package/dist/promises/index.d.ts +1 -1
  104. package/dist/promises/index.js +5 -1
  105. package/dist/rzl-utils.global.js +16 -1
  106. package/dist/strings/index.cjs +75 -1
  107. package/dist/strings/index.d.ts +1 -1
  108. package/dist/strings/index.js +6 -1
  109. package/dist/tailwind/index.cjs +36 -1
  110. package/dist/tailwind/index.d.ts +1 -1
  111. package/dist/tailwind/index.js +3 -1
  112. package/dist/urls/index.cjs +44 -1
  113. package/dist/urls/index.d.ts +1 -1
  114. package/dist/urls/index.js +15 -1
  115. package/package.json +16 -19
  116. package/dist/chunk-JYQTCICM.js +0 -1
  117. package/dist/chunk-YLA3DURS.cjs +0 -1
@@ -1 +1,53 @@
1
- import{isNonEmptyString as e}from"./chunk-CMW2TBOQ.js";var l=l=>{if(!e(l))return 0;let c=l.trim().replace(/\u00A0/g,"").replace(/\u202F/g,""),s=!1;/^\(.*\)$/.test(c)&&(s=!0,c=c.slice(1,-1).trim()),c=c.replace(/^[-\s]+/,e=>e.includes("-")?"-":"").replace(/[\s.,-]+$/,""),s=s||/^-/.test(c)||/^[^\d]*-/.test(c);let r=c.replace(/[^0-9.,'\s]/g,"").replace(/[\s']/g,"");const t=r.match(/,\d{2}/g);if(t&&t.length>1)r=r.replace(/,/g,"");else{const e=(r.match(/\./g)||[]).length,l=(r.match(/,/g)||[]).length;if(e>1&&0===l)r=r.replace(/\./g,"");else if(l>1&&0===e)r=r.replace(/,/g,"");else{const e=r.lastIndexOf(","),l=r.lastIndexOf(".");if(e>l)r=r.replace(/\./g,"").replace(",",".");else if(l>e)r=r.replace(/,/g,"");else if(e>l){const l=r.slice(0,e).replace(/,/g,"").replace(/\./g,""),c=r.slice(e+1);r=l+"."+c}else if(l>e){const e=r.slice(0,l).replace(/\./g,"").replace(/,/g,""),c=r.slice(l+1);r=e+"."+c}else-1!==e?r=r.replace(/,/g,""):-1!==l&&(r=r.replace(/\./g,""))}}const a=parseFloat(r)||0;return s?-a:a};export{l as parseCurrencyString};
1
+ import { isNonEmptyString } from './chunk-CMW2TBOQ.js';
2
+ var parseCurrencyString = (input) => {
3
+ if (!isNonEmptyString(input)) return 0;
4
+ let trimmed = input.trim().replace(/\u00A0/g, "").replace(/\u202F/g, "");
5
+ let isNegative = false;
6
+ if (/^\(.*\)$/.test(trimmed)) {
7
+ isNegative = true;
8
+ trimmed = trimmed.slice(1, -1).trim();
9
+ }
10
+ trimmed = trimmed.replace(/^[-\s]+/, (match) => match.includes("-") ? "-" : "").replace(/[\s.,-]+$/, "");
11
+ isNegative = isNegative || /^-/.test(trimmed) || /^[^\d]*-/.test(trimmed);
12
+ const cleaned = trimmed.replace(/[^0-9.,'\s]/g, "");
13
+ let cleanedNoSpace = cleaned.replace(/[\s']/g, "");
14
+ const indianMatches = cleanedNoSpace.match(/,\d{2}/g);
15
+ const isIndianStyle = indianMatches && indianMatches.length > 1;
16
+ if (isIndianStyle) {
17
+ cleanedNoSpace = cleanedNoSpace.replace(/,/g, "");
18
+ } else {
19
+ const dotCount = (cleanedNoSpace.match(/\./g) || []).length;
20
+ const commaCount = (cleanedNoSpace.match(/,/g) || []).length;
21
+ if (dotCount > 1 && commaCount === 0) {
22
+ cleanedNoSpace = cleanedNoSpace.replace(/\./g, "");
23
+ } else if (commaCount > 1 && dotCount === 0) {
24
+ cleanedNoSpace = cleanedNoSpace.replace(/,/g, "");
25
+ } else {
26
+ const lastComma = cleanedNoSpace.lastIndexOf(",");
27
+ const lastDot = cleanedNoSpace.lastIndexOf(".");
28
+ if (lastComma > lastDot) {
29
+ cleanedNoSpace = cleanedNoSpace.replace(/\./g, "").replace(",", ".");
30
+ } else if (lastDot > lastComma) {
31
+ cleanedNoSpace = cleanedNoSpace.replace(/,/g, "");
32
+ } else {
33
+ if (lastComma > lastDot) {
34
+ const beforeDecimal = cleanedNoSpace.slice(0, lastComma).replace(/,/g, "").replace(/\./g, "");
35
+ const afterDecimal = cleanedNoSpace.slice(lastComma + 1);
36
+ cleanedNoSpace = beforeDecimal + "." + afterDecimal;
37
+ } else if (lastDot > lastComma) {
38
+ const beforeDecimal = cleanedNoSpace.slice(0, lastDot).replace(/\./g, "").replace(/,/g, "");
39
+ const afterDecimal = cleanedNoSpace.slice(lastDot + 1);
40
+ cleanedNoSpace = beforeDecimal + "." + afterDecimal;
41
+ } else if (lastComma !== -1) {
42
+ cleanedNoSpace = cleanedNoSpace.replace(/,/g, "");
43
+ } else if (lastDot !== -1) {
44
+ cleanedNoSpace = cleanedNoSpace.replace(/\./g, "");
45
+ }
46
+ }
47
+ }
48
+ }
49
+ const num = parseFloat(cleanedNoSpace) || 0;
50
+ return isNegative ? -num : num;
51
+ };
52
+
53
+ export { parseCurrencyString };
@@ -1 +1,26 @@
1
- "use strict";var r=require("./chunk-UDA26MCU.cjs"),e=require("./chunk-PZQ6I4JJ.cjs");exports.assertIsBigInt=(s,i={})=>{if(r.isBigInt(s))return;const n=e.resolveErrorMessageAssertions({value:s,options:i,requiredValidType:"big int"});throw new TypeError(n)},exports.assertIsNumber=(r,s={})=>{const i=e.hasOwnProp(s,"includeNaN")?s.includeNaN:void 0;if(e.isNumber(r,{includeNaN:i}))return;const n=e.resolveErrorMessageAssertions({value:r,options:s,requiredValidType:"number"});throw new TypeError(n)};
1
+ 'use strict';
2
+
3
+ var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
4
+ var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
5
+ var assertIsBigInt = (value, options = {}) => {
6
+ if (chunkUDA26MCU_cjs.isBigInt(value)) return;
7
+ const errorMessage = chunkPZQ6I4JJ_cjs.resolveErrorMessageAssertions({
8
+ value,
9
+ options,
10
+ requiredValidType: "big int"
11
+ });
12
+ throw new TypeError(errorMessage);
13
+ };
14
+ var assertIsNumber = (value, options = {}) => {
15
+ const includeNaN = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
16
+ if (chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN })) return;
17
+ const errorMessage = chunkPZQ6I4JJ_cjs.resolveErrorMessageAssertions({
18
+ value,
19
+ options,
20
+ requiredValidType: "number"
21
+ });
22
+ throw new TypeError(errorMessage);
23
+ };
24
+
25
+ exports.assertIsBigInt = assertIsBigInt;
26
+ exports.assertIsNumber = assertIsNumber;
@@ -1 +1,6 @@
1
- import{isNonEmptyString as r}from"./chunk-CMW2TBOQ.js";var m=m=>r(m)?m.trim():"";export{m as normalizeString};
1
+ import { isNonEmptyString } from './chunk-CMW2TBOQ.js';
2
+ var normalizeString = (input) => {
3
+ return isNonEmptyString(input) ? input.trim() : "";
4
+ };
5
+
6
+ export { normalizeString };
@@ -1 +1,93 @@
1
- "use strict";var e=require("./chunk-T7PU2V7X.cjs"),r=require("./chunk-PZQ6I4JJ.cjs"),t=e=>e instanceof RegExp;function n(e){return e instanceof ArrayBuffer}function i(f,s,u,o=new WeakMap){if(f===s)return!0;if(f!=f&&s!=s)return!0;if(!r.isObjectOrArray(f)||!r.isObjectOrArray(s))return!1;if(o.get(f)===s)return!0;o.set(f,s);const a=(e,t,n,f,s)=>{if(u){const i=u(e,t,n,f,s,o);if(!r.isUndefined(i))return i}return i(e,t,u,o)};if(e.isDate(f)&&e.isDate(s))return f.getTime()===s.getTime();if(t(f)&&t(s))return f.source===s.source&&f.flags===s.flags;if(r.isError(f)&&r.isError(s))return f.name===s.name&&f.message===s.message;if(ArrayBuffer.isView(f)&&ArrayBuffer.isView(s)){const e=new Uint8Array(f.buffer,f.byteOffset,f.byteLength),r=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}if(n(f)&&n(s)){if(f.byteLength!==s.byteLength)return!1;const e=new Uint8Array(f),r=new Uint8Array(s);for(let t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}if(e.isMap(f)&&e.isMap(s)){if(f.size!==s.size)return!1;for(const[e,r]of f){if(!s.has(e))return!1;if(!i(r,s.get(e),u,o))return!1}return!0}if(r.isSet(f)&&r.isSet(s)){if(f.size!==s.size)return!1;for(const e of f){let r=!1;for(const t of s)if(i(e,t,u,o)){r=!0;break}if(!r)return!1}return!0}if(r.isArray(f)&&r.isArray(s)){if(f.length!==s.length)return!1;for(let e=0;e<f.length;e++)if(!a(f[e],s[e],e,f,s))return!1;return!0}if(Object.getPrototypeOf(f)!==Object.getPrototypeOf(s))return!1;const c=Reflect.ownKeys(f),g=Reflect.ownKeys(s);if(c.length!==g.length)return!1;for(const e of c){if(!a(f[e],s[e],e,f,s))return!1}return!0}exports.baseDeepEqual=i,exports.isArrayBuffer=n,exports.isEqual=function(e,r){return i(e,r,void 0,new WeakMap)},exports.isRegExp=t;
1
+ 'use strict';
2
+
3
+ var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
4
+ var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
5
+ var isRegExp = (value) => {
6
+ return value instanceof RegExp;
7
+ };
8
+ function isArrayBuffer(value) {
9
+ return value instanceof ArrayBuffer;
10
+ }
11
+ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
12
+ if (value === other) return true;
13
+ if (value !== value && other !== other) return true;
14
+ if (!chunkPZQ6I4JJ_cjs.isObjectOrArray(value) || !chunkPZQ6I4JJ_cjs.isObjectOrArray(other)) {
15
+ return false;
16
+ }
17
+ if (seen.get(value) === other) return true;
18
+ seen.set(value, other);
19
+ const callCustomizer = (v, o, key, valObj, othObj) => {
20
+ if (customizer) {
21
+ const result = customizer(v, o, key, valObj, othObj, seen);
22
+ if (!chunkPZQ6I4JJ_cjs.isUndefined(result)) return result;
23
+ }
24
+ return baseDeepEqual(v, o, customizer, seen);
25
+ };
26
+ if (chunkT7PU2V7X_cjs.isDate(value) && chunkT7PU2V7X_cjs.isDate(other)) return value.getTime() === other.getTime();
27
+ if (isRegExp(value) && isRegExp(other))
28
+ return value.source === other.source && value.flags === other.flags;
29
+ if (chunkPZQ6I4JJ_cjs.isError(value) && chunkPZQ6I4JJ_cjs.isError(other))
30
+ return value.name === other.name && value.message === other.message;
31
+ if (ArrayBuffer.isView(value) && ArrayBuffer.isView(other)) {
32
+ const v = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
33
+ const o = new Uint8Array(other.buffer, other.byteOffset, other.byteLength);
34
+ if (v.length !== o.length) return false;
35
+ for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
36
+ return true;
37
+ }
38
+ if (isArrayBuffer(value) && isArrayBuffer(other)) {
39
+ if (value.byteLength !== other.byteLength) return false;
40
+ const v = new Uint8Array(value), o = new Uint8Array(other);
41
+ for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
42
+ return true;
43
+ }
44
+ if (chunkT7PU2V7X_cjs.isMap(value) && chunkT7PU2V7X_cjs.isMap(other)) {
45
+ if (value.size !== other.size) return false;
46
+ for (const [k, v] of value) {
47
+ if (!other.has(k)) return false;
48
+ if (!baseDeepEqual(v, other.get(k), customizer, seen)) return false;
49
+ }
50
+ return true;
51
+ }
52
+ if (chunkPZQ6I4JJ_cjs.isSet(value) && chunkPZQ6I4JJ_cjs.isSet(other)) {
53
+ if (value.size !== other.size) return false;
54
+ for (const v of value) {
55
+ let matched = false;
56
+ for (const o of other) {
57
+ if (baseDeepEqual(v, o, customizer, seen)) {
58
+ matched = true;
59
+ break;
60
+ }
61
+ }
62
+ if (!matched) return false;
63
+ }
64
+ return true;
65
+ }
66
+ if (chunkPZQ6I4JJ_cjs.isArray(value) && chunkPZQ6I4JJ_cjs.isArray(other)) {
67
+ if (value.length !== other.length) return false;
68
+ for (let i = 0; i < value.length; i++) {
69
+ if (!callCustomizer(value[i], other[i], i, value, other)) return false;
70
+ }
71
+ return true;
72
+ }
73
+ if (Object.getPrototypeOf(value) !== Object.getPrototypeOf(other)) {
74
+ return false;
75
+ }
76
+ const vKeys = Reflect.ownKeys(value);
77
+ const oKeys = Reflect.ownKeys(other);
78
+ if (vKeys.length !== oKeys.length) return false;
79
+ for (const key of vKeys) {
80
+ const vVal = value[key];
81
+ const oVal = other[key];
82
+ if (!callCustomizer(vVal, oVal, key, value, other)) return false;
83
+ }
84
+ return true;
85
+ }
86
+ function isEqual(value, other) {
87
+ return baseDeepEqual(value, other, void 0, /* @__PURE__ */ new WeakMap());
88
+ }
89
+
90
+ exports.baseDeepEqual = baseDeepEqual;
91
+ exports.isArrayBuffer = isArrayBuffer;
92
+ exports.isEqual = isEqual;
93
+ exports.isRegExp = isRegExp;
@@ -1 +1,81 @@
1
- import{isEmptyString as e}from"./chunk-W2WNBUDE.js";import{isNonEmptyString as r,isPlainObject as t,isString as i,isNumber as s,getPreciseType as a}from"./chunk-CMW2TBOQ.js";var n=(e,i={lowerCaseNextRest:!0,trim:!1})=>{if(!r(e))return"";t(i)||(i={});const s=!1!==i.lowerCaseNextRest;return!0===i.trim&&(e=e.trim()),e[0].toUpperCase()+(s?e.slice(1).toLowerCase():e.slice(1))},o=(e,i={collapseSpaces:!1,trim:!1})=>{if(!r(e))return"";let s=e;t(i)||(i={});const a=!0===i.collapseSpaces;if(!0===i.trim&&(s=s.trim()),a){const e=s.match(/^\s*/)?.[0]??"",r=s.match(/\s*$/)?.[0]??"";s=s.trim().replace(/\s+/g," "),s=`${e}${s}${r}`}return s.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")};function p(r){if(!i(r))return;if(e(r))return"";return r.replace(/<\/?[a-zA-Z][^<>]*\/?>/g," ").trim().replace(/\s+/g," ").trim()}var c=e=>{if(!r(e))return"";const t=(e=e.replace(/\s+/g," ").trim()).split(" ");return t.length>1?t[0][0]+t[1][0].toUpperCase():e.length>1?e.substring(0,2).toUpperCase():e[0].toUpperCase()},l=(e,r,t)=>{if(!s(e)||!i(t)||!i(r))throw new TypeError(`First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${a(e)}\`, 'originalString': \`${a(r)}\`, 'replaceTo': \`${a(t)}\`]".`);if(e<0||e>=r.length)throw new RangeError("First parameter (`index`) is out of range from second parameter (`originalString`).");return r.slice(0,e)+t+r.slice(e+1)};export{n as capitalizeFirst,o as capitalizeWords,c as getInitialsName,l as replaceAt,p as stripHtmlTags};
1
+ import { isEmptyString } from './chunk-W2WNBUDE.js';
2
+ import { isNonEmptyString, isPlainObject, isString, isNumber, getPreciseType } from './chunk-CMW2TBOQ.js';
3
+ var capitalizeFirst = (string, options = {
4
+ lowerCaseNextRest: true,
5
+ trim: false
6
+ }) => {
7
+ if (!isNonEmptyString(string)) return "";
8
+ if (!isPlainObject(options)) {
9
+ options = {};
10
+ }
11
+ const lowerCaseNextRest = options.lowerCaseNextRest !== false;
12
+ const trim = options.trim === true;
13
+ if (trim) string = string.trim();
14
+ return string[0].toUpperCase() + (lowerCaseNextRest ? string.slice(1).toLowerCase() : string.slice(1));
15
+ };
16
+ var capitalizeWords = (value, options = {
17
+ collapseSpaces: false,
18
+ trim: false
19
+ }) => {
20
+ if (!isNonEmptyString(value)) return "";
21
+ let result = value;
22
+ if (!isPlainObject(options)) {
23
+ options = {};
24
+ }
25
+ const collapseSpaces = options.collapseSpaces === true;
26
+ const trim = options.trim === true;
27
+ if (trim) {
28
+ result = result.trim();
29
+ }
30
+ if (collapseSpaces) {
31
+ const leadingSpaces = result.match(/^\s*/)?.[0] ?? "";
32
+ const trailingSpaces = result.match(/\s*$/)?.[0] ?? "";
33
+ result = result.trim().replace(/\s+/g, " ");
34
+ result = `${leadingSpaces}${result}${trailingSpaces}`;
35
+ }
36
+ return result.toLowerCase().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
37
+ };
38
+ function stripHtmlTags(input) {
39
+ if (!isString(input)) {
40
+ return void 0;
41
+ }
42
+ if (isEmptyString(input)) {
43
+ return "";
44
+ }
45
+ const stripped = input.replace(/<\/?[a-zA-Z][^<>]*\/?>/g, " ").trim();
46
+ const cleaned = stripped.replace(/\s+/g, " ").trim();
47
+ return cleaned;
48
+ }
49
+ var getInitialsName = (name) => {
50
+ if (!isNonEmptyString(name)) return "";
51
+ name = name.replace(/\s+/g, " ").trim();
52
+ const nameParts = name.split(" ");
53
+ if (nameParts.length > 1) {
54
+ return nameParts[0][0] + nameParts[1][0].toUpperCase();
55
+ }
56
+ return name.length > 1 ? name.substring(0, 2).toUpperCase() : (
57
+ // First two letters for single-word names
58
+ name[0].toUpperCase()
59
+ );
60
+ };
61
+ var replaceAt = (index, originalString, replaceTo) => {
62
+ if (!isNumber(index) || !isString(replaceTo) || !isString(originalString)) {
63
+ throw new TypeError(
64
+ `First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${getPreciseType(
65
+ index
66
+ )}\`, 'originalString': \`${getPreciseType(
67
+ originalString
68
+ )}\`, 'replaceTo': \`${getPreciseType(replaceTo)}\`]".`
69
+ );
70
+ }
71
+ if (index < 0 || index >= originalString.length) {
72
+ throw new RangeError(
73
+ `First parameter (\`index\`) is out of range from second parameter (\`originalString\`).`
74
+ );
75
+ }
76
+ return originalString.slice(0, index) + // Extract before the index
77
+ replaceTo + // Insert replacement
78
+ originalString.slice(index + 1);
79
+ };
80
+
81
+ export { capitalizeFirst, capitalizeWords, getInitialsName, replaceAt, stripHtmlTags };
@@ -1 +1,334 @@
1
- import{isURL as e}from"./chunk-ONZFBJVW.js";import{isTypedArray as r}from"./chunk-5IGC6PBH.js";import{parseCurrencyString as t}from"./chunk-IRFL4MAX.js";import{isEmptyString as n}from"./chunk-W2WNBUDE.js";import{assertIsString as o}from"./chunk-SBKGWRS5.js";import{isEqual as i,isRegExp as u,baseDeepEqual as a}from"./chunk-NBZWMBO6.js";import{isEmptyArray as s}from"./chunk-6JFCSH7J.js";import{safeStableStringify as f,isDate as c,isMap as p}from"./chunk-PET42Z7W.js";import{isArray as m,getPreciseType as h,assertIsBoolean as y,isNonEmptyString as l,assertIsPlainObject as g,isObjectOrArray as b,isFunction as d,isString as v,isNumber as T,isSymbol as $,isSet as j,isPlainObject as S,isNil as w,isBoolean as N,isBuffer as k,isNaN as O,isUndefined as E,isObject as P,isNull as W}from"./chunk-CMW2TBOQ.js";var A=(e,r,t=!1)=>{if(!m(e)||!m(r))throw new TypeError(`Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${h(e)}\`, 'array2': \`${h(r)}\`].`);if(y(t,{message:({currentType:e,validType:r})=>`Third parameter \`ignoreOrder\` must be of type \`${r}\`, but received: \`${e}\`.`}),!i(e.length,r.length))return!1;const n=e=>{if(!m(e))return e;return e.map(e=>m(e)?n(e):e).sort((e,r)=>{const t=f(e),n=f(r);return t<n?-1:t>n?1:0})},o=t?n(e):e,u=t?n(r):r;return!!i(o.length,u.length)&&o.every((e,r)=>f(e)===f(u[r]))},M=(e,r)=>i(e,r),R=(r,t)=>{if(!e(r)||!e(t))throw new TypeError("Parameters `urlA` and `urlB` (first and second parameter) must be instance of URL.");return r.protocol+"//"+r.host+r.pathname==t.protocol+"//"+t.host+t.pathname},B=(r,t)=>{if(!e(r)||!e(t))throw new TypeError("Parameters `urlA` and `urlB` (first and second parameter) must be instance of URL.");return r.protocol+"//"+r.host+r.pathname+r.search==t.protocol+"//"+t.host+t.pathname+t.search},x=(e,r,t={})=>{if(!l(e)||!m(r))return!1;g(t,{message:({currentType:e,validType:r})=>`Third parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const{exactMatch:n=!1,flags:i="i"}=t;y(n,{message:({currentType:e,validType:r})=>`Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),o(i,{message:({currentType:e,validType:r})=>`Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const u=r.filter(e=>l(e)).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return 0!==u.length&&u.every(r=>new RegExp(n?`(?<!\\S)${r}(?!\\S)`:r,i.includes("u")?i:i+"u").test(e))},z=(e,r,t={})=>{if(!l(e)||!m(r))return!1;g(t,{message:({currentType:e,validType:r})=>`Third parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const{exactMatch:n=!1,flags:i="i"}=t;y(n,{message:({currentType:e,validType:r})=>`Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),o(i,{message:({currentType:e,validType:r})=>`Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const u=r.filter(e=>l(e)).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));if(0===u.length)return!1;const a=n?`(?<!\\S)(${u.join("|")})(?!\\S)`:`(${u.join("|")})`;return new RegExp(a,i.includes("u")?i:i+"u").test(e)};function I(e){const r=typeof e;return"string"===r||"number"===r||"symbol"===r}var F=(e,r)=>{if(!b(e))return!1;if(!I(r))throw new TypeError(`Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${h(r)}\`.`);return!!Object.prototype.hasOwnProperty.call(e,r)||(m(e)?e.some(e=>F(e,r)):Object.values(e).some(e=>b(e)&&F(e,r)))},Z=(e,r)=>{if(!m(e)||!m(r)||s(e)||s(r))return!1;const t=new Set(e);return r.some(e=>t.has(e))},C=e=>"[object Arguments]"===Object.prototype.toString.call(e);function U(e){return"number"==typeof e&&e>-1&&Number.isInteger(e)&&e<=Number.MAX_SAFE_INTEGER}function G(e){return!d(e)&&b(e)&&U(e?.length)}function J(e){return b(e)&&U(e.length)}var L=e=>{if(!v(e)&&!T(e))return!1;return 0!==t(e.toString())||"0"===e.toString().trim()},_=(e,r)=>{if("number"==typeof e&&"number"==typeof r&&Number.isNaN(e)&&Number.isNaN(r))return!0;if(e===r)return!0;if(typeof e!=typeof r)return!1;if(c(e)&&c(r))return e.getTime()===r.getTime();if(u(e)&&u(r))return e.toString()===r.toString();if($(e)&&$(r))return e.toString()===r.toString();if(j(e)&&j(r)){if(e.size!==r.size)return!1;const t=Array.from(r),n=new Set;for(const r of e){let e=!1;for(let o=0;o<t.length;o++)if(!n.has(o)&&_(r,t[o])){n.add(o),e=!0;break}if(!e)return!1}return!0}if(p(e)&&p(r)){if(e.size!==r.size)return!1;const t=Array.from(r),n=new Set;for(const[r,o]of e){let e=!1;for(let i=0;i<t.length;i++){if(n.has(i))continue;const[u,a]=t[i];if(_(r,u)&&_(o,a)){n.add(i),e=!0;break}}if(!e)return!1}return!0}if(m(e)&&m(r))return e.length===r.length&&e.every((e,t)=>_(e,r[t]));if(b(e)&&b(r)&&e&&r){if(m(e)!==m(r))return!1;const t=Object.keys(e),n=Object.keys(r);return t.length===n.length&&t.every(t=>_(e[t],r[t]))}return!1};function H(e){return!!e&&"object"==typeof e&&1===e?.nodeType&&!S(e)}function K(e){return!!w(e)||(!!(N(e)||T(e,{includeNaN:!0})||$(e))||(d(e)?0===Object.keys(e).length:v(e)||m(e)||C(e)||r(e)?0===e.length:p(e)||j(e)?0===e.size:k(e)?0===e.length:!!S(e)&&0===Object.keys(e).length))}var X=e=>{if(v(e))return n(e);if(T(e))return O(e);if(m(e))return s(e)||e.every(X);if(b(e)){const r=Object.keys(e),t=Object.getOwnPropertySymbols(e);return 0===r.length&&0===t.length||[...r,...t].every(r=>X(e[r]))}return!e};function D(e,r,t){return a(e,r,t,new WeakMap)}function Q(e,r,t){return q(e,r,t)}function V(e,r){return e===r||0===e&&0===r||Number.isNaN(e)&&Number.isNaN(r)}function q(e,r,t){if(e===r)return!0;if(!b(r))return V(e,r);if(!b(e))return!1;const n=Reflect.ownKeys(r).filter(e=>!(m(r)&&"length"===e));for(const o of n){if(!(o in e))return!1;const n=e[o],i=r[o],u=t?.(n,i,o,e,r);if(E(u)){if(b(n)&&b(i)){if(!Q(n,i,t))return!1}else if(!V(n,i))return!1}else if(!u)return!1}return!0}function Y(e,r){return q(e,r)}var ee=Function.prototype.toString,re=/\{\s*\[native code\]\s*\}/;function te(e){if(!d(e))return!1;try{const r=ee.call(e);return re.test(r)}catch{return!1}}function ne(e){return!w(e)&&(b(e)||d(e))}function oe(e){return"number"==typeof e&&Number.isSafeInteger(e)}var ie=e=>{if(!l(e))return!1;let r;try{r=decodeURIComponent(e)}catch{return!1}if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;return new RegExp(/^https?:\/\/(?:localhost(?::\d+)?(?:[\/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?::\d+)?(?:[\/?#][^\s]*)?)$/).test(r)};function ue(e){return P(e)&&!W(e)&&e instanceof WeakMap}export{A as areArraysEqual,M as areObjectsEqual,R as areURLsEqualPath,B as areURLsIdentical,Z as arrayHasAnyMatch,F as doesKeyExist,C as isArguments,G as isArrayLike,J as isArrayLikeObject,L as isCurrencyLike,_ as isDeepEqual,H as isElement,K as isEmpty,X as isEmptyDeep,D as isEqualWith,U as isLength,Y as isMatch,Q as isMatchWith,te as isNative,ne as isObjectLoose,I as isPropertyKey,oe as isSafeInteger,ie as isValidURL,ue as isWeakMap,x as textContainsAll,z as textContainsAny};
1
+ import { isURL } from './chunk-ONZFBJVW.js';
2
+ import { isTypedArray } from './chunk-5IGC6PBH.js';
3
+ import { parseCurrencyString } from './chunk-IRFL4MAX.js';
4
+ import { isEmptyString } from './chunk-W2WNBUDE.js';
5
+ import { assertIsString } from './chunk-SBKGWRS5.js';
6
+ import { isEqual, isRegExp, baseDeepEqual } from './chunk-NBZWMBO6.js';
7
+ import { isEmptyArray } from './chunk-6JFCSH7J.js';
8
+ import { safeStableStringify, isDate, isMap } from './chunk-PET42Z7W.js';
9
+ import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-CMW2TBOQ.js';
10
+ var areArraysEqual = (array1, array2, ignoreOrder = false) => {
11
+ if (!(isArray(array1) && isArray(array2))) {
12
+ throw new TypeError(
13
+ `Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${getPreciseType(
14
+ array1
15
+ )}\`, 'array2': \`${getPreciseType(array2)}\`].`
16
+ );
17
+ }
18
+ assertIsBoolean(ignoreOrder, {
19
+ message: ({ currentType, validType }) => `Third parameter \`ignoreOrder\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
20
+ });
21
+ if (!isEqual(array1.length, array2.length)) return false;
22
+ const deepIgnoreOrder = (arr) => {
23
+ if (!isArray(arr)) return arr;
24
+ const sorted = arr.map((item) => {
25
+ if (isArray(item)) {
26
+ return deepIgnoreOrder(item);
27
+ }
28
+ return item;
29
+ });
30
+ return sorted.sort((a, b) => {
31
+ const sa = safeStableStringify(a);
32
+ const sb = safeStableStringify(b);
33
+ return sa < sb ? -1 : sa > sb ? 1 : 0;
34
+ });
35
+ };
36
+ const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;
37
+ const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;
38
+ if (!isEqual(normalizedArr1.length, normalizedArr2.length)) return false;
39
+ return normalizedArr1.every(
40
+ (item, index) => safeStableStringify(item) === safeStableStringify(normalizedArr2[index])
41
+ );
42
+ };
43
+ var areObjectsEqual = (object1, object2) => {
44
+ return isEqual(object1, object2);
45
+ };
46
+ var areURLsEqualPath = (urlA, urlB) => {
47
+ if (!isURL(urlA) || !isURL(urlB)) {
48
+ throw new TypeError(
49
+ `Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
50
+ );
51
+ }
52
+ return urlA.protocol + "//" + urlA.host + urlA.pathname === urlB.protocol + "//" + urlB.host + urlB.pathname;
53
+ };
54
+ var areURLsIdentical = (urlA, urlB) => {
55
+ if (!isURL(urlA) || !isURL(urlB)) {
56
+ throw new TypeError(
57
+ `Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
58
+ );
59
+ }
60
+ return urlA.protocol + "//" + urlA.host + urlA.pathname + urlA.search === urlB.protocol + "//" + urlB.host + urlB.pathname + urlB.search;
61
+ };
62
+ var textContainsAll = (text, searchWords, options = {}) => {
63
+ if (!isNonEmptyString(text) || !isArray(searchWords)) {
64
+ return false;
65
+ }
66
+ assertIsPlainObject(options, {
67
+ message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
68
+ });
69
+ const { exactMatch = false, flags = "i" } = options;
70
+ assertIsBoolean(exactMatch, {
71
+ message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
72
+ });
73
+ assertIsString(flags, {
74
+ message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
75
+ });
76
+ const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
77
+ const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
78
+ if (validSearchWords.length === 0) return false;
79
+ return validSearchWords.every((word) => {
80
+ const pattern = exactMatch ? `(?<!\\S)${word}(?!\\S)` : word;
81
+ return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
82
+ });
83
+ };
84
+ var textContainsAny = (text, searchWords, options = {}) => {
85
+ if (!isNonEmptyString(text) || !isArray(searchWords)) {
86
+ return false;
87
+ }
88
+ assertIsPlainObject(options, {
89
+ message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
90
+ });
91
+ const { exactMatch = false, flags = "i" } = options;
92
+ assertIsBoolean(exactMatch, {
93
+ message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
94
+ });
95
+ assertIsString(flags, {
96
+ message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
97
+ });
98
+ const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
99
+ const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
100
+ if (validSearchWords.length === 0) return false;
101
+ const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
102
+ return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
103
+ };
104
+ function isPropertyKey(value) {
105
+ const type = typeof value;
106
+ return type === "string" || type === "number" || type === "symbol";
107
+ }
108
+ var doesKeyExist = (object, key) => {
109
+ if (!isObjectOrArray(object)) return false;
110
+ if (!isPropertyKey(key)) {
111
+ throw new TypeError(
112
+ `Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${getPreciseType(
113
+ key
114
+ )}\`.`
115
+ );
116
+ }
117
+ if (Object.prototype.hasOwnProperty.call(object, key)) return true;
118
+ if (isArray(object)) {
119
+ return object.some((item) => doesKeyExist(item, key));
120
+ }
121
+ return Object.values(object).some(
122
+ (value) => isObjectOrArray(value) && doesKeyExist(value, key)
123
+ );
124
+ };
125
+ var arrayHasAnyMatch = (sourceArray, targetArray) => {
126
+ if (!isArray(sourceArray) || !isArray(targetArray) || isEmptyArray(sourceArray) || isEmptyArray(targetArray)) {
127
+ return false;
128
+ }
129
+ const sourceSet = new Set(sourceArray);
130
+ return targetArray.some((item) => sourceSet.has(item));
131
+ };
132
+ var isArguments = (value) => {
133
+ return Object.prototype.toString.call(value) === "[object Arguments]";
134
+ };
135
+ function isLength(value) {
136
+ return typeof value === "number" && value > -1 && Number.isInteger(value) && value <= Number.MAX_SAFE_INTEGER;
137
+ }
138
+ function isArrayLike(value) {
139
+ return !isFunction(value) && isObjectOrArray(value) && isLength(value?.length);
140
+ }
141
+ function isArrayLikeObject(value) {
142
+ return isObjectOrArray(value) && isLength(value.length);
143
+ }
144
+ var isCurrencyLike = (input) => {
145
+ if (!(isString(input) || isNumber(input))) return false;
146
+ const parsed = parseCurrencyString(input.toString());
147
+ if (parsed !== 0) return true;
148
+ return input.toString().trim() === "0";
149
+ };
150
+ var isDeepEqual = (a, b) => {
151
+ if (typeof a === "number" && typeof b === "number" && Number.isNaN(a) && Number.isNaN(b)) {
152
+ return true;
153
+ }
154
+ if (a === b) return true;
155
+ if (typeof a !== typeof b) return false;
156
+ if (isDate(a) && isDate(b)) {
157
+ return a.getTime() === b.getTime();
158
+ }
159
+ if (isRegExp(a) && isRegExp(b)) {
160
+ return a.toString() === b.toString();
161
+ }
162
+ if (isSymbol(a) && isSymbol(b)) {
163
+ return a.toString() === b.toString();
164
+ }
165
+ if (isSet(a) && isSet(b)) {
166
+ if (a.size !== b.size) return false;
167
+ const bValues = Array.from(b);
168
+ const matched = /* @__PURE__ */ new Set();
169
+ for (const aVal of a) {
170
+ let found = false;
171
+ for (let i = 0; i < bValues.length; i++) {
172
+ if (matched.has(i)) continue;
173
+ if (isDeepEqual(aVal, bValues[i])) {
174
+ matched.add(i);
175
+ found = true;
176
+ break;
177
+ }
178
+ }
179
+ if (!found) return false;
180
+ }
181
+ return true;
182
+ }
183
+ if (isMap(a) && isMap(b)) {
184
+ if (a.size !== b.size) return false;
185
+ const bEntries = Array.from(b);
186
+ const matched = /* @__PURE__ */ new Set();
187
+ for (const [aKey, aVal] of a) {
188
+ let found = false;
189
+ for (let i = 0; i < bEntries.length; i++) {
190
+ if (matched.has(i)) continue;
191
+ const [bKey, bVal] = bEntries[i];
192
+ if (isDeepEqual(aKey, bKey) && isDeepEqual(aVal, bVal)) {
193
+ matched.add(i);
194
+ found = true;
195
+ break;
196
+ }
197
+ }
198
+ if (!found) return false;
199
+ }
200
+ return true;
201
+ }
202
+ if (isArray(a) && isArray(b)) {
203
+ if (a.length !== b.length) return false;
204
+ return a.every((item, i) => isDeepEqual(item, b[i]));
205
+ }
206
+ if (isObjectOrArray(a) && isObjectOrArray(b) && a && b) {
207
+ if (isArray(a) !== isArray(b)) return false;
208
+ const aKeys = Object.keys(a);
209
+ const bKeys = Object.keys(b);
210
+ if (aKeys.length !== bKeys.length) return false;
211
+ return aKeys.every((key) => isDeepEqual(a[key], b[key]));
212
+ }
213
+ return false;
214
+ };
215
+ function isElement(value) {
216
+ return !!value && typeof value === "object" && value?.nodeType === 1 && !isPlainObject(value);
217
+ }
218
+ function isEmpty(value) {
219
+ if (isNil(value)) return true;
220
+ if (isBoolean(value) || isNumber(value, { includeNaN: true }) || isSymbol(value))
221
+ return true;
222
+ if (isFunction(value)) {
223
+ return Object.keys(value).length === 0;
224
+ }
225
+ if (isString(value) || isArray(value) || isArguments(value) || isTypedArray(value)) {
226
+ return value.length === 0;
227
+ }
228
+ if (isMap(value) || isSet(value)) {
229
+ return value.size === 0;
230
+ }
231
+ if (isBuffer(value)) {
232
+ return value.length === 0;
233
+ }
234
+ if (isPlainObject(value)) {
235
+ return Object.keys(value).length === 0;
236
+ }
237
+ return false;
238
+ }
239
+ var isEmptyDeep = (value) => {
240
+ if (isString(value)) return isEmptyString(value);
241
+ if (isNumber(value)) return isNaN(value);
242
+ if (isArray(value)) {
243
+ return isEmptyArray(value) || value.every(isEmptyDeep);
244
+ }
245
+ if (isObjectOrArray(value)) {
246
+ const keys = Object.keys(value);
247
+ const symbols = Object.getOwnPropertySymbols(value);
248
+ if (keys.length === 0 && symbols.length === 0) return true;
249
+ return [...keys, ...symbols].every((key) => isEmptyDeep(value[key]));
250
+ }
251
+ if (!value) return true;
252
+ return false;
253
+ };
254
+ function isEqualWith(value, other, customizer) {
255
+ return baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
256
+ }
257
+ function isMatchWith(value, other, customizer) {
258
+ return baseIsMatch(value, other, customizer);
259
+ }
260
+ function isSameValue(x, y) {
261
+ return x === y || x === 0 && y === 0 || Number.isNaN(x) && Number.isNaN(y);
262
+ }
263
+ function baseIsMatch(object, source, customizer) {
264
+ if (object === source) return true;
265
+ if (!isObjectOrArray(source)) {
266
+ return isSameValue(object, source);
267
+ }
268
+ if (!isObjectOrArray(object)) {
269
+ return false;
270
+ }
271
+ const keys = Reflect.ownKeys(source).filter(
272
+ (k) => !(isArray(source) && k === "length")
273
+ );
274
+ for (const key of keys) {
275
+ if (!(key in object)) return false;
276
+ const objValue = object[key];
277
+ const srcValue = source[key];
278
+ const result = customizer?.(objValue, srcValue, key, object, source);
279
+ if (!isUndefined(result)) {
280
+ if (!result) return false;
281
+ continue;
282
+ }
283
+ if (isObjectOrArray(objValue) && isObjectOrArray(srcValue)) {
284
+ if (!isMatchWith(objValue, srcValue, customizer)) return false;
285
+ } else {
286
+ if (!isSameValue(objValue, srcValue)) return false;
287
+ }
288
+ }
289
+ return true;
290
+ }
291
+ function isMatch(object, source) {
292
+ return baseIsMatch(object, source);
293
+ }
294
+ var funcToString = Function.prototype.toString;
295
+ var reIsNative = /\{\s*\[native code\]\s*\}/;
296
+ function isNative(value) {
297
+ if (!isFunction(value)) return false;
298
+ try {
299
+ const source = funcToString.call(value);
300
+ return reIsNative.test(source);
301
+ } catch {
302
+ return false;
303
+ }
304
+ }
305
+ function isObjectLoose(value) {
306
+ return !isNil(value) && (isObjectOrArray(value) || isFunction(value));
307
+ }
308
+ function isSafeInteger(value) {
309
+ return typeof value === "number" && Number.isSafeInteger(value);
310
+ }
311
+ var isValidURL = (url) => {
312
+ if (!isNonEmptyString(url)) return false;
313
+ let decodedUrl;
314
+ try {
315
+ decodedUrl = decodeURIComponent(url);
316
+ } catch {
317
+ return false;
318
+ }
319
+ if (!decodedUrl.startsWith("http://") && !decodedUrl.startsWith("https://")) {
320
+ return false;
321
+ }
322
+ const urlPattern = new RegExp(
323
+ /^https?:\/\/(?:localhost(?::\d+)?(?:[\/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?::\d+)?(?:[\/?#][^\s]*)?)$/
324
+ //! DEPRECATED
325
+ // /^https?:\/\/(?:localhost(?::\d+)?(?:[/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6})(?:[/?#][^\s]*)?$/
326
+ // /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/
327
+ );
328
+ return urlPattern.test(decodedUrl);
329
+ };
330
+ function isWeakMap(value) {
331
+ return isObject(value) && !isNull(value) && value instanceof WeakMap;
332
+ }
333
+
334
+ export { areArraysEqual, areObjectsEqual, areURLsEqualPath, areURLsIdentical, arrayHasAnyMatch, doesKeyExist, isArguments, isArrayLike, isArrayLikeObject, isCurrencyLike, isDeepEqual, isElement, isEmpty, isEmptyDeep, isEqualWith, isLength, isMatch, isMatchWith, isNative, isObjectLoose, isPropertyKey, isSafeInteger, isValidURL, isWeakMap, textContainsAll, textContainsAny };
@@ -1 +1,6 @@
1
- "use strict";exports.isURL=s=>s instanceof URL;
1
+ 'use strict';
2
+ var isURL = (value) => {
3
+ return value instanceof URL;
4
+ };
5
+
6
+ exports.isURL = isURL;
@@ -1 +1,16 @@
1
- "use strict";var r=require("./chunk-PZQ6I4JJ.cjs");exports.removeSpaces=(e,t={trimOnly:!1})=>{if(!r.isNonEmptyString(e))return"";r.isPlainObject(t)||(t={});const{trimOnly:i=!1}=t;return i?e.trim():e.replace(/\s+/g,"")};
1
+ 'use strict';
2
+
3
+ var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
4
+ var removeSpaces = (value, options = {
5
+ trimOnly: false
6
+ }) => {
7
+ if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(value)) return "";
8
+ if (!chunkPZQ6I4JJ_cjs.isPlainObject(options)) {
9
+ options = {};
10
+ }
11
+ const { trimOnly = false } = options;
12
+ if (trimOnly) return value.trim();
13
+ return value.replace(/\s+/g, "");
14
+ };
15
+
16
+ exports.removeSpaces = removeSpaces;
@@ -1 +1,5 @@
1
- var e=()=>"undefined"==typeof window||"undefined"==typeof document;export{e as isServer};
1
+ var isServer = () => {
2
+ return typeof window === "undefined" || typeof document === "undefined";
3
+ };
4
+
5
+ export { isServer };