@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.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 +56 -27
- package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
- package/dist/any-BmdI8UbK.d.ts +56 -56
- package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +398 -418
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-26XIKDJI.cjs +1 -0
- package/dist/chunk-2NWHDDM5.js +1 -0
- package/dist/chunk-2UIRWYE3.js +1 -0
- package/dist/chunk-3KBHD3BS.cjs +1 -0
- package/dist/chunk-4HD2O5A4.js +1 -0
- package/dist/chunk-5C2SMIGX.cjs +1 -0
- package/dist/chunk-5I2B5DOG.js +1 -0
- package/dist/chunk-6HQDHIOD.js +1 -0
- package/dist/chunk-735HJXBT.cjs +1 -0
- package/dist/chunk-7BXIZM57.cjs +1 -0
- package/dist/chunk-7KJBDGEP.js +1 -0
- package/dist/chunk-7U44T63D.cjs +1 -0
- package/dist/chunk-AJ65QFV2.js +1 -0
- package/dist/chunk-APHDUCVQ.js +1 -0
- package/dist/chunk-BSVZRN7C.js +1 -0
- package/dist/chunk-C6JFHUR2.cjs +1 -0
- package/dist/chunk-CPLBRGST.js +1 -0
- package/dist/chunk-CTBRLEOG.js +1 -0
- package/dist/chunk-DUK2K4FB.js +1 -0
- package/dist/chunk-DVMHRLKP.cjs +1 -0
- package/dist/chunk-E63WVPZE.cjs +1 -0
- package/dist/chunk-EBMHQW7X.cjs +1 -0
- package/dist/chunk-EGNZCW4K.js +1 -0
- package/dist/chunk-FEKDB32T.js +1 -0
- package/dist/chunk-FIAAX3UE.js +1 -0
- package/dist/chunk-FUS3DVLB.cjs +1 -0
- package/dist/chunk-GGRMHIFJ.cjs +1 -0
- package/dist/chunk-HQ5GQTEE.js +1 -0
- package/dist/chunk-I5X5IN4H.js +1 -0
- package/dist/chunk-I7YGXQPI.cjs +1 -0
- package/dist/chunk-INUFZJLX.cjs +1 -0
- package/dist/chunk-IREHUBF7.js +1 -0
- package/dist/chunk-J2RGTPGK.cjs +1 -0
- package/dist/chunk-KHO2SBNA.cjs +1 -0
- package/dist/chunk-KXIXXSWX.cjs +1 -0
- package/dist/chunk-LBMEEJWA.js +1 -0
- package/dist/chunk-MC3LXMCQ.js +1 -0
- package/dist/chunk-MMSYCIJ2.cjs +1 -1
- package/dist/chunk-NU3N4WHD.cjs +1 -0
- package/dist/chunk-ODZQXH7E.cjs +1 -0
- package/dist/chunk-ONZFBJVW.js +1 -0
- package/dist/chunk-PXDRHFIE.js +1 -0
- package/dist/chunk-Q6NHYWVX.js +1 -0
- package/dist/chunk-QNKGP5DY.js +1 -0
- package/dist/chunk-S6Z6I2EG.cjs +1 -0
- package/dist/chunk-SMADKXZE.js +1 -0
- package/dist/chunk-TSLYDPBJ.js +1 -0
- package/dist/chunk-TVXADXCC.cjs +1 -0
- package/dist/chunk-UDA26MCU.cjs +1 -0
- package/dist/chunk-UET567YM.cjs +1 -0
- package/dist/chunk-VEYMQ3UA.js +1 -0
- package/dist/chunk-W2W3L2M5.js +1 -0
- package/dist/chunk-WBWTXKMC.cjs +1 -0
- package/dist/chunk-WVSPXFTY.js +1 -0
- package/dist/chunk-XC2PYCT4.cjs +1 -0
- package/dist/chunk-XIXA5KDF.cjs +1 -0
- package/dist/chunk-Y4O5KZF6.cjs +1 -0
- package/dist/chunk-YRM7IJLX.js +1 -0
- package/dist/chunk-YT3MSZKK.cjs +1 -0
- package/dist/chunk-YXHCULSO.cjs +1 -0
- package/dist/chunk-YZR5OGJA.cjs +1 -0
- package/dist/chunk-Z4DXK7A6.cjs +1 -0
- package/dist/chunk-ZXIWDFEQ.js +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +1368 -1515
- package/dist/conversions/index.js +1 -1
- package/dist/env/index.cjs +1 -1
- package/dist/env/index.d.ts +14 -17
- package/dist/env/index.js +1 -1
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +111 -108
- package/dist/events/index.js +1 -1
- package/dist/extends-Bk_SBGdT.d.ts +367 -0
- package/dist/formatting/index.cjs +1 -1
- package/dist/formatting/index.d.ts +878 -840
- package/dist/formatting/index.js +1 -1
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.ts +173 -150
- package/dist/generator/index.js +1 -1
- package/dist/if-CvT4R7Kh.d.ts +16 -16
- package/dist/is-array-Cymwrsmm.d.ts +1119 -0
- package/dist/isPlainObject-BVhBAPHX.d.ts +169 -0
- package/dist/never-BfayMBF9.d.ts +64 -64
- package/dist/next/index.cjs +1 -8
- package/dist/next/index.d.ts +196 -176
- package/dist/next/index.js +1 -8
- package/dist/next/server/index.cjs +1 -2
- package/dist/next/server/index.d.ts +26 -40
- package/dist/next/server/index.js +1 -2
- package/dist/nils-DMz3kU7M.d.ts +155 -155
- package/dist/omit-VvmIsZmX.d.ts +25 -25
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +121 -176
- package/dist/operations/index.js +1 -1
- package/dist/or-DyZCRvaU.d.ts +89 -0
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +35 -36
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +1797 -1677
- package/dist/predicates/index.js +1 -1
- package/dist/prettify-C4xLcYOP.d.ts +328 -328
- package/dist/promise/index.cjs +1 -1
- package/dist/promise/index.d.ts +29 -38
- package/dist/promise/index.js +1 -1
- package/dist/rzl-utils.global.js +1 -4
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +712 -787
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +1 -0
- package/dist/tailwind/index.d.ts +565 -0
- package/dist/tailwind/index.js +1 -0
- package/dist/type-data-DDs-u2kq.d.ts +241 -241
- package/dist/types/index.d.ts +3266 -3266
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +384 -409
- package/dist/urls/index.js +1 -1
- package/package.json +61 -18
- package/dist/array-CIZRbqTF.d.ts +0 -223
- package/dist/chunk-2TRAPBZ7.cjs +0 -1
- package/dist/chunk-3D74QO5D.cjs +0 -1
- package/dist/chunk-4DK3RCC4.js +0 -2
- package/dist/chunk-4JOQ45HL.js +0 -1
- package/dist/chunk-55CZALRS.js +0 -1
- package/dist/chunk-56QBKKRE.js +0 -1
- package/dist/chunk-5JFV3GDE.cjs +0 -4
- package/dist/chunk-5SZUSNGZ.js +0 -1
- package/dist/chunk-62HX5Z45.cjs +0 -1
- package/dist/chunk-7NA6DUHR.cjs +0 -2
- package/dist/chunk-7YWAQOA4.cjs +0 -1
- package/dist/chunk-BVPMMWDL.cjs +0 -1
- package/dist/chunk-BYZAD3XN.cjs +0 -1
- package/dist/chunk-CEFYHEM4.cjs +0 -1
- package/dist/chunk-CN53M4QZ.cjs +0 -1
- package/dist/chunk-D47MHBSD.cjs +0 -1
- package/dist/chunk-DGH75GJD.js +0 -1
- package/dist/chunk-E5NUI7PN.js +0 -1
- package/dist/chunk-ELDDNERR.js +0 -1
- package/dist/chunk-EXZ47NOW.js +0 -1
- package/dist/chunk-FDITZ5C6.cjs +0 -1
- package/dist/chunk-FF76ISQ2.js +0 -1
- package/dist/chunk-FIEZKTAZ.cjs +0 -1
- package/dist/chunk-FSSV24W7.cjs +0 -1
- package/dist/chunk-GCGU2WB7.js +0 -1
- package/dist/chunk-GECI2YBP.js +0 -1
- package/dist/chunk-GQE4OVHC.cjs +0 -1
- package/dist/chunk-GRVZXQXL.cjs +0 -1
- package/dist/chunk-I4AVNHPA.cjs +0 -1
- package/dist/chunk-JFRL7NKU.js +0 -4
- package/dist/chunk-JWHM3WZQ.cjs +0 -1
- package/dist/chunk-KCQDDZJE.cjs +0 -1
- package/dist/chunk-L54ZPSYJ.js +0 -1
- package/dist/chunk-LVKAYEZ4.js +0 -1
- package/dist/chunk-MBDWTK54.cjs +0 -1
- package/dist/chunk-MNGGDB2G.js +0 -1
- package/dist/chunk-MY7BA4GI.cjs +0 -1
- package/dist/chunk-N2IJPIND.cjs +0 -1
- package/dist/chunk-NIMNTEGV.js +0 -1
- package/dist/chunk-NNM7QCNB.js +0 -1
- package/dist/chunk-PUQXRLZH.cjs +0 -1
- package/dist/chunk-PVJF2JHM.js +0 -1
- package/dist/chunk-QCFXEUKL.js +0 -1
- package/dist/chunk-QFCGBBSY.js +0 -1
- package/dist/chunk-QQYAUPSK.cjs +0 -1
- package/dist/chunk-RN3TP3S3.js +0 -1
- package/dist/chunk-RV2VULM7.cjs +0 -1
- package/dist/chunk-SW6HYEW7.cjs +0 -1
- package/dist/chunk-SYJC7UAW.js +0 -1
- package/dist/chunk-TC4VBE4Y.cjs +0 -1
- package/dist/chunk-TUXDINHF.cjs +0 -1
- package/dist/chunk-U5Y2FXMN.cjs +0 -1
- package/dist/chunk-UUPQI6ND.cjs +0 -1
- package/dist/chunk-VYCGZ2S6.js +0 -1
- package/dist/chunk-W5EDKJK3.js +0 -1
- package/dist/chunk-WHAVUFEU.js +0 -1
- package/dist/chunk-XCFIOTCV.js +0 -1
- package/dist/chunk-XE27XPJR.js +0 -1
- package/dist/chunk-XH6MCRLP.js +0 -1
- package/dist/chunk-XVB3ZZEB.js +0 -1
- package/dist/chunk-ZBSIGJFO.cjs +0 -1
- package/dist/chunk-ZYAML74V.js +0 -1
- package/dist/extends-Mp81Hq9-.d.ts +0 -145
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/is-array-Ckm_47hw.d.ts +0 -1557
- package/dist/isPlainObject-BKYaI6a8.d.ts +0 -182
- package/dist/stylings/index.cjs +0 -1
- package/dist/stylings/index.d.ts +0 -49
- package/dist/stylings/index.js +0 -1
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import{N as NonPlainObject}from'./type-data-DDs-u2kq.js';type GetPreciseTypeOptions={
|
|
2
|
-
/** -------------------------------------------------------
|
|
3
|
-
* * ***Specifies the format in which the returned string type should be transformed.***
|
|
4
|
-
* -------------------------------------------------------
|
|
5
|
-
*
|
|
6
|
-
* ℹ️ For special string literals in `SPECIAL_CASES` (`"-Infinity" | "Infinity" | "NaN"`), which will remain unchanged.
|
|
7
|
-
* @default "toLowerCase"
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Supported formats:
|
|
11
|
-
* - `"toLowerCase"` (default) — converts all letters to lowercase.
|
|
12
|
-
* - ➔ `"result example type"`
|
|
13
|
-
* - `"toDotCase"` — words separated by dots.
|
|
14
|
-
* - ➔ `"result.example.type"`
|
|
15
|
-
* - `"toCamelCase"` — first word lowercase, subsequent words capitalized.
|
|
16
|
-
* - ➔ `"resultExampleType"`
|
|
17
|
-
* - `"toKebabCase"` — words separated by hyphens.
|
|
18
|
-
* - ➔ `"result-example-type"`
|
|
19
|
-
* - `"toSnakeCase"` — words separated by underscores.
|
|
20
|
-
* - ➔ `"result_example_type"`
|
|
21
|
-
* - `"toPascalCase"` — all words capitalized, no spaces.
|
|
22
|
-
* - ➔ `"ResultExampleType"`
|
|
23
|
-
* - `"toPascalCaseSpace"` — all words capitalized with spaces between words.
|
|
24
|
-
* - ➔ `"Result Example Type"`
|
|
25
|
-
* - `"slugify"` — URL-friendly slug (lowercase with hyphens).
|
|
26
|
-
* - ➔ `"result-example-type"`
|
|
27
|
-
*
|
|
28
|
-
* @note
|
|
29
|
-
* ⚠️ If an invalid value is provided, the function will automatically fallback to the default `"toLowerCase"`.
|
|
30
|
-
*/
|
|
31
|
-
formatCase?:"toPascalCaseSpace"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"|"toLowerCase";};
|
|
32
|
-
/** ----------------------------------------------------------
|
|
33
|
-
* * ***Returns a detailed and normalized type string for the given value.***
|
|
34
|
-
* ----------------------------------------------------------
|
|
35
|
-
*
|
|
36
|
-
* The returned string is human-readable _**toLowerCase**_ with spaces _***(by default)***_ or
|
|
37
|
-
* formatted according to the `options.formatCase` setting.
|
|
38
|
-
*
|
|
39
|
-
* Handles:
|
|
40
|
-
* - Primitives (`string`, `number`, `boolean`, `null`, `undefined`, `symbol`, `bigint`)
|
|
41
|
-
* - Built-in objects (`Array`, `Map`, `Set`, `Error subclasses`, `Typed Arrays`, etc)
|
|
42
|
-
* - Objects created with `Object.create(null)`
|
|
43
|
-
* - Generator instances
|
|
44
|
-
* - Node.js `Buffer` instances
|
|
45
|
-
* - Proxy detection (returns `"Proxy"` if detected; detection is not 100% accurate)
|
|
46
|
-
* - Uses cached mapping table (`FIXES`) for known types to provide consistent naming
|
|
47
|
-
* - Falls back to constructor name or `Object.prototype.toString` tag
|
|
48
|
-
*
|
|
49
|
-
* @param {*} value - The value to detect the precise type of
|
|
50
|
-
* @param {Object} [options] - Optional configuration
|
|
51
|
-
* @param {"toPascalCaseSpace"|"toLowerCase"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"} [options.formatCase="toLowerCase"]
|
|
52
|
-
* - Specifies how the returned type string should be formatted.
|
|
53
|
-
* - ⚠️ Special string literals in `SPECIAL_CASES` (`"-Infinity" | "Infinity" | "NaN"`)
|
|
54
|
-
* will remain unchanged even if a different `formatCase` is applied.
|
|
55
|
-
*
|
|
56
|
-
* @returns {string} The normalized and formatted type string
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* getPreciseType(123); // ➔ "number"
|
|
60
|
-
* getPreciseType(null); // ➔ "null"
|
|
61
|
-
* getPreciseType(/regex/,{ formatCase: "toKebabCase" });
|
|
62
|
-
* // ➔ "reg-exp"
|
|
63
|
-
* getPreciseType(function* () {}, { formatCase: "toCamelCase" });
|
|
64
|
-
* // ➔ "generatorFunction"
|
|
65
|
-
* getPreciseType(async function () {}, { formatCase: "toPascalCaseSpace" });
|
|
66
|
-
* // ➔ "Async Function"
|
|
67
|
-
* getPreciseType("NaN", { formatCase: "toKebabCase" });
|
|
68
|
-
* // ➔ "NaN" (SPECIAL_CASES remain)
|
|
69
|
-
*/
|
|
70
|
-
declare const getPreciseType:(value:unknown,options?:GetPreciseTypeOptions)=>string;type IsNumberOptions={
|
|
71
|
-
/**
|
|
72
|
-
* If set to `true`, `NaN` will be considered a valid number.
|
|
73
|
-
* @default false
|
|
74
|
-
*/
|
|
75
|
-
includeNaN?:boolean;};
|
|
76
|
-
/** ---------------------------------------------------------
|
|
77
|
-
* * ***Type guard: `isNumber`.***
|
|
78
|
-
* ----------------------------------------------------------
|
|
79
|
-
* @description Checks if a value is of type **`number`**.
|
|
80
|
-
*
|
|
81
|
-
* - Uses `typeof value === "number"`.
|
|
82
|
-
* - By default, excludes **`NaN`**.
|
|
83
|
-
* - If `options.includeNaN` is `true`, then **`NaN`** is also considered valid.
|
|
84
|
-
* - Still considers `Infinity` and `-Infinity` as numbers (consistent with JavaScript).
|
|
85
|
-
*
|
|
86
|
-
* ℹ️ To exclude `Infinity` and `-Infinity`, use **{@link isFinite}** instead.
|
|
87
|
-
*
|
|
88
|
-
* @param {*} value - The value to check.
|
|
89
|
-
* @param {IsNumberOptions} options - Optional settings.
|
|
90
|
-
* @param {boolean} options.includeNaN If `true`, `NaN` will be considered a valid number, dsefaults to `false`, which excludes `NaN`.
|
|
91
|
-
* @returns {boolean} Returns `true` if the value is a number (and depending on `includeNaN`, `NaN` is included or excluded).
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* isNumber(42);
|
|
95
|
-
* // ➔ true
|
|
96
|
-
* isNumber(Infinity);
|
|
97
|
-
* // ➔ true
|
|
98
|
-
* isNumber(-Infinity);
|
|
99
|
-
* // ➔ true
|
|
100
|
-
* isNumber(NaN);
|
|
101
|
-
* // ➔ false (default)
|
|
102
|
-
* isNumber(NaN, { includeNaN: true });
|
|
103
|
-
* // ➔ true
|
|
104
|
-
* isNumber("42");
|
|
105
|
-
* // ➔ false
|
|
106
|
-
*/
|
|
107
|
-
declare const isNumber:(value:unknown,options?:IsNumberOptions)=>value is number;type HasKeys<T>=keyof T extends never?false:true;
|
|
108
|
-
/** ----------------------------------------------------------
|
|
109
|
-
* * ***Utility type: `IsPlainObjectResult`.***
|
|
110
|
-
* ----------------------------------------------------------
|
|
111
|
-
* @description
|
|
112
|
-
* Represents the inferred type after asserting a value is a **plain object**.
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
* - If `T` is `unknown`, the resulting type is `Record<PropertyKey, unknown> & T`.
|
|
117
|
-
* - If `T` is an object:
|
|
118
|
-
* - If it is a non-plain object (class instance, built-in object, etc.), the result is `never`.
|
|
119
|
-
* - If it has no keys (`HasKeys<T>` checked by **{@link HasKeys}** is false), the result is `Record<PropertyKey, unknown> & T`.
|
|
120
|
-
* - Otherwise, the result is `T` itself.
|
|
121
|
-
* - For any other types, the result is `never`.
|
|
122
|
-
*
|
|
123
|
-
* @template T - The input type to be asserted as a plain object.
|
|
124
|
-
* @example
|
|
125
|
-
* ```ts
|
|
126
|
-
* type A = IsPlainObjectResult<unknown>;
|
|
127
|
-
* // ➔ Record<PropertyKey, unknown> & unknown
|
|
128
|
-
* type B = IsPlainObjectResult<{}>;
|
|
129
|
-
* // ➔ Record<PropertyKey, unknown> & {}
|
|
130
|
-
* type C = IsPlainObjectResult<{ foo: string }>;
|
|
131
|
-
* // ➔ { foo: string }
|
|
132
|
-
* type D = IsPlainObjectResult<Date>;
|
|
133
|
-
* // ➔ never
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
type IsPlainObjectResult<T>=unknown extends T?Record<PropertyKey,unknown>& T:T extends object?T extends NonPlainObject?never:HasKeys<T>extends false?Record<PropertyKey,unknown>& T:T:Extract<T,Record<PropertyKey,unknown>>;
|
|
137
|
-
/** ----------------------------------------------------------
|
|
138
|
-
* * ***Type guard: `isPlainObject`.***
|
|
139
|
-
* ----------------------------------------------------------
|
|
140
|
-
* @description
|
|
141
|
-
* Checks if a value is a **plain-object**.
|
|
142
|
-
*
|
|
143
|
-
* A plain object is:
|
|
144
|
-
* - Created by the `Object` constructor, or
|
|
145
|
-
* - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).
|
|
146
|
-
* ----------------------------------------------------------
|
|
147
|
-
* - ✅ Returns `true` for:
|
|
148
|
-
* - Empty object literals: `{}`
|
|
149
|
-
* - Objects with null prototype: `Object.create(null)`
|
|
150
|
-
* ----------------------------------------------------------
|
|
151
|
-
* - ❌ Returns `false` for:
|
|
152
|
-
* - Arrays (`[]`, `new Array()`)
|
|
153
|
-
* - Functions (regular, arrow, or class constructors)
|
|
154
|
-
* - Built-in objects: `Date`, `RegExp`, `Error`, `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
155
|
-
* - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
|
|
156
|
-
* - `null` or `undefined`
|
|
157
|
-
* - Symbols
|
|
158
|
-
* - Class instances
|
|
159
|
-
*
|
|
160
|
-
* @template T - The type of the value being checked.
|
|
161
|
-
* @param {*} value - The value to check.
|
|
162
|
-
* @returns {boolean} Return `true` if `value` is a `plain-object`, otherwise `false`.
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* isPlainObject({});
|
|
166
|
-
* // ➔ true
|
|
167
|
-
* isPlainObject(Object.create(null));
|
|
168
|
-
* // ➔ true
|
|
169
|
-
* isPlainObject(null);
|
|
170
|
-
* // ➔ false
|
|
171
|
-
* isPlainObject(() => {});
|
|
172
|
-
* // ➔ false
|
|
173
|
-
* isPlainObject([1, 2, 3]);
|
|
174
|
-
* // ➔ false
|
|
175
|
-
* isPlainObject(new Date());
|
|
176
|
-
* // ➔ false
|
|
177
|
-
* isPlainObject(new MyClass());
|
|
178
|
-
* // ➔ false
|
|
179
|
-
* isPlainObject(new String("x"));
|
|
180
|
-
* // ➔ false
|
|
181
|
-
*/
|
|
182
|
-
declare function isPlainObject<T>(value:T):value is IsPlainObjectResult<T>;declare function isPlainObject<T>(value:T):value is NonNullable<Extract<T,Record<PropertyKey,unknown>>>;export{type GetPreciseTypeOptions as G,type IsNumberOptions as I,type IsPlainObjectResult as a,isPlainObject as b,getPreciseType as g,isNumber as i};
|
package/dist/stylings/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkMY7BA4GI_cjs=require('../chunk-MY7BA4GI.cjs');require('../chunk-62HX5Z45.cjs'),require('../chunk-CN53M4QZ.cjs');Object.defineProperty(exports,"shouldForwardProp",{enumerable:true,get:function(){return chunkMY7BA4GI_cjs.a}});
|
package/dist/stylings/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a union type into an intersection type.
|
|
3
|
-
*
|
|
4
|
-
* @template U - The union type to be converted.
|
|
5
|
-
*/
|
|
6
|
-
type UnionToIntersectionStrict<U>=(U extends never?never:(arg:U)=>never)extends(arg:infer I)=>void?I:never;
|
|
7
|
-
/**
|
|
8
|
-
* Converts a union type into a tuple type.
|
|
9
|
-
*
|
|
10
|
-
* @template T - The union type to be converted.
|
|
11
|
-
*/
|
|
12
|
-
type UnionToTupleStrict<T>=UnionToIntersectionStrict<T extends never?never:(t:T)=>T>extends(_:never)=>infer W?[...UnionToTupleStrict<Exclude<T,W>>,W]:[];
|
|
13
|
-
/** ----------------------------------------------------------
|
|
14
|
-
* * ***Creates a helper for styled-components `shouldForwardProp`.***
|
|
15
|
-
* ----------------------------------------------------------
|
|
16
|
-
*
|
|
17
|
-
* @description
|
|
18
|
-
* This utility returns a predicate function that determines
|
|
19
|
-
* whether a given prop should be forwarded to the DOM.
|
|
20
|
-
* Useful for filtering out internal props (e.g., `$size`, `$active`)
|
|
21
|
-
* so they don't end up as invalid HTML attributes.
|
|
22
|
-
*
|
|
23
|
-
* - Accepts a tuple (strict) of prop keys to exclude from forwarding.
|
|
24
|
-
* - Automatically coerces prop names to string for consistent checking.
|
|
25
|
-
* - Supports string, number, or symbol keys (via PropertyKey).
|
|
26
|
-
* - Will throw an error if the provided `props` argument is not an array.
|
|
27
|
-
*
|
|
28
|
-
* @template CustomProps - The type of the component's props.
|
|
29
|
-
* @param {UnionToTupleStrict<keyof CustomProps>} props
|
|
30
|
-
* The list of prop names (keys of `CustomProps`) to exclude from forwarding.
|
|
31
|
-
*
|
|
32
|
-
* @returns {(propName: PropertyKey) => boolean}
|
|
33
|
-
* A function that takes a prop name and returns `true` if it should be forwarded, `false` if it should be blocked.
|
|
34
|
-
*
|
|
35
|
-
* @throws {Error} If `props` is not an array.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* type Props = { $size: string; color: string; visible: boolean };
|
|
39
|
-
* const filter = shouldForwardProp<Props>(["$size"]);
|
|
40
|
-
* filter("$size"); // false (blocked)
|
|
41
|
-
* filter("color"); // true (forwarded)
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Using with styled-components:
|
|
45
|
-
* styled.div.withConfig({
|
|
46
|
-
* shouldForwardProp: shouldForwardProp<CustomProps>(["$internal"])
|
|
47
|
-
* })
|
|
48
|
-
*/
|
|
49
|
-
declare const shouldForwardProp:<CustomProps>(props:Partial<UnionToTupleStrict<keyof CustomProps>>)=>((propName:keyof CustomProps)=>boolean);export{shouldForwardProp};
|
package/dist/stylings/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as shouldForwardProp}from'../chunk-FF76ISQ2.js';import'../chunk-QFCGBBSY.js';import'../chunk-XCFIOTCV.js';
|