@rcompat/is 0.2.1 → 0.3.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.
@@ -1,3 +1,3 @@
1
- import type Dict from "@rcompat/type/Dict";
1
+ import type { Dict } from "@rcompat/type";
2
2
  export default function isDict(x: unknown): x is Dict;
3
3
  //# sourceMappingURL=dict.d.ts.map
@@ -3,8 +3,8 @@ import newable from "#newable";
3
3
  import numeric from "#numeric";
4
4
  import object from "#object";
5
5
  import primitive from "#primitive";
6
- import type Dict from "@rcompat/type/Dict";
7
- import type Nullish from "@rcompat/type/Nullish";
6
+ import type { Dict, Nullish } from "@rcompat/type";
7
+ declare function isArray(x: unknown): x is unknown[];
8
8
  declare function isDate(x: unknown): x is Date;
9
9
  declare function isDefined(x: unknown): x is {} | null;
10
10
  declare function isDict(x: unknown): x is Dict;
@@ -18,9 +18,9 @@ declare function isURL(x: unknown): x is URL;
18
18
  declare function isMap(x: unknown): x is Map<unknown, unknown>;
19
19
  declare function isSet(x: unknown): x is Set<unknown>;
20
20
  declare const _default: {
21
- array: (arg: any) => arg is any[];
21
+ array: typeof isArray;
22
22
  blank: (x: unknown) => x is string;
23
- boolish: (x: unknown) => x is import("@rcompat/type/Boolish").default;
23
+ boolish: (x: unknown) => x is import("@rcompat/type").Boolish;
24
24
  date: typeof isDate;
25
25
  defined: typeof isDefined;
26
26
  dict: typeof isDict;
@@ -5,6 +5,9 @@ import numeric from "#numeric";
5
5
  import object from "#object";
6
6
  import primitive from "#primitive";
7
7
  import strings from "#strings";
8
+ function isArray(x) {
9
+ return Array.isArray(x);
10
+ }
8
11
  function isDate(x) {
9
12
  return x instanceof Date;
10
13
  }
@@ -45,7 +48,7 @@ function isSet(x) {
45
48
  return x instanceof Set;
46
49
  }
47
50
  export default {
48
- array: Array.isArray,
51
+ array: isArray,
49
52
  blank: strings.isBlank,
50
53
  boolish: strings.isBoolish,
51
54
  date: isDate,
@@ -1,3 +1,3 @@
1
- import type Newable from "@rcompat/type/Newable";
1
+ import type { Newable } from "@rcompat/type";
2
2
  export default function isNewable(x: unknown): x is Newable;
3
3
  //# sourceMappingURL=newable.d.ts.map
@@ -1,3 +1,3 @@
1
- import type Primitive from "@rcompat/type/Primitive";
1
+ import type { Primitive } from "@rcompat/type";
2
2
  export default function isPrimitive(x: unknown): x is Primitive;
3
3
  //# sourceMappingURL=primitive.d.ts.map
@@ -1,4 +1,4 @@
1
- import type Boolish from "@rcompat/type/Boolish";
1
+ import type { Boolish } from "@rcompat/type";
2
2
  declare function isBlank(x: unknown): x is string;
3
3
  declare function isBoolish(x: unknown): x is Boolish;
4
4
  declare const _default: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcompat/is",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Standard library identity checks",
5
5
  "bugs": "https://github.com/rcompat/rcompat/issues",
6
6
  "license": "MIT",
@@ -14,6 +14,9 @@
14
14
  "url": "https://github.com/rcompat/rcompat",
15
15
  "directory": "packages/is"
16
16
  },
17
+ "devDependencies": {
18
+ "@rcompat/type": "^0.8.0"
19
+ },
17
20
  "type": "module",
18
21
  "imports": {
19
22
  "#*": {
@@ -1,3 +0,0 @@
1
- declare const _default: (arg: any) => arg is any[];
2
- export default _default;
3
- //# sourceMappingURL=array.d.ts.map
@@ -1,2 +0,0 @@
1
- export default Array.isArray;
2
- //# sourceMappingURL=array.js.map
@@ -1,2 +0,0 @@
1
- export default function isBlank(x: unknown): x is string;
2
- //# sourceMappingURL=blank.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isBlank(x) {
2
- return typeof x === "string" && /^\s*$/.test(x);
3
- }
4
- //# sourceMappingURL=blank.js.map
@@ -1,3 +0,0 @@
1
- import type Boolish from "@rcompat/type/Boolish";
2
- export default function isBoolish(x: unknown): x is Boolish;
3
- //# sourceMappingURL=boolish.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isBoolish(x) {
2
- return x === "true" || x === "false";
3
- }
4
- //# sourceMappingURL=boolish.js.map
@@ -1,2 +0,0 @@
1
- export default function isDate(x: unknown): x is Date;
2
- //# sourceMappingURL=date.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isDate(x) {
2
- return x instanceof Date;
3
- }
4
- //# sourceMappingURL=date.js.map
@@ -1,2 +0,0 @@
1
- export default function isDefined(x: unknown): x is {} | null;
2
- //# sourceMappingURL=defined.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isDefined(x) {
2
- return x !== undefined;
3
- }
4
- //# sourceMappingURL=defined.js.map
@@ -1,2 +0,0 @@
1
- export default function isFalsy(x: unknown): boolean;
2
- //# sourceMappingURL=falsy.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isFalsy(x) {
2
- return !x;
3
- }
4
- //# sourceMappingURL=falsy.js.map
@@ -1,2 +0,0 @@
1
- export default function isFinite(x: unknown): x is bigint | number;
2
- //# sourceMappingURL=finite.d.ts.map
@@ -1,8 +0,0 @@
1
- export default function isFinite(x) {
2
- if (typeof x === "bigint")
3
- return true;
4
- if (typeof x === "number")
5
- return Number.isFinite(x);
6
- return false;
7
- }
8
- //# sourceMappingURL=finite.js.map
@@ -1,2 +0,0 @@
1
- export default function isInt(x: unknown): x is number;
2
- //# sourceMappingURL=int.d.ts.map
@@ -1,6 +0,0 @@
1
- export default function isInt(x) {
2
- if (typeof x === "number")
3
- return Number.isInteger(x);
4
- return false;
5
- }
6
- //# sourceMappingURL=int.js.map
@@ -1,2 +0,0 @@
1
- export default function isNaN(x: unknown): x is number;
2
- //# sourceMappingURL=nan.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isNaN(x) {
2
- return typeof x === "number" && Number.isNaN(x);
3
- }
4
- //# sourceMappingURL=nan.js.map
@@ -1,3 +0,0 @@
1
- import type Nullish from "@rcompat/type/Nullish";
2
- export default function isNullish(x: unknown): x is Nullish;
3
- //# sourceMappingURL=nullish.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isNullish(x) {
2
- return x === null || x === undefined;
3
- }
4
- //# sourceMappingURL=nullish.js.map
@@ -1,2 +0,0 @@
1
- export default function isPromise(x: unknown): x is Promise<unknown>;
2
- //# sourceMappingURL=promise.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isPromise(x) {
2
- return x instanceof Promise;
3
- }
4
- //# sourceMappingURL=promise.js.map
@@ -1,2 +0,0 @@
1
- export default function isRegExp(x: unknown): x is RegExp;
2
- //# sourceMappingURL=regexp.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isRegExp(x) {
2
- return x instanceof RegExp;
3
- }
4
- //# sourceMappingURL=regexp.js.map
@@ -1,2 +0,0 @@
1
- export default function isSafeint(x: unknown): x is number;
2
- //# sourceMappingURL=safeint.d.ts.map
@@ -1,6 +0,0 @@
1
- export default function isSafeint(x) {
2
- if (typeof x === "number")
3
- return Number.isSafeInteger(x);
4
- return false;
5
- }
6
- //# sourceMappingURL=safeint.js.map
@@ -1,2 +0,0 @@
1
- export default function isTruthy(x: unknown): boolean;
2
- //# sourceMappingURL=truthy.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isTruthy(x) {
2
- return !!x;
3
- }
4
- //# sourceMappingURL=truthy.js.map
@@ -1,2 +0,0 @@
1
- export default function isUint(x: unknown): x is bigint | number;
2
- //# sourceMappingURL=uint.d.ts.map
@@ -1,5 +0,0 @@
1
- import int from "#int";
2
- export default function isUint(x) {
3
- return int(x) && BigInt(x) >= 0n;
4
- }
5
- //# sourceMappingURL=uint.js.map
@@ -1,2 +0,0 @@
1
- export default function isURL(x: unknown): x is URL;
2
- //# sourceMappingURL=url.d.ts.map
@@ -1,4 +0,0 @@
1
- export default function isURL(x) {
2
- return x instanceof URL;
3
- }
4
- //# sourceMappingURL=url.js.map