@visulima/object 1.0.1 → 1.0.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/CHANGELOG.md +16 -0
- package/LICENSE.md +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +139 -16
- package/dist/index.d.mts +139 -16
- package/dist/index.d.ts +139 -16
- package/dist/index.mjs +1 -1
- package/dist/shared/getProperty-BE7cAsTa.mjs +1 -0
- package/dist/shared/getProperty-CFmO4UX4.cjs +1 -0
- package/dist/shared/isPlainObject-B0tpqX_G.cjs +1 -0
- package/dist/shared/isPlainObject-VVOVbznO.mjs +1 -0
- package/dist/shared/omit-BTcVGp-C.cjs +1 -0
- package/dist/shared/omit-DClq0ugw.mjs +1 -0
- package/dist/shared/paths-are-equal-BgwMgI_D.mjs +1 -0
- package/dist/shared/paths-are-equal-D8teV-Y-.cjs +1 -0
- package/dist/shared/pick-C02Ru-rn.mjs +1 -0
- package/dist/shared/pick-Dc4jbs2q.cjs +1 -0
- package/package.json +15 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @visulima/object [1.0.2](https://github.com/visulima/visulima/compare/@visulima/object@1.0.1...@visulima/object@1.0.2) (2024-09-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added types support for node10 ([604583f](https://github.com/visulima/visulima/commit/604583fa3c24b950fafad45d17e7a1333040fd76))
|
|
6
|
+
|
|
7
|
+
### Styles
|
|
8
|
+
|
|
9
|
+
* cs fixes ([f5c4af7](https://github.com/visulima/visulima/commit/f5c4af7cfa9fc79b6d3fa60c1e48d88bffab5a08))
|
|
10
|
+
|
|
11
|
+
### Miscellaneous Chores
|
|
12
|
+
|
|
13
|
+
* update dev dependencies ([0738f98](https://github.com/visulima/visulima/commit/0738f9810478bb215ce4b2571dc8874c4c503089))
|
|
14
|
+
* updated dev dependencies ([45c2a76](https://github.com/visulima/visulima/commit/45c2a76bc974ecb2c6b172c3af03373d4cc6a5ce))
|
|
15
|
+
* updated dev dependencies ([da46d8e](https://github.com/visulima/visulima/commit/da46d8ef8a964c086060944172f1bd931b7bde9a))
|
|
16
|
+
|
|
1
17
|
## @visulima/object [1.0.1](https://github.com/visulima/visulima/compare/@visulima/object@1.0.0...@visulima/object@1.0.1) (2024-08-01)
|
|
2
18
|
|
|
3
19
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -40,13 +40,13 @@ By: Sindre Sorhus
|
|
|
40
40
|
Repository: sindresorhus/dot-prop
|
|
41
41
|
|
|
42
42
|
> MIT License
|
|
43
|
-
>
|
|
43
|
+
>
|
|
44
44
|
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
45
|
-
>
|
|
45
|
+
>
|
|
46
46
|
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
47
|
-
>
|
|
47
|
+
>
|
|
48
48
|
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
49
|
-
>
|
|
49
|
+
>
|
|
50
50
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
51
51
|
|
|
52
52
|
---------------------------------------
|
|
@@ -57,13 +57,13 @@ By: Sindre Sorhus
|
|
|
57
57
|
Repository: sindresorhus/is-plain-obj
|
|
58
58
|
|
|
59
59
|
> MIT License
|
|
60
|
-
>
|
|
60
|
+
>
|
|
61
61
|
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
62
|
-
>
|
|
62
|
+
>
|
|
63
63
|
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
64
|
-
>
|
|
64
|
+
>
|
|
65
65
|
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
66
|
-
>
|
|
66
|
+
>
|
|
67
67
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
68
68
|
|
|
69
69
|
<!-- DEPENDENCIES -->
|
|
@@ -88,13 +88,13 @@ By: Sindre Sorhus
|
|
|
88
88
|
Repository: sindresorhus/dot-prop
|
|
89
89
|
|
|
90
90
|
> MIT License
|
|
91
|
-
>
|
|
91
|
+
>
|
|
92
92
|
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
93
|
-
>
|
|
93
|
+
>
|
|
94
94
|
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
95
|
-
>
|
|
95
|
+
>
|
|
96
96
|
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
97
|
-
>
|
|
97
|
+
>
|
|
98
98
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
99
99
|
|
|
100
100
|
---------------------------------------
|
|
@@ -105,13 +105,13 @@ By: Sindre Sorhus
|
|
|
105
105
|
Repository: sindresorhus/is-plain-obj
|
|
106
106
|
|
|
107
107
|
> MIT License
|
|
108
|
-
>
|
|
108
|
+
>
|
|
109
109
|
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
110
|
-
>
|
|
110
|
+
>
|
|
111
111
|
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
112
|
-
>
|
|
112
|
+
>
|
|
113
113
|
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
114
|
-
>
|
|
114
|
+
>
|
|
115
115
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
116
116
|
|
|
117
117
|
---------------------------------------
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var D=Object.defineProperty;var u=(s,p)=>D(s,"name",{value:p,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./shared/omit-BTcVGp-C.cjs"),q=require("./shared/pick-Dc4jbs2q.cjs"),c=require("./shared/getProperty-CFmO4UX4.cjs"),M=require("./shared/isPlainObject-B0tpqX_G.cjs");var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y={},a={};Object.defineProperty(a,"__esModule",{value:!0});a.isDocumentToRecurOn=a.flatten=a.unique=void 0;function S(s){return[...new Set(s)]}u(S,"unique");a.unique=S;function T(s){return[].concat(...s)}u(T,"flatten");a.flatten=T;function E(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length}u(E,"isDocumentToRecurOn");a.isDocumentToRecurOn=E;var P={};Object.defineProperty(P,"__esModule",{value:!0});(function(s){var p=o&&o.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),A=o&&o.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),v=o&&o.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&p(e,r,t);return A(e,r),e},m=o&&o.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&p(e,r,t)};Object.defineProperty(s,"__esModule",{value:!0}),s.deepKeysFromList=s.deepKeys=void 0;const f=v(a);m(P,s);function d(r,e){const t=j(e);return typeof r=="object"&&r!==null?g("",r,t):[]}u(d,"deepKeys"),s.deepKeys=d;function b(r,e){const t=j(e);return r.map(i=>typeof i=="object"&&i!==null?d(i,t):[])}u(b,"deepKeysFromList"),s.deepKeysFromList=b;function g(r,e,t){const i=Object.keys(e).map(n=>{const l=_(r,O(n,t));return t.expandNestedObjects&&f.isDocumentToRecurOn(e[n])||t.arrayIndexesAsKeys&&Array.isArray(e[n])&&e[n].length?g(l,e[n],t):t.expandArrayObjects&&Array.isArray(e[n])?h(e[n],l,t):t.ignoreEmptyArrays&&Array.isArray(e[n])&&!e[n].length?[]:l});return f.flatten(i)}u(g,"generateDeepKeysList");function h(r,e,t){let i=b(r,t);return r.length?r.length&&f.flatten(i).length===0?[e]:(i=i.map(n=>Array.isArray(n)&&n.length===0?[e]:n.map(l=>_(e,O(l,t)))),f.unique(f.flatten(i))):t.ignoreEmptyArraysWhenExpanding?[]:[e]}u(h,"processArrayKeys");function O(r,e){return e.escapeNestedDots?r.replace(/\./g,"\\."):r}u(O,"escapeNestedDotsIfSpecified");function _(r,e){return r?r+"."+e:e}u(_,"buildKeyName");function j(r){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...r??{}}}u(j,"mergeOptions")})(y);exports.omit=w.m;exports.pick=q.a;exports.deleteProperty=c.deleteProperty;exports.escapePath=c.escapePath;exports.getProperty=c.getProperty;exports.hasProperty=c.hasProperty;exports.setProperty=c.setProperty;exports.isPlainObject=M.isPlainObject;exports.deepKeys=y.deepKeys;exports.deepKeysFromList=y.deepKeysFromList;
|
package/dist/index.d.cts
CHANGED
|
@@ -785,6 +785,33 @@ NumberAbsolute<NegativeInfinity>
|
|
|
785
785
|
*/
|
|
786
786
|
type NumberAbsolute<N extends number> = `${N}` extends `-${infer StringPositiveN}` ? StringToNumber<StringPositiveN> : N;
|
|
787
787
|
|
|
788
|
+
/**
|
|
789
|
+
Check whether the given type is a number or a number string.
|
|
790
|
+
|
|
791
|
+
Supports floating-point as a string.
|
|
792
|
+
|
|
793
|
+
@example
|
|
794
|
+
```
|
|
795
|
+
type A = IsNumberLike<'1'>;
|
|
796
|
+
//=> true
|
|
797
|
+
|
|
798
|
+
type B = IsNumberLike<'-1.1'>;
|
|
799
|
+
//=> true
|
|
800
|
+
|
|
801
|
+
type C = IsNumberLike<1>;
|
|
802
|
+
//=> true
|
|
803
|
+
|
|
804
|
+
type D = IsNumberLike<'a'>;
|
|
805
|
+
//=> false
|
|
806
|
+
*/
|
|
807
|
+
type IsNumberLike<N> =
|
|
808
|
+
N extends number ? true
|
|
809
|
+
: N extends `${number}`
|
|
810
|
+
? true
|
|
811
|
+
: N extends `${number}.${number}`
|
|
812
|
+
? true
|
|
813
|
+
: false;
|
|
814
|
+
|
|
788
815
|
/**
|
|
789
816
|
Returns the minimum number in the given union of numbers.
|
|
790
817
|
|
|
@@ -1166,6 +1193,44 @@ type PathsOptions = {
|
|
|
1166
1193
|
@default 10
|
|
1167
1194
|
*/
|
|
1168
1195
|
maxRecursionDepth?: number;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
Use bracket notation for array indices and numeric object keys.
|
|
1199
|
+
|
|
1200
|
+
@default false
|
|
1201
|
+
|
|
1202
|
+
@example
|
|
1203
|
+
```
|
|
1204
|
+
type ArrayExample = {
|
|
1205
|
+
array: ['foo'];
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
type A = Paths<ArrayExample, {bracketNotation: false}>;
|
|
1209
|
+
//=> 'array' | 'array.0'
|
|
1210
|
+
|
|
1211
|
+
type B = Paths<ArrayExample, {bracketNotation: true}>;
|
|
1212
|
+
//=> 'array' | 'array[0]'
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
@example
|
|
1216
|
+
```
|
|
1217
|
+
type NumberKeyExample = {
|
|
1218
|
+
1: ['foo'];
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
type A = Paths<NumberKeyExample, {bracketNotation: false}>;
|
|
1222
|
+
//=> 1 | '1' | '1.0'
|
|
1223
|
+
|
|
1224
|
+
type B = Paths<NumberKeyExample, {bracketNotation: true}>;
|
|
1225
|
+
//=> '[1]' | '[1][0]'
|
|
1226
|
+
```
|
|
1227
|
+
*/
|
|
1228
|
+
bracketNotation?: boolean;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
type DefaultPathsOptions = {
|
|
1232
|
+
maxRecursionDepth: 10;
|
|
1233
|
+
bracketNotation: false;
|
|
1169
1234
|
};
|
|
1170
1235
|
|
|
1171
1236
|
/**
|
|
@@ -1209,7 +1274,14 @@ open('listB.1'); // TypeError. Because listB only has one element.
|
|
|
1209
1274
|
@category Object
|
|
1210
1275
|
@category Array
|
|
1211
1276
|
*/
|
|
1212
|
-
type Paths<T, Options extends PathsOptions = {}> =
|
|
1277
|
+
type Paths<T, Options extends PathsOptions = {}> = _Paths<T, {
|
|
1278
|
+
// Set default maxRecursionDepth to 10
|
|
1279
|
+
maxRecursionDepth: Options['maxRecursionDepth'] extends number ? Options['maxRecursionDepth'] : DefaultPathsOptions['maxRecursionDepth'];
|
|
1280
|
+
// Set default bracketNotation to false
|
|
1281
|
+
bracketNotation: Options['bracketNotation'] extends boolean ? Options['bracketNotation'] : DefaultPathsOptions['bracketNotation'];
|
|
1282
|
+
}>;
|
|
1283
|
+
|
|
1284
|
+
type _Paths<T, Options extends Required<PathsOptions>> =
|
|
1213
1285
|
T extends NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
|
1214
1286
|
? never
|
|
1215
1287
|
: IsAny<T> extends true
|
|
@@ -1224,25 +1296,50 @@ type Paths<T, Options extends PathsOptions = {}> =
|
|
|
1224
1296
|
? InternalPaths<T, Options>
|
|
1225
1297
|
: never;
|
|
1226
1298
|
|
|
1227
|
-
type InternalPaths<T, Options extends PathsOptions =
|
|
1228
|
-
|
|
1299
|
+
type InternalPaths<T, Options extends Required<PathsOptions>> =
|
|
1300
|
+
Options['maxRecursionDepth'] extends infer MaxDepth extends number
|
|
1229
1301
|
? Required<T> extends infer T
|
|
1230
1302
|
? T extends EmptyObject | readonly []
|
|
1231
1303
|
? never
|
|
1232
1304
|
: {
|
|
1233
1305
|
[Key in keyof T]:
|
|
1234
1306
|
Key extends string | number // Limit `Key` to string or number.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1241
|
-
? IsNever<Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>> extends false
|
|
1242
|
-
? `${Key}.${Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>}`
|
|
1243
|
-
: never
|
|
1307
|
+
? (
|
|
1308
|
+
Options['bracketNotation'] extends true
|
|
1309
|
+
? IsNumberLike<Key> extends true
|
|
1310
|
+
? `[${Key}]`
|
|
1311
|
+
: (Key | ToString<Key>)
|
|
1244
1312
|
: never
|
|
1245
|
-
|
|
1313
|
+
|
|
|
1314
|
+
Options['bracketNotation'] extends false
|
|
1315
|
+
// If `Key` is a number, return `Key | `${Key}``, because both `array[0]` and `array['0']` work.
|
|
1316
|
+
? (Key | ToString<Key>)
|
|
1317
|
+
: never
|
|
1318
|
+
) extends infer TranformedKey extends string | number ?
|
|
1319
|
+
// 1. If style is 'a[0].b' and 'Key' is a numberlike value like 3 or '3', transform 'Key' to `[${Key}]`, else to `${Key}` | Key
|
|
1320
|
+
// 2. If style is 'a.0.b', transform 'Key' to `${Key}` | Key
|
|
1321
|
+
| TranformedKey
|
|
1322
|
+
| (
|
|
1323
|
+
// Recursively generate paths for the current key
|
|
1324
|
+
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1325
|
+
? _Paths<T[Key], {bracketNotation: Options['bracketNotation']; maxRecursionDepth: Subtract<MaxDepth, 1>}> extends infer SubPath
|
|
1326
|
+
? SubPath extends string | number
|
|
1327
|
+
? (
|
|
1328
|
+
Options['bracketNotation'] extends true
|
|
1329
|
+
? SubPath extends `[${any}]` | `[${any}]${string}`
|
|
1330
|
+
? `${TranformedKey}${SubPath}` // If next node is number key like `[3]`, no need to add `.` before it.
|
|
1331
|
+
: `${TranformedKey}.${SubPath}`
|
|
1332
|
+
: never
|
|
1333
|
+
) | (
|
|
1334
|
+
Options['bracketNotation'] extends false
|
|
1335
|
+
? `${TranformedKey}.${SubPath}`
|
|
1336
|
+
: never
|
|
1337
|
+
)
|
|
1338
|
+
: never
|
|
1339
|
+
: never
|
|
1340
|
+
: never
|
|
1341
|
+
)
|
|
1342
|
+
: never
|
|
1246
1343
|
: never
|
|
1247
1344
|
}[keyof T & (T extends UnknownArray ? number : unknown)]
|
|
1248
1345
|
: never
|
|
@@ -1546,6 +1643,8 @@ type ArraySplice<
|
|
|
1546
1643
|
: never // Should never happen
|
|
1547
1644
|
: never; // Should never happen
|
|
1548
1645
|
|
|
1646
|
+
type LiteralStringUnion<T> = LiteralUnion<T, string>;
|
|
1647
|
+
|
|
1549
1648
|
/**
|
|
1550
1649
|
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
1551
1650
|
|
|
@@ -1774,6 +1873,25 @@ type UsefulInfo = OmitDeep<Info, 'userInfo.uselessInfo'>;
|
|
|
1774
1873
|
// userInfo: {
|
|
1775
1874
|
// name: string;
|
|
1776
1875
|
// };
|
|
1876
|
+
// };
|
|
1877
|
+
|
|
1878
|
+
// Supports removing multiple paths
|
|
1879
|
+
type Info1 = {
|
|
1880
|
+
userInfo: {
|
|
1881
|
+
name: string;
|
|
1882
|
+
uselessField: string;
|
|
1883
|
+
uselessInfo: {
|
|
1884
|
+
foo: string;
|
|
1885
|
+
};
|
|
1886
|
+
};
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
type UsefulInfo1 = OmitDeep<Info1, 'userInfo.uselessInfo' | 'userInfo.uselessField'>;
|
|
1890
|
+
// type UsefulInfo1 = {
|
|
1891
|
+
// userInfo: {
|
|
1892
|
+
// name: string;
|
|
1893
|
+
// };
|
|
1894
|
+
// };
|
|
1777
1895
|
|
|
1778
1896
|
// Supports array
|
|
1779
1897
|
type A = OmitDeep<[1, 'foo', 2], 1>;
|
|
@@ -1946,7 +2064,7 @@ type GetOptions = {
|
|
|
1946
2064
|
/**
|
|
1947
2065
|
Like the `Get` type but receives an array of strings as a path parameter.
|
|
1948
2066
|
*/
|
|
1949
|
-
type GetWithPath<BaseType, Keys
|
|
2067
|
+
type GetWithPath<BaseType, Keys, Options extends GetOptions = {}> =
|
|
1950
2068
|
Keys extends readonly []
|
|
1951
2069
|
? BaseType
|
|
1952
2070
|
: Keys extends readonly [infer Head, ...infer Tail]
|
|
@@ -2117,8 +2235,13 @@ Get<Record<string, string>, 'foo', {strict: true}> // => string
|
|
|
2117
2235
|
@category Array
|
|
2118
2236
|
@category Template literal
|
|
2119
2237
|
*/
|
|
2120
|
-
type Get<
|
|
2121
|
-
|
|
2238
|
+
type Get<
|
|
2239
|
+
BaseType,
|
|
2240
|
+
Path extends
|
|
2241
|
+
| readonly string[]
|
|
2242
|
+
| LiteralStringUnion<ToString<Paths<BaseType, {bracketNotation: false}> | Paths<BaseType, {bracketNotation: true}>>>,
|
|
2243
|
+
Options extends GetOptions = {}> =
|
|
2244
|
+
GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
|
|
2122
2245
|
|
|
2123
2246
|
declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
|
|
2124
2247
|
|
package/dist/index.d.mts
CHANGED
|
@@ -785,6 +785,33 @@ NumberAbsolute<NegativeInfinity>
|
|
|
785
785
|
*/
|
|
786
786
|
type NumberAbsolute<N extends number> = `${N}` extends `-${infer StringPositiveN}` ? StringToNumber<StringPositiveN> : N;
|
|
787
787
|
|
|
788
|
+
/**
|
|
789
|
+
Check whether the given type is a number or a number string.
|
|
790
|
+
|
|
791
|
+
Supports floating-point as a string.
|
|
792
|
+
|
|
793
|
+
@example
|
|
794
|
+
```
|
|
795
|
+
type A = IsNumberLike<'1'>;
|
|
796
|
+
//=> true
|
|
797
|
+
|
|
798
|
+
type B = IsNumberLike<'-1.1'>;
|
|
799
|
+
//=> true
|
|
800
|
+
|
|
801
|
+
type C = IsNumberLike<1>;
|
|
802
|
+
//=> true
|
|
803
|
+
|
|
804
|
+
type D = IsNumberLike<'a'>;
|
|
805
|
+
//=> false
|
|
806
|
+
*/
|
|
807
|
+
type IsNumberLike<N> =
|
|
808
|
+
N extends number ? true
|
|
809
|
+
: N extends `${number}`
|
|
810
|
+
? true
|
|
811
|
+
: N extends `${number}.${number}`
|
|
812
|
+
? true
|
|
813
|
+
: false;
|
|
814
|
+
|
|
788
815
|
/**
|
|
789
816
|
Returns the minimum number in the given union of numbers.
|
|
790
817
|
|
|
@@ -1166,6 +1193,44 @@ type PathsOptions = {
|
|
|
1166
1193
|
@default 10
|
|
1167
1194
|
*/
|
|
1168
1195
|
maxRecursionDepth?: number;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
Use bracket notation for array indices and numeric object keys.
|
|
1199
|
+
|
|
1200
|
+
@default false
|
|
1201
|
+
|
|
1202
|
+
@example
|
|
1203
|
+
```
|
|
1204
|
+
type ArrayExample = {
|
|
1205
|
+
array: ['foo'];
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
type A = Paths<ArrayExample, {bracketNotation: false}>;
|
|
1209
|
+
//=> 'array' | 'array.0'
|
|
1210
|
+
|
|
1211
|
+
type B = Paths<ArrayExample, {bracketNotation: true}>;
|
|
1212
|
+
//=> 'array' | 'array[0]'
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
@example
|
|
1216
|
+
```
|
|
1217
|
+
type NumberKeyExample = {
|
|
1218
|
+
1: ['foo'];
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
type A = Paths<NumberKeyExample, {bracketNotation: false}>;
|
|
1222
|
+
//=> 1 | '1' | '1.0'
|
|
1223
|
+
|
|
1224
|
+
type B = Paths<NumberKeyExample, {bracketNotation: true}>;
|
|
1225
|
+
//=> '[1]' | '[1][0]'
|
|
1226
|
+
```
|
|
1227
|
+
*/
|
|
1228
|
+
bracketNotation?: boolean;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
type DefaultPathsOptions = {
|
|
1232
|
+
maxRecursionDepth: 10;
|
|
1233
|
+
bracketNotation: false;
|
|
1169
1234
|
};
|
|
1170
1235
|
|
|
1171
1236
|
/**
|
|
@@ -1209,7 +1274,14 @@ open('listB.1'); // TypeError. Because listB only has one element.
|
|
|
1209
1274
|
@category Object
|
|
1210
1275
|
@category Array
|
|
1211
1276
|
*/
|
|
1212
|
-
type Paths<T, Options extends PathsOptions = {}> =
|
|
1277
|
+
type Paths<T, Options extends PathsOptions = {}> = _Paths<T, {
|
|
1278
|
+
// Set default maxRecursionDepth to 10
|
|
1279
|
+
maxRecursionDepth: Options['maxRecursionDepth'] extends number ? Options['maxRecursionDepth'] : DefaultPathsOptions['maxRecursionDepth'];
|
|
1280
|
+
// Set default bracketNotation to false
|
|
1281
|
+
bracketNotation: Options['bracketNotation'] extends boolean ? Options['bracketNotation'] : DefaultPathsOptions['bracketNotation'];
|
|
1282
|
+
}>;
|
|
1283
|
+
|
|
1284
|
+
type _Paths<T, Options extends Required<PathsOptions>> =
|
|
1213
1285
|
T extends NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
|
1214
1286
|
? never
|
|
1215
1287
|
: IsAny<T> extends true
|
|
@@ -1224,25 +1296,50 @@ type Paths<T, Options extends PathsOptions = {}> =
|
|
|
1224
1296
|
? InternalPaths<T, Options>
|
|
1225
1297
|
: never;
|
|
1226
1298
|
|
|
1227
|
-
type InternalPaths<T, Options extends PathsOptions =
|
|
1228
|
-
|
|
1299
|
+
type InternalPaths<T, Options extends Required<PathsOptions>> =
|
|
1300
|
+
Options['maxRecursionDepth'] extends infer MaxDepth extends number
|
|
1229
1301
|
? Required<T> extends infer T
|
|
1230
1302
|
? T extends EmptyObject | readonly []
|
|
1231
1303
|
? never
|
|
1232
1304
|
: {
|
|
1233
1305
|
[Key in keyof T]:
|
|
1234
1306
|
Key extends string | number // Limit `Key` to string or number.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1241
|
-
? IsNever<Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>> extends false
|
|
1242
|
-
? `${Key}.${Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>}`
|
|
1243
|
-
: never
|
|
1307
|
+
? (
|
|
1308
|
+
Options['bracketNotation'] extends true
|
|
1309
|
+
? IsNumberLike<Key> extends true
|
|
1310
|
+
? `[${Key}]`
|
|
1311
|
+
: (Key | ToString<Key>)
|
|
1244
1312
|
: never
|
|
1245
|
-
|
|
1313
|
+
|
|
|
1314
|
+
Options['bracketNotation'] extends false
|
|
1315
|
+
// If `Key` is a number, return `Key | `${Key}``, because both `array[0]` and `array['0']` work.
|
|
1316
|
+
? (Key | ToString<Key>)
|
|
1317
|
+
: never
|
|
1318
|
+
) extends infer TranformedKey extends string | number ?
|
|
1319
|
+
// 1. If style is 'a[0].b' and 'Key' is a numberlike value like 3 or '3', transform 'Key' to `[${Key}]`, else to `${Key}` | Key
|
|
1320
|
+
// 2. If style is 'a.0.b', transform 'Key' to `${Key}` | Key
|
|
1321
|
+
| TranformedKey
|
|
1322
|
+
| (
|
|
1323
|
+
// Recursively generate paths for the current key
|
|
1324
|
+
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1325
|
+
? _Paths<T[Key], {bracketNotation: Options['bracketNotation']; maxRecursionDepth: Subtract<MaxDepth, 1>}> extends infer SubPath
|
|
1326
|
+
? SubPath extends string | number
|
|
1327
|
+
? (
|
|
1328
|
+
Options['bracketNotation'] extends true
|
|
1329
|
+
? SubPath extends `[${any}]` | `[${any}]${string}`
|
|
1330
|
+
? `${TranformedKey}${SubPath}` // If next node is number key like `[3]`, no need to add `.` before it.
|
|
1331
|
+
: `${TranformedKey}.${SubPath}`
|
|
1332
|
+
: never
|
|
1333
|
+
) | (
|
|
1334
|
+
Options['bracketNotation'] extends false
|
|
1335
|
+
? `${TranformedKey}.${SubPath}`
|
|
1336
|
+
: never
|
|
1337
|
+
)
|
|
1338
|
+
: never
|
|
1339
|
+
: never
|
|
1340
|
+
: never
|
|
1341
|
+
)
|
|
1342
|
+
: never
|
|
1246
1343
|
: never
|
|
1247
1344
|
}[keyof T & (T extends UnknownArray ? number : unknown)]
|
|
1248
1345
|
: never
|
|
@@ -1546,6 +1643,8 @@ type ArraySplice<
|
|
|
1546
1643
|
: never // Should never happen
|
|
1547
1644
|
: never; // Should never happen
|
|
1548
1645
|
|
|
1646
|
+
type LiteralStringUnion<T> = LiteralUnion<T, string>;
|
|
1647
|
+
|
|
1549
1648
|
/**
|
|
1550
1649
|
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
1551
1650
|
|
|
@@ -1774,6 +1873,25 @@ type UsefulInfo = OmitDeep<Info, 'userInfo.uselessInfo'>;
|
|
|
1774
1873
|
// userInfo: {
|
|
1775
1874
|
// name: string;
|
|
1776
1875
|
// };
|
|
1876
|
+
// };
|
|
1877
|
+
|
|
1878
|
+
// Supports removing multiple paths
|
|
1879
|
+
type Info1 = {
|
|
1880
|
+
userInfo: {
|
|
1881
|
+
name: string;
|
|
1882
|
+
uselessField: string;
|
|
1883
|
+
uselessInfo: {
|
|
1884
|
+
foo: string;
|
|
1885
|
+
};
|
|
1886
|
+
};
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
type UsefulInfo1 = OmitDeep<Info1, 'userInfo.uselessInfo' | 'userInfo.uselessField'>;
|
|
1890
|
+
// type UsefulInfo1 = {
|
|
1891
|
+
// userInfo: {
|
|
1892
|
+
// name: string;
|
|
1893
|
+
// };
|
|
1894
|
+
// };
|
|
1777
1895
|
|
|
1778
1896
|
// Supports array
|
|
1779
1897
|
type A = OmitDeep<[1, 'foo', 2], 1>;
|
|
@@ -1946,7 +2064,7 @@ type GetOptions = {
|
|
|
1946
2064
|
/**
|
|
1947
2065
|
Like the `Get` type but receives an array of strings as a path parameter.
|
|
1948
2066
|
*/
|
|
1949
|
-
type GetWithPath<BaseType, Keys
|
|
2067
|
+
type GetWithPath<BaseType, Keys, Options extends GetOptions = {}> =
|
|
1950
2068
|
Keys extends readonly []
|
|
1951
2069
|
? BaseType
|
|
1952
2070
|
: Keys extends readonly [infer Head, ...infer Tail]
|
|
@@ -2117,8 +2235,13 @@ Get<Record<string, string>, 'foo', {strict: true}> // => string
|
|
|
2117
2235
|
@category Array
|
|
2118
2236
|
@category Template literal
|
|
2119
2237
|
*/
|
|
2120
|
-
type Get<
|
|
2121
|
-
|
|
2238
|
+
type Get<
|
|
2239
|
+
BaseType,
|
|
2240
|
+
Path extends
|
|
2241
|
+
| readonly string[]
|
|
2242
|
+
| LiteralStringUnion<ToString<Paths<BaseType, {bracketNotation: false}> | Paths<BaseType, {bracketNotation: true}>>>,
|
|
2243
|
+
Options extends GetOptions = {}> =
|
|
2244
|
+
GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
|
|
2122
2245
|
|
|
2123
2246
|
declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
|
|
2124
2247
|
|
package/dist/index.d.ts
CHANGED
|
@@ -785,6 +785,33 @@ NumberAbsolute<NegativeInfinity>
|
|
|
785
785
|
*/
|
|
786
786
|
type NumberAbsolute<N extends number> = `${N}` extends `-${infer StringPositiveN}` ? StringToNumber<StringPositiveN> : N;
|
|
787
787
|
|
|
788
|
+
/**
|
|
789
|
+
Check whether the given type is a number or a number string.
|
|
790
|
+
|
|
791
|
+
Supports floating-point as a string.
|
|
792
|
+
|
|
793
|
+
@example
|
|
794
|
+
```
|
|
795
|
+
type A = IsNumberLike<'1'>;
|
|
796
|
+
//=> true
|
|
797
|
+
|
|
798
|
+
type B = IsNumberLike<'-1.1'>;
|
|
799
|
+
//=> true
|
|
800
|
+
|
|
801
|
+
type C = IsNumberLike<1>;
|
|
802
|
+
//=> true
|
|
803
|
+
|
|
804
|
+
type D = IsNumberLike<'a'>;
|
|
805
|
+
//=> false
|
|
806
|
+
*/
|
|
807
|
+
type IsNumberLike<N> =
|
|
808
|
+
N extends number ? true
|
|
809
|
+
: N extends `${number}`
|
|
810
|
+
? true
|
|
811
|
+
: N extends `${number}.${number}`
|
|
812
|
+
? true
|
|
813
|
+
: false;
|
|
814
|
+
|
|
788
815
|
/**
|
|
789
816
|
Returns the minimum number in the given union of numbers.
|
|
790
817
|
|
|
@@ -1166,6 +1193,44 @@ type PathsOptions = {
|
|
|
1166
1193
|
@default 10
|
|
1167
1194
|
*/
|
|
1168
1195
|
maxRecursionDepth?: number;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
Use bracket notation for array indices and numeric object keys.
|
|
1199
|
+
|
|
1200
|
+
@default false
|
|
1201
|
+
|
|
1202
|
+
@example
|
|
1203
|
+
```
|
|
1204
|
+
type ArrayExample = {
|
|
1205
|
+
array: ['foo'];
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
type A = Paths<ArrayExample, {bracketNotation: false}>;
|
|
1209
|
+
//=> 'array' | 'array.0'
|
|
1210
|
+
|
|
1211
|
+
type B = Paths<ArrayExample, {bracketNotation: true}>;
|
|
1212
|
+
//=> 'array' | 'array[0]'
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
@example
|
|
1216
|
+
```
|
|
1217
|
+
type NumberKeyExample = {
|
|
1218
|
+
1: ['foo'];
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
type A = Paths<NumberKeyExample, {bracketNotation: false}>;
|
|
1222
|
+
//=> 1 | '1' | '1.0'
|
|
1223
|
+
|
|
1224
|
+
type B = Paths<NumberKeyExample, {bracketNotation: true}>;
|
|
1225
|
+
//=> '[1]' | '[1][0]'
|
|
1226
|
+
```
|
|
1227
|
+
*/
|
|
1228
|
+
bracketNotation?: boolean;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
type DefaultPathsOptions = {
|
|
1232
|
+
maxRecursionDepth: 10;
|
|
1233
|
+
bracketNotation: false;
|
|
1169
1234
|
};
|
|
1170
1235
|
|
|
1171
1236
|
/**
|
|
@@ -1209,7 +1274,14 @@ open('listB.1'); // TypeError. Because listB only has one element.
|
|
|
1209
1274
|
@category Object
|
|
1210
1275
|
@category Array
|
|
1211
1276
|
*/
|
|
1212
|
-
type Paths<T, Options extends PathsOptions = {}> =
|
|
1277
|
+
type Paths<T, Options extends PathsOptions = {}> = _Paths<T, {
|
|
1278
|
+
// Set default maxRecursionDepth to 10
|
|
1279
|
+
maxRecursionDepth: Options['maxRecursionDepth'] extends number ? Options['maxRecursionDepth'] : DefaultPathsOptions['maxRecursionDepth'];
|
|
1280
|
+
// Set default bracketNotation to false
|
|
1281
|
+
bracketNotation: Options['bracketNotation'] extends boolean ? Options['bracketNotation'] : DefaultPathsOptions['bracketNotation'];
|
|
1282
|
+
}>;
|
|
1283
|
+
|
|
1284
|
+
type _Paths<T, Options extends Required<PathsOptions>> =
|
|
1213
1285
|
T extends NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
|
1214
1286
|
? never
|
|
1215
1287
|
: IsAny<T> extends true
|
|
@@ -1224,25 +1296,50 @@ type Paths<T, Options extends PathsOptions = {}> =
|
|
|
1224
1296
|
? InternalPaths<T, Options>
|
|
1225
1297
|
: never;
|
|
1226
1298
|
|
|
1227
|
-
type InternalPaths<T, Options extends PathsOptions =
|
|
1228
|
-
|
|
1299
|
+
type InternalPaths<T, Options extends Required<PathsOptions>> =
|
|
1300
|
+
Options['maxRecursionDepth'] extends infer MaxDepth extends number
|
|
1229
1301
|
? Required<T> extends infer T
|
|
1230
1302
|
? T extends EmptyObject | readonly []
|
|
1231
1303
|
? never
|
|
1232
1304
|
: {
|
|
1233
1305
|
[Key in keyof T]:
|
|
1234
1306
|
Key extends string | number // Limit `Key` to string or number.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1241
|
-
? IsNever<Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>> extends false
|
|
1242
|
-
? `${Key}.${Paths<T[Key], {maxRecursionDepth: Subtract<MaxDepth, 1>}>}`
|
|
1243
|
-
: never
|
|
1307
|
+
? (
|
|
1308
|
+
Options['bracketNotation'] extends true
|
|
1309
|
+
? IsNumberLike<Key> extends true
|
|
1310
|
+
? `[${Key}]`
|
|
1311
|
+
: (Key | ToString<Key>)
|
|
1244
1312
|
: never
|
|
1245
|
-
|
|
1313
|
+
|
|
|
1314
|
+
Options['bracketNotation'] extends false
|
|
1315
|
+
// If `Key` is a number, return `Key | `${Key}``, because both `array[0]` and `array['0']` work.
|
|
1316
|
+
? (Key | ToString<Key>)
|
|
1317
|
+
: never
|
|
1318
|
+
) extends infer TranformedKey extends string | number ?
|
|
1319
|
+
// 1. If style is 'a[0].b' and 'Key' is a numberlike value like 3 or '3', transform 'Key' to `[${Key}]`, else to `${Key}` | Key
|
|
1320
|
+
// 2. If style is 'a.0.b', transform 'Key' to `${Key}` | Key
|
|
1321
|
+
| TranformedKey
|
|
1322
|
+
| (
|
|
1323
|
+
// Recursively generate paths for the current key
|
|
1324
|
+
GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
|
|
1325
|
+
? _Paths<T[Key], {bracketNotation: Options['bracketNotation']; maxRecursionDepth: Subtract<MaxDepth, 1>}> extends infer SubPath
|
|
1326
|
+
? SubPath extends string | number
|
|
1327
|
+
? (
|
|
1328
|
+
Options['bracketNotation'] extends true
|
|
1329
|
+
? SubPath extends `[${any}]` | `[${any}]${string}`
|
|
1330
|
+
? `${TranformedKey}${SubPath}` // If next node is number key like `[3]`, no need to add `.` before it.
|
|
1331
|
+
: `${TranformedKey}.${SubPath}`
|
|
1332
|
+
: never
|
|
1333
|
+
) | (
|
|
1334
|
+
Options['bracketNotation'] extends false
|
|
1335
|
+
? `${TranformedKey}.${SubPath}`
|
|
1336
|
+
: never
|
|
1337
|
+
)
|
|
1338
|
+
: never
|
|
1339
|
+
: never
|
|
1340
|
+
: never
|
|
1341
|
+
)
|
|
1342
|
+
: never
|
|
1246
1343
|
: never
|
|
1247
1344
|
}[keyof T & (T extends UnknownArray ? number : unknown)]
|
|
1248
1345
|
: never
|
|
@@ -1546,6 +1643,8 @@ type ArraySplice<
|
|
|
1546
1643
|
: never // Should never happen
|
|
1547
1644
|
: never; // Should never happen
|
|
1548
1645
|
|
|
1646
|
+
type LiteralStringUnion<T> = LiteralUnion<T, string>;
|
|
1647
|
+
|
|
1549
1648
|
/**
|
|
1550
1649
|
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
1551
1650
|
|
|
@@ -1774,6 +1873,25 @@ type UsefulInfo = OmitDeep<Info, 'userInfo.uselessInfo'>;
|
|
|
1774
1873
|
// userInfo: {
|
|
1775
1874
|
// name: string;
|
|
1776
1875
|
// };
|
|
1876
|
+
// };
|
|
1877
|
+
|
|
1878
|
+
// Supports removing multiple paths
|
|
1879
|
+
type Info1 = {
|
|
1880
|
+
userInfo: {
|
|
1881
|
+
name: string;
|
|
1882
|
+
uselessField: string;
|
|
1883
|
+
uselessInfo: {
|
|
1884
|
+
foo: string;
|
|
1885
|
+
};
|
|
1886
|
+
};
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
type UsefulInfo1 = OmitDeep<Info1, 'userInfo.uselessInfo' | 'userInfo.uselessField'>;
|
|
1890
|
+
// type UsefulInfo1 = {
|
|
1891
|
+
// userInfo: {
|
|
1892
|
+
// name: string;
|
|
1893
|
+
// };
|
|
1894
|
+
// };
|
|
1777
1895
|
|
|
1778
1896
|
// Supports array
|
|
1779
1897
|
type A = OmitDeep<[1, 'foo', 2], 1>;
|
|
@@ -1946,7 +2064,7 @@ type GetOptions = {
|
|
|
1946
2064
|
/**
|
|
1947
2065
|
Like the `Get` type but receives an array of strings as a path parameter.
|
|
1948
2066
|
*/
|
|
1949
|
-
type GetWithPath<BaseType, Keys
|
|
2067
|
+
type GetWithPath<BaseType, Keys, Options extends GetOptions = {}> =
|
|
1950
2068
|
Keys extends readonly []
|
|
1951
2069
|
? BaseType
|
|
1952
2070
|
: Keys extends readonly [infer Head, ...infer Tail]
|
|
@@ -2117,8 +2235,13 @@ Get<Record<string, string>, 'foo', {strict: true}> // => string
|
|
|
2117
2235
|
@category Array
|
|
2118
2236
|
@category Template literal
|
|
2119
2237
|
*/
|
|
2120
|
-
type Get<
|
|
2121
|
-
|
|
2238
|
+
type Get<
|
|
2239
|
+
BaseType,
|
|
2240
|
+
Path extends
|
|
2241
|
+
| readonly string[]
|
|
2242
|
+
| LiteralStringUnion<ToString<Paths<BaseType, {bracketNotation: false}> | Paths<BaseType, {bracketNotation: true}>>>,
|
|
2243
|
+
Options extends GetOptions = {}> =
|
|
2244
|
+
GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
|
|
2122
2245
|
|
|
2123
2246
|
declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
|
|
2124
2247
|
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D=Object.defineProperty;var u=(s,c)=>D(s,"name",{value:c,configurable:!0});import{m as F}from"./shared/omit-DClq0ugw.mjs";import{a as q}from"./shared/pick-C02Ru-rn.mjs";import{d as I,e as B,g as W,h as G,s as K}from"./shared/getProperty-BE7cAsTa.mjs";import{i as z}from"./shared/isPlainObject-VVOVbznO.mjs";var a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},p={},f={};Object.defineProperty(f,"__esModule",{value:!0});f.isDocumentToRecurOn=f.flatten=f.unique=void 0;function P(s){return[...new Set(s)]}u(P,"unique");f.unique=P;function w(s){return[].concat(...s)}u(w,"flatten");f.flatten=w;function x(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length}u(x,"isDocumentToRecurOn");f.isDocumentToRecurOn=x;var j={};Object.defineProperty(j,"__esModule",{value:!0});(function(s){var c=a&&a.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),A=a&&a.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),m=a&&a.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&c(e,r,t);return A(e,r),e},v=a&&a.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&c(e,r,t)};Object.defineProperty(s,"__esModule",{value:!0}),s.deepKeysFromList=s.deepKeys=void 0;const o=m(f);v(j,s);function d(r,e){const t=_(e);return typeof r=="object"&&r!==null?g("",r,t):[]}u(d,"deepKeys"),s.deepKeys=d;function y(r,e){const t=_(e);return r.map(i=>typeof i=="object"&&i!==null?d(i,t):[])}u(y,"deepKeysFromList"),s.deepKeysFromList=y;function g(r,e,t){const i=Object.keys(e).map(n=>{const l=O(r,b(n,t));return t.expandNestedObjects&&o.isDocumentToRecurOn(e[n])||t.arrayIndexesAsKeys&&Array.isArray(e[n])&&e[n].length?g(l,e[n],t):t.expandArrayObjects&&Array.isArray(e[n])?h(e[n],l,t):t.ignoreEmptyArrays&&Array.isArray(e[n])&&!e[n].length?[]:l});return o.flatten(i)}u(g,"generateDeepKeysList");function h(r,e,t){let i=y(r,t);return r.length?r.length&&o.flatten(i).length===0?[e]:(i=i.map(n=>Array.isArray(n)&&n.length===0?[e]:n.map(l=>O(e,b(l,t)))),o.unique(o.flatten(i))):t.ignoreEmptyArraysWhenExpanding?[]:[e]}u(h,"processArrayKeys");function b(r,e){return e.escapeNestedDots?r.replace(/\./g,"\\."):r}u(b,"escapeNestedDotsIfSpecified");function O(r,e){return r?r+"."+e:e}u(O,"buildKeyName");function _(r){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...r??{}}}u(_,"mergeOptions")})(p);const E=p.deepKeys,L=p.deepKeysFromList;export{E as deepKeys,L as deepKeysFromList,I as deleteProperty,B as escapePath,W as getProperty,G as hasProperty,z as isPlainObject,F as omit,q as pick,K as setProperty};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var s=(r,t)=>p(r,"name",{value:t,configurable:!0});const f=s(r=>{const t=typeof r;return r!==null&&(t==="object"||t==="function")},"isObject"),u=new Set(["__proto__","prototype","constructor"]),c=new Set("0123456789");function o(r){const t=[];let e="",n="start",i=!1;for(const a of r)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(e+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,e+=a;break}if(u.has(e))return[];t.push(e),e="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,e+=a;break}if(n==="property"){if(u.has(e))return[];t.push(e),e=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(e,10)),e="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!c.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,e+="\\"),e+=a}}switch(i&&(e+="\\"),n){case"property":{if(u.has(e))return[];t.push(e);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}s(o,"getPathSegments");function l(r,t){if(typeof t!="number"&&Array.isArray(r)){const e=Number.parseInt(t,10);return Number.isInteger(e)&&r[e]===r[t]}return!1}s(l,"isStringIndex");function h(r,t){if(l(r,t))throw new Error("Cannot use string index")}s(h,"assertNotStringIndex");function y(r,t,e){if(!f(r)||typeof t!="string")return e===void 0?r:e;const n=o(t);if(n.length===0)return e;for(let i=0;i<n.length;i++){const a=n[i];if(l(r,a)?r=i===n.length-1?void 0:null:r=r[a],r==null){if(i!==n.length-1)return e;break}}return r===void 0?e:r}s(y,"getProperty");function g(r,t,e){if(!f(r)||typeof t!="string")return r;const n=r,i=o(t);for(let a=0;a<i.length;a++){const d=i[a];h(r,d),a===i.length-1?r[d]=e:f(r[d])||(r[d]=typeof i[a+1]=="number"?[]:{}),r=r[d]}return n}s(g,"setProperty");function w(r,t){if(!f(r)||typeof t!="string")return!1;const e=o(t);for(let n=0;n<e.length;n++){const i=e[n];if(h(r,i),n===e.length-1)return delete r[i],!0;if(r=r[i],!f(r))return!1}}s(w,"deleteProperty");function E(r,t){if(!f(r)||typeof t!="string")return!1;const e=o(t);if(e.length===0)return!1;for(const n of e){if(!f(r)||!(n in r)||l(r,n))return!1;r=r[n]}return!0}s(E,"hasProperty");function I(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}s(I,"escapePath");export{w as d,I as e,y as g,E as h,g as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var s=(r,t)=>h(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=s(r=>{const t=typeof r;return r!==null&&(t==="object"||t==="function")},"isObject"),u=new Set(["__proto__","prototype","constructor"]),y=new Set("0123456789");function d(r){const t=[];let n="",e="start",i=!1;for(const a of r)switch(a){case"\\":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");i&&(n+=a),e="property",i=!i;break}case".":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="property";break}if(i){i=!1,n+=a;break}if(u.has(n))return[];t.push(n),n="",e="property";break}case"[":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="index";break}if(i){i=!1,n+=a;break}if(e==="property"){if(u.has(n))return[];t.push(n),n=""}e="index";break}case"]":{if(e==="index"){t.push(Number.parseInt(n,10)),n="",e="indexEnd";break}if(e==="indexEnd")throw new Error("Invalid character after an index")}default:{if(e==="index"&&!y.has(a))throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");e==="start"&&(e="property"),i&&(i=!1,n+="\\"),n+=a}}switch(i&&(n+="\\"),e){case"property":{if(u.has(n))return[];t.push(n);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}s(d,"getPathSegments");function l(r,t){if(typeof t!="number"&&Array.isArray(r)){const n=Number.parseInt(t,10);return Number.isInteger(n)&&r[n]===r[t]}return!1}s(l,"isStringIndex");function p(r,t){if(l(r,t))throw new Error("Cannot use string index")}s(p,"assertNotStringIndex");function c(r,t,n){if(!f(r)||typeof t!="string")return n===void 0?r:n;const e=d(t);if(e.length===0)return n;for(let i=0;i<e.length;i++){const a=e[i];if(l(r,a)?r=i===e.length-1?void 0:null:r=r[a],r==null){if(i!==e.length-1)return n;break}}return r===void 0?n:r}s(c,"getProperty");function g(r,t,n){if(!f(r)||typeof t!="string")return r;const e=r,i=d(t);for(let a=0;a<i.length;a++){const o=i[a];p(r,o),a===i.length-1?r[o]=n:f(r[o])||(r[o]=typeof i[a+1]=="number"?[]:{}),r=r[o]}return e}s(g,"setProperty");function x(r,t){if(!f(r)||typeof t!="string")return!1;const n=d(t);for(let e=0;e<n.length;e++){const i=n[e];if(p(r,i),e===n.length-1)return delete r[i],!0;if(r=r[i],!f(r))return!1}}s(x,"deleteProperty");function w(r,t){if(!f(r)||typeof t!="string")return!1;const n=d(t);if(n.length===0)return!1;for(const e of n){if(!f(r)||!(e in r)||l(r,e))return!1;r=r[e]}return!0}s(w,"hasProperty");function E(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}s(E,"escapePath");exports.deleteProperty=x;exports.escapePath=E;exports.getProperty=c;exports.hasProperty=w;exports.setProperty=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var o=(t,e)=>n(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}o(r,"isPlainObject");exports.isPlainObject=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var e=(t,o)=>n(t,"name",{value:o,configurable:!0});function i(t){if(typeof t!="object"||t===null)return!1;const o=Object.getPrototypeOf(t);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}e(i,"isPlainObject");export{i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var n=(e,r)=>m(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./isPlainObject-B0tpqX_G.cjs"),v=require("./paths-are-equal-D8teV-Y-.cjs");var O=Object.defineProperty,j=n((e,r)=>O(e,"name",{value:r,configurable:!0}),"m$1");const o=j((e,r,s="")=>l.isPlainObject(e)?Object.entries(e).reduce((a,[t,c])=>{let i=s;return i&&(i+="."),i+=t,r.some(b=>v.c(i,b))?a:l.isPlainObject(c)?(a[t]=o(e[t],r,i),a):(a[t]=c,a)},{}):e,"recursiveOmit");var y=Object.defineProperty,u=n((e,r)=>y(e,"name",{value:r,configurable:!0}),"r");const f=u(e=>Array.isArray(e)&&e.length>0,"isFullArray"),P=u((e,r)=>f(r)?o(e,r):e,"omit");exports.m=P;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,e)=>s(r,"name",{value:e,configurable:!0});import{i as c}from"./isPlainObject-VVOVbznO.mjs";import{c as v}from"./paths-are-equal-BgwMgI_D.mjs";var b=Object.defineProperty,p=o((r,e)=>b(r,"name",{value:e,configurable:!0}),"m$1");const m=p((r,e,u="")=>c(r)?Object.entries(r).reduce((a,[n,t])=>{let i=u;return i&&(i+="."),i+=n,e.some(f=>v(i,f))?a:c(t)?(a[n]=m(r[n],e,i),a):(a[n]=t,a)},{}):r,"recursiveOmit");var y=Object.defineProperty,l=o((r,e)=>y(r,"name",{value:e,configurable:!0}),"r");const O=l(r=>Array.isArray(r)&&r.length>0,"isFullArray"),A=l((r,e)=>O(e)?m(r,e):r,"omit");export{A as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var t=(r,e)=>u(r,"name",{value:e,configurable:!0});var p=Object.defineProperty,l=t((r,e)=>p(r,"name",{value:e,configurable:!0}),"n");const d=l((r,e)=>{const o=e.split(".");return r.split(".").reduce((n,a,c)=>{const s=o[c]==="*"?"*":a;return n.push(s),n},[]).join(".")===e},"pathsAreEqual");export{d as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=(r,e)=>o(r,"name",{value:e,configurable:!0});var i=Object.defineProperty,l=n((r,e)=>i(r,"name",{value:e,configurable:!0}),"n");const p=l((r,e)=>{const c=e.split(".");return r.split(".").reduce((t,s,u)=>{const a=c[u]==="*"?"*":s;return t.push(a),t},[]).join(".")===e},"pathsAreEqual");exports.c=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var a=(e,r)=>j(e,"name",{value:r,configurable:!0});import{i as s}from"./isPlainObject-VVOVbznO.mjs";import{c as m}from"./paths-are-equal-BgwMgI_D.mjs";var y=Object.defineProperty,P=a((e,r)=>y(e,"name",{value:r,configurable:!0}),"h");const p=P((e,r,f="")=>s(e)?Object.entries(e).reduce((t,[l,c])=>{let i=f;if(i&&(i+="."),i+=l,r.length>0){let n=!1;if(r.forEach(o=>{const v=i.split(".").length,b=o.split(".").length,g=o.split(".").slice(0,v).join("."),h=i.split(".").slice(0,b).join(".");m(h,g)&&(n=!0)}),!n)return t}return s(c)?(t[l]=p(e[l],r,i),t):(t[l]=c,t)},{}):e,"recursivePick");var d=Object.defineProperty,u=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"t");const O=u(e=>Array.isArray(e)&&e.length>0,"isFullArray"),x=u((e,r)=>O(r)?p(e,r):{},"pick");export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var P=Object.defineProperty;var a=(e,r)=>P(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./isPlainObject-B0tpqX_G.cjs"),h=require("./paths-are-equal-D8teV-Y-.cjs");var y=Object.defineProperty,O=a((e,r)=>y(e,"name",{value:r,configurable:!0}),"h");const o=O((e,r,p="")=>u.isPlainObject(e)?Object.entries(e).reduce((i,[l,c])=>{let t=p;if(t&&(t+="."),t+=l,r.length>0){let n=!1;if(r.forEach(s=>{const j=t.split(".").length,f=s.split(".").length,g=s.split(".").slice(0,j).join("."),v=t.split(".").slice(0,f).join(".");h.c(v,g)&&(n=!0)}),!n)return i}return u.isPlainObject(c)?(i[l]=o(e[l],r,t),i):(i[l]=c,i)},{}):e,"recursivePick");var d=Object.defineProperty,b=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"t");const A=b(e=>Array.isArray(e)&&e.length>0,"isFullArray"),m=b((e,r)=>A(r)?o(e,r):{},"pick");exports.a=m;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/object",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Helper functions for working with objects and arrays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -64,6 +64,13 @@
|
|
|
64
64
|
"module": "dist/index.mjs",
|
|
65
65
|
"browser": "./dist/index.mjs",
|
|
66
66
|
"types": "dist/index.d.ts",
|
|
67
|
+
"typesVersions": {
|
|
68
|
+
"*": {
|
|
69
|
+
"*": [
|
|
70
|
+
"./dist/index.d.ts"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
67
74
|
"files": [
|
|
68
75
|
"dist",
|
|
69
76
|
"README.md",
|
|
@@ -74,19 +81,20 @@
|
|
|
74
81
|
"@anolilab/prettier-config": "^5.0.14",
|
|
75
82
|
"@anolilab/semantic-release-pnpm": "1.1.3",
|
|
76
83
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
84
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
77
85
|
"@babel/core": "^7.25.2",
|
|
78
86
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
79
87
|
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
80
|
-
"@total-typescript/ts-reset": "^0.
|
|
88
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
81
89
|
"@types/node": "18.19.39",
|
|
82
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
90
|
+
"@visulima/packem": "^1.0.0-alpha.93",
|
|
83
91
|
"@vitest/coverage-v8": "^2.0.5",
|
|
84
92
|
"@vitest/ui": "^2.0.5",
|
|
85
93
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
86
94
|
"cross-env": "^7.0.3",
|
|
87
95
|
"deeks": "^3.1.1",
|
|
88
96
|
"dot-prop": "^9.0.0",
|
|
89
|
-
"esbuild": "^0.23.
|
|
97
|
+
"esbuild": "^0.23.1",
|
|
90
98
|
"eslint": "8.57.0",
|
|
91
99
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
92
100
|
"eslint-plugin-etc": "^2.0.3",
|
|
@@ -99,8 +107,8 @@
|
|
|
99
107
|
"prettier": "^3.3.3",
|
|
100
108
|
"rimraf": "5.0.9",
|
|
101
109
|
"secretlint": "8.2.4",
|
|
102
|
-
"semantic-release": "^24.
|
|
103
|
-
"type-fest": "^4.
|
|
110
|
+
"semantic-release": "^24.1.0",
|
|
111
|
+
"type-fest": "^4.26.0",
|
|
104
112
|
"typescript": "5.5.4",
|
|
105
113
|
"vitest": "^2.0.5"
|
|
106
114
|
},
|
|
@@ -129,6 +137,7 @@
|
|
|
129
137
|
"build:prod": "cross-env NODE_ENV=production packem build",
|
|
130
138
|
"clean": "rimraf node_modules dist .eslintcache",
|
|
131
139
|
"dev": "pnpm run build --watch",
|
|
140
|
+
"lint:attw": "attw --pack",
|
|
132
141
|
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
133
142
|
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
134
143
|
"lint:package-json": "publint --strict",
|