@oliversalzburg/js-utils 0.0.23-dev.2 → 0.0.23-dev.4

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/core.d.ts CHANGED
@@ -1,28 +1,34 @@
1
1
  /**
2
2
  * Describes a function that is a constructor for something.
3
3
  * @typeParam TConstructed - The type this is a constructor for.
4
+ * @group Types
4
5
  */
5
6
  export type ConstructorOf<TConstructed> = new (...args: Array<any>) => TConstructed;
6
7
  /**
7
8
  * Describes any function.
9
+ * @group Types
8
10
  */
9
11
  export type AnyFunction = (...args: Array<any>) => any;
10
12
  /**
11
13
  * Describes any asynchronous function.
14
+ * @group Types
12
15
  */
13
16
  export type AnyAsyncFunction = (...args: Array<any>) => Promise<any>;
14
17
  /**
15
18
  * Any constructor
19
+ * @group Types
16
20
  */
17
21
  export type AnyConstructor = new (...args: Array<any>) => any;
18
22
  /**
19
23
  * Describes a function returning an instance of a given type.
20
24
  * @typeParam TReturned - The type of the item returned by the function.
25
+ * @group Types
21
26
  */
22
27
  export type AnyFunctionReturning<TReturned = any> = (...args: Array<any>) => TReturned;
23
28
  /**
24
29
  * Describes an async function returning an instance of a given type.
25
30
  * @typeParam TReturned - The type of the item returned by the function.
31
+ * @group Types
26
32
  */
27
33
  export type AnyAsyncFunctionReturning<TReturned = any> = (...args: Array<any>) => TReturned;
28
34
  /**
@@ -32,5 +38,14 @@ export type AnyAsyncFunctionReturning<TReturned = any> = (...args: Array<any>) =
32
38
  * **Hint**: Don't use mixins.
33
39
  * @typeParam TTarget - The type of the classed this mixin is being
34
40
  * mixed in with.
41
+ * @group Types
35
42
  */
36
43
  export type Mixin<TTarget extends AnyFunctionReturning> = InstanceType<ReturnType<TTarget>>;
44
+ /**
45
+ * Recursive definition of a regular JS object, which is a key-value hash
46
+ * of strings to primitives, or another object of the same type.
47
+ * @group Types
48
+ */
49
+ export type JsonObject = string | number | boolean | null | Array<JsonObject> | {
50
+ [key: string]: JsonObject;
51
+ };
package/nil.d.ts CHANGED
@@ -2,11 +2,13 @@ import { ConstructorOf } from "./core.js";
2
2
  /**
3
3
  * When you want to normalize away `null` | `undefined`, or deal
4
4
  * with either type through a consistent interface.
5
+ * @group Types
5
6
  */
6
7
  export type Nil = null | undefined;
7
8
  /**
8
9
  * A type that could be either what you want, or `Nil`.
9
10
  * @typeParam T - The type that should be made nillable.
11
+ * @group Types
10
12
  */
11
13
  export type Maybe<T> = T | Nil;
12
14
  /**
package/nil.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"nil.js","sourceRoot":"","sources":["../source/nil.ts"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAI,OAAiB;IACxC,OAAO,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,EAAE,CAAI,OAAiB,EAAE,YAA8B;IACrE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,YAAY,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C;;;OAGG;IACH,YAAY,OAAO,GAAG,sBAAsB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,OAAiB,EAAE,YAAqB;IACnE,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;QAClB,MAAM,IAAI,kBAAkB,CAAC,YAAY,CAAC,CAAC;KAC5C;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAI,OAAiB;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;KAChC;AACH,CAAC"}
1
+ {"version":3,"file":"nil.js","sourceRoot":"","sources":["../source/nil.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAI,OAAiB;IACxC,OAAO,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,EAAE,CAAI,OAAiB,EAAE,YAA8B;IACrE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,YAAY,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C;;;OAGG;IACH,YAAY,OAAO,GAAG,sBAAsB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAI,OAAiB,EAAE,YAAqB;IACnE,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;QAClB,MAAM,IAAI,kBAAkB,CAAC,YAAY,CAAC,CAAC;KAC5C;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAI,OAAiB;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;KAChC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@oliversalzburg/js-utils",
4
- "version": "0.0.23-dev.2",
4
+ "version": "0.0.23-dev.4",
5
5
  "license": "MIT",
6
6
  "author": "Oliver Salzburg <oliver.salzburg@gmail.com>",
7
7
  "repository": {