@thi.ng/checks 3.7.25 → 3.8.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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 210 standalone projects, maintained as part
10
+ > This is one of 211 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -135,7 +135,7 @@ For Node.js REPL:
135
135
  const ch = await import("@thi.ng/checks");
136
136
  ```
137
137
 
138
- Package sizes (brotli'd, pre-treeshake): ESM: 1.71 KB
138
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.80 KB
139
139
 
140
140
  ## Dependencies
141
141
 
package/is-negative.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export declare const isNegative: (x: any) => x is number;
2
+ export declare const isNegativeInt: (x: any) => x is number;
3
+ export declare const isNonPositiveInt: (x: any) => x is number;
2
4
  //# sourceMappingURL=is-negative.d.ts.map
package/is-negative.js CHANGED
@@ -1,4 +1,8 @@
1
1
  const isNegative = (x) => typeof x === "number" && x < 0;
2
+ const isNegativeInt = (x) => Number.isInteger(x) && x < 0;
3
+ const isNonPositiveInt = (x) => Number.isInteger(x) && x <= 0;
2
4
  export {
3
- isNegative
5
+ isNegative,
6
+ isNegativeInt,
7
+ isNonPositiveInt
4
8
  };
package/is-positive.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export declare const isPositive: (x: any) => x is number;
2
+ export declare const isPositiveInt: (x: any) => x is number;
3
+ export declare const isNonNegativeInt: (x: any) => x is number;
2
4
  //# sourceMappingURL=is-positive.d.ts.map
package/is-positive.js CHANGED
@@ -1,4 +1,8 @@
1
1
  const isPositive = (x) => typeof x === "number" && x > 0;
2
+ const isPositiveInt = (x) => Number.isInteger(x) && x > 0;
3
+ const isNonNegativeInt = (x) => Number.isInteger(x) && x >= 0;
2
4
  export {
3
- isPositive
5
+ isNonNegativeInt,
6
+ isPositive,
7
+ isPositiveInt
4
8
  };
@@ -1,3 +1,9 @@
1
- export type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
1
+ export type TypedArray = IntArray | UintArray | FloatArray;
2
+ export type FloatArray = Float32Array | Float64Array;
3
+ export type IntArray = Int8Array | Int16Array | Int32Array;
4
+ export type UintArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
2
5
  export declare const isTypedArray: (x: any) => x is TypedArray;
6
+ export declare const isIntArray: (x: any) => x is IntArray;
7
+ export declare const isUintArray: (x: any) => x is UintArray;
8
+ export declare const isFloatArray: (x: any) => x is FloatArray;
3
9
  //# sourceMappingURL=is-typedarray.d.ts.map
package/is-typedarray.js CHANGED
@@ -1,4 +1,10 @@
1
- const isTypedArray = (x) => !!x && (x instanceof Float32Array || x instanceof Float64Array || x instanceof Uint32Array || x instanceof Int32Array || x instanceof Uint8Array || x instanceof Int8Array || x instanceof Uint16Array || x instanceof Int16Array || x instanceof Uint8ClampedArray);
1
+ const isTypedArray = (x) => !!x && (x instanceof Uint8Array || x instanceof Int8Array || x instanceof Uint16Array || x instanceof Int16Array || x instanceof Uint32Array || x instanceof Int32Array || x instanceof Float32Array || x instanceof Float64Array || x instanceof Uint8ClampedArray);
2
+ const isIntArray = (x) => !!x && (x instanceof Int8Array || x instanceof Int16Array || x instanceof Int32Array);
3
+ const isUintArray = (x) => !!x && (x instanceof Uint32Array || x instanceof Uint16Array || x instanceof Uint8Array || x instanceof Uint8ClampedArray);
4
+ const isFloatArray = (x) => !!x && (x instanceof Float32Array || x instanceof Float64Array);
2
5
  export {
3
- isTypedArray
6
+ isFloatArray,
7
+ isIntArray,
8
+ isTypedArray,
9
+ isUintArray
4
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/checks",
3
- "version": "3.7.25",
3
+ "version": "3.8.0",
4
4
  "description": "Collection of 70+ type, feature & value checks",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -290,5 +290,5 @@
290
290
  "thi.ng": {
291
291
  "alias": "ch"
292
292
  },
293
- "gitHead": "fdca77cabf47dd23a9ab17a5ca13e3060075c12c\n"
293
+ "gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
294
294
  }