@rzl-zone/utils-js 3.3.1 → 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 (132) 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 +2 -2
  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 +2 -2
  81. package/dist/formatters/index.js +10 -1
  82. package/dist/generators/index.cjs +31 -1
  83. package/dist/generators/index.d.ts +2 -2
  84. package/dist/generators/index.js +6 -1
  85. package/dist/index.d.ts +1 -1
  86. package/dist/{isPlainObject-DGJkcFYw.d.ts → isPlainObject-FWmcJF6k.d.ts} +5 -5
  87. package/dist/next/index.cjs +205 -1
  88. package/dist/next/index.d.ts +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 -24
  116. package/dist/NumberRangeUnion-B6bhM2s7.d.ts +0 -33
  117. package/dist/any-v4TsK9ES.d.ts +0 -66
  118. package/dist/arrays-normalize-recursive-BqmVuFlD.d.ts +0 -72
  119. package/dist/chunk-JYQTCICM.js +0 -1
  120. package/dist/chunk-YLA3DURS.cjs +0 -1
  121. package/dist/extends-DtdRjDyU.d.ts +0 -343
  122. package/dist/if-ChM35c_q.d.ts +0 -19
  123. package/dist/is-array-BJeHxPM3.d.ts +0 -952
  124. package/dist/never-D89PbPh5.d.ts +0 -66
  125. package/dist/nils-CO8zLHSB.d.ts +0 -151
  126. package/dist/or-C6qzKt2I.d.ts +0 -82
  127. package/dist/override-CL2olHE5.d.ts +0 -59
  128. package/dist/pick-BSMX6Xe2.d.ts +0 -15
  129. package/dist/prettify-3o8_Kw6b.d.ts +0 -564
  130. package/dist/promises-LU7K00H0.d.ts +0 -72
  131. package/dist/string-B1jlOnws.d.ts +0 -312
  132. package/dist/types/index.d.ts +0 -3345
