@livechat/data-utils
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@livechat/data-utils", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Collection of utility functions", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -1,12 +0,1 @@ | ||
type ArrayElement<A> = A extends readonly (infer T)[] ? T : never; | ||
type DeepWriteable<T> = { | ||
-readonly [P in keyof T]: DeepWriteable<T[P]>; | ||
}; | ||
type Cast<X, Y> = X extends Y ? X : Y; | ||
type FromPairs<T> = T extends [infer Key, any][] ? { | ||
[K in Cast<Key, PropertyKey>]: Extract<ArrayElement<T>, [K, any]>[1]; | ||
} : { | ||
[key in string]: any; | ||
}; | ||
type FromPairsWithReadOnly<T> = FromPairs<DeepWriteable<T>>; | ||
/** | ||
@@ -19,4 +8,5 @@ * returns an object constructed from the provided array of key, value pairs' | ||
*/ | ||
export default function fromPairs<T extends ReadonlyArray<readonly [PropertyKey, any]>>(pairs: T): FromPairsWithReadOnly<T>; | ||
export {}; | ||
export default function fromPairs<T extends ReadonlyArray<readonly [PropertyKey, any]>>(pairs: T): { | ||
[K in T[number] as K[0]]: K[1]; | ||
}; | ||
//# sourceMappingURL=fromPairs.d.ts.map |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256088
6273