inferred-types 0.23.1 → 0.23.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/index.d.ts
CHANGED
|
@@ -1469,7 +1469,9 @@ declare function strArrayToDict<T extends readonly string[]>(...strings: T): Exp
|
|
|
1469
1469
|
* const arr = dictToKv({ id: 123, foo: "bar" });
|
|
1470
1470
|
* ```
|
|
1471
1471
|
*/
|
|
1472
|
-
declare function dictToKv<N extends Narrowable, T extends
|
|
1472
|
+
declare function dictToKv<N extends Narrowable, T extends {
|
|
1473
|
+
[key: string]: N;
|
|
1474
|
+
}, U extends boolean>(obj: T, _makeTuple?: U): U extends true ? UnionToTuple<(Mutable<T> extends infer T_1 extends object ? { [K in keyof T_1]: {
|
|
1473
1475
|
key: K;
|
|
1474
1476
|
value: Mutable<T>[K];
|
|
1475
1477
|
}; } : never)[keyof T], LastInUnion<(Mutable<T> extends infer T_1 extends object ? { [K in keyof T_1]: {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import { keys } from "src/utility/keys";
|
|
|
11
11
|
* const arr = dictToKv({ id: 123, foo: "bar" });
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export function dictToKv<N extends Narrowable, T extends
|
|
14
|
+
export function dictToKv<N extends Narrowable, T extends { [key: string]: N }, U extends boolean>(
|
|
15
15
|
obj: T,
|
|
16
16
|
_makeTuple: U = false as U
|
|
17
17
|
) {
|