@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0-beta.2
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/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +96 -116
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-25G6B35W.js +1 -0
- package/dist/chunk-2AUUPGMN.js +1 -0
- package/dist/chunk-2JQQQ625.js +1 -0
- package/dist/chunk-445TAVT4.cjs +1 -0
- package/dist/chunk-467VEMJH.js +1 -0
- package/dist/chunk-6Q4I2RPC.cjs +1 -0
- package/dist/chunk-6SMJMZ7G.cjs +1 -0
- package/dist/chunk-BLCANGFS.js +1 -0
- package/dist/chunk-CK3BZGEU.js +1 -0
- package/dist/{chunk-JWHM3WZQ.cjs → chunk-D43GV6EF.cjs} +1 -1
- package/dist/chunk-DFSTVQFI.cjs +1 -0
- package/dist/chunk-DYRDBYPF.cjs +1 -0
- package/dist/chunk-EXXLUO7L.cjs +1 -0
- package/dist/chunk-G72VSVGO.js +1 -0
- package/dist/chunk-GAJTFCUA.js +1 -0
- package/dist/chunk-GOJNH55O.cjs +1 -0
- package/dist/chunk-HXST7RJB.js +1 -0
- package/dist/{chunk-BYZAD3XN.cjs → chunk-HXTACM3O.cjs} +1 -1
- package/dist/chunk-IJTZWWRJ.cjs +1 -0
- package/dist/chunk-ISJ33O2J.cjs +1 -0
- package/dist/chunk-JISH2VGG.js +1 -0
- package/dist/{chunk-FF76ISQ2.js → chunk-JQZUWBIX.js} +1 -1
- package/dist/{chunk-XH6MCRLP.js → chunk-K4PLGD7C.js} +1 -1
- package/dist/chunk-KZQB7H4E.cjs +1 -0
- package/dist/chunk-LUVV5KSD.cjs +2 -0
- package/dist/chunk-LVUSFXQS.cjs +1 -0
- package/dist/chunk-ME5OV5HN.js +1 -0
- package/dist/chunk-MF5Y5K4N.cjs +1 -0
- package/dist/chunk-MJAW5RAK.js +1 -0
- package/dist/chunk-MWLEM7ED.js +1 -0
- package/dist/chunk-NSVLG7NY.js +4 -0
- package/dist/chunk-NUHOOAUN.cjs +1 -0
- package/dist/chunk-NUVGETPD.js +2 -0
- package/dist/chunk-O5VXBNUQ.cjs +4 -0
- package/dist/chunk-O7SJR4CY.cjs +1 -0
- package/dist/chunk-OX6RLS2F.cjs +1 -0
- package/dist/chunk-PFLNHD4B.cjs +1 -0
- package/dist/chunk-PSWITZK5.js +1 -0
- package/dist/chunk-PYUVKHUF.cjs +1 -0
- package/dist/chunk-REFMEB4A.js +1 -0
- package/dist/chunk-RHE3M2NJ.cjs +1 -0
- package/dist/chunk-RHIBYOFQ.js +1 -0
- package/dist/chunk-S7GMG4TB.js +1 -0
- package/dist/chunk-TQMZ2LPI.js +1 -0
- package/dist/{chunk-RN3TP3S3.js → chunk-U4TZO7WV.js} +1 -1
- package/dist/chunk-UUMKL74S.js +1 -0
- package/dist/{chunk-EXZ47NOW.js → chunk-VQLAPEL3.js} +1 -1
- package/dist/chunk-VTR75UID.cjs +1 -0
- package/dist/chunk-XFCJDSB2.cjs +1 -0
- package/dist/chunk-XOYX4PLZ.cjs +1 -0
- package/dist/chunk-Z6FLCEN6.js +1 -0
- package/dist/chunk-ZO5364A6.cjs +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +396 -593
- package/dist/conversions/index.js +1 -1
- package/dist/env/index.d.ts +5 -8
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +80 -77
- package/dist/events/index.js +1 -1
- package/dist/{array-CIZRbqTF.d.ts → extends-Bk_SBGdT.d.ts} +145 -1
- package/dist/formatting/index.cjs +1 -1
- package/dist/formatting/index.d.ts +478 -440
- package/dist/formatting/index.js +1 -1
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.ts +135 -112
- package/dist/generator/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{is-array-Ckm_47hw.d.ts → is-array--YjXV-Wx.d.ts} +2 -352
- package/dist/{isPlainObject-BKYaI6a8.d.ts → isPlainObject-BVhBAPHX.d.ts} +49 -62
- package/dist/next/index.cjs +6 -6
- package/dist/next/index.d.ts +125 -105
- package/dist/next/index.js +5 -5
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +8 -22
- package/dist/next/server/index.js +1 -1
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +72 -127
- package/dist/operations/index.js +1 -1
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +26 -27
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +686 -660
- package/dist/predicates/index.js +1 -1
- package/dist/promise/index.cjs +1 -1
- package/dist/promise/index.d.ts +14 -23
- package/dist/promise/index.js +1 -1
- package/dist/rzl-utils.global.js +3 -3
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +301 -376
- package/dist/strings/index.js +1 -1
- package/dist/stylings/index.cjs +1 -1
- package/dist/stylings/index.d.ts +15 -23
- package/dist/stylings/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +276 -301
- package/dist/urls/index.js +1 -1
- package/package.json +53 -11
- 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-5JFV3GDE.cjs +0 -4
- package/dist/chunk-62HX5Z45.cjs +0 -1
- package/dist/chunk-7NA6DUHR.cjs +0 -2
- package/dist/chunk-BVPMMWDL.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-FDITZ5C6.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-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-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-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-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
|
@@ -1,182 +1,127 @@
|
|
|
1
1
|
import{N as NumberRangeUnion}from'../NumberRangeUnion-DC-C3_Kq.js';
|
|
2
2
|
/** ----------------------------------------------------------------------
|
|
3
|
-
* * ***
|
|
3
|
+
* * ***Utility: `findDuplicates`.***
|
|
4
4
|
* ----------------------------------------------------------------------
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* **Finds duplicate values in an array by deep equality comparison.**
|
|
6
|
+
* - **Behavior:**
|
|
7
|
+
* - Uses ***{@link isEqual | `isEqual`}*** to compare elements
|
|
8
|
+
* (handles objects, arrays, dates, NaN, etc.).
|
|
9
|
+
* - Returns a new array containing only the *first occurrences* of duplicated values.
|
|
10
|
+
* - Does **not mutate** the original array.
|
|
11
|
+
* - Throws ***{@link TypeError | `TypeError`}*** if input is not an array.
|
|
11
12
|
* @template T Type of elements in the input array.
|
|
12
13
|
* @param {T[]} values - The array to check for duplicates.
|
|
13
14
|
* @returns {T[]} An array of the duplicate values found in the input,
|
|
14
15
|
* preserving order of their first duplicate appearance.
|
|
15
|
-
*
|
|
16
16
|
* @throws {TypeError} If the provided `values` argument is not an array.
|
|
17
|
-
*
|
|
18
17
|
* @example
|
|
19
|
-
* findDuplicates([1, 2, 2, 3, 4, 4]);
|
|
20
|
-
*
|
|
21
|
-
* findDuplicates([
|
|
22
|
-
*
|
|
23
|
-
* findDuplicates([
|
|
24
|
-
*
|
|
18
|
+
* findDuplicates([1, 2, 2, 3, 4, 4]);
|
|
19
|
+
* // ➔ [2, 4]
|
|
20
|
+
* findDuplicates(["apple", "banana", "apple", "orange"]);
|
|
21
|
+
* // ➔ ["apple"]
|
|
22
|
+
* findDuplicates([{ a: 1 }, { a: 1 }, { a: 2 }]);
|
|
23
|
+
* // ➔ [{ a: 1 }]
|
|
24
|
+
* findDuplicates([NaN, NaN, 1]);
|
|
25
|
+
* // ➔ [NaN]
|
|
26
|
+
* findDuplicates([true, false, true]);
|
|
27
|
+
* // ➔ [true]
|
|
28
|
+
* findDuplicates([1, 2, 3]);
|
|
29
|
+
* // ➔ []
|
|
25
30
|
*/
|
|
26
31
|
declare const findDuplicates:<T>(values:T[])=>T[];
|
|
27
32
|
/** --------------------------------
|
|
28
|
-
* * ***
|
|
33
|
+
* * ***Utility: `omitKeys`.***
|
|
29
34
|
* --------------------------------
|
|
30
|
-
* This function creates a shallow copy of the given object
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* It also validates that
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* **This function creates a shallow copy of the given object omitting the
|
|
36
|
+
* specified keys.**
|
|
37
|
+
* - **Behavior:**
|
|
38
|
+
* - It will return a new object without mutating the original.
|
|
39
|
+
* - It also validates that ***`keysToOmit`*** does not contain duplicate keys.
|
|
40
|
+
* - **ℹ️ Internally:**
|
|
41
|
+
* - It uses ***{@link isEqual | `isEqual`}*** to check for duplicates in
|
|
42
|
+
* the ***`keysToOmit`*** array.
|
|
38
43
|
* @template I The type of the input object.
|
|
39
44
|
* @template K The keys to omit from the object.
|
|
40
45
|
* @param {I} object - The source object to omit keys from.
|
|
41
46
|
* @param {K[]} keysToOmit - An array of keys to exclude from the returned object.
|
|
42
47
|
* @returns {Omit<I, K>} A new object without the specified keys.
|
|
43
|
-
*
|
|
44
48
|
* @throws {TypeError} If `keysToOmit` is not an array.
|
|
45
49
|
* @throws {Error} If duplicate keys are found in `keysToOmit`.
|
|
46
|
-
*
|
|
47
50
|
* @example
|
|
48
51
|
* omitKeys({ a: 1, b: 2, c: 3 }, ["b", "c"]);
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
+
* //➔ { a: 1 }
|
|
52
53
|
* omitKeys({ name: "John", age: 30 }, ["age"]);
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
54
|
+
* //➔ { name: "John" }
|
|
56
55
|
* omitKeys({ a: 1, b: 2 }, []);
|
|
57
|
-
*
|
|
56
|
+
* //➔ { a: 1, b: 2 } (no changes)
|
|
58
57
|
*/
|
|
59
58
|
declare const omitKeys:<I extends Record<string,unknown>,K extends keyof I>(object:I,keysToOmit:K[])=>Omit<I,K>;type IndexArray=NumberRangeUnion<0,30>;type DotPath<T,Prev extends string="">=T extends Array<infer U>?DotPath<U,`${Prev}${Prev extends "" ? "" : "."}${IndexArray}`>:T extends object?{[K in keyof T & string]:`${Prev}${Prev extends "" ? "" : "."}${K}`|DotPath<T[K],`${Prev}${Prev extends "" ? "" : "."}${K}`>;}[keyof T & string]:never;
|
|
60
59
|
/** ------------------------------------------------------
|
|
61
|
-
* *
|
|
62
|
-
* * Also removes resulting empty objects (`{}`) and arrays (`[]`),
|
|
63
|
-
* * cascading upwards to remove empty parents until root if needed.
|
|
60
|
+
* * ***Utility: `omitKeysDeep`.***
|
|
64
61
|
* ------------------------------------------------------
|
|
65
|
-
*
|
|
62
|
+
* **Recursively omits properties from an object using dot notation paths.**
|
|
63
|
+
* - **Behavior:**
|
|
64
|
+
* - Also removes resulting empty objects (`{}`) and arrays (`[]`),
|
|
65
|
+
* - cascading upwards to remove empty parents until root if needed.
|
|
66
|
+
* - **⚠️ Be careful:**
|
|
67
|
+
* - If after omission an object or array becomes empty, it will be removed entirely
|
|
68
|
+
* including all the way up to the root if necessary, resulting in `{}`.
|
|
69
|
+
* - **ℹ️ Note:**
|
|
70
|
+
* - For array indices, TypeScript autocomplete only suggests `0`–`30`
|
|
71
|
+
* (to prevent editor lag on large unions).
|
|
72
|
+
* However, higher indices are still fully supported at runtime — you can
|
|
73
|
+
* manually type `"arr.99.key"` and it will work the same.
|
|
66
74
|
* @template I - Type of the input object
|
|
67
|
-
*
|
|
68
75
|
* @param {I} object
|
|
69
|
-
*
|
|
70
|
-
*
|
|
76
|
+
* The object to process. Should be a plain nested object or array structure.
|
|
71
77
|
* @param {DotPath<I>[]} keysToOmit
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
78
|
+
* An array of string paths in dot notation indicating the properties to remove, paths
|
|
79
|
+
* can include numeric indices to target array elements, e.g. `"arr.0.x"` to
|
|
80
|
+
* remove `x` from the first object inside the `arr` array.
|
|
76
81
|
* @returns {Partial<I>}
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
82
|
+
* A new deeply cloned object with the specified keys omitted, with resulting
|
|
83
|
+
* empty objects or arrays fully removed (even if it collapses to `{}`).
|
|
80
84
|
* @throws {TypeError}
|
|
81
85
|
* If `keysToOmit` is not an array will throw TypeError.
|
|
82
|
-
*
|
|
83
|
-
* @throws {Error}
|
|
84
|
-
* If `keysToOmit` contains duplicate paths will throw Error.
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* ⚠️ Be careful: if after omission an object or array becomes empty, it will be removed entirely
|
|
88
|
-
* including all the way up to the root if necessary, resulting in `{}`.
|
|
89
|
-
*
|
|
90
|
-
* ⚠️ Note: For array indices, TypeScript autocomplete only suggests `0`–`30`
|
|
91
|
-
* (to prevent editor lag on large unions).
|
|
92
|
-
* However, higher indices are still fully supported at runtime — you can
|
|
93
|
-
* manually type `"arr.99.key"` and it will work the same.
|
|
94
|
-
*
|
|
86
|
+
* @throws {Error} If `keysToOmit` contains duplicate paths will throw Error.
|
|
95
87
|
* @example
|
|
96
88
|
* omitKeysDeep({ arr: [{ a: 1 }] }, ["arr.0.a"]);
|
|
97
|
-
* //
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
89
|
+
* // ➔ {} (array becomes empty and removed)
|
|
100
90
|
* omitKeysDeep({ a: { b: { c: 1 }, d: 2 }, e: 3 }, ["a.b.c"]);
|
|
101
|
-
* //
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
91
|
+
* // ➔ { a: { d: 2 }, e: 3 }
|
|
104
92
|
* omitKeysDeep({ a: [{ b: 1 }, { c: 2 }] }, ["a.0.b"]);
|
|
105
|
-
* //
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
93
|
+
* // ➔ { a: [{ c: 2 }] }
|
|
108
94
|
* omitKeysDeep({ a: [{ b: 1 }] }, ["a.0.b"]);
|
|
109
|
-
* //
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
95
|
+
* // ➔ {} (array becomes empty and removed)
|
|
112
96
|
* omitKeysDeep({ complex: [{ deep: [{ x: 1, y: 2 }] }] }, ["complex.0.deep.0.x"]);
|
|
113
|
-
* //
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
97
|
+
* // ➔ { complex: [{ deep: [{ y: 2 }] }] }
|
|
116
98
|
* omitKeysDeep({ complex: [{ deep: [{ x: 1 }] }] }, ["complex.0.deep.0.x"]);
|
|
117
|
-
* //
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
99
|
+
* // ➔ {} (deep chain emptied and collapsed)
|
|
120
100
|
* omitKeysDeep({ data: [[{ foo: 1, bar: 2 }]] }, ["data.0.0.foo"]);
|
|
121
|
-
* //
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
101
|
+
* // ➔ { data: [[{ bar: 2 }]] }
|
|
124
102
|
* omitKeysDeep({ data: [[{ foo: 1 }]] }, ["data.0.0.foo"]);
|
|
125
|
-
* //
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
103
|
+
* // ➔ {} (nested arrays emptied completely)
|
|
128
104
|
* omitKeysDeep({ x: [{ y: [{ z: 1 }, { w: 2 }] }] }, ["x.0.y.0.z"]);
|
|
129
|
-
* //
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
105
|
+
* // ➔ { x: [{ y: [{ w: 2 }] }] }
|
|
132
106
|
* omitKeysDeep({ x: [{ y: [{ z: 1 }] }] }, ["x.0.y.0.z"]);
|
|
133
|
-
* //
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
107
|
+
* // ➔ {} (entire nested arrays removed)
|
|
136
108
|
* omitKeysDeep({ p: { q: { r: 5 } }, s: 6 }, ["p.q.r"]);
|
|
137
|
-
* //
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
109
|
+
* // ➔ { s: 6 } (`p` removed because it becomes empty)
|
|
140
110
|
* omitKeysDeep({ arr: [{ a: 1, b: 2 }, { c: 3 }] }, ["arr.0.a"]);
|
|
141
|
-
* //
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
111
|
+
* // ➔ { arr: [{ b: 2 }, { c: 3 }] }
|
|
144
112
|
* omitKeysDeep({ root: [{ sub: [{ leaf: 10 }] }] }, ["root.0.sub.0.leaf"]);
|
|
145
|
-
* //
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
113
|
+
* // ➔ {} (deep nested arrays emptied to root)
|
|
148
114
|
* omitKeysDeep({ meta: { tags: ["x", "y"], count: 2 } }, ["meta.count"]);
|
|
149
|
-
* //
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
115
|
+
* // ➔ { meta: { tags: ["x", "y"] } }
|
|
152
116
|
* omitKeysDeep({ arr: [[{ a: 1 }, { b: 2 }]] }, ["arr.0.0.a"]);
|
|
153
|
-
* //
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
117
|
+
* // ➔ { arr: [[{ b: 2 }]] }
|
|
156
118
|
* omitKeysDeep({ arr: [[{ a: 1 }]] }, ["arr.0.0.a"]);
|
|
157
|
-
* //
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
119
|
+
* // ➔ {} (double nested emptied)
|
|
160
120
|
* omitKeysDeep({ nested: [{ list: [{ id: 1, val: 2 }] }] }, ["nested.0.list.0.val"]);
|
|
161
|
-
* //
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
121
|
+
* // ➔ { nested: [{ list: [{ id: 1 }] }] }
|
|
164
122
|
* omitKeysDeep({ nested: [{ list: [{ id: 1 }] }] }, ["nested.0.list.0.id"]);
|
|
165
|
-
* //
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
123
|
+
* // ➔ {} (full collapse to empty)
|
|
168
124
|
* omitKeysDeep({ mixed: { a: [1, 2, 3], b: { c: 4 } } }, ["mixed.b.c"]);
|
|
169
|
-
* //
|
|
170
|
-
*/
|
|
171
|
-
declare const omitKeysDeep:<I extends Record<string,unknown>>(object:I,keysToOmit:DotPath<I>[])=>Partial<I>;
|
|
172
|
-
/** --------------------------------
|
|
173
|
-
* * Removes Property from PROPS Collection
|
|
174
|
-
* --------------------------------
|
|
175
|
-
* @description Becarefull put array in arrayException, If array is duplicated it will be throw an exception error
|
|
176
|
-
* @param object is Record as object (string,any)
|
|
177
|
-
* @param arrayExcept is Array exception []
|
|
178
|
-
* @returns
|
|
179
|
-
*
|
|
180
|
-
* @deprecated - Use `omitKeys` instead, this function will remove a next update.
|
|
125
|
+
* // ➔ { mixed: { a: [1, 2, 3] } }
|
|
181
126
|
*/
|
|
182
|
-
declare const
|
|
127
|
+
declare const omitKeysDeep:<I extends Record<string,unknown>>(object:I,keysToOmit:DotPath<I>[])=>Partial<I>;export{findDuplicates,omitKeys,omitKeysDeep};
|
package/dist/operations/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as findDuplicates,b as omitKeys,c as omitKeysDeep
|
|
1
|
+
export{a as findDuplicates,b as omitKeys,c as omitKeysDeep}from'../chunk-UUMKL74S.js';import'../chunk-MWLEM7ED.js';import'../chunk-ME5OV5HN.js';import'../chunk-2JQQQ625.js';import'../chunk-SYJC7UAW.js';import'../chunk-467VEMJH.js';import'../chunk-5SZUSNGZ.js';import'../chunk-MJAW5RAK.js';
|
package/dist/parsers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkHXTACM3O_cjs=require('../chunk-HXTACM3O.cjs');require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"extractFileName",{enumerable:true,get:function(){return chunkHXTACM3O_cjs.a}});
|
package/dist/parsers/index.d.ts
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
/** ----------------------------------------------------------
|
|
2
|
-
* * ***
|
|
2
|
+
* * ***Utility: `extractFileName`.***
|
|
3
3
|
* ----------------------------------------------------------
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
4
|
+
* **Extracts the base file name (without extension) from a given URL, file path, or file name.**
|
|
5
|
+
* - **Behavior:**
|
|
6
|
+
* - Strips known extensions (including multi-part extensions such as `.tar.gz`, `.tar.bz2`, etc.).
|
|
7
|
+
* - Handles plain file names, local file paths, and full URLs seamlessly.
|
|
8
|
+
* - If the path ends with a `/`, returns an empty string `""` (represents a directory or empty segment).
|
|
9
|
+
* - If the input is empty, whitespace, or not a string, returns `undefined`.
|
|
10
|
+
* - Leaves unknown or unrecognized extensions intact (does not attempt to strip unknown file extensions).
|
|
11
|
+
* - **Summary:**
|
|
12
|
+
* - `extractFileName("https://example.com/file.txt")` ➔ `"file"`.
|
|
13
|
+
* - `extractFileName("/local/path/image.jpeg")` ➔ `"image"`.
|
|
14
|
+
* - `extractFileName("backup.archive.tar.gz")` ➔ `"backup.archive"`.
|
|
15
|
+
* - `extractFileName("folder/")` ➔ `""`.
|
|
16
|
+
* - `extractFileName("")` ➔ `undefined`.
|
|
17
|
+
* - `extractFileName("unknownfile.weirdext")` ➔ `"unknownfile.weirdext"`
|
|
18
|
+
* ***(keeps unknown extension)***.
|
|
19
|
+
* @description
|
|
19
20
|
* This is particularly useful for displaying or logging file names
|
|
20
21
|
* without cluttering them with redundant extensions, while being careful
|
|
21
22
|
* not to accidentally truncate unfamiliar formats.
|
|
22
|
-
*
|
|
23
|
-
* @param {string} url - The URL, file system path, or plain file name to process.
|
|
23
|
+
* @param {string | null | undefined} url - The URL, file system path, or plain file name to process.
|
|
24
24
|
* @returns {string | undefined} The file name without its extension(s),
|
|
25
25
|
* or `undefined` if input is invalid,
|
|
26
26
|
* or an empty string `""` if the path ends with `/`.
|
|
27
|
-
*
|
|
28
27
|
* @example
|
|
29
|
-
* extractFileName("document.pdf");
|
|
30
|
-
* extractFileName("/files/archive.tar.gz");
|
|
31
|
-
* extractFileName("https://cdn.site.com/video.mp4");
|
|
32
|
-
* extractFileName("folder/");
|
|
33
|
-
* extractFileName("strangefile.unknownext");
|
|
34
|
-
* extractFileName("");
|
|
35
|
-
* extractFileName(123);
|
|
28
|
+
* extractFileName("document.pdf"); // ➔ "document"
|
|
29
|
+
* extractFileName("/files/archive.tar.gz"); // ➔ "archive"
|
|
30
|
+
* extractFileName("https://cdn.site.com/video.mp4"); // ➔ "video"
|
|
31
|
+
* extractFileName("folder/"); // ➔ ""
|
|
32
|
+
* extractFileName("strangefile.unknownext"); // ➔ "strangefile.unknownext"
|
|
33
|
+
* extractFileName(""); // ➔ undefined
|
|
34
|
+
* extractFileName(123); // ➔ undefined
|
|
36
35
|
*/
|
|
37
|
-
declare const extractFileName:(url
|
|
36
|
+
declare const extractFileName:(url:string|null|undefined)=>string|undefined;export{extractFileName};
|
package/dist/parsers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as extractFileName}from'../chunk-
|
|
1
|
+
export{a as extractFileName}from'../chunk-VQLAPEL3.js';import'../chunk-MJAW5RAK.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkLUVV5KSD_cjs=require('../chunk-LUVV5KSD.cjs'),chunkFIEZKTAZ_cjs=require('../chunk-FIEZKTAZ.cjs'),chunkRHE3M2NJ_cjs=require('../chunk-RHE3M2NJ.cjs'),chunk6SMJMZ7G_cjs=require('../chunk-6SMJMZ7G.cjs'),chunkPFLNHD4B_cjs=require('../chunk-PFLNHD4B.cjs');require('../chunk-D43GV6EF.cjs');var chunkMF5Y5K4N_cjs=require('../chunk-MF5Y5K4N.cjs'),chunk6Q4I2RPC_cjs=require('../chunk-6Q4I2RPC.cjs');require('../chunk-DYRDBYPF.cjs');var chunkPUQXRLZH_cjs=require('../chunk-PUQXRLZH.cjs'),chunkO7SJR4CY_cjs=require('../chunk-O7SJR4CY.cjs'),chunk7YWAQOA4_cjs=require('../chunk-7YWAQOA4.cjs'),chunkLVUSFXQS_cjs=require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"areArraysEqual",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.a}});Object.defineProperty(exports,"areObjectsEqual",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.b}});Object.defineProperty(exports,"areURLsEqualPath",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.c}});Object.defineProperty(exports,"areURLsIdentical",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.d}});Object.defineProperty(exports,"arrayHasAnyMatch",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.i}});Object.defineProperty(exports,"doesKeyExist",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.h}});Object.defineProperty(exports,"isArguments",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.j}});Object.defineProperty(exports,"isArrayLike",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.l}});Object.defineProperty(exports,"isArrayLikeObject",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.m}});Object.defineProperty(exports,"isCurrencyLike",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.n}});Object.defineProperty(exports,"isDeepEqual",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.o}});Object.defineProperty(exports,"isElement",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.p}});Object.defineProperty(exports,"isEmpty",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.q}});Object.defineProperty(exports,"isEmptyDeep",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.r}});Object.defineProperty(exports,"isEqualWith",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.s}});Object.defineProperty(exports,"isLength",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.k}});Object.defineProperty(exports,"isMatch",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.u}});Object.defineProperty(exports,"isMatchWith",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.t}});Object.defineProperty(exports,"isNative",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.v}});Object.defineProperty(exports,"isObjectLoose",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.w}});Object.defineProperty(exports,"isPropertyKey",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.g}});Object.defineProperty(exports,"isSafeInteger",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.x}});Object.defineProperty(exports,"isValidURL",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.y}});Object.defineProperty(exports,"isWeakMap",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.z}});Object.defineProperty(exports,"textContainsAll",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.e}});Object.defineProperty(exports,"textContainsAny",{enumerable:true,get:function(){return chunkLUVV5KSD_cjs.f}});Object.defineProperty(exports,"isURL",{enumerable:true,get:function(){return chunkFIEZKTAZ_cjs.a}});Object.defineProperty(exports,"isNonEmptyValue",{enumerable:true,get:function(){return chunkRHE3M2NJ_cjs.a}});Object.defineProperty(exports,"isTypedArray",{enumerable:true,get:function(){return chunkRHE3M2NJ_cjs.b}});Object.defineProperty(exports,"isEmptyValue",{enumerable:true,get:function(){return chunk6SMJMZ7G_cjs.a}});Object.defineProperty(exports,"isArrayBuffer",{enumerable:true,get:function(){return chunkPFLNHD4B_cjs.b}});Object.defineProperty(exports,"isEmptyArray",{enumerable:true,get:function(){return chunkPFLNHD4B_cjs.e}});Object.defineProperty(exports,"isEmptyObject",{enumerable:true,get:function(){return chunkPFLNHD4B_cjs.f}});Object.defineProperty(exports,"isEqual",{enumerable:true,get:function(){return chunkPFLNHD4B_cjs.d}});Object.defineProperty(exports,"isRegExp",{enumerable:true,get:function(){return chunkPFLNHD4B_cjs.a}});Object.defineProperty(exports,"isFinite",{enumerable:true,get:function(){return chunkMF5Y5K4N_cjs.a}});Object.defineProperty(exports,"isEmptyString",{enumerable:true,get:function(){return chunk6Q4I2RPC_cjs.a}});Object.defineProperty(exports,"isInteger",{enumerable:true,get:function(){return chunkPUQXRLZH_cjs.a}});Object.defineProperty(exports,"isDate",{enumerable:true,get:function(){return chunkO7SJR4CY_cjs.b}});Object.defineProperty(exports,"isMap",{enumerable:true,get:function(){return chunkO7SJR4CY_cjs.a}});Object.defineProperty(exports,"isBigInt",{enumerable:true,get:function(){return chunk7YWAQOA4_cjs.a}});Object.defineProperty(exports,"getPreciseType",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.E}});Object.defineProperty(exports,"hasOwnProp",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.o}});Object.defineProperty(exports,"isArray",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.d}});Object.defineProperty(exports,"isBoolean",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.a}});Object.defineProperty(exports,"isBuffer",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.D}});Object.defineProperty(exports,"isError",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.C}});Object.defineProperty(exports,"isFunction",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.b}});Object.defineProperty(exports,"isNaN",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.h}});Object.defineProperty(exports,"isNil",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.c}});Object.defineProperty(exports,"isNonEmptyArray",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.r}});Object.defineProperty(exports,"isNonEmptyString",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.p}});Object.defineProperty(exports,"isNull",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.i}});Object.defineProperty(exports,"isNumber",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.k}});Object.defineProperty(exports,"isObject",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.e}});Object.defineProperty(exports,"isObjectOrArray",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.n}});Object.defineProperty(exports,"isPlainObject",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.f}});Object.defineProperty(exports,"isSet",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.q}});Object.defineProperty(exports,"isString",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.g}});Object.defineProperty(exports,"isSymbol",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.l}});Object.defineProperty(exports,"isUndefined",{enumerable:true,get:function(){return chunkLVUSFXQS_cjs.m}});
|