@rcompat/is 0.4.0 → 0.4.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.
@@ -6,12 +6,14 @@ import primitive from "#primitive";
6
6
  import type { Dict, Nullish, UnknownFunction } from "@rcompat/type";
7
7
  declare function isArray(x: unknown): x is unknown[];
8
8
  declare function isBigint(x: unknown): x is bigint;
9
+ declare function isBlob(x: unknown): x is Blob;
9
10
  declare function isBoolean(x: unknown): x is boolean;
10
11
  declare function isDate(x: unknown): x is Date;
11
12
  declare function isDefined(x: unknown): x is {} | null;
12
13
  declare function isDict(x: unknown): x is Dict;
13
14
  declare function isError(x: unknown): x is Error;
14
15
  declare function isFalsy(x: unknown): boolean;
16
+ declare function isFile(x: unknown): x is File;
15
17
  declare function isFunction(x: unknown): x is UnknownFunction;
16
18
  declare function isIterable(x: unknown): x is Iterable<unknown>;
17
19
  declare function isMap(x: unknown): x is Map<unknown, unknown>;
@@ -31,6 +33,7 @@ declare const _default: {
31
33
  array: typeof isArray;
32
34
  bigint: typeof isBigint;
33
35
  blank: (x: unknown) => x is string;
36
+ blob: typeof isBlob;
34
37
  boolish: (x: unknown) => x is import("@rcompat/type").Boolish;
35
38
  boolean: typeof isBoolean;
36
39
  date: typeof isDate;
@@ -39,6 +42,7 @@ declare const _default: {
39
42
  empty: typeof empty;
40
43
  error: typeof isError;
41
44
  falsy: typeof isFalsy;
45
+ file: typeof isFile;
42
46
  finite: (x: unknown) => x is bigint | number;
43
47
  function: typeof isFunction;
44
48
  int: (x: unknown) => x is bigint | number;
@@ -11,6 +11,9 @@ function isArray(x) {
11
11
  function isBigint(x) {
12
12
  return typeof x === "bigint";
13
13
  }
14
+ function isBlob(x) {
15
+ return x instanceof Blob;
16
+ }
14
17
  function isBoolean(x) {
15
18
  return typeof x === "boolean";
16
19
  }
@@ -32,6 +35,9 @@ function isError(x) {
32
35
  function isFalsy(x) {
33
36
  return !x;
34
37
  }
38
+ function isFile(x) {
39
+ return x instanceof File;
40
+ }
35
41
  function isFunction(x) {
36
42
  return typeof x === "function";
37
43
  }
@@ -81,6 +87,7 @@ export default {
81
87
  array: isArray,
82
88
  bigint: isBigint,
83
89
  blank: strings.isBlank,
90
+ blob: isBlob,
84
91
  boolish: strings.isBoolish,
85
92
  boolean: isBoolean,
86
93
  date: isDate,
@@ -89,6 +96,7 @@ export default {
89
96
  empty,
90
97
  error: isError,
91
98
  falsy: isFalsy,
99
+ file: isFile,
92
100
  finite: numbers.isFinite,
93
101
  function: isFunction,
94
102
  int: numbers.isInt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcompat/is",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Standard library identity checks",
5
5
  "bugs": "https://github.com/rcompat/rcompat/issues",
6
6
  "license": "MIT",