@@ -1 +1,531 @@
1
- "use strict";var e=require("./chunk-CAH33WOQ.cjs"),r=require("./chunk-NRF6LWBC.cjs"),t=require("./chunk-E55EQK2U.cjs"),i=require("./chunk-HYRQMTRH.cjs"),s=require("./chunk-JBQMXC5I.cjs"),n=require("./chunk-ZETAZZLD.cjs"),o=require("./chunk-6JFZL7YE.cjs"),a=require("./chunk-T7PU2V7X.cjs"),m=require("./chunk-UDA26MCU.cjs"),p=require("./chunk-PZQ6I4JJ.cjs");function y(e,r){if(!1!==r&&"stringOrNumber"!==r&&"primitives"!==r&&"all"!==r)throw new TypeError(`Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${p.getPreciseType(r)}\`, with value: \`${a.safeStableStringify(r)}\`.`);if(p.isNaN(e))return"primitives"===r||"all"===r?"NaN":NaN;if(p.isString(e)||p.isNumber(e))return"stringOrNumber"===r||"primitives"===r||"all"===r?String(e):e;if(p.isBoolean(e)||m.isBigInt(e)||p.isNil(e))return"primitives"===r||"all"===r?String(e):e;if(p.isNumberObject(e)||p.isBooleanObject(e)||p.isStringObject(e))return"all"===r?e.valueOf().toString():e;if(p.isSymbol(e))return"all"===r?e.toString():e;if(p.isFunction(e))return"all"===r?e.toString():e;if(p.isArray(e))return e.map(e=>y(e,r));if(p.isObjectOrArray(e)){if(a.isDate(e))return"all"===r?e.toISOString():e;if(s.isRegExp(e))return"all"===r?e.toString():e;if(p.isError(e)||e instanceof Promise)return"all"===r?e.toString():e;if(p.isSet(e))return"all"===r?[...e].map(e=>y(e,r)):e;if(a.isMap(e))return"all"===r?[...e.entries()].map(([e,t])=>[y(e,r),y(t,r)]):e;const t={};if(p.isObject(e))for(const i of Object.keys(e))t[i]=y(e[i],r);return t}return e}var c=e=>!p.isNil(e)&&(p.isString(e)?p.isNonEmptyString(e):p.isBoolean(e)?e:p.isNumber(e,{includeNaN:!0})?0!==e:p.isArray(e)?e.some(c):!!p.isObject(e)&&Object.values(e).some(c)),u=(e,r)=>{if(!p.isObjectOrArray(e))return e;const[t,...i]=r;if(p.isArray(e))for(const t of e)p.isObjectOrArray(t)&&u(t,r);else n.isEmptyArray(i)?p.isPlainObject(e)&&delete e[t]:p.isPlainObject(e)&&p.isObjectOrArray(e[t])&&u(e[t],i);return e},f=(e,r)=>{if(!p.isPlainObject(e))return e;const[t,...i]=r;return 0===i.length?p.isPlainObject(e)&&delete e[t]:p.isPlainObject(e[t])&&f(e[t],i),e};exports.convertType=e=>{const r={undefined:void 0,null:null,nan:NaN,true:!0,false:!1,yes:!0,no:!1};if(p.isString(e)){const t=e.trim().toLowerCase();if(Object.prototype.hasOwnProperty.call(r,t))return r[t];const i=t.replace(/,/g,""),s=Number(i);return!p.isNaN(s)&&p.isNonEmptyString(i)?s:e.trim()}return e},exports.dedupeArray=(e,r={})=>{o.assertIsArray(e,{message:({currentType:e,validType:r})=>`First parameter (\`inputArray\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`}),p.assertIsPlainObject(r,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const t=!!p.hasOwnProp(r,"flatten")&&r.flatten,i=!!p.hasOwnProp(r,"forceToString")&&r.forceToString;if(!1!==i&&"stringOrNumber"!==i&&"primitives"!==i&&"all"!==i)throw new TypeError(`Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${p.getPreciseType(i)}\`, with value: \`${a.safeStableStringify(i)}\`.`);p.assertIsBoolean(t,{message:({currentType:e,validType:r})=>`Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const n=e=>{const r=[];return e.reduce((e,t)=>{const o=p.isArray(t)?n(t):y(t,i);return r.some(e=>s.isEqual(e,o))||(r.push(o),e.push(o)),e},[])},m=e=>p.isArray(e)?e.flatMap(m):p.isSet(e)?[...e].flatMap(m):a.isMap(e)?[...e.values()].flatMap(m):[e];return n(t?m(e):e)},exports.removeObjectPaths=function(e,r,t=!0){if(n.isEmptyObject(e,{checkSymbols:!0}))return{};if(o.assertIsArray(r,{message:({currentType:e,validType:t})=>`Second parameter (\`keysToDelete\`) must be of type \`${t}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${e}\`, with value: \`${a.safeStableStringify(r)}\`.`}),!r.every(e=>p.isPlainObject(e)&&"key"in e))throw new TypeError(`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${a.safeStableStringify(r)}\`.`);let s=t?(e=>{try{if(p.isFunction(structuredClone))return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))})(e):e;for(const{key:e,deep:t}of r){if(i.assertIsString(e,{message:({currentType:e,validType:r})=>`Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${r}\`, but received: \`${e}\`.`}),!p.isUndefined(t)&&!p.isBoolean(t))throw new TypeError(`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) ➔ (key: "${e}", deep: ${t}) must be of type \`boolean\` or \`undefined\`, but received: \`${p.getPreciseType(t)}\`.`);const r=e.split(".");s=t?u(s,r):f(s,r)}return s},exports.toBooleanContent=r=>!p.isNil(r)&&(p.isString(r)?p.isNonEmptyString(r):p.isBoolean(r)?r:p.isNumber(r,{includeNaN:!0})?0!==r:p.isArray(r)||p.isObject(r)?e.isNonEmptyValue(r):Boolean(r)),exports.toBooleanContentDeep=c,exports.toBooleanExplicit=(e,r={})=>{if(p.isNil(e))return!1;p.isPlainObject(r)||(r={});const t=!!p.hasOwnProp(r,"caseInsensitive")&&r.caseInsensitive,i=!p.hasOwnProp(r,"trimString")||r.trimString,s=!!p.hasOwnProp(r,"includeIndeterminate")&&r.includeIndeterminate;if(!p.isBoolean(t)||!p.isBoolean(i)||!p.isBoolean(s))throw new TypeError(`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${p.getPreciseType(t)}\`, 'trimString': \`${p.getPreciseType(i)}\`, 'includeIndeterminate': \`${p.getPreciseType(s)}\`].`);if(p.isString(e)){let r=e;i&&(r=r.trim()),t&&(r=r.toLowerCase());const n=["true","on","yes","1"];return s&&n.push("indeterminate"),n.includes(r)}return p.isNumber(e)?1===e:!!p.isBoolean(e)&&e},exports.toBooleanLoose=e=>!p.isNil(e)&&(p.isString(e)?!t.isEmptyString(e):p.isBoolean(e)?e:p.isNumber(e,{includeNaN:!0})?0!==e:p.isArray(e)?e.length>0:Boolean(e)),exports.toNumberArrayUnRecursive=function(e,t={}){p.assertIsPlainObject(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const i=!p.hasOwnProp(t,"removeInvalidValueNumber")||t.removeInvalidValueNumber;if(p.assertIsBoolean(i,{message:({currentType:e,validType:r})=>`Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),p.isArray(e)){const t=Array.from(e,e=>{if(m.isBigInt(e))return Number(e);const r=String(e).trim().match(/-?\d+(\.\d+)?/);return r?Number(r[0]):p.isNull(e)?null:void 0});return i?r.filterNilArray(t):t}},exports.toNumberDeep=function(r,t={}){return p.assertIsPlainObject(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`}),function r(t,i){if(p.isNil(t)||s.isRegExp(t))return;const{removeEmptyArrays:o,removeEmptyObjects:m,isRoot:y}=i;if(!p.isBoolean(m)||!p.isBoolean(o))throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${p.getPreciseType(m)}\`, 'removeEmptyArrays': \`${p.getPreciseType(o)}\`].`);if(p.isNumber(t)||p.isBoolean(t)||p.isNonEmptyString(t)){const e=Number(t);return p.isInfinityNumber(e)||p.isNaN(e)?void 0:e}if(p.isNumberObject(t)||p.isStringObject(t)||p.isBooleanObject(t)){const e=Number(t.valueOf());return p.isInfinityNumber(e)||p.isNaN(e)?void 0:e}if(a.isDate(t,{skipInvalidDate:!0}))try{return p.isNaN(t.getTime())?0:t.getTime()}catch{return 0}if(p.isBuffer(t)){const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}if(e.isTypedArray(t)){if(t instanceof BigInt64Array||t instanceof BigUint64Array){const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}{const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}}if(p.isSet(t)){const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}if(a.isMap(t)){let e=Array.from(t.entries()).map(([e,t])=>{const i=r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1}),s=r(t,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1});return p.isUndefined(i)||p.isUndefined(s)?void 0:[i,s]}).filter(e=>!p.isUndefined(e));if(o&&(e=e.filter(e=>!n.isEmptyArray(e))),o&&n.isEmptyArray(e))return;return e}if(p.isArray(t)){const e=t.map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}if(p.isObject(t)){const e={};for(const[i,s]of Object.entries(t)){const t=r(s,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1});p.isUndefined(t)||(e[i]=t)}return m&&n.isEmptyObject(e)?y?{}:void 0:e}}(r,{removeEmptyObjects:!!p.hasOwnProp(t,"removeEmptyObjects")&&t.removeEmptyObjects,removeEmptyArrays:!!p.hasOwnProp(t,"removeEmptyArrays")&&t.removeEmptyArrays,isRoot:!0})},exports.toStringDeep=function(r,t={}){return p.assertIsPlainObject(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`}),function r(t,i){if(p.isNil(t)||p.isInfinityNumber(t))return;const{removeEmptyArrays:o,removeEmptyObjects:m,isRoot:y}=i;if(!p.isBoolean(m)||!p.isBoolean(o))throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${p.getPreciseType(m)}\`, 'removeEmptyArrays': \`${p.getPreciseType(o)}\`].`);if(p.isNumber(t)||p.isString(t)||p.isBoolean(t))return String(t);if(p.isNumberObject(t)){const e=t.valueOf();return p.isInfinityNumber(e)||p.isNaN(e)?void 0:e.toString()}if(p.isStringObject(t))return t.valueOf();if(p.isBooleanObject(t))return t.valueOf().toString();if(a.isDate(t,{skipInvalidDate:!0}))try{return t.toISOString()}catch{return t.toString()}if(s.isRegExp(t))return t.toString();if(p.isBuffer(t))return Array.from(t).map(e=>String(e)).filter(e=>!p.isUndefined(e));if(e.isTypedArray(t)){if(t instanceof BigInt64Array||t instanceof BigUint64Array){const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).map(e=>String(e)).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}{const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).map(e=>String(e)).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}}if(p.isSet(t)){const e=Array.from(t).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&n.isEmptyArray(e))return;return e}if(a.isMap(t)){const e=Array.from(t.entries()).map(([e,t])=>[r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1}),r(t,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})]).filter(([e,r])=>!p.isUndefined(e)&&!p.isUndefined(r));if(o&&n.isEmptyArray(e))return;return e}if(p.isArray(t)){let e=t.map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!p.isUndefined(e));if(o&&(e=e.filter(e=>!(p.isArray(e)&&0===e.length))),o&&n.isEmptyArray(e))return;return e}if(p.isObject(t)){const e={};for(const[i,s]of Object.entries(t)){const t=r(s,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1});p.isUndefined(t)?p.isArray(s)&&!o&&(e[i]=[]):e[i]=t}return m&&0===Object.keys(e).length?y?{}:void 0:e}}(r,{removeEmptyObjects:!!p.hasOwnProp(t,"removeEmptyObjects")&&t.removeEmptyObjects,removeEmptyArrays:!!p.hasOwnProp(t,"removeEmptyArrays")&&t.removeEmptyArrays,isRoot:!0})},exports.toStringDeepForce=y;
1
+ 'use strict';
2
+
3
+ var chunkCAH33WOQ_cjs = require('./chunk-CAH33WOQ.cjs');
4
+ var chunkNRF6LWBC_cjs = require('./chunk-NRF6LWBC.cjs');
5
+ var chunkE55EQK2U_cjs = require('./chunk-E55EQK2U.cjs');
6
+ var chunkHYRQMTRH_cjs = require('./chunk-HYRQMTRH.cjs');
7
+ var chunkJBQMXC5I_cjs = require('./chunk-JBQMXC5I.cjs');
8
+ var chunkZETAZZLD_cjs = require('./chunk-ZETAZZLD.cjs');
9
+ var chunk6JFZL7YE_cjs = require('./chunk-6JFZL7YE.cjs');
10
+ var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
11
+ var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
12
+ var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
13
+ function toNumberArrayUnRecursive(array, options = {}) {
14
+ chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
15
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
16
+ });
17
+ const riv = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "removeInvalidValueNumber") ? options.removeInvalidValueNumber : true;
18
+ chunkPZQ6I4JJ_cjs.assertIsBoolean(riv, {
19
+ message: ({ currentType, validType }) => `Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
20
+ });
21
+ if (chunkPZQ6I4JJ_cjs.isArray(array)) {
22
+ const result = Array.from(array, (x) => {
23
+ if (chunkUDA26MCU_cjs.isBigInt(x)) return Number(x);
24
+ const str = String(x).trim();
25
+ const match = str.match(/-?\d+(\.\d+)?/);
26
+ return match ? Number(match[0]) : chunkPZQ6I4JJ_cjs.isNull(x) ? null : void 0;
27
+ });
28
+ return riv ? chunkNRF6LWBC_cjs.filterNilArray(result) : result;
29
+ }
30
+ return void 0;
31
+ }
32
+ function toStringDeepForce(value, forceToString) {
33
+ if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
34
+ throw new TypeError(
35
+ `Second parameter \`forceToString\` must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkPZQ6I4JJ_cjs.getPreciseType(
36
+ forceToString
37
+ )}\`, with value: \`${chunkT7PU2V7X_cjs.safeStableStringify(forceToString)}\`.`
38
+ );
39
+ }
40
+ if (chunkPZQ6I4JJ_cjs.isNaN(value)) {
41
+ return forceToString === "primitives" || forceToString === "all" ? "NaN" : NaN;
42
+ }
43
+ if (chunkPZQ6I4JJ_cjs.isString(value) || chunkPZQ6I4JJ_cjs.isNumber(value)) {
44
+ return forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all" ? String(value) : value;
45
+ }
46
+ if (chunkPZQ6I4JJ_cjs.isBoolean(value) || chunkUDA26MCU_cjs.isBigInt(value) || chunkPZQ6I4JJ_cjs.isNil(value)) {
47
+ return forceToString === "primitives" || forceToString === "all" ? String(value) : value;
48
+ }
49
+ if (chunkPZQ6I4JJ_cjs.isNumberObject(value) || chunkPZQ6I4JJ_cjs.isBooleanObject(value) || chunkPZQ6I4JJ_cjs.isStringObject(value)) {
50
+ return forceToString === "all" ? value.valueOf().toString() : value;
51
+ }
52
+ if (chunkPZQ6I4JJ_cjs.isSymbol(value)) {
53
+ return forceToString === "all" ? value.toString() : value;
54
+ }
55
+ if (chunkPZQ6I4JJ_cjs.isFunction(value)) {
56
+ return forceToString === "all" ? value.toString() : value;
57
+ }
58
+ if (chunkPZQ6I4JJ_cjs.isArray(value)) {
59
+ return value.map((v) => toStringDeepForce(v, forceToString));
60
+ }
61
+ if (chunkPZQ6I4JJ_cjs.isObjectOrArray(value)) {
62
+ if (chunkT7PU2V7X_cjs.isDate(value)) {
63
+ return forceToString === "all" ? value.toISOString() : value;
64
+ }
65
+ if (chunkJBQMXC5I_cjs.isRegExp(value)) {
66
+ return forceToString === "all" ? value.toString() : value;
67
+ }
68
+ if (chunkPZQ6I4JJ_cjs.isError(value) || value instanceof Promise) {
69
+ return forceToString === "all" ? value.toString() : value;
70
+ }
71
+ if (chunkPZQ6I4JJ_cjs.isSet(value)) {
72
+ return forceToString === "all" ? [...value].map((v) => toStringDeepForce(v, forceToString)) : value;
73
+ }
74
+ if (chunkT7PU2V7X_cjs.isMap(value)) {
75
+ return forceToString === "all" ? [...value.entries()].map(([k, v]) => [
76
+ toStringDeepForce(k, forceToString),
77
+ toStringDeepForce(v, forceToString)
78
+ ]) : value;
79
+ }
80
+ const result = {};
81
+ if (chunkPZQ6I4JJ_cjs.isObject(value)) {
82
+ for (const key of Object.keys(value)) {
83
+ result[key] = toStringDeepForce(value[key], forceToString);
84
+ }
85
+ }
86
+ return result;
87
+ }
88
+ return value;
89
+ }
90
+ var dedupeArray = (inputArray, options = {}) => {
91
+ chunk6JFZL7YE_cjs.assertIsArray(inputArray, {
92
+ message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
93
+ });
94
+ chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
95
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
96
+ });
97
+ const flatten = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "flatten") ? options.flatten : false;
98
+ const forceToString = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "forceToString") ? options.forceToString : false;
99
+ if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
100
+ throw new TypeError(
101
+ `Parameter \`forceToString\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` with value one of "stringOrNumber" | "primitives" | "all", but received: \`${chunkPZQ6I4JJ_cjs.getPreciseType(
102
+ forceToString
103
+ )}\`, with value: \`${chunkT7PU2V7X_cjs.safeStableStringify(forceToString)}\`.`
104
+ );
105
+ }
106
+ chunkPZQ6I4JJ_cjs.assertIsBoolean(flatten, {
107
+ message: ({ currentType, validType }) => `Parameter \`flatten\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
108
+ });
109
+ const process = (arr) => {
110
+ const seen = [];
111
+ return arr.reduce((acc, item) => {
112
+ const value = chunkPZQ6I4JJ_cjs.isArray(item) ? process(item) : toStringDeepForce(item, forceToString);
113
+ if (!seen.some((s) => chunkJBQMXC5I_cjs.isEqual(s, value))) {
114
+ seen.push(value);
115
+ acc.push(value);
116
+ }
117
+ return acc;
118
+ }, []);
119
+ };
120
+ const deepFlatten = (value) => {
121
+ if (chunkPZQ6I4JJ_cjs.isArray(value)) {
122
+ return value.flatMap(deepFlatten);
123
+ }
124
+ if (chunkPZQ6I4JJ_cjs.isSet(value)) {
125
+ return [...value].flatMap(deepFlatten);
126
+ }
127
+ if (chunkT7PU2V7X_cjs.isMap(value)) {
128
+ return [...value.values()].flatMap(deepFlatten);
129
+ }
130
+ return [value];
131
+ };
132
+ return flatten ? process(deepFlatten(inputArray)) : process(inputArray);
133
+ };
134
+ var toBooleanContent = (value) => {
135
+ if (chunkPZQ6I4JJ_cjs.isNil(value)) return false;
136
+ if (chunkPZQ6I4JJ_cjs.isString(value)) return chunkPZQ6I4JJ_cjs.isNonEmptyString(value);
137
+ if (chunkPZQ6I4JJ_cjs.isBoolean(value)) return value;
138
+ if (chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
139
+ if (chunkPZQ6I4JJ_cjs.isArray(value) || chunkPZQ6I4JJ_cjs.isObject(value)) return chunkCAH33WOQ_cjs.isNonEmptyValue(value);
140
+ return Boolean(value);
141
+ };
142
+ var toBooleanContentDeep = (value) => {
143
+ if (chunkPZQ6I4JJ_cjs.isNil(value)) return false;
144
+ if (chunkPZQ6I4JJ_cjs.isString(value)) return chunkPZQ6I4JJ_cjs.isNonEmptyString(value);
145
+ if (chunkPZQ6I4JJ_cjs.isBoolean(value)) return value;
146
+ if (chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
147
+ if (chunkPZQ6I4JJ_cjs.isArray(value)) return value.some(toBooleanContentDeep);
148
+ if (chunkPZQ6I4JJ_cjs.isObject(value)) return Object.values(value).some(toBooleanContentDeep);
149
+ return false;
150
+ };
151
+ var toBooleanExplicit = (value, options = {}) => {
152
+ if (chunkPZQ6I4JJ_cjs.isNil(value)) return false;
153
+ if (!chunkPZQ6I4JJ_cjs.isPlainObject(options)) options = {};
154
+ const ci = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "caseInsensitive") ? options.caseInsensitive : false;
155
+ const ts = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "trimString") ? options.trimString : true;
156
+ const incInd = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "includeIndeterminate") ? options.includeIndeterminate : false;
157
+ if (!chunkPZQ6I4JJ_cjs.isBoolean(ci) || !chunkPZQ6I4JJ_cjs.isBoolean(ts) || !chunkPZQ6I4JJ_cjs.isBoolean(incInd)) {
158
+ throw new TypeError(
159
+ `Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${chunkPZQ6I4JJ_cjs.getPreciseType(
160
+ ci
161
+ )}\`, 'trimString': \`${chunkPZQ6I4JJ_cjs.getPreciseType(
162
+ ts
163
+ )}\`, 'includeIndeterminate': \`${chunkPZQ6I4JJ_cjs.getPreciseType(incInd)}\`].`
164
+ );
165
+ }
166
+ if (chunkPZQ6I4JJ_cjs.isString(value)) {
167
+ let normalized = value;
168
+ if (ts) normalized = normalized.trim();
169
+ if (ci) normalized = normalized.toLowerCase();
170
+ const validTrueStrings = ["true", "on", "yes", "1"];
171
+ if (incInd) validTrueStrings.push("indeterminate");
172
+ return validTrueStrings.includes(normalized);
173
+ }
174
+ if (chunkPZQ6I4JJ_cjs.isNumber(value)) return value === 1;
175
+ if (chunkPZQ6I4JJ_cjs.isBoolean(value)) return value;
176
+ return false;
177
+ };
178
+ var toBooleanLoose = (value) => {
179
+ if (chunkPZQ6I4JJ_cjs.isNil(value)) return false;
180
+ if (chunkPZQ6I4JJ_cjs.isString(value)) return !chunkE55EQK2U_cjs.isEmptyString(value);
181
+ if (chunkPZQ6I4JJ_cjs.isBoolean(value)) return value;
182
+ if (chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN: true })) return value !== 0;
183
+ if (chunkPZQ6I4JJ_cjs.isArray(value)) return value.length > 0;
184
+ return Boolean(value);
185
+ };
186
+ var convertType = (value) => {
187
+ const predefinedValues = {
188
+ undefined: void 0,
189
+ null: null,
190
+ nan: NaN,
191
+ true: true,
192
+ false: false,
193
+ yes: true,
194
+ no: false
195
+ };
196
+ if (chunkPZQ6I4JJ_cjs.isString(value)) {
197
+ const normalized = value.trim().toLowerCase();
198
+ if (Object.prototype.hasOwnProperty.call(predefinedValues, normalized)) {
199
+ return predefinedValues[normalized];
200
+ }
201
+ const numericString = normalized.replace(/,/g, "");
202
+ const numberString = Number(numericString);
203
+ if (!chunkPZQ6I4JJ_cjs.isNaN(numberString) && chunkPZQ6I4JJ_cjs.isNonEmptyString(numericString)) {
204
+ return numberString;
205
+ }
206
+ return value.trim();
207
+ }
208
+ return value;
209
+ };
210
+ var deepCloneSafe = (obj) => {
211
+ try {
212
+ if (chunkPZQ6I4JJ_cjs.isFunction(structuredClone)) {
213
+ return structuredClone(obj);
214
+ }
215
+ } catch {
216
+ }
217
+ return JSON.parse(JSON.stringify(obj));
218
+ };
219
+ var deleteNestedKey = (obj, path) => {
220
+ if (!chunkPZQ6I4JJ_cjs.isObjectOrArray(obj)) return obj;
221
+ const [currentKey, ...rest] = path;
222
+ if (chunkPZQ6I4JJ_cjs.isArray(obj)) {
223
+ for (const item of obj) {
224
+ if (chunkPZQ6I4JJ_cjs.isObjectOrArray(item)) deleteNestedKey(item, path);
225
+ }
226
+ } else if (chunkZETAZZLD_cjs.isEmptyArray(rest)) {
227
+ if (chunkPZQ6I4JJ_cjs.isPlainObject(obj)) delete obj[currentKey];
228
+ } else if (chunkPZQ6I4JJ_cjs.isPlainObject(obj) && chunkPZQ6I4JJ_cjs.isObjectOrArray(obj[currentKey])) {
229
+ deleteNestedKey(obj[currentKey], rest);
230
+ }
231
+ return obj;
232
+ };
233
+ var deleteExactPathOnce = (obj, path) => {
234
+ if (!chunkPZQ6I4JJ_cjs.isPlainObject(obj)) return obj;
235
+ const [currentKey, ...rest] = path;
236
+ if (rest.length === 0) {
237
+ if (chunkPZQ6I4JJ_cjs.isPlainObject(obj)) delete obj[currentKey];
238
+ } else if (chunkPZQ6I4JJ_cjs.isPlainObject(obj[currentKey])) {
239
+ deleteExactPathOnce(obj[currentKey], rest);
240
+ }
241
+ return obj;
242
+ };
243
+ function removeObjectPaths(object, keysToDelete, deepClone = true) {
244
+ if (chunkZETAZZLD_cjs.isEmptyObject(object, { checkSymbols: true }))
245
+ return {};
246
+ chunk6JFZL7YE_cjs.assertIsArray(keysToDelete, {
247
+ message: ({ currentType, validType }) => `Second parameter (\`keysToDelete\`) must be of type \`${validType}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${currentType}\`, with value: \`${chunkT7PU2V7X_cjs.safeStableStringify(
248
+ keysToDelete
249
+ )}\`.`
250
+ });
251
+ if (!keysToDelete.every((k) => chunkPZQ6I4JJ_cjs.isPlainObject(k) && "key" in k)) {
252
+ throw new TypeError(
253
+ `Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${chunkT7PU2V7X_cjs.safeStableStringify(
254
+ keysToDelete
255
+ )}\`.`
256
+ );
257
+ }
258
+ let result = deepClone ? deepCloneSafe(object) : object;
259
+ for (const { key, deep } of keysToDelete) {
260
+ chunkHYRQMTRH_cjs.assertIsString(key, {
261
+ message: ({ currentType, validType }) => `Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
262
+ });
263
+ if (!chunkPZQ6I4JJ_cjs.isUndefined(deep) && !chunkPZQ6I4JJ_cjs.isBoolean(deep)) {
264
+ throw new TypeError(
265
+ `Parameter \`deep\` at Second Parameter (\`keysToDelete\`) \u2794 (key: "${key}", deep: ${deep}) must be of type \`boolean\` or \`undefined\`, but received: \`${chunkPZQ6I4JJ_cjs.getPreciseType(
266
+ deep
267
+ )}\`.`
268
+ );
269
+ }
270
+ const path = key.split(".");
271
+ result = deep ? deleteNestedKey(result, path) : deleteExactPathOnce(result, path);
272
+ }
273
+ return result;
274
+ }
275
+ function toNumberDeep(input, options = {}) {
276
+ chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
277
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
278
+ });
279
+ const removeEmptyObjects = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
280
+ const removeEmptyArrays = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
281
+ function _internal(input2, options2) {
282
+ if (chunkPZQ6I4JJ_cjs.isNil(input2) || chunkJBQMXC5I_cjs.isRegExp(input2)) return void 0;
283
+ const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
284
+ if (!chunkPZQ6I4JJ_cjs.isBoolean(removeEmptyObjects2) || !chunkPZQ6I4JJ_cjs.isBoolean(removeEmptyArrays2)) {
285
+ throw new TypeError(
286
+ `Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkPZQ6I4JJ_cjs.getPreciseType(
287
+ removeEmptyObjects2
288
+ )}\`, 'removeEmptyArrays': \`${chunkPZQ6I4JJ_cjs.getPreciseType(removeEmptyArrays2)}\`].`
289
+ );
290
+ }
291
+ if (chunkPZQ6I4JJ_cjs.isNumber(input2) || chunkPZQ6I4JJ_cjs.isBoolean(input2) || chunkPZQ6I4JJ_cjs.isNonEmptyString(input2)) {
292
+ const num = Number(input2);
293
+ return chunkPZQ6I4JJ_cjs.isInfinityNumber(num) || chunkPZQ6I4JJ_cjs.isNaN(num) ? void 0 : num;
294
+ }
295
+ if (chunkPZQ6I4JJ_cjs.isNumberObject(input2) || chunkPZQ6I4JJ_cjs.isStringObject(input2) || chunkPZQ6I4JJ_cjs.isBooleanObject(input2)) {
296
+ const valOf = Number(input2.valueOf());
297
+ return chunkPZQ6I4JJ_cjs.isInfinityNumber(valOf) || chunkPZQ6I4JJ_cjs.isNaN(valOf) ? void 0 : valOf;
298
+ }
299
+ if (chunkT7PU2V7X_cjs.isDate(input2, { skipInvalidDate: true })) {
300
+ try {
301
+ return !chunkPZQ6I4JJ_cjs.isNaN(input2.getTime()) ? input2.getTime() : 0;
302
+ } catch {
303
+ return 0;
304
+ }
305
+ }
306
+ if (chunkPZQ6I4JJ_cjs.isBuffer(input2)) {
307
+ const arr = Array.from(input2).map(
308
+ (n) => _internal(n, {
309
+ removeEmptyObjects: removeEmptyObjects2,
310
+ removeEmptyArrays: removeEmptyArrays2,
311
+ isRoot: false
312
+ })
313
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
314
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(arr)) return void 0;
315
+ return arr;
316
+ }
317
+ if (chunkCAH33WOQ_cjs.isTypedArray(input2)) {
318
+ if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
319
+ const newArray = Array.from(input2).map(
320
+ (item) => _internal(item, {
321
+ removeEmptyObjects: removeEmptyObjects2,
322
+ removeEmptyArrays: removeEmptyArrays2,
323
+ isRoot: false
324
+ })
325
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
326
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
327
+ return newArray;
328
+ } else {
329
+ const newArray = Array.from(input2).map(
330
+ (item) => _internal(item, {
331
+ removeEmptyObjects: removeEmptyObjects2,
332
+ removeEmptyArrays: removeEmptyArrays2,
333
+ isRoot: false
334
+ })
335
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
336
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
337
+ return newArray;
338
+ }
339
+ }
340
+ if (chunkPZQ6I4JJ_cjs.isSet(input2)) {
341
+ const newArray = Array.from(input2).map(
342
+ (item) => _internal(item, {
343
+ removeEmptyObjects: removeEmptyObjects2,
344
+ removeEmptyArrays: removeEmptyArrays2,
345
+ isRoot: false
346
+ })
347
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
348
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
349
+ return newArray;
350
+ }
351
+ if (chunkT7PU2V7X_cjs.isMap(input2)) {
352
+ let newArray = Array.from(input2.entries()).map(([k, v]) => {
353
+ const key = _internal(k, {
354
+ removeEmptyObjects: removeEmptyObjects2,
355
+ removeEmptyArrays: removeEmptyArrays2,
356
+ isRoot: false
357
+ });
358
+ const value = _internal(v, {
359
+ removeEmptyObjects: removeEmptyObjects2,
360
+ removeEmptyArrays: removeEmptyArrays2,
361
+ isRoot: false
362
+ });
363
+ return !chunkPZQ6I4JJ_cjs.isUndefined(key) && !chunkPZQ6I4JJ_cjs.isUndefined(value) ? [key, value] : void 0;
364
+ }).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
365
+ if (removeEmptyArrays2) {
366
+ newArray = newArray.filter((v) => !chunkZETAZZLD_cjs.isEmptyArray(v));
367
+ }
368
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
369
+ return newArray;
370
+ }
371
+ if (chunkPZQ6I4JJ_cjs.isArray(input2)) {
372
+ const newArray = input2.map(
373
+ (item) => _internal(item, {
374
+ removeEmptyObjects: removeEmptyObjects2,
375
+ removeEmptyArrays: removeEmptyArrays2,
376
+ isRoot: false
377
+ })
378
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
379
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
380
+ return newArray;
381
+ }
382
+ if (chunkPZQ6I4JJ_cjs.isObject(input2)) {
383
+ const newObject = {};
384
+ for (const [key, value] of Object.entries(input2)) {
385
+ const convertedValue = _internal(value, {
386
+ removeEmptyObjects: removeEmptyObjects2,
387
+ removeEmptyArrays: removeEmptyArrays2,
388
+ isRoot: false
389
+ });
390
+ if (!chunkPZQ6I4JJ_cjs.isUndefined(convertedValue)) {
391
+ newObject[key] = convertedValue;
392
+ }
393
+ }
394
+ if (removeEmptyObjects2 && chunkZETAZZLD_cjs.isEmptyObject(newObject)) {
395
+ return isRoot ? {} : void 0;
396
+ }
397
+ return newObject;
398
+ }
399
+ return void 0;
400
+ }
401
+ return _internal(input, {
402
+ removeEmptyObjects,
403
+ removeEmptyArrays,
404
+ isRoot: true
405
+ });
406
+ }
407
+ function toStringDeep(input, options = {}) {
408
+ chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
409
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
410
+ });
411
+ const removeEmptyObjects = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "removeEmptyObjects") ? options.removeEmptyObjects : false;
412
+ const removeEmptyArrays = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "removeEmptyArrays") ? options.removeEmptyArrays : false;
413
+ function _internal(input2, options2) {
414
+ if (chunkPZQ6I4JJ_cjs.isNil(input2) || chunkPZQ6I4JJ_cjs.isInfinityNumber(input2)) return void 0;
415
+ const { removeEmptyArrays: removeEmptyArrays2, removeEmptyObjects: removeEmptyObjects2, isRoot } = options2;
416
+ if (!chunkPZQ6I4JJ_cjs.isBoolean(removeEmptyObjects2) || !chunkPZQ6I4JJ_cjs.isBoolean(removeEmptyArrays2)) {
417
+ throw new TypeError(
418
+ `Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${chunkPZQ6I4JJ_cjs.getPreciseType(
419
+ removeEmptyObjects2
420
+ )}\`, 'removeEmptyArrays': \`${chunkPZQ6I4JJ_cjs.getPreciseType(removeEmptyArrays2)}\`].`
421
+ );
422
+ }
423
+ if (chunkPZQ6I4JJ_cjs.isNumber(input2) || chunkPZQ6I4JJ_cjs.isString(input2) || chunkPZQ6I4JJ_cjs.isBoolean(input2)) return String(input2);
424
+ if (chunkPZQ6I4JJ_cjs.isNumberObject(input2)) {
425
+ const valOf = input2.valueOf();
426
+ return chunkPZQ6I4JJ_cjs.isInfinityNumber(valOf) || chunkPZQ6I4JJ_cjs.isNaN(valOf) ? void 0 : valOf.toString();
427
+ }
428
+ if (chunkPZQ6I4JJ_cjs.isStringObject(input2)) return input2.valueOf();
429
+ if (chunkPZQ6I4JJ_cjs.isBooleanObject(input2)) return input2.valueOf().toString();
430
+ if (chunkT7PU2V7X_cjs.isDate(input2, { skipInvalidDate: true })) {
431
+ try {
432
+ return input2.toISOString();
433
+ } catch {
434
+ return input2.toString();
435
+ }
436
+ }
437
+ if (chunkJBQMXC5I_cjs.isRegExp(input2)) return input2.toString();
438
+ if (chunkPZQ6I4JJ_cjs.isBuffer(input2)) {
439
+ return Array.from(input2).map((v) => String(v)).filter((v) => !chunkPZQ6I4JJ_cjs.isUndefined(v));
440
+ }
441
+ if (chunkCAH33WOQ_cjs.isTypedArray(input2)) {
442
+ if (input2 instanceof BigInt64Array || input2 instanceof BigUint64Array) {
443
+ const newArray = Array.from(input2).map(
444
+ (item) => _internal(item, {
445
+ removeEmptyObjects: removeEmptyObjects2,
446
+ removeEmptyArrays: removeEmptyArrays2,
447
+ isRoot: false
448
+ })
449
+ ).map((v) => String(v)).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
450
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
451
+ return newArray;
452
+ } else {
453
+ const newArray = Array.from(input2).map(
454
+ (item) => _internal(item, {
455
+ removeEmptyObjects: removeEmptyObjects2,
456
+ removeEmptyArrays: removeEmptyArrays2,
457
+ isRoot: false
458
+ })
459
+ ).map((v) => String(v)).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
460
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
461
+ return newArray;
462
+ }
463
+ }
464
+ if (chunkPZQ6I4JJ_cjs.isSet(input2)) {
465
+ const arr = Array.from(input2).map(
466
+ (v) => _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
467
+ ).filter((v) => !chunkPZQ6I4JJ_cjs.isUndefined(v));
468
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(arr)) return void 0;
469
+ return arr;
470
+ }
471
+ if (chunkT7PU2V7X_cjs.isMap(input2)) {
472
+ const arr = Array.from(input2.entries()).map(([k, v]) => [
473
+ _internal(k, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false }),
474
+ _internal(v, { removeEmptyObjects: removeEmptyObjects2, removeEmptyArrays: removeEmptyArrays2, isRoot: false })
475
+ ]).filter(([k, v]) => !chunkPZQ6I4JJ_cjs.isUndefined(k) && !chunkPZQ6I4JJ_cjs.isUndefined(v));
476
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(arr)) return void 0;
477
+ return arr;
478
+ }
479
+ if (chunkPZQ6I4JJ_cjs.isArray(input2)) {
480
+ let newArray = input2.map(
481
+ (item) => _internal(item, {
482
+ removeEmptyObjects: removeEmptyObjects2,
483
+ removeEmptyArrays: removeEmptyArrays2,
484
+ isRoot: false
485
+ })
486
+ ).filter((item) => !chunkPZQ6I4JJ_cjs.isUndefined(item));
487
+ if (removeEmptyArrays2) {
488
+ newArray = newArray.filter((v) => !(chunkPZQ6I4JJ_cjs.isArray(v) && v.length === 0));
489
+ }
490
+ if (removeEmptyArrays2 && chunkZETAZZLD_cjs.isEmptyArray(newArray)) return void 0;
491
+ return newArray;
492
+ }
493
+ if (chunkPZQ6I4JJ_cjs.isObject(input2)) {
494
+ const newObject = {};
495
+ for (const [key, value] of Object.entries(input2)) {
496
+ const convertedValue = _internal(value, {
497
+ removeEmptyObjects: removeEmptyObjects2,
498
+ removeEmptyArrays: removeEmptyArrays2,
499
+ isRoot: false
500
+ });
501
+ if (!chunkPZQ6I4JJ_cjs.isUndefined(convertedValue)) {
502
+ newObject[key] = convertedValue;
503
+ } else if (chunkPZQ6I4JJ_cjs.isArray(value) && !removeEmptyArrays2) {
504
+ newObject[key] = [];
505
+ }
506
+ }
507
+ if (removeEmptyObjects2 && Object.keys(newObject).length === 0) {
508
+ return isRoot ? {} : void 0;
509
+ }
510
+ return newObject;
511
+ }
512
+ return void 0;
513
+ }
514
+ return _internal(input, {
515
+ removeEmptyObjects,
516
+ removeEmptyArrays,
517
+ isRoot: true
518
+ });
519
+ }
520
+
521
+ exports.convertType = convertType;
522
+ exports.dedupeArray = dedupeArray;
523
+ exports.removeObjectPaths = removeObjectPaths;
524
+ exports.toBooleanContent = toBooleanContent;
525
+ exports.toBooleanContentDeep = toBooleanContentDeep;
526
+ exports.toBooleanExplicit = toBooleanExplicit;
527
+ exports.toBooleanLoose = toBooleanLoose;
528
+ exports.toNumberArrayUnRecursive = toNumberArrayUnRecursive;
529
+ exports.toNumberDeep = toNumberDeep;
530
+ exports.toStringDeep = toStringDeep;
531
+ exports.toStringDeepForce = toStringDeepForce;