@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.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/{LICENSE.md → LICENSE} +3 -3
- package/README.md +62 -89
- package/dist/.references/index.d.cts +25 -0
- package/dist/.references/index.d.ts +25 -0
- package/dist/assertIsArray-BChqwPiP.cjs +26 -0
- package/dist/assertIsArray-BChqwPiP.cjs.map +1 -0
- package/dist/assertIsArray-BfAbIUfa.js +20 -0
- package/dist/assertIsArray-BfAbIUfa.js.map +1 -0
- package/dist/assertIsBoolean-BlBct0Fc.js +1073 -0
- package/dist/assertIsBoolean-BlBct0Fc.js.map +1 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs +1283 -0
- package/dist/assertIsBoolean-DozdtbNi.cjs.map +1 -0
- package/dist/assertIsString-Bvk7bUL7.cjs +26 -0
- package/dist/assertIsString-Bvk7bUL7.cjs.map +1 -0
- package/dist/assertIsString-DqV9NwbI.js +20 -0
- package/dist/assertIsString-DqV9NwbI.js.map +1 -0
- package/dist/assertions/index.cjs +37 -40
- package/dist/assertions/index.cjs.map +1 -0
- package/dist/assertions/index.d.cts +12 -0
- package/dist/assertions/index.d.ts +10 -824
- package/dist/assertions/index.js +30 -13
- package/dist/assertions/index.js.map +1 -0
- package/dist/conversions/index.cjs +34 -103
- package/dist/conversions/index.d.cts +12 -0
- package/dist/conversions/index.d.ts +10 -1791
- package/dist/conversions/index.js +14 -24
- package/dist/conversions-CBs8-REq.cjs +448 -0
- package/dist/conversions-CBs8-REq.cjs.map +1 -0
- package/dist/conversions-EMJa3g-D.js +382 -0
- package/dist/conversions-EMJa3g-D.js.map +1 -0
- package/dist/events/index.cjs +55 -31
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +174 -0
- package/dist/events/index.d.ts +31 -35
- package/dist/events/index.js +50 -12
- package/dist/events/index.js.map +1 -0
- package/dist/formatEnvPort-DpIXzPAZ.js +159 -0
- package/dist/formatEnvPort-DpIXzPAZ.js.map +1 -0
- package/dist/formatEnvPort-hHNvOim-.cjs +171 -0
- package/dist/formatEnvPort-hHNvOim-.cjs.map +1 -0
- package/dist/formatters/index.cjs +21 -61
- package/dist/formatters/index.d.cts +12 -0
- package/dist/formatters/index.d.ts +10 -2152
- package/dist/formatters/index.js +10 -18
- package/dist/formatters-QcZO_Cpx.js +367 -0
- package/dist/formatters-QcZO_Cpx.js.map +1 -0
- package/dist/formatters-lAYgA11L.cjs +427 -0
- package/dist/formatters-lAYgA11L.cjs.map +1 -0
- package/dist/generators/index.cjs +161 -41
- package/dist/generators/index.cjs.map +1 -0
- package/dist/generators/index.d.cts +12 -0
- package/dist/generators/index.d.ts +10 -338
- package/dist/generators/index.js +154 -14
- package/dist/generators/index.js.map +1 -0
- package/dist/index-26W7ItWx.d.ts +760 -0
- package/dist/index-BPPQjAfs.d.cts +2359 -0
- package/dist/index-BXjlgBLz.d.cts +2139 -0
- package/dist/index-B_Wwo91H.d.ts +2359 -0
- package/dist/index-CpufydcI.d.cts +704 -0
- package/dist/index-Czc4O526.d.ts +333 -0
- package/dist/index-DPs1_p5G.d.cts +760 -0
- package/dist/index-DRpOyBSC.d.ts +1703 -0
- package/dist/index-DWWvtHUn.d.cts +822 -0
- package/dist/index-DnM0LD0n.d.cts +333 -0
- package/dist/index-GUZ9fK6T.d.ts +2139 -0
- package/dist/index-I4fAzwXV.d.ts +704 -0
- package/dist/index-JDrOl_19.d.ts +822 -0
- package/dist/index-b66P49Qe.d.cts +1703 -0
- package/dist/isBigInt-B1cijjqm.cjs +20 -0
- package/dist/isBigInt-B1cijjqm.cjs.map +1 -0
- package/dist/isBigInt-C0bN0Rhu.js +14 -0
- package/dist/isBigInt-C0bN0Rhu.js.map +1 -0
- package/dist/isEmptyObject-DI42NEo0.cjs +37 -0
- package/dist/isEmptyObject-DI42NEo0.cjs.map +1 -0
- package/dist/isEmptyObject-DeLVIJpl.js +25 -0
- package/dist/isEmptyObject-DeLVIJpl.js.map +1 -0
- package/dist/isEmptyString-BTUWYTbw.js +15 -0
- package/dist/isEmptyString-BTUWYTbw.js.map +1 -0
- package/dist/isEmptyString-CCK3bP74.cjs +21 -0
- package/dist/isEmptyString-CCK3bP74.cjs.map +1 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs +30 -0
- package/dist/isEmptyValue-DMSMFTU8.cjs.map +1 -0
- package/dist/isEmptyValue-fjnfQnt5.js +24 -0
- package/dist/isEmptyValue-fjnfQnt5.js.map +1 -0
- package/dist/isEqual-B1fRgEuU.cjs +111 -0
- package/dist/isEqual-B1fRgEuU.cjs.map +1 -0
- package/dist/isEqual-DhyP8fB_.js +87 -0
- package/dist/isEqual-DhyP8fB_.js.map +1 -0
- package/dist/isFinite-BYMOo0os.js +15 -0
- package/dist/isFinite-BYMOo0os.js.map +1 -0
- package/dist/isFinite-sFkps2TY.cjs +21 -0
- package/dist/isFinite-sFkps2TY.cjs.map +1 -0
- package/dist/isInteger-DS9V7l_f.js +14 -0
- package/dist/isInteger-DS9V7l_f.js.map +1 -0
- package/dist/isInteger-FTCthMre.cjs +20 -0
- package/dist/isInteger-FTCthMre.cjs.map +1 -0
- package/dist/isPlainObject-DcFGh3_5.d.ts +530 -0
- package/dist/isPlainObject-doTI11Ib.d.cts +530 -0
- package/dist/isServer-D1TXfOs3.js +14 -0
- package/dist/isServer-D1TXfOs3.js.map +1 -0
- package/dist/isServer-q-QLFCqE.cjs +20 -0
- package/dist/isServer-q-QLFCqE.cjs.map +1 -0
- package/dist/isTypedArray-47R0wdrc.js +31 -0
- package/dist/isTypedArray-47R0wdrc.js.map +1 -0
- package/dist/isTypedArray-DiCoqffZ.cjs +43 -0
- package/dist/isTypedArray-DiCoqffZ.cjs.map +1 -0
- package/dist/isURL-CQiowFq2.js +14 -0
- package/dist/isURL-CQiowFq2.js.map +1 -0
- package/dist/isURL-WZypXsax.cjs +20 -0
- package/dist/isURL-WZypXsax.cjs.map +1 -0
- package/dist/isValidDomain-BSXshgkC.cjs +1788 -0
- package/dist/isValidDomain-BSXshgkC.cjs.map +1 -0
- package/dist/isValidDomain-DwA2EN79.js +1782 -0
- package/dist/isValidDomain-DwA2EN79.js.map +1 -0
- package/dist/next/index.cjs +119 -214
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +226 -0
- package/dist/next/index.d.ts +26 -31
- package/dist/next/index.js +117 -212
- package/dist/next/index.js.map +1 -0
- package/dist/next/server/index.cjs +25 -40
- package/dist/next/server/index.cjs.map +1 -0
- package/dist/next/server/index.d.cts +39 -0
- package/dist/next/server/index.d.ts +9 -10
- package/dist/next/server/index.js +23 -38
- package/dist/next/server/index.js.map +1 -0
- package/dist/noop-B2mTBhW-.cjs +18 -0
- package/dist/noop-B2mTBhW-.cjs.map +1 -0
- package/dist/noop-BzktGBVz.js +12 -0
- package/dist/noop-BzktGBVz.js.map +1 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs +29 -0
- package/dist/normalizeSpaces-DQHR3Tlr.cjs.map +1 -0
- package/dist/normalizeSpaces-WS_iERJk.js +23 -0
- package/dist/normalizeSpaces-WS_iERJk.js.map +1 -0
- package/dist/normalizeString-2WLth_Gj.js +15 -0
- package/dist/normalizeString-2WLth_Gj.js.map +1 -0
- package/dist/normalizeString-D8euBcRD.cjs +21 -0
- package/dist/normalizeString-D8euBcRD.cjs.map +1 -0
- package/dist/operations/index.cjs +65 -32
- package/dist/operations/index.cjs.map +1 -0
- package/dist/operations/index.d.cts +139 -0
- package/dist/operations/index.d.ts +10 -15
- package/dist/operations/index.js +61 -17
- package/dist/operations/index.js.map +1 -0
- package/dist/parsers/index.cjs +12 -19
- package/dist/parsers/index.d.cts +239 -0
- package/dist/parsers/index.d.ts +71 -72
- package/dist/parsers/index.js +10 -12
- package/dist/parsers-DXtpsDyj.cjs +649 -0
- package/dist/parsers-DXtpsDyj.cjs.map +1 -0
- package/dist/parsers-Dpuq-V4u.js +643 -0
- package/dist/parsers-Dpuq-V4u.js.map +1 -0
- package/dist/parsing-B43x1sxn.js +50 -0
- package/dist/parsing-B43x1sxn.js.map +1 -0
- package/dist/parsing-lRoxn1Nz.cjs +56 -0
- package/dist/parsing-lRoxn1Nz.cjs.map +1 -0
- package/dist/predicates/index.cjs +91 -296
- package/dist/predicates/index.d.cts +13 -0
- package/dist/predicates/index.d.ts +12 -2482
- package/dist/predicates/index.js +23 -25
- package/dist/predicates-DiaYA7Ps.cjs +413 -0
- package/dist/predicates-DiaYA7Ps.cjs.map +1 -0
- package/dist/predicates-gNepszvo.js +257 -0
- package/dist/predicates-gNepszvo.js.map +1 -0
- package/dist/promises/index.cjs +76 -24
- package/dist/promises/index.cjs.map +1 -0
- package/dist/promises/index.d.cts +123 -0
- package/dist/promises/index.d.ts +28 -31
- package/dist/promises/index.js +73 -13
- package/dist/promises/index.js.map +1 -0
- package/dist/punyCode-CTWXVVFo.cjs +185 -0
- package/dist/punyCode-CTWXVVFo.cjs.map +1 -0
- package/dist/punyCode-hmiFzLWT.js +179 -0
- package/dist/punyCode-hmiFzLWT.js.map +1 -0
- package/dist/removeSpaces-BE8lfh-4.js +19 -0
- package/dist/removeSpaces-BE8lfh-4.js.map +1 -0
- package/dist/removeSpaces-DRRxNWlb.cjs +25 -0
- package/dist/removeSpaces-DRRxNWlb.cjs.map +1 -0
- package/dist/safeJsonParse-BBnQElk8.cjs +208 -0
- package/dist/safeJsonParse-BBnQElk8.cjs.map +1 -0
- package/dist/safeJsonParse-CXruaP0p.js +184 -0
- package/dist/safeJsonParse-CXruaP0p.js.map +1 -0
- package/dist/safeStableStringify-BNh3D0K0.js +88 -0
- package/dist/safeStableStringify-BNh3D0K0.js.map +1 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs +106 -0
- package/dist/safeStableStringify-Cc62pfRp.cjs.map +1 -0
- package/dist/strings/index.cjs +76 -81
- package/dist/strings/index.cjs.map +1 -0
- package/dist/strings/index.d.cts +12 -0
- package/dist/strings/index.d.ts +10 -775
- package/dist/strings/index.js +59 -14
- package/dist/strings/index.js.map +1 -0
- package/dist/tailwind/index.cjs +19 -47
- package/dist/tailwind/index.d.cts +12 -0
- package/dist/tailwind/index.d.ts +11 -712
- package/dist/tailwind/index.js +10 -12
- package/dist/tailwind-DJ4cmLUw.cjs +247 -0
- package/dist/tailwind-DJ4cmLUw.cjs.map +1 -0
- package/dist/tailwind-IJvOdkZp.js +199 -0
- package/dist/tailwind-IJvOdkZp.js.map +1 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js +39 -0
- package/dist/toStringArrayUnRecursive-CFs0jTEg.js.map +1 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs +51 -0
- package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs.map +1 -0
- package/dist/urls/index.cjs +129 -57
- package/dist/urls/index.cjs.map +1 -0
- package/dist/urls/index.d.cts +740 -0
- package/dist/urls/index.d.ts +218 -224
- package/dist/urls/index.js +121 -26
- package/dist/urls/index.js.map +1 -0
- package/package.json +203 -194
- package/dist/chunk-2AFQ33D3.cjs +0 -64
- package/dist/chunk-2CYDJVGM.js +0 -246
- package/dist/chunk-2MW4JDQ2.cjs +0 -598
- package/dist/chunk-2VTDXC3N.cjs +0 -1825
- package/dist/chunk-44XX2P34.js +0 -209
- package/dist/chunk-4YLBKLGS.cjs +0 -18
- package/dist/chunk-566CXQW7.cjs +0 -560
- package/dist/chunk-57EPKYID.cjs +0 -397
- package/dist/chunk-5MGEC3YG.js +0 -63
- package/dist/chunk-6EF52423.cjs +0 -249
- package/dist/chunk-6SCOKU3S.js +0 -109
- package/dist/chunk-6VUXD3CF.js +0 -119
- package/dist/chunk-7B76BSNK.cjs +0 -118
- package/dist/chunk-7Y6I2DSU.cjs +0 -101
- package/dist/chunk-A7S7E2EE.cjs +0 -308
- package/dist/chunk-AJZ6PMMZ.js +0 -16
- package/dist/chunk-AXGBL2IO.cjs +0 -251
- package/dist/chunk-B4TC6FBV.cjs +0 -678
- package/dist/chunk-BAV5T2E3.cjs +0 -15
- package/dist/chunk-BKIJBNIE.js +0 -21
- package/dist/chunk-BNIMTFK5.js +0 -59
- package/dist/chunk-BXW7YXB7.js +0 -1823
- package/dist/chunk-CFYZC4S6.js +0 -53
- package/dist/chunk-CSG4SCL3.js +0 -1587
- package/dist/chunk-CWQW7AKK.js +0 -676
- package/dist/chunk-DVMHRLKP.cjs +0 -16
- package/dist/chunk-EN7LVZBZ.js +0 -548
- package/dist/chunk-EV4Y7HCY.cjs +0 -26
- package/dist/chunk-F66VDYIZ.cjs +0 -18
- package/dist/chunk-FLJX37EL.cjs +0 -30
- package/dist/chunk-GKC3UDMC.cjs +0 -1623
- package/dist/chunk-H65I3GRZ.cjs +0 -106
- package/dist/chunk-HHYWB7VZ.js +0 -24
- package/dist/chunk-HNGGISFL.cjs +0 -65
- package/dist/chunk-HNSQAVSZ.cjs +0 -35
- package/dist/chunk-HSP6IWZK.js +0 -17
- package/dist/chunk-IDZS7J6T.js +0 -242
- package/dist/chunk-JS6R55VL.js +0 -302
- package/dist/chunk-JZVT5FK7.js +0 -232
- package/dist/chunk-KHO2SBNA.cjs +0 -16
- package/dist/chunk-KIDJCMNJ.js +0 -33
- package/dist/chunk-KOLEURVT.cjs +0 -38
- package/dist/chunk-L4V53MQK.cjs +0 -269
- package/dist/chunk-L5RDAVVH.js +0 -14
- package/dist/chunk-NODTV4F3.js +0 -16
- package/dist/chunk-NYK5K3V2.cjs +0 -211
- package/dist/chunk-ODUO3RTL.cjs +0 -113
- package/dist/chunk-ONZFBJVW.js +0 -14
- package/dist/chunk-PFXCTE37.js +0 -28
- package/dist/chunk-PPST7QAQ.js +0 -587
- package/dist/chunk-Q5IMYDFL.cjs +0 -33
- package/dist/chunk-QFFBIOJ4.js +0 -31
- package/dist/chunk-QNKGP5DY.js +0 -14
- package/dist/chunk-RRQHMOPE.cjs +0 -19
- package/dist/chunk-RU5OSRBU.js +0 -95
- package/dist/chunk-SDMPEJ4F.js +0 -35
- package/dist/chunk-SYNL5IKP.js +0 -115
- package/dist/chunk-TCDOWZQE.js +0 -16
- package/dist/chunk-TQPGXGKB.cjs +0 -123
- package/dist/chunk-TULOI4GL.js +0 -370
- package/dist/chunk-UBHCP4N5.cjs +0 -36
- package/dist/chunk-UCHF3M34.cjs +0 -56
- package/dist/chunk-UDA26MCU.cjs +0 -16
- package/dist/chunk-V3C4FYZL.cjs +0 -18
- package/dist/chunk-VAAHZFBF.js +0 -32
- package/dist/chunk-VJDDGRIK.cjs +0 -16
- package/dist/chunk-WVSPXFTY.js +0 -14
- package/dist/chunk-WYP76WXB.js +0 -101
- package/dist/chunk-YDE4ZBB7.cjs +0 -237
- package/dist/chunk-YKQEOO7C.cjs +0 -23
- package/dist/chunk-YSZC56SZ.js +0 -264
- package/dist/chunk-YWHHVDT4.js +0 -13
- package/dist/index.d.ts +0 -24
- package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
- package/dist/rzl-utils.global.js +0 -10
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* @rzl-zone/utils-js
|
|
4
|
+
* ------------------------------------------------------------------------
|
|
5
|
+
* Version: `3.12.1-beta.0`
|
|
6
|
+
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
|
+
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
|
+
* ========================================================================
|
|
9
|
+
*/
|
|
10
|
+
"use strict";
|
|
11
|
+
const require_isEmptyValue = require('./isEmptyValue-DMSMFTU8.cjs');
|
|
12
|
+
const isNonEmptyValue = (value, options = {}) => {
|
|
13
|
+
return !require_isEmptyValue.isEmptyValue(value, options);
|
|
14
|
+
};
|
|
15
|
+
const typedArrayTags = new Set([
|
|
16
|
+
"[object Int8Array]",
|
|
17
|
+
"[object Uint8Array]",
|
|
18
|
+
"[object Uint8ClampedArray]",
|
|
19
|
+
"[object Int16Array]",
|
|
20
|
+
"[object Uint16Array]",
|
|
21
|
+
"[object Int32Array]",
|
|
22
|
+
"[object Uint32Array]",
|
|
23
|
+
"[object Float32Array]",
|
|
24
|
+
"[object Float64Array]",
|
|
25
|
+
"[object BigInt64Array]",
|
|
26
|
+
"[object BigUint64Array]"
|
|
27
|
+
]);
|
|
28
|
+
function isTypedArray(value) {
|
|
29
|
+
return value != null && typeof value === "object" && typedArrayTags.has(Object.prototype.toString.call(value));
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(exports, 'isNonEmptyValue', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return isNonEmptyValue;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, 'isTypedArray', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return isTypedArray;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=isTypedArray-DiCoqffZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTypedArray-DiCoqffZ.cjs","names":["isEmptyValue"],"sources":["../src/predicates/is/isNonEmptyValue.ts","../src/predicates/is/isTypedArray.ts"],"sourcesContent":["import { isEmptyValue } from \"./isEmptyValue\";\n\ntype IsNonEmptyValueOptions = {\n /** Whether to check symbol properties when checking empty objects, default: `false`.\n *\n * @default false\n */\n checkSymbols?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Predicated: `isNonEmptyValue`.***\n * ----------------------------------------------------------\n * **Determines if a value is a **non-empty** object (`{}` with props), **non-empty** array (`[]` with items) or generally truthy.**\n * - **Behavior:**\n * - Returns `true` for:\n * - Objects **with properties**\n * - Arrays **with items**\n * - Non-empty, non-whitespace strings\n * - Numbers (except `NaN`, includes `0`)\n * - Functions\n * - `true`\n * - Returns `false` for:\n * - Empty objects (`{}`)\n * - Empty arrays (`[]`)\n * - `null` or `undefined`\n * - Empty strings (`\"\"`) or whitespace-only strings (`\" \"`)\n * - `false`\n * - `NaN`\n * - Safely handles `null`, `undefined`, and non-object types without throwing.\n * @param {*} value - The value to evaluate.\n * @param {IsNonEmptyValueOptions} [options] - Optional settings.\n * @returns {boolean} Return `true` if the value is considered non-empty/truthy, otherwise `false`.\n * @example\n * isNonEmptyValue({});\n * // ➔ false\n * isNonEmptyValue([]);\n * // ➔ false\n * isNonEmptyValue({ key: \"value\" });\n * // ➔ true\n * isNonEmptyValue({ [Symbol(\"foo\")]: 123 });\n * // ➔ false (default `checkSymbols` is `false`)\n * isNonEmptyValue({ [Symbol(\"foo\")]: 123 }, { checkSymbols: false });\n * // ➔ false (default `checkSymbols` is `false`)\n * isNonEmptyValue({ [Symbol(\"foo\")]: 123 }, { checkSymbols: true });\n * // ➔ true\n * isNonEmptyValue([1, 2, 3]);\n * // ➔ true\n * isNonEmptyValue(NaN);\n * // ➔ false\n * isNonEmptyValue(true);\n * // ➔ true\n * isNonEmptyValue(false);\n * // ➔ false\n * isNonEmptyValue(null);\n * // ➔ false\n * isNonEmptyValue(undefined);\n * // ➔ false\n * isNonEmptyValue(\"\");\n * // ➔ false\n * isNonEmptyValue(\" \");\n * // ➔ false\n * isNonEmptyValue(0);\n * // ➔ true\n * isNonEmptyValue(-1);\n * // ➔ true\n * isNonEmptyValue(2);\n * // ➔ true\n * isNonEmptyValue(() => {});\n * // ➔ true\n */\nexport const isNonEmptyValue = (\n value: unknown,\n options: IsNonEmptyValueOptions = {}\n): boolean => {\n return !isEmptyValue(value, options);\n};\n","import type { TypedArray } from \"@rzl-zone/ts-types-plus\";\n\nconst typedArrayTags = new Set([\n \"[object Int8Array]\",\n \"[object Uint8Array]\",\n \"[object Uint8ClampedArray]\",\n \"[object Int16Array]\",\n \"[object Uint16Array]\",\n \"[object Int32Array]\",\n \"[object Uint32Array]\",\n \"[object Float32Array]\",\n \"[object Float64Array]\",\n \"[object BigInt64Array]\",\n \"[object BigUint64Array]\"\n]);\n\n/** --------------------------------------------------\n * * ***Type guard: `isTypedArray`.***\n * ----------------------------------------------------------\n * **Checks if `value` is classified as a\n * **[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**.**\n * - **Behavior:**\n * - Validates that `value` is a non-null object.\n * - Uses `Object.prototype.toString` tag matching against known typed array tags.\n * - Narrows type to **{@link TypedArray | `TypedArray`}** when true.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the value is a typed array, otherwise `false`.\n * @example\n * isTypedArray(new Uint8Array); // ➔ true\n * isTypedArray(new Uint8Array()); // ➔ true\n * isTypedArray(new Float32Array()); // ➔ true\n * isTypedArray(new Uint8ClampedArray()); // ➔ true\n * isTypedArray([]); // ➔ false\n * isTypedArray(Buffer.from(\"hi\")); // ➔ false\n */\nexport function isTypedArray(value: unknown): value is TypedArray {\n return (\n value != null &&\n typeof value === \"object\" &&\n typedArrayTags.has(Object.prototype.toString.call(value))\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,mBACX,OACA,UAAkC,EAAE,KACxB;CACZ,OAAO,CAACA,kCAAa,OAAO,QAAQ;;;;;ACzEtC,MAAM,iBAAiB,IAAI,IAAI;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;;;;;;;;;;;;;;;;AAqBF,SAAgB,aAAa,OAAqC;CAChE,OACE,SAAS,QACT,OAAO,UAAU,YACjB,eAAe,IAAI,OAAO,UAAU,SAAS,KAAK,MAAM,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* @rzl-zone/utils-js
|
|
4
|
+
* ------------------------------------------------------------------------
|
|
5
|
+
* Version: `3.12.1-beta.0`
|
|
6
|
+
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
|
+
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
|
+
* ========================================================================
|
|
9
|
+
*/
|
|
10
|
+
const isURL = (value) => {
|
|
11
|
+
return value instanceof URL;
|
|
12
|
+
};
|
|
13
|
+
export { isURL as t };
|
|
14
|
+
//# sourceMappingURL=isURL-CQiowFq2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isURL-CQiowFq2.js","names":[],"sources":["../src/predicates/is/isURL.ts"],"sourcesContent":["/** ---------------------------------------------------------\n * * ***Type guard: `isURL`.***\n * ----------------------------------------------------------\n * **Checks if a value is an instance of the\n * **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** class.**\n * - **Behavior:**\n * - Narrows type to `URL` when true.\n * - Excludes `strings`, `plain-objects`, and `other non-URL values`.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the value is an instance of `URL`, otherwise `false`.\n * @example\n * isURL(new URL(\"https://example.com\"));\n * // ➔ true\n * isURL(\"https://example.com\");\n * // ➔ false\n */\nexport const isURL = (value: unknown): value is URL => {\n return value instanceof URL;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,SAAS,UAAiC;CACrD,OAAO,iBAAiB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* @rzl-zone/utils-js
|
|
4
|
+
* ------------------------------------------------------------------------
|
|
5
|
+
* Version: `3.12.1-beta.0`
|
|
6
|
+
* Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
|
|
7
|
+
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
|
|
8
|
+
* ========================================================================
|
|
9
|
+
*/
|
|
10
|
+
"use strict";
|
|
11
|
+
const isURL = (value) => {
|
|
12
|
+
return value instanceof URL;
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, 'isURL', {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return isURL;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=isURL-WZypXsax.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isURL-WZypXsax.cjs","names":[],"sources":["../src/predicates/is/isURL.ts"],"sourcesContent":["/** ---------------------------------------------------------\n * * ***Type guard: `isURL`.***\n * ----------------------------------------------------------\n * **Checks if a value is an instance of the\n * **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** class.**\n * - **Behavior:**\n * - Narrows type to `URL` when true.\n * - Excludes `strings`, `plain-objects`, and `other non-URL values`.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the value is an instance of `URL`, otherwise `false`.\n * @example\n * isURL(new URL(\"https://example.com\"));\n * // ➔ true\n * isURL(\"https://example.com\");\n * // ➔ false\n */\nexport const isURL = (value: unknown): value is URL => {\n return value instanceof URL;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,SAAS,UAAiC;CACrD,OAAO,iBAAiB"}
|