@augment-vir/common 28.2.3 → 29.0.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/dist/cjs/augments/array/array.js +9 -10
- package/dist/cjs/augments/array/remove-duplicates.js +1 -2
- package/dist/cjs/augments/async.js +3 -4
- package/dist/cjs/augments/boolean.js +3 -4
- package/dist/cjs/augments/common-number.js +10 -10
- package/dist/cjs/augments/common-string.js +16 -16
- package/dist/cjs/augments/debounce.js +2 -2
- package/dist/cjs/augments/environment.js +1 -2
- package/dist/cjs/augments/error.js +5 -6
- package/dist/cjs/augments/esm-path.js +1 -2
- package/dist/cjs/augments/json.js +2 -3
- package/dist/cjs/augments/object/enum.js +5 -6
- package/dist/cjs/augments/object/filter-object.js +3 -4
- package/dist/cjs/augments/object/get-or-set.js +2 -3
- package/dist/cjs/augments/object/has-key.js +1 -2
- package/dist/cjs/augments/object/jsonify.js +1 -2
- package/dist/cjs/augments/object/map-object.js +2 -3
- package/dist/cjs/augments/object/merge-deep.js +1 -2
- package/dist/cjs/augments/object/merge-property-arrays.js +1 -2
- package/dist/cjs/augments/object/object-entries.js +6 -7
- package/dist/cjs/augments/object/object.js +2 -3
- package/dist/cjs/augments/object/selection-set.js +2 -0
- package/dist/cjs/augments/object/typed-has-property.js +2 -3
- package/dist/cjs/augments/promise/deferred-promise.js +1 -2
- package/dist/cjs/augments/promise/promise.js +5 -5
- package/dist/cjs/augments/promise/wait.js +4 -4
- package/dist/cjs/augments/random.js +4 -5
- package/dist/cjs/augments/regexp.js +3 -4
- package/dist/cjs/augments/string/prefixes.js +2 -3
- package/dist/cjs/augments/string/suffixes.js +7 -7
- package/dist/cjs/augments/string/uuid.js +1 -2
- package/dist/cjs/augments/time.js +2 -2
- package/dist/cjs/augments/truncate-number.js +1 -2
- package/dist/cjs/augments/tuple.js +2 -3
- package/dist/cjs/augments/type.js +4 -5
- package/dist/cjs/augments/union.js +2 -0
- package/dist/cjs/augments/wrap-in-try.js +1 -2
- package/dist/cjs/index.js +3 -2
- package/dist/esm/augments/object/selection-set.js +1 -0
- package/dist/esm/augments/union.js +1 -0
- package/dist/esm/index.js +3 -2
- package/dist/types/augments/object/key-count.d.ts +13 -0
- package/dist/types/augments/object/map-object.d.ts +1 -1
- package/dist/types/augments/object/pick-deep.d.ts +0 -6
- package/dist/types/augments/object/selection-set.d.ts +25 -0
- package/dist/types/index.d.ts +3 -2
- package/package.json +2 -2
- package/dist/cjs/augments/object/nested-keys.js +0 -61
- package/dist/esm/augments/object/nested-keys.js +0 -56
- package/dist/types/augments/object/nested-keys.d.ts +0 -18
- /package/dist/cjs/augments/object/{old-union-to-intersection.js → key-count.js} +0 -0
- /package/dist/esm/augments/object/{old-union-to-intersection.js → key-count.js} +0 -0
- /package/dist/types/augments/{object/old-union-to-intersection.d.ts → union.d.ts} +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ArrayElement } from '../type';
|
|
2
|
-
import { TsRecurse, TsRecursionStart, TsRecursionTracker, TsTooMuchRecursion } from '../type-recursion';
|
|
3
|
-
import { PropertyValueType } from './object';
|
|
4
|
-
import { UnionToIntersection } from './old-union-to-intersection';
|
|
5
|
-
export type NestedSequentialKeys<ObjectGeneric extends object, Depth extends TsRecursionTracker = TsRecursionStart> = Depth extends TsTooMuchRecursion ? ['Error: recursive object depth is too deep.'] : NonNullable<ObjectGeneric> extends ReadonlyArray<any> ? Extract<NonNullable<ObjectGeneric>[number], object> extends never ? [number] : NestedSequentialKeys<Extract<NonNullable<ObjectGeneric>[number], object>, TsRecurse<Depth>> : PropertyValueType<{
|
|
6
|
-
[Prop in keyof ObjectGeneric]: NonNullable<ObjectGeneric[Prop]> extends object ? Readonly<[
|
|
7
|
-
Prop,
|
|
8
|
-
...(NestedSequentialKeys<NonNullable<ObjectGeneric[Prop]>, TsRecurse<Depth>> | [])
|
|
9
|
-
]> : Readonly<[Prop]>;
|
|
10
|
-
}>;
|
|
11
|
-
export type NestedKeys<ObjectGeneric extends object, Depth extends TsRecursionTracker = TsRecursionStart> = Depth extends TsTooMuchRecursion ? ['Error: recursive object depth is too deep.'] : ObjectGeneric extends ReadonlyArray<any> ? NestedKeys<ArrayElement<ObjectGeneric>, TsRecurse<Depth>> : UnionToIntersection<Extract<PropertyValueType<ObjectGeneric>, object>> extends object ? [
|
|
12
|
-
keyof ObjectGeneric,
|
|
13
|
-
...(NestedKeys<UnionToIntersection<Extract<PropertyValueType<ObjectGeneric>, object>>, TsRecurse<Depth>> | [])
|
|
14
|
-
] : [keyof ObjectGeneric];
|
|
15
|
-
export type NestedValue<ObjectGeneric extends object, NestedKeysGeneric extends NestedSequentialKeys<ObjectGeneric>> = ObjectGeneric extends ReadonlyArray<any> ? NestedValue<Extract<ObjectGeneric[number], object>, NestedKeysGeneric>[] : NestedKeysGeneric extends readonly [infer FirstEntry, ...infer FollowingEntries] ? FirstEntry extends keyof ObjectGeneric ? FollowingEntries extends never[] ? ObjectGeneric[FirstEntry] : ObjectGeneric[FirstEntry] extends object ? FollowingEntries extends NestedSequentialKeys<ObjectGeneric[FirstEntry]> ? NestedValue<ObjectGeneric[FirstEntry], FollowingEntries> : never : never : never : never;
|
|
16
|
-
/** This mutates the {@link originalObject} input. */
|
|
17
|
-
export declare function setValueWithNestedKeys<const ObjectGeneric extends object, const KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(originalObject: ObjectGeneric, nestedKeys: Readonly<KeysGeneric>, value: Readonly<NestedValue<ObjectGeneric, KeysGeneric>>): void;
|
|
18
|
-
export declare function getValueFromNestedKeys<const ObjectGeneric extends object, const KeysGeneric extends NestedSequentialKeys<ObjectGeneric>>(originalObject: ObjectGeneric, nestedKeys: KeysGeneric): NestedValue<ObjectGeneric, KeysGeneric>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|