ts-gems 3.0.0 → 3.1.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/lib/nullish.d.ts +5 -5
- package/lib/types.d.ts +20 -0
- package/package.json +2 -2
package/lib/nullish.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { IfNoDeepValue } from './helpers';
|
|
|
2
2
|
import { IfNever } from './type-check';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Make all properties in T
|
|
5
|
+
* Make all properties in T nullish
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
[
|
|
7
|
+
export type NullishObject<T = null> ={
|
|
8
|
+
[K in keyof T as (IfNever<Exclude<T[K], undefined>, never, K>)]?: T[K] | null
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Make all properties in T
|
|
13
|
+
* Make all properties in T nullish deeply
|
|
14
14
|
*/
|
|
15
15
|
export type DeepNullish<T> = {
|
|
16
16
|
[K in keyof T as (IfNever<Exclude<T[K], undefined>, never, K>)]?:
|
|
@@ -21,7 +21,7 @@ export type DeepNullish<T> = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Make all properties in T
|
|
24
|
+
* Make all properties in T nullish deeply including arrays
|
|
25
25
|
*/
|
|
26
26
|
export type DeeperNullish<T> = {
|
|
27
27
|
[K in keyof T as (IfNever<Exclude<T[K], undefined>, never, K>)]?:
|
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declare ReadableStream and WritableStream in case dom.d.ts is not added to the tsconfig
|
|
3
|
+
* lib causing ReadableStream or WritableStream interface is not defined.
|
|
4
|
+
* For developers with dom.d.ts added, the ReadableStream and WritableStream
|
|
5
|
+
* interface will be merged correctly.
|
|
6
|
+
*
|
|
7
|
+
* This is also required for any clients with streaming interface where ReadableStream
|
|
8
|
+
* or WritableStream type is also referred.
|
|
9
|
+
*/
|
|
10
|
+
declare global {
|
|
11
|
+
export interface ReadableStream {}
|
|
12
|
+
export interface WritableStream {}
|
|
13
|
+
}
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* BasicPrimitive
|
|
3
17
|
* @desc Type representing [`BasicPrimitive`](https://www.typescriptlang.org/docs/handbook/release-notes/overview.html#smarter-type-alias-preservation) types in TypeScript
|
|
@@ -51,6 +65,12 @@ export type Class<Args extends any[] = any[], Instance = {}, Static = {}> =
|
|
|
51
65
|
*/
|
|
52
66
|
export type Maybe<T> = T | undefined;
|
|
53
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Nullish
|
|
70
|
+
* @desc Type representing T | undefined | null
|
|
71
|
+
*/
|
|
72
|
+
export type Nullish<T = null> = T | undefined | null;
|
|
73
|
+
|
|
54
74
|
|
|
55
75
|
export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
|
|
56
76
|
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"lodash",
|
|
13
13
|
"underscore"
|
|
14
14
|
],
|
|
15
|
-
"version": "3.
|
|
15
|
+
"version": "3.1.1",
|
|
16
16
|
"types": "lib/index.d.ts",
|
|
17
17
|
"main": "lib/index.js",
|
|
18
18
|
"module": "lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.5.11",
|
|
36
|
-
"eslint": "^8.
|
|
36
|
+
"eslint": "^8.56.0",
|
|
37
37
|
"jest": "^29.7.0",
|
|
38
38
|
"ts-jest": "^29.1.1",
|
|
39
39
|
"typescript": "^5.3.3"
|