@sohanemon/utils 5.0.1 → 5.0.2

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.
@@ -1,6 +1,5 @@
1
1
  export type Primitive = string | number | bigint | boolean | symbol | null | undefined;
2
2
  export type Falsy = false | '' | 0 | null | undefined;
3
- export type Nullish = null | undefined;
4
3
  export declare const isFalsy: (val: unknown) => val is Falsy;
5
- export declare const isNullish: (val: unknown) => val is Nullish;
4
+ export declare const isNullish: (val: unknown) => val is (null | undefined);
6
5
  export declare const isPrimitive: (val: unknown) => val is Primitive;
@@ -10,6 +10,18 @@ export type DeepRequired<T> = T extends Function ? T : T extends Array<infer U>
10
10
  export type Never<T> = {
11
11
  [K in keyof T]: never;
12
12
  };
13
+ export type Nullable<T> = T extends object ? {
14
+ [P in keyof T]: Nullable<T[P]>;
15
+ } : T | null;
16
+ export type Optional<T> = T extends object ? {
17
+ [P in keyof T]: Optional<T[P]>;
18
+ } : T | undefined;
19
+ export type Nullish<T> = T extends object ? {
20
+ [P in keyof T]: Nullish<T[P]>;
21
+ } : T | null | undefined;
22
+ export type Maybe<T> = T extends object ? {
23
+ [P in keyof T]?: Nullish<T[P]>;
24
+ } : T | null | undefined;
13
25
  export type DeepReadonly<T> = T extends Function ? T : T extends Array<infer U> ? ReadonlyArray<DeepReadonly<U>> : T extends object ? {
14
26
  readonly [K in keyof T]: DeepReadonly<T[K]>;
15
27
  } : T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sohanemon/utils",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "author": "Sohan Emon <sohanemon@outlook.com>",
5
5
  "description": "",
6
6
  "type": "module",