@rimbu/base 0.9.0 → 0.9.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
|
@@ -76,7 +76,7 @@ console.log(arr);
|
|
|
76
76
|
|
|
77
77
|
## Contributing
|
|
78
78
|
|
|
79
|
-
Feel very welcome to contribute to further improve Rimbu. Please read our [Contributing guide](
|
|
79
|
+
Feel very welcome to contribute to further improve Rimbu. Please read our [Contributing guide](https://github.com/rimbu-org/rimbu/blob/main/CONTRIBUTING.md).
|
|
80
80
|
|
|
81
81
|
## Contributors
|
|
82
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-object.js","sourceRoot":"","sources":["../../src/plain-object.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"plain-object.js","sourceRoot":"","sources":["../../src/plain-object.ts"],"names":[],"mappings":";;;AAgDA;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,GAAQ;IACjC,IACE,SAAS,KAAK,GAAG;QACjB,IAAI,KAAK,GAAG;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,CAAC,GAAG,CAAC,WAAW,YAAY,QAAQ;YAClC,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC;QACpC,MAAM,CAAC,QAAQ,IAAI,GAAG;QACtB,MAAM,CAAC,aAAa,IAAI,GAAG,EAC3B;QACA,OAAO,KAAK,CAAC;KACd;IAED,IAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAE7C,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,CAAC;AAC9D,CAAC;AAhBD,gCAgBC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,GAAQ;IACjC,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC;AAC3E,CAAC;AAFD,gCAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-object.js","sourceRoot":"","sources":["../../src/plain-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plain-object.js","sourceRoot":"","sources":["../../src/plain-object.ts"],"names":[],"mappings":"AAgDA;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAQ;IACjC,IACE,SAAS,KAAK,GAAG;QACjB,IAAI,KAAK,GAAG;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,CAAC,GAAG,CAAC,WAAW,YAAY,QAAQ;YAClC,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC;QACpC,MAAM,CAAC,QAAQ,IAAI,GAAG;QACtB,MAAM,CAAC,aAAa,IAAI,GAAG,EAC3B;QACA,OAAO,KAAK,CAAC;KACd;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAE7C,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,GAAQ;IACjC,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC;AAC3E,CAAC"}
|
|
@@ -17,7 +17,17 @@ export declare type IsObjWithoutFunctions<T extends Record<any, any>> = AnyFunc
|
|
|
17
17
|
* Otherwise, it resolves to false
|
|
18
18
|
*/
|
|
19
19
|
export declare type IsPlainObj<T> = T extends null | undefined | number | string | boolean | bigint | symbol | AnyFunc | Iterable<unknown> | AsyncIterable<unknown> ? false : IsObjWithoutFunctions<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Utility type that will only accept objects that are considered 'plain objects' according
|
|
22
|
+
* to the `IsPlainObj` predicate type.
|
|
23
|
+
* @typeparam T - the value type to test
|
|
24
|
+
*/
|
|
20
25
|
export declare type PlainObj<T> = IsPlainObj<T> extends true ? T : never;
|
|
26
|
+
/**
|
|
27
|
+
* Utility type that will only return true if the input type T is equal to `any`.
|
|
28
|
+
* @typeparam T - the value type to test
|
|
29
|
+
*/
|
|
30
|
+
export declare type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
21
31
|
/**
|
|
22
32
|
* Companion function to the `IsRecord<T>` type that checks whether the given object is a pure
|
|
23
33
|
* data object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimbu/base",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Utilities to implement Rimbu collections",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"sideEffects": false,
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@rimbu/common": "^0.9.
|
|
54
|
+
"@rimbu/common": "^0.9.4",
|
|
55
55
|
"tslib": "^2.4.0"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"index": "src/index.ts",
|
|
62
62
|
"replacer": "../../config/denoify-rimbu-replacer.js"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "60d3b52050fc30f10921cbf92d637362d663d7e0"
|
|
65
65
|
}
|
package/src/plain-object.ts
CHANGED
|
@@ -33,8 +33,19 @@ export type IsPlainObj<T> = T extends
|
|
|
33
33
|
? false
|
|
34
34
|
: IsObjWithoutFunctions<T>;
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Utility type that will only accept objects that are considered 'plain objects' according
|
|
38
|
+
* to the `IsPlainObj` predicate type.
|
|
39
|
+
* @typeparam T - the value type to test
|
|
40
|
+
*/
|
|
36
41
|
export type PlainObj<T> = IsPlainObj<T> extends true ? T : never;
|
|
37
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Utility type that will only return true if the input type T is equal to `any`.
|
|
45
|
+
* @typeparam T - the value type to test
|
|
46
|
+
*/
|
|
47
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
48
|
+
|
|
38
49
|
/**
|
|
39
50
|
* Companion function to the `IsRecord<T>` type that checks whether the given object is a pure
|
|
40
51
|
* data object.
|