@rzl-zone/utils-js 3.13.0-beta.2 → 3.13.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.
- package/README.md +4 -4
- package/dist/.references/index.d.cts +1 -1
- package/dist/.references/index.d.ts +1 -1
- package/dist/{assertIsArray-BqjMoan3.cjs → assertIsArray-BgdgVjDu.cjs} +3 -3
- package/dist/{assertIsArray-BqjMoan3.cjs.map → assertIsArray-BgdgVjDu.cjs.map} +1 -1
- package/dist/{assertIsArray-6BcSdNa-.js → assertIsArray-hZyYKvLb.js} +3 -3
- package/dist/{assertIsArray-6BcSdNa-.js.map → assertIsArray-hZyYKvLb.js.map} +1 -1
- package/dist/{assertIsBoolean-Bv6gL-xe.js → assertIsBoolean-9-huIcIR.js} +2 -2
- package/dist/{assertIsBoolean-Bv6gL-xe.js.map → assertIsBoolean-9-huIcIR.js.map} +1 -1
- package/dist/{assertIsBoolean-amRiJHnh.cjs → assertIsBoolean-JGpkg5ju.cjs} +2 -2
- package/dist/{assertIsBoolean-amRiJHnh.cjs.map → assertIsBoolean-JGpkg5ju.cjs.map} +1 -1
- package/dist/{assertIsString-1WiUjgqf.js → assertIsString-CcOpQqcv.js} +3 -3
- package/dist/{assertIsString-1WiUjgqf.js.map → assertIsString-CcOpQqcv.js.map} +1 -1
- package/dist/{assertIsString-C0b28AU1.cjs → assertIsString-UR6QjqyZ.cjs} +3 -3
- package/dist/{assertIsString-C0b28AU1.cjs.map → assertIsString-UR6QjqyZ.cjs.map} +1 -1
- package/dist/assertions/index.cjs +5 -5
- package/dist/assertions/index.d.cts +2 -2
- package/dist/assertions/index.d.ts +2 -2
- package/dist/assertions/index.js +5 -5
- package/dist/conversions/index.cjs +6 -6
- package/dist/conversions/index.d.cts +2 -2
- package/dist/conversions/index.d.ts +2 -2
- package/dist/conversions/index.js +6 -6
- package/dist/{conversions-lvvAYiZs.cjs → conversions-DLt2zlyu.cjs} +12 -12
- package/dist/{conversions-lvvAYiZs.cjs.map → conversions-DLt2zlyu.cjs.map} +1 -1
- package/dist/{conversions-BrI0GIOr.js → conversions-Du6GC5JA.js} +12 -12
- package/dist/{conversions-BrI0GIOr.js.map → conversions-Du6GC5JA.js.map} +1 -1
- package/dist/events/index.cjs +4 -4
- package/dist/events/index.d.cts +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +2 -2
- package/dist/formatters/index.d.cts +2 -2
- package/dist/formatters/index.d.ts +2 -2
- package/dist/formatters/index.js +2 -2
- package/dist/{formatters-DQr05EUA.cjs → formatters-C0t5CdX-.cjs} +10 -10
- package/dist/{formatters-DQr05EUA.cjs.map → formatters-C0t5CdX-.cjs.map} +1 -1
- package/dist/{formatters-zDzQvtb4.js → formatters-RomzqDp_.js} +10 -10
- package/dist/{formatters-zDzQvtb4.js.map → formatters-RomzqDp_.js.map} +1 -1
- package/dist/generators/index.cjs +5 -5
- package/dist/generators/index.d.cts +2 -2
- package/dist/generators/index.d.ts +2 -2
- package/dist/generators/index.js +5 -5
- package/dist/{index-GSUN6rjA.d.ts → index-50G4edI1.d.ts} +2 -2
- package/dist/{index-DxZlGbAH.d.ts → index-5DpyzfpU.d.ts} +1 -1
- package/dist/{index-BlTCrSyc.d.cts → index-B6Xg9Z8l.d.ts} +2 -2
- package/dist/{index-3jBnthag.d.cts → index-BFI4R7Pn.d.ts} +1 -1
- package/dist/{index-Ckao53JY.d.ts → index-BcKPWWfh.d.ts} +2 -2
- package/dist/{index-CEm8ZOvj.d.ts → index-CMcxcN7w.d.cts} +2 -2
- package/dist/{index-_dJhBl1h.d.ts → index-CPc-TTMc.d.cts} +1 -1
- package/dist/{index-DIeR8qa-.d.ts → index-D-5AsV9K.d.cts} +1 -1
- package/dist/{index-bMa-0Yr4.d.cts → index-DM_0q4CY.d.cts} +1 -1
- package/dist/{index-z_uCh5KW.d.cts → index-DoteSYTy.d.cts} +1 -1
- package/dist/{index-DHHrLc0B.d.ts → index-bGRsmkyA.d.ts} +1 -1
- package/dist/{index-DyVWeYP3.d.cts → index-hsSSKuvW.d.ts} +1 -1
- package/dist/{index-BXwimNPA.d.cts → index-s7h0w-8H.d.cts} +2 -2
- package/dist/{index-CLq5kZmQ.d.cts → index-tYmZ3X4Y.d.cts} +2 -2
- package/dist/{isBigInt-CIFRnsdx.cjs → isBigInt-C0gHDkh4.cjs} +2 -2
- package/dist/{isBigInt-CIFRnsdx.cjs.map → isBigInt-C0gHDkh4.cjs.map} +1 -1
- package/dist/{isBigInt-D-Pu9sxp.js → isBigInt-bbW78ITJ.js} +2 -2
- package/dist/{isBigInt-D-Pu9sxp.js.map → isBigInt-bbW78ITJ.js.map} +1 -1
- package/dist/{isEmptyObject-CZ9DLi7R.js → isEmptyObject-CZsFdN7x.js} +3 -3
- package/dist/{isEmptyObject-CZ9DLi7R.js.map → isEmptyObject-CZsFdN7x.js.map} +1 -1
- package/dist/{isEmptyObject-CEySmyHK.cjs → isEmptyObject-D-fETD_f.cjs} +3 -3
- package/dist/{isEmptyObject-CEySmyHK.cjs.map → isEmptyObject-D-fETD_f.cjs.map} +1 -1
- package/dist/{isEmptyString-DI64RQCy.cjs → isEmptyString-Dx6OM5PL.cjs} +3 -3
- package/dist/{isEmptyString-DI64RQCy.cjs.map → isEmptyString-Dx6OM5PL.cjs.map} +1 -1
- package/dist/{isEmptyString-DFDtBbNr.js → isEmptyString-pmcf-orv.js} +3 -3
- package/dist/{isEmptyString-DFDtBbNr.js.map → isEmptyString-pmcf-orv.js.map} +1 -1
- package/dist/{isEmptyValue-aGyeClwA.js → isEmptyValue-CkiXENcT.js} +5 -5
- package/dist/{isEmptyValue-aGyeClwA.js.map → isEmptyValue-CkiXENcT.js.map} +1 -1
- package/dist/{isEmptyValue-Cw6ovu7z.cjs → isEmptyValue-v6BsHBiu.cjs} +5 -5
- package/dist/{isEmptyValue-Cw6ovu7z.cjs.map → isEmptyValue-v6BsHBiu.cjs.map} +1 -1
- package/dist/{isEqual-UsvOwrlY.cjs → isEqual-CZxetLzm.cjs} +4 -4
- package/dist/{isEqual-UsvOwrlY.cjs.map → isEqual-CZxetLzm.cjs.map} +1 -1
- package/dist/{isEqual-Dtb2sXUv.js → isEqual-Dc8fNB2J.js} +4 -4
- package/dist/{isEqual-Dtb2sXUv.js.map → isEqual-Dc8fNB2J.js.map} +1 -1
- package/dist/{isFinite-uukWvxJh.cjs → isFinite-0z31xOa2.cjs} +3 -3
- package/dist/{isFinite-uukWvxJh.cjs.map → isFinite-0z31xOa2.cjs.map} +1 -1
- package/dist/{isFinite-Cz_IFXuV.js → isFinite-CI59vUHt.js} +3 -3
- package/dist/{isFinite-Cz_IFXuV.js.map → isFinite-CI59vUHt.js.map} +1 -1
- package/dist/{isInteger-DPYjliLZ.cjs → isInteger-DUhd-dyt.cjs} +2 -2
- package/dist/{isInteger-DPYjliLZ.cjs.map → isInteger-DUhd-dyt.cjs.map} +1 -1
- package/dist/{isInteger-DZ163OQg.js → isInteger-DeN5FIAr.js} +2 -2
- package/dist/{isInteger-DZ163OQg.js.map → isInteger-DeN5FIAr.js.map} +1 -1
- package/dist/{isPlainObject-CBABRyEX.d.cts → isPlainObject-CjoJH9yk.d.ts} +1 -1
- package/dist/{isPlainObject-Dr8gi89U.d.ts → isPlainObject-DvxdHoAf.d.cts} +1 -1
- package/dist/{isServer-BDShLyVJ.js → isServer-BM5GzRpI.js} +2 -2
- package/dist/{isServer-BDShLyVJ.js.map → isServer-BM5GzRpI.js.map} +1 -1
- package/dist/{isServer-BzDeYuGg.cjs → isServer-TOmhgOtP.cjs} +2 -2
- package/dist/{isServer-BzDeYuGg.cjs.map → isServer-TOmhgOtP.cjs.map} +1 -1
- package/dist/{isTypedArray-DuUUA4CL.js → isTypedArray-BPerK072.js} +3 -3
- package/dist/{isTypedArray-DuUUA4CL.js.map → isTypedArray-BPerK072.js.map} +1 -1
- package/dist/{isTypedArray-DaYAkyrt.cjs → isTypedArray-pAdBFUDl.cjs} +3 -3
- package/dist/{isTypedArray-DaYAkyrt.cjs.map → isTypedArray-pAdBFUDl.cjs.map} +1 -1
- package/dist/{isValidDomain-BxyToAlh.cjs → isValidDomain-BMcr9vTp.cjs} +6 -6
- package/dist/isValidDomain-BMcr9vTp.cjs.map +1 -0
- package/dist/{isValidDomain-CTw5vZFY.js → isValidDomain-CHKOn79-.js} +6 -6
- package/dist/isValidDomain-CHKOn79-.js.map +1 -0
- package/dist/{noop-DGg9vMSD.js → noop-BaNz9ls5.js} +2 -2
- package/dist/{noop-DGg9vMSD.js.map → noop-BaNz9ls5.js.map} +1 -1
- package/dist/{noop-7KrqC9DC.cjs → noop-D4g9yTAW.cjs} +2 -2
- package/dist/{noop-7KrqC9DC.cjs.map → noop-D4g9yTAW.cjs.map} +1 -1
- package/dist/{normalizeSpaces-C1eLwykD.js → normalizeSpaces-DupusmF5.js} +3 -3
- package/dist/{normalizeSpaces-C1eLwykD.js.map → normalizeSpaces-DupusmF5.js.map} +1 -1
- package/dist/{normalizeSpaces-B6ZQOZRX.cjs → normalizeSpaces-MWiYtSyS.cjs} +3 -3
- package/dist/{normalizeSpaces-B6ZQOZRX.cjs.map → normalizeSpaces-MWiYtSyS.cjs.map} +1 -1
- package/dist/operations/index.cjs +7 -7
- package/dist/operations/index.d.cts +1 -1
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +7 -7
- package/dist/parsers/index.cjs +2 -2
- package/dist/parsers/index.d.cts +1 -1
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +2 -2
- package/dist/{parsers-DEFpCYhw.cjs → parsers-Bd-YRt6j.cjs} +4 -4
- package/dist/{parsers-DEFpCYhw.cjs.map → parsers-Bd-YRt6j.cjs.map} +1 -1
- package/dist/{parsers-bQQ9mStV.js → parsers-Dl9fFra4.js} +4 -4
- package/dist/{parsers-bQQ9mStV.js.map → parsers-Dl9fFra4.js.map} +1 -1
- package/dist/{parsing-BngARhmu.js → parsing-BG73HUrI.js} +3 -3
- package/dist/{parsing-BngARhmu.js.map → parsing-BG73HUrI.js.map} +1 -1
- package/dist/{parsing-lI5EN4LY.cjs → parsing-CU_Mc7CF.cjs} +3 -3
- package/dist/{parsing-lI5EN4LY.cjs.map → parsing-CU_Mc7CF.cjs.map} +1 -1
- package/dist/predicates/index.cjs +14 -14
- package/dist/predicates/index.d.cts +3 -3
- package/dist/predicates/index.d.ts +3 -3
- package/dist/predicates/index.js +14 -14
- package/dist/{predicates-CMmP3fPJ.cjs → predicates-Bd4AnXr0.cjs} +11 -11
- package/dist/{predicates-CMmP3fPJ.cjs.map → predicates-Bd4AnXr0.cjs.map} +1 -1
- package/dist/{predicates-V87QD8hs.js → predicates-VJN-VDha.js} +11 -11
- package/dist/{predicates-V87QD8hs.js.map → predicates-VJN-VDha.js.map} +1 -1
- package/dist/promises/index.cjs +4 -4
- package/dist/promises/index.d.cts +1 -1
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +4 -4
- package/dist/{punyCode-DmTsB7q_.cjs → punyCode-5wmummgP.cjs} +4 -4
- package/dist/{punyCode-DmTsB7q_.cjs.map → punyCode-5wmummgP.cjs.map} +1 -1
- package/dist/{punyCode-BeFYDjj0.js → punyCode-C0ft9dER.js} +4 -4
- package/dist/{punyCode-BeFYDjj0.js.map → punyCode-C0ft9dER.js.map} +1 -1
- package/dist/{removeSpaces-C8mu_yp3.cjs → removeSpaces-CPj1ABLa.cjs} +3 -3
- package/dist/{removeSpaces-C8mu_yp3.cjs.map → removeSpaces-CPj1ABLa.cjs.map} +1 -1
- package/dist/{removeSpaces-B96axxP6.js → removeSpaces-DpiJ1H1P.js} +3 -3
- package/dist/{removeSpaces-B96axxP6.js.map → removeSpaces-DpiJ1H1P.js.map} +1 -1
- package/dist/rzl-utils.global.js +1 -1
- package/dist/{safeJsonParse-DyCsTXlU.js → safeJsonParse-BxOZgGy7.js} +6 -6
- package/dist/{safeJsonParse-DyCsTXlU.js.map → safeJsonParse-BxOZgGy7.js.map} +1 -1
- package/dist/{safeJsonParse-BXbtX_j7.cjs → safeJsonParse-v7ll9iFG.cjs} +6 -6
- package/dist/{safeJsonParse-BXbtX_j7.cjs.map → safeJsonParse-v7ll9iFG.cjs.map} +1 -1
- package/dist/{safeStableStringify-DRYQ56Dg.cjs → safeStableStringify-BiUOLBYo.cjs} +4 -4
- package/dist/{safeStableStringify-DRYQ56Dg.cjs.map → safeStableStringify-BiUOLBYo.cjs.map} +1 -1
- package/dist/{safeStableStringify-BrOcdX9n.js → safeStableStringify-C5Gc3ZED.js} +4 -4
- package/dist/{safeStableStringify-BrOcdX9n.js.map → safeStableStringify-C5Gc3ZED.js.map} +1 -1
- package/dist/strings/index.cjs +5 -5
- package/dist/strings/index.d.cts +2 -2
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +5 -5
- package/dist/tailwind/index.cjs +2 -2
- package/dist/tailwind/index.d.cts +2 -2
- package/dist/tailwind/index.d.ts +2 -2
- package/dist/tailwind/index.js +2 -2
- package/dist/{tailwind-BZ2_MeNX.js → tailwind-CxI2DXpR.js} +5 -5
- package/dist/{tailwind-BZ2_MeNX.js.map → tailwind-CxI2DXpR.js.map} +1 -1
- package/dist/{tailwind-C1YtxJ-K.cjs → tailwind-DhKiKZAc.cjs} +5 -5
- package/dist/{tailwind-C1YtxJ-K.cjs.map → tailwind-DhKiKZAc.cjs.map} +1 -1
- package/dist/{toStringArrayUnRecursive-tHp2a7KR.js → toStringArrayUnRecursive-BaZrCGaR.js} +6 -6
- package/dist/{toStringArrayUnRecursive-tHp2a7KR.js.map → toStringArrayUnRecursive-BaZrCGaR.js.map} +1 -1
- package/dist/{toStringArrayUnRecursive-D1mPM4wg.cjs → toStringArrayUnRecursive-BuRBWRcB.cjs} +6 -6
- package/dist/{toStringArrayUnRecursive-D1mPM4wg.cjs.map → toStringArrayUnRecursive-BuRBWRcB.cjs.map} +1 -1
- package/dist/urls/index.cjs +3 -3
- package/dist/urls/index.d.cts +1 -1
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls/index.js +3 -3
- package/dist/{urls-DCyx8Wpk.cjs → urls-CyhKg1Cn.cjs} +11 -11
- package/dist/{urls-DCyx8Wpk.cjs.map → urls-CyhKg1Cn.cjs.map} +1 -1
- package/dist/{urls-CoxDAoki.js → urls-nr2hUK75.js} +11 -11
- package/dist/{urls-CoxDAoki.js.map → urls-nr2hUK75.js.map} +1 -1
- package/package.json +5 -5
- package/dist/isValidDomain-BxyToAlh.cjs.map +0 -1
- package/dist/isValidDomain-CTw5vZFY.js.map +0 -1
package/README.md
CHANGED
|
@@ -116,9 +116,9 @@ pnpm add @rzl-zone/utils-js@latest
|
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
|
-
<h2 id="nextjs-support">🧬 <strong>Next.js Support
|
|
119
|
+
<h2 id="nextjs-support">🧬 <strong>Next.js Support</strong></h2>
|
|
120
120
|
|
|
121
|
-
> ⚠️ Starting from version `3.13.0`, Next.js
|
|
121
|
+
> ⚠️ Starting from version `3.13.0`, the following Next.js entry points were removed from `@rzl-zone/utils-js` and migrated into the dedicated package <a href="https://www.npmjs.com/package/@rzl-zone/next-kit" target="_blank" rel="nofollow noreferrer noopener"><code>@rzl-zone/next-kit</code></a>.
|
|
122
122
|
>
|
|
123
123
|
> Migrated entry points:
|
|
124
124
|
>
|
|
@@ -176,9 +176,9 @@ pnpm add @rzl-zone/utils-js@latest
|
|
|
176
176
|
> ⚠️ **Note:**
|
|
177
177
|
> When using the library via CDN in the browser:
|
|
178
178
|
>
|
|
179
|
-
> - Always include first the
|
|
179
|
+
> - Always include first the `<script/>` tag before your own scripts when using the CDN version.
|
|
180
180
|
> - Some Node.js-specific utilities may **not** be available, e.g.:
|
|
181
|
-
> - Category utils of `tailwind
|
|
181
|
+
> - Category utils of `tailwind`.
|
|
182
182
|
> - Server-only features (like Next.js helpers) will **not** be available.
|
|
183
183
|
> - The global object provided is `RzlUtilsJs`.
|
|
184
184
|
> - The CDN bundle is **~370KB+ minified**, for production, consider using bundlers or npm packages for smaller size and tree-shaking.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/utils-js
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `3.13.0
|
|
5
|
+
* Version: `3.13.0`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
8
|
* ========================================================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/utils-js
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `3.13.0
|
|
5
|
+
* Version: `3.13.0`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
8
|
* ========================================================================
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/utils-js
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `3.13.0
|
|
5
|
+
* Version: `3.13.0`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
"use strict";
|
|
11
|
-
const require_assertIsBoolean = require('./assertIsBoolean-
|
|
11
|
+
const require_assertIsBoolean = require('./assertIsBoolean-JGpkg5ju.cjs');
|
|
12
12
|
function assertIsArray(value, options) {
|
|
13
13
|
if (require_assertIsBoolean.isArray(value)) return;
|
|
14
14
|
require_assertIsBoolean.resolveErrorMessageAssertions({
|
|
@@ -23,4 +23,4 @@ Object.defineProperty(exports, 'assertIsArray', {
|
|
|
23
23
|
return assertIsArray;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
//# sourceMappingURL=assertIsArray-
|
|
26
|
+
//# sourceMappingURL=assertIsArray-BgdgVjDu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertIsArray-
|
|
1
|
+
{"version":3,"file":"assertIsArray-BgdgVjDu.cjs","names":["isArray"],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AAqJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAIA,gCAAQ,MAAM,EAAE;CAEpB,sDAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/utils-js
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `3.13.0
|
|
5
|
+
* Version: `3.13.0`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
|
-
import { M as isArray, n as resolveErrorMessageAssertions } from "./assertIsBoolean-
|
|
10
|
+
import { M as isArray, n as resolveErrorMessageAssertions } from "./assertIsBoolean-9-huIcIR.js";
|
|
11
11
|
function assertIsArray(value, options) {
|
|
12
12
|
if (isArray(value)) return;
|
|
13
13
|
resolveErrorMessageAssertions({
|
|
@@ -17,4 +17,4 @@ function assertIsArray(value, options) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
export { assertIsArray as t };
|
|
20
|
-
//# sourceMappingURL=assertIsArray-
|
|
20
|
+
//# sourceMappingURL=assertIsArray-hZyYKvLb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertIsArray-
|
|
1
|
+
{"version":3,"file":"assertIsArray-hZyYKvLb.js","names":[],"sources":["../src/assertions/objects/assertIsArray.ts"],"sourcesContent":["import type {\n IsArray,\n IsReadonlyArray,\n IsUnknown\n} from \"@rzl-zone/ts-types-plus\";\nimport type { ArrayFallback } from \"@/_private/types.arrays\";\n\nimport { isArray } from \"@/predicates/is/isArray\";\n\nimport {\n resolveErrorMessageAssertions,\n type OptionsAssertIs\n} from \"../_private/assertIs\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype AssertIsArrayResult<T> =\n IsUnknown<T> extends true\n ? unknown[] & T\n : IsReadonlyArray<T> extends true\n ? T\n : T extends []\n ? T\n : IsArray<T> extends true\n ? T\n : Extract<T, unknown[] | [] | readonly []>;\n\n/** -------------------------------------------------------\n * * ***Type guard assertion: `assertIsArray`.***\n * -------------------------------------------------------\n * **This function is an **assertion function**.**\n * - **Behavior:**\n * - Validates that the given `value` is an **array**.\n * - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.\n * - ✅ If `value` is an `array` ➔ execution continues normally.\n * - ❌ If `value` is not an `array` ➔ throws a built-in error with either:\n * - A custom error message (`options.message`), or\n * - A default message including the actual type.\n * - **⚠️ Error type selection (`options.errorType`):**\n * - You can override the type of error thrown when validation fails.\n * - Must be one of the standard JavaScript built-in errors:\n * - [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) |\n * [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) |\n * [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) |\n * [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) |\n * [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) |\n * [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) |\n * [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)\n * - **Default:** `\"TypeError\"` if not provided or invalid.\n * @template T - The input type being asserted.\n * @param {*} value - ***The value to validate.***\n * @param {OptionsAssertIs} [options]\n * ***Optional configuration:***\n * - `message`: A custom error message (`string` or `function`).\n * - `errorType`: Built-in JavaScript error type to throw on failure (default `\"TypeError\"`).\n * - `formatCase`: Controls how detected type names are formatted case in error messages.\n * - `useAcronyms`: Control uppercase preservation of recognized acronyms during formatting.\n * @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.\n * @throws [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) | [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) | [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) | [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) | [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) | [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) if the value is not an array.\n * @example\n * ```ts\n * // ✅ Simple usage\n * assertIsArray([]);\n * assertIsArray([\"123\", 456]);\n * assertIsArray(Array.from([\"abc\"]));\n * // No error, value is array\n *\n * // ❌ Throws TypeError (default behavior)\n * // Case 1: Invalid input type — received a string instead of a array\n * assertIsArray(\"42\");\n * // ➔ TypeError: \"Parameter input (`value`) must be of type `array`, but received: `string`.\"\n *\n * // ❌ Throws custom error type (e.g., RangeError)\n * assertIsArray(async function () {}, { errorType: \"RangeError\" });\n * // ➔ RangeError: \"Parameter input (`value`) must be of type `array`, but received: `async-function`.\"\n *\n * // ❌ Throws a TypeError with a custom string static message\n * assertIsArray(\"123\", { message: \"Must be a array!\" });\n * // ➔ TypeError: \"Must be a array!\"\n *\n * // ❌ Throws a TypeError with a custom message function and formatCase\n * assertIsArray(/regex/, {\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * formatCase: \"toPascalCaseSpace\"\n * });\n * // ➔ TypeError: \"Expected array but got (Reg Exp).\"\n *\n * // ❌ Throws a TypeError with a custom useAcronyms option\n * // Case 1:\n * assertIsArray(new URL(\"https://example.com\"),{\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (url).\"\n * assertIsArray(new URL(\"https://example.com\"), {\n * useAcronyms: true,\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URL).\"\n *\n * // Case 2:\n * assertIsArray(new URLSearchParams, {\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (UrlSearchParams).\"\n * assertIsArray(new URLSearchParams, {\n * useAcronyms: true,\n * formatCase: \"toPascalCase\",\n * message: ({ currentType, validType }) => {\n * return `Expected ${validType} but got (${currentType}).`\n * },\n * });\n * // ➔ TypeError: \"Expected array but got (URLSearchParams).\"\n * ```\n * -------------------------------------------------------\n * ✅ ***Real-world usage example***:\n * ```ts\n * const mixedValue: string | number[] | undefined = getUserInput();\n *\n * // Runtime assertion: throws if `mixedValue` is not a `number[]`\n * assertIsArray(mixedValue, {\n * errorType: \"RangeError\",\n * message: \"Must be array!\"\n * });\n *\n * // ✅ If no error thrown, TypeScript narrows `mixedValue` to `number[]` here\n * const result: number[] = mixedValue; // ➔ Safe type assignment\n * console.log(result.push(1, 2, 3)); // ➔ Safe to use array methods\n * ```\n */\nexport function assertIsArray(\n value: [],\n options?: OptionsAssertIs\n): asserts value is [];\nexport function assertIsArray<T>(\n value: T,\n options?: OptionsAssertIs\n): asserts value is ArrayFallback<T>;\nexport function assertIsArray(\n value: unknown,\n options?: OptionsAssertIs\n): asserts value is unknown[];\nexport function assertIsArray<T>(value: T, options?: OptionsAssertIs) {\n if (isArray(value)) return;\n\n resolveErrorMessageAssertions({ value, options, requiredValidType: \"array\" });\n}\n"],"mappings":";;;;;;;;;;;;;AAqJA,SAAgB,cAAiB,OAAU,SAA2B;CACpE,IAAI,QAAQ,MAAM,EAAE;CAEpB,8BAA8B;EAAE;EAAO;EAAS,mBAAmB;EAAS,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/utils-js
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `3.13.0
|
|
5
|
+
* Version: `3.13.0`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
8
|
* ========================================================================
|
|
@@ -1070,4 +1070,4 @@ const assertIsBoolean = (value, options = {}) => {
|
|
|
1070
1070
|
});
|
|
1071
1071
|
};
|
|
1072
1072
|
export { isPlainObject as A, isSymbol as C, isNaN as D, isNull as E, isBoolean as F, isArray as M, isNil as N, isNumberObject as O, isFunction as P, isUndefined as S, assertIsPlainObject as T, isBuffer as _, toPascalCase as a, hasOwnProp as b, toKebabCase as c, slugify as d, isSet as f, isStringObject as g, isBooleanObject as h, toPascalCaseSpace as i, isObject as j, isString as k, toCamelCase as l, isInfinityNumber as m, resolveErrorMessageAssertions as n, toLowerCase as o, isNonEmptyArray as p, getPreciseType as r, toSnakeCase as s, assertIsBoolean as t, toDotCase as u, isError as v, isNumber as w, isObjectOrArray as x, isNonEmptyString as y };
|
|
1073
|
-
//# sourceMappingURL=assertIsBoolean-
|
|
1073
|
+
//# sourceMappingURL=assertIsBoolean-9-huIcIR.js.map
|