@koine/utils 2.0.0-beta.22 → 2.0.0-beta.24
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/package.json +1 -1
- package/typings.d.ts +14 -36
package/package.json
CHANGED
package/typings.d.ts
CHANGED
|
@@ -2,29 +2,9 @@
|
|
|
2
2
|
* List here the global variables used by third party scripts supported within
|
|
3
3
|
* the `koine` ecosystem.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* List here the global variables used by third party scripts supported within
|
|
7
|
-
* the `koine` ecosystem.
|
|
8
|
-
*/
|
|
9
5
|
|
|
10
6
|
// as in type-fest start
|
|
11
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };
|
|
12
|
-
type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B
|
|
13
|
-
? 1
|
|
14
|
-
: 2
|
|
15
|
-
? true
|
|
16
|
-
: false;
|
|
17
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true
|
|
18
|
-
? never
|
|
19
|
-
: KeyType extends ExcludeType
|
|
20
|
-
? never
|
|
21
|
-
: KeyType;
|
|
22
|
-
type Except<ObjectType, KeysType extends keyof ObjectType> = {
|
|
23
|
-
[KeyType in keyof ObjectType as Filter<
|
|
24
|
-
KeyType,
|
|
25
|
-
KeysType
|
|
26
|
-
>]: ObjectType[KeyType];
|
|
27
|
-
};
|
|
7
|
+
declare type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };
|
|
28
8
|
// as in type-fest end
|
|
29
9
|
|
|
30
10
|
/**
|
|
@@ -34,24 +14,22 @@ type Except<ObjectType, KeysType extends keyof ObjectType> = {
|
|
|
34
14
|
*/
|
|
35
15
|
declare type Tweak<
|
|
36
16
|
TModel extends object,
|
|
37
|
-
TRequiredKeys extends keyof TModel |
|
|
17
|
+
TRequiredKeys extends keyof TModel | never,
|
|
38
18
|
TReplacements extends Partial<Record<keyof TModel, unknown>> | false = false,
|
|
39
19
|
> = TReplacements extends false
|
|
40
20
|
? Simplify<
|
|
41
|
-
TRequiredKeys
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}>
|
|
21
|
+
Omit<TModel, TRequiredKeys> &
|
|
22
|
+
Required<{
|
|
23
|
+
[K in TRequiredKeys]: NonNullable<TModel[K]>;
|
|
24
|
+
}>
|
|
46
25
|
>
|
|
47
26
|
: Simplify<
|
|
48
|
-
|
|
49
|
-
Omit<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
& TReplacements
|
|
27
|
+
Omit<
|
|
28
|
+
Omit<TModel, TRequiredKeys> &
|
|
29
|
+
Required<{
|
|
30
|
+
[K in TRequiredKeys]: NonNullable<TModel[K]>;
|
|
31
|
+
}>,
|
|
32
|
+
keyof TReplacements
|
|
33
|
+
> &
|
|
34
|
+
TReplacements
|
|
57
35
|
>;
|