@alessiofrittoli/type-utils 0.3.1 → 1.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/README.md +1 -1
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/package.json +1 -1
- package/scripts/postinstall/ts-setup.js +1 -0
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -42,6 +42,24 @@ declare global {
|
|
|
42
42
|
};
|
|
43
43
|
/** Get the Type of a function arguments. */
|
|
44
44
|
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any ? A : never;
|
|
45
|
+
/**
|
|
46
|
+
* Makes all 1st level properties of a type required.
|
|
47
|
+
*/
|
|
48
|
+
type Full<T> = {
|
|
49
|
+
[P in keyof T]-?: T[P];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Recursively makes all properties of a type required at all nested levels.
|
|
53
|
+
*/
|
|
54
|
+
type DeepFull<T> = {
|
|
55
|
+
[P in keyof T]-?: DeepFull<T[P]>;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Removes `null` and `undefined` from all properties of a type.
|
|
59
|
+
*/
|
|
60
|
+
type NonNullableFields<T> = {
|
|
61
|
+
[P in keyof T]: NonNullable<T[P]>;
|
|
62
|
+
};
|
|
45
63
|
}
|
|
46
64
|
|
|
47
65
|
type DoNotUse = never;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,24 @@ declare global {
|
|
|
42
42
|
};
|
|
43
43
|
/** Get the Type of a function arguments. */
|
|
44
44
|
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any ? A : never;
|
|
45
|
+
/**
|
|
46
|
+
* Makes all 1st level properties of a type required.
|
|
47
|
+
*/
|
|
48
|
+
type Full<T> = {
|
|
49
|
+
[P in keyof T]-?: T[P];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Recursively makes all properties of a type required at all nested levels.
|
|
53
|
+
*/
|
|
54
|
+
type DeepFull<T> = {
|
|
55
|
+
[P in keyof T]-?: DeepFull<T[P]>;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Removes `null` and `undefined` from all properties of a type.
|
|
59
|
+
*/
|
|
60
|
+
type NonNullableFields<T> = {
|
|
61
|
+
[P in keyof T]: NonNullable<T[P]>;
|
|
62
|
+
};
|
|
45
63
|
}
|
|
46
64
|
|
|
47
65
|
type DoNotUse = never;
|
package/package.json
CHANGED