@contrail/util 1.1.18 → 1.1.19
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.
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare function cloneDeep<T>(obj: T): DatesAsStrings<T> | null;
|
|
2
|
-
type
|
|
2
|
+
export type IsTuple<T> = T extends readonly any[] ? (number extends T['length'] ? false : true) : false;
|
|
3
|
+
type MapTupleMutableDatesAsStrings<T extends any[]> = T extends [infer H, ...infer R] ? [DatesAsStrings<H>, ...MapTupleMutableDatesAsStrings<R>] : [];
|
|
4
|
+
type MapTupleReadonlyDatesAsStrings<T extends readonly any[]> = T extends readonly [infer H, ...infer R] ? readonly [DatesAsStrings<H>, ...MapTupleReadonlyDatesAsStrings<R>] : readonly [];
|
|
5
|
+
export type MapTupleDatesAsStrings<T extends readonly any[]> = T extends any[] ? MapTupleMutableDatesAsStrings<T> : MapTupleReadonlyDatesAsStrings<T>;
|
|
6
|
+
export type DatesAsStrings<T> = T extends Date ? string : T extends any[] ? IsTuple<T> extends true ? MapTupleDatesAsStrings<T> : DatesAsStrings<T[number]>[] : T extends object ? {
|
|
3
7
|
[K in keyof T]: DatesAsStrings<T[K]>;
|
|
4
8
|
} : T;
|
|
5
9
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/util",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "General JavaScript utilities",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"testEnvironment": "node"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@contrail/types": "^3.1.
|
|
42
|
+
"@contrail/types": "^3.1.3",
|
|
43
43
|
"fflate": "^0.8.2",
|
|
44
44
|
"lodash": "^4.17.21"
|
|
45
45
|
}
|