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