@alessiofrittoli/type-utils 0.3.2 → 1.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Type Utils ❇️
2
2
 
3
- Version 0.3.2
3
+ Version 1.0.1
4
4
 
5
5
  ## Lightweight TypeScript types utilities
6
6
 
@@ -41,7 +41,7 @@ pnpm i @alessiofrittoli/type-utils
41
41
  ```
42
42
 
43
43
  This tiny library defines some global types which are not imported in your IDE by default.\
44
- After installation a `postinstall` scritp is executed to create the `type-utils.d.ts` file at the root of your project.
44
+ After installation a `postinstall` script is executed to create the `type-utils.d.ts` file at the root of your project.
45
45
  Please make sure to add it in the array of the "include" property in your `tsconfig.json`.
46
46
 
47
47
  ```json
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessiofrittoli/type-utils",
3
- "version": "0.3.2",
3
+ "version": "1.0.1",
4
4
  "description": "Lightweight TypeScript types utilities",
5
5
  "author": {
6
6
  "name": "Alessio Frittoli",