@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Type Utils ❇️
2
2
 
3
- Version 0.3.1
3
+ Version 1.0.0
4
4
 
5
5
  ## Lightweight TypeScript types utilities
6
6
 
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.1",
3
+ "version": "1.0.0",
4
4
  "description": "Lightweight TypeScript types utilities",
5
5
  "author": {
6
6
  "name": "Alessio Frittoli",
@@ -9,6 +9,7 @@ const tsSetup = () => {
9
9
  const projectRoot = process.env.INIT_CWD || process.cwd()
10
10
 
11
11
  if ( projectRoot.endsWith( projectName ) ) {
12
+ console.log( `Skip "postinstall" script. Running in ${ project.name }` )
12
13
  return
13
14
  }
14
15
  if ( ! projectRoot ) {