@thi.ng/checks 3.3.13 → 3.4.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-05-11T12:16:33Z
3
+ - **Last updated**: 2023-08-04T10:58:19Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [3.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/checks@3.4.0) (2023-08-04)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add isGenerator() ([af8ffb3](https://github.com/thi-ng/umbrella/commit/af8ffb3))
17
+
12
18
  ### [3.3.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/checks@3.3.5) (2022-12-16)
13
19
 
14
20
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -47,7 +47,7 @@ For Node.js REPL:
47
47
  const checks = await import("@thi.ng/checks");
48
48
  ```
49
49
 
50
- Package sizes (brotli'd, pre-treeshake): ESM: 1.59 KB
50
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.60 KB
51
51
 
52
52
  ## Dependencies
53
53
 
package/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export * from "./is-file.js";
26
26
  export * from "./is-firefox.js";
27
27
  export * from "./is-float-string.js";
28
28
  export * from "./is-function.js";
29
+ export * from "./is-generator.js";
29
30
  export * from "./is-hex.js";
30
31
  export * from "./is-hex-color.js";
31
32
  export * from "./is-ie.js";
package/index.js CHANGED
@@ -26,6 +26,7 @@ export * from "./is-file.js";
26
26
  export * from "./is-firefox.js";
27
27
  export * from "./is-float-string.js";
28
28
  export * from "./is-function.js";
29
+ export * from "./is-generator.js";
29
30
  export * from "./is-hex.js";
30
31
  export * from "./is-hex-color.js";
31
32
  export * from "./is-ie.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true if `x` is an instantiated ES6 generator (i.e. it
3
+ * {@link isIterable} and {@link implementsFunction} `next`).
4
+ *
5
+ * @param x
6
+ */
7
+ export declare const isGenerator: (x: any) => x is Generator<unknown, any, unknown>;
8
+ //# sourceMappingURL=is-generator.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { implementsFunction } from "./implements-function.js";
2
+ import { isIterable } from "./is-iterable.js";
3
+ /**
4
+ * Returns true if `x` is an instantiated ES6 generator (i.e. it
5
+ * {@link isIterable} and {@link implementsFunction} `next`).
6
+ *
7
+ * @param x
8
+ */
9
+ export const isGenerator = (x) => isIterable(x) && implementsFunction(x, "next");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/checks",
3
- "version": "3.3.13",
3
+ "version": "3.4.0",
4
4
  "description": "Collection of 70+ type, feature & value checks",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -38,16 +38,16 @@
38
38
  "test": "testament test"
39
39
  },
40
40
  "dependencies": {
41
- "tslib": "^2.5.0"
41
+ "tslib": "^2.6.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@microsoft/api-extractor": "^7.34.8",
45
- "@thi.ng/testament": "^0.3.16",
46
- "@types/node": "^20.1.0",
47
- "rimraf": "^5.0.0",
44
+ "@microsoft/api-extractor": "^7.36.3",
45
+ "@thi.ng/testament": "^0.3.18",
46
+ "@types/node": "^20.4.6",
47
+ "rimraf": "^5.0.1",
48
48
  "tools": "^0.0.1",
49
- "typedoc": "^0.24.6",
50
- "typescript": "^5.0.4"
49
+ "typedoc": "^0.24.8",
50
+ "typescript": "^5.1.6"
51
51
  },
52
52
  "keywords": [
53
53
  "detect",
@@ -158,6 +158,9 @@
158
158
  "./is-function": {
159
159
  "default": "./is-function.js"
160
160
  },
161
+ "./is-generator": {
162
+ "default": "./is-generator.js"
163
+ },
161
164
  "./is-hex-color": {
162
165
  "default": "./is-hex-color.js"
163
166
  },
@@ -276,5 +279,5 @@
276
279
  "default": "./is-zero.js"
277
280
  }
278
281
  },
279
- "gitHead": "20ab11b687a13228f6a8cecdc5f05ba9105122ea\n"
282
+ "gitHead": "9fa3f7f8169efa30e3c71b43c82f77393581c3b5\n"
280
283
  }