@stryke/type-checks 0.5.40 → 0.6.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 +28 -0
- package/README.md +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/is-buffer.cjs +3 -2
- package/dist/is-buffer.d.cts +2 -0
- package/dist/is-buffer.d.cts.map +1 -1
- package/dist/is-buffer.d.mts +2 -0
- package/dist/is-buffer.d.mts.map +1 -1
- package/dist/is-buffer.mjs +2 -0
- package/dist/is-buffer.mjs.map +1 -1
- package/dist/is-deep-key.cjs +12 -0
- package/dist/is-deep-key.d.cts.map +1 -1
- package/dist/is-deep-key.d.mts.map +1 -1
- package/dist/is-deep-key.mjs +12 -0
- package/dist/is-deep-key.mjs.map +1 -1
- package/dist/is-empty-array.cjs +33 -0
- package/dist/is-empty-array.d.cts +18 -0
- package/dist/is-empty-array.d.cts.map +1 -0
- package/dist/is-empty-array.d.mts +18 -0
- package/dist/is-empty-array.d.mts.map +1 -0
- package/dist/is-empty-array.mjs +33 -0
- package/dist/is-empty-array.mjs.map +1 -0
- package/dist/is-empty-object.d.cts.map +1 -1
- package/dist/is-empty-object.d.mts.map +1 -1
- package/dist/is-empty-object.mjs.map +1 -1
- package/dist/is-equal.cjs +3 -3
- package/dist/is-equal.mjs +3 -3
- package/dist/is-equal.mjs.map +1 -1
- package/dist/is-object-index.cjs +6 -0
- package/dist/is-object-index.mjs +6 -0
- package/dist/is-object-index.mjs.map +1 -1
- package/dist/is-plain-object.cjs +2 -2
- package/dist/is-plain-object.d.cts +1 -1
- package/dist/is-plain-object.d.mts +1 -1
- package/dist/is-plain-object.mjs +2 -2
- package/dist/is-plain-object.mjs.map +1 -1
- package/dist/is-promise.d.cts.map +1 -1
- package/dist/is-promise.d.mts.map +1 -1
- package/dist/is-promise.mjs.map +1 -1
- package/dist/type-detect.cjs +2 -2
- package/dist/type-detect.mjs +2 -2
- package/dist/type-detect.mjs.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - Type Checks
|
|
4
4
|
|
|
5
|
+
## [0.6.0](https://github.com/storm-software/stryke/releases/tag/type-checks%400.6.0) (03/23/2026)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update `package.json` files ([fb0e0711](https://github.com/storm-software/stryke/commit/fb0e0711))
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **monorepo:** Update all repository projects to resolve linting failures ([e9fb597b](https://github.com/storm-software/stryke/commit/e9fb597b))
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- **type-checks:** Added `isEmptyArray` type-checker function ([22706388](https://github.com/storm-software/stryke/commit/22706388))
|
|
18
|
+
|
|
19
|
+
### Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated **types** to **v0.11.2**
|
|
22
|
+
|
|
23
|
+
## [0.5.41](https://github.com/storm-software/stryke/releases/tag/type-checks%400.5.41) (03/16/2026)
|
|
24
|
+
|
|
25
|
+
### Miscellaneous
|
|
26
|
+
|
|
27
|
+
- **monorepo:** Added `README.md` workspace files ([515dc333](https://github.com/storm-software/stryke/commit/515dc333))
|
|
28
|
+
|
|
29
|
+
### Updated Dependencies
|
|
30
|
+
|
|
31
|
+
- Updated **types** to **v0.11.1**
|
|
32
|
+
|
|
5
33
|
## [0.5.40](https://github.com/storm-software/stryke/releases/tag/type-checks%400.5.40) (03/16/2026)
|
|
6
34
|
|
|
7
35
|
### Updated Dependencies
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ This package is part of Storm Software's **🌩️ Stryke** monorepo. Stryke pac
|
|
|
28
28
|
|
|
29
29
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
30
30
|
|
|
31
|
-
[](https://github.com/storm-software/stryke) [](http://commitizen.github.io/cz-cli/)  
|
|
32
32
|
|
|
33
33
|
> [!IMPORTANT] Important
|
|
34
34
|
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
package/dist/index.cjs
CHANGED
|
@@ -16,6 +16,7 @@ const require_is_buffer = require('./is-buffer.cjs');
|
|
|
16
16
|
const require_type_detect = require('./type-detect.cjs');
|
|
17
17
|
const require_is_collection = require('./is-collection.cjs');
|
|
18
18
|
const require_is_deep_key = require('./is-deep-key.cjs');
|
|
19
|
+
const require_is_empty_array = require('./is-empty-array.cjs');
|
|
19
20
|
const require_is_empty_object = require('./is-empty-object.cjs');
|
|
20
21
|
const require_is_string = require('./is-string.cjs');
|
|
21
22
|
const require_is_empty_string = require('./is-empty-string.cjs');
|
|
@@ -58,7 +59,9 @@ exports.isDate = require_is_date.isDate;
|
|
|
58
59
|
exports.isDeepKey = require_is_deep_key.isDeepKey;
|
|
59
60
|
exports.isEmpty = require_is_empty.isEmpty;
|
|
60
61
|
exports.isEmptyAnything = require_is_empty.isEmptyAnything;
|
|
62
|
+
exports.isEmptyArray = require_is_empty_array.isEmptyArray;
|
|
61
63
|
exports.isEmptyObject = require_is_empty_object.isEmptyObject;
|
|
64
|
+
exports.isEmptyOrEmptyArray = require_is_empty_array.isEmptyOrEmptyArray;
|
|
62
65
|
exports.isEmptyOrEmptyObject = require_is_empty_object.isEmptyOrEmptyObject;
|
|
63
66
|
exports.isEmptyString = require_is_empty_string.isEmptyString;
|
|
64
67
|
exports.isEqual = require_is_equal.isEqual;
|
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,7 @@ import { isCollection } from "./is-collection.cjs";
|
|
|
8
8
|
import { isDate } from "./is-date.cjs";
|
|
9
9
|
import { isDeepKey, isKeyOrDeepKey } from "./is-deep-key.cjs";
|
|
10
10
|
import { isEmpty, isEmptyAnything } from "./is-empty.cjs";
|
|
11
|
+
import { isEmptyArray, isEmptyOrEmptyArray } from "./is-empty-array.cjs";
|
|
11
12
|
import { isEmptyObject, isEmptyOrEmptyObject } from "./is-empty-object.cjs";
|
|
12
13
|
import { isEmptyString } from "./is-empty-string.cjs";
|
|
13
14
|
import { isEqual } from "./is-equal.cjs";
|
|
@@ -41,4 +42,4 @@ import { isUndefined } from "./is-undefined.cjs";
|
|
|
41
42
|
import { isURL } from "./is-url.cjs";
|
|
42
43
|
import { propertyExists, propertyUnsafe } from "./property-exists.cjs";
|
|
43
44
|
import { typeDetect } from "./type-detect.cjs";
|
|
44
|
-
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyObject, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
|
45
|
+
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyArray, isEmptyObject, isEmptyOrEmptyArray, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { isCollection } from "./is-collection.mjs";
|
|
|
8
8
|
import { isDate } from "./is-date.mjs";
|
|
9
9
|
import { isDeepKey, isKeyOrDeepKey } from "./is-deep-key.mjs";
|
|
10
10
|
import { isEmpty, isEmptyAnything } from "./is-empty.mjs";
|
|
11
|
+
import { isEmptyArray, isEmptyOrEmptyArray } from "./is-empty-array.mjs";
|
|
11
12
|
import { isEmptyObject, isEmptyOrEmptyObject } from "./is-empty-object.mjs";
|
|
12
13
|
import { isEmptyString } from "./is-empty-string.mjs";
|
|
13
14
|
import { isEqual } from "./is-equal.mjs";
|
|
@@ -41,4 +42,4 @@ import { isUndefined } from "./is-undefined.mjs";
|
|
|
41
42
|
import { isURL } from "./is-url.mjs";
|
|
42
43
|
import { propertyExists, propertyUnsafe } from "./property-exists.mjs";
|
|
43
44
|
import { typeDetect } from "./type-detect.mjs";
|
|
44
|
-
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyObject, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
|
45
|
+
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyArray, isEmptyObject, isEmptyOrEmptyArray, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
package/dist/index.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import { isBuffer, isBufferExists } from "./is-buffer.mjs";
|
|
|
16
16
|
import { typeDetect } from "./type-detect.mjs";
|
|
17
17
|
import { isCollection } from "./is-collection.mjs";
|
|
18
18
|
import { isDeepKey, isKeyOrDeepKey } from "./is-deep-key.mjs";
|
|
19
|
+
import { isEmptyArray, isEmptyOrEmptyArray } from "./is-empty-array.mjs";
|
|
19
20
|
import { isEmptyObject, isEmptyOrEmptyObject } from "./is-empty-object.mjs";
|
|
20
21
|
import { isString } from "./is-string.mjs";
|
|
21
22
|
import { isEmptyString } from "./is-empty-string.mjs";
|
|
@@ -42,4 +43,4 @@ import { isTypedArray } from "./is-typed-array.mjs";
|
|
|
42
43
|
import { isURL } from "./is-url.mjs";
|
|
43
44
|
import { propertyExists, propertyUnsafe } from "./property-exists.mjs";
|
|
44
45
|
|
|
45
|
-
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyObject, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
|
46
|
+
export { getObjectTag, isAnyNumber, isArrayLike, isAsyncFunction, isAsyncIterable, isBigInt, isBoolean, isBuffer, isBufferExists, isClass, isCollection, isConventionalClass, isDate, isDeepKey, isEmpty, isEmptyAnything, isEmptyArray, isEmptyObject, isEmptyOrEmptyArray, isEmptyOrEmptyObject, isEmptyString, isEqual, isError, isFileResult, isFloat, isFunction, isInteger, isKeyOrDeepKey, isMergeableObject, isNativeClass, isNotEmpty, isNull, isNumber, isObject, isObjectIndex, isObjectLike, isPlainObject, isPrimitive, isPromise, isPromiseLike, isReactElement, isRef, isRegExp, isSelectOption, isSet, isSetArray, isSetObject, isSetString, isString, isSymbol, isSyncFunction, isTyped, isTypedArray, isURL, isUndefined, propertyExists, propertyUnsafe, typeDetect };
|
package/dist/is-buffer.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
let node_buffer = require("node:buffer");
|
|
1
2
|
|
|
2
3
|
//#region src/is-buffer.ts
|
|
3
|
-
const isBufferExists = typeof Buffer !== "undefined";
|
|
4
|
+
const isBufferExists = typeof node_buffer.Buffer !== "undefined";
|
|
4
5
|
/**
|
|
5
6
|
* Check if the provided value's type is `Buffer`
|
|
6
7
|
*/
|
|
7
|
-
const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {
|
|
8
|
+
const isBuffer = isBufferExists ? node_buffer.Buffer.isBuffer.bind(node_buffer.Buffer) : function isBuffer$1(value) {
|
|
8
9
|
return false;
|
|
9
10
|
};
|
|
10
11
|
|
package/dist/is-buffer.d.cts
CHANGED
package/dist/is-buffer.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-buffer.d.cts","names":[],"sources":["../src/is-buffer.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-buffer.d.cts","names":[],"sources":["../src/is-buffer.ts"],"sourcesContent":[],"mappings":";;;cAoBa;;AAAb;AAKA;cAAa,iBAAiB,MAAA,CAAO"}
|
package/dist/is-buffer.d.mts
CHANGED
package/dist/is-buffer.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-buffer.d.mts","names":[],"sources":["../src/is-buffer.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-buffer.d.mts","names":[],"sources":["../src/is-buffer.ts"],"sourcesContent":[],"mappings":";;;cAoBa;;AAAb;AAKA;cAAa,iBAAiB,MAAA,CAAO"}
|
package/dist/is-buffer.mjs
CHANGED
package/dist/is-buffer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Buffer } from \"node:buffer\";\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":";;;AAoBA,MAAa,iBAAiB,OAAO,WAAW;;;;AAKhD,MAAaA,WAAmC,iBAC5C,OAAO,SAAS,KAAK,OAAO,GAO5B,SAASC,WACP,OACiB;AACjB,QAAO"}
|
package/dist/is-deep-key.cjs
CHANGED
|
@@ -21,6 +21,12 @@ function isDeepKey(key) {
|
|
|
21
21
|
case "number":
|
|
22
22
|
case "symbol": return false;
|
|
23
23
|
case "string": return key.includes(".") || key.includes("[") || key.includes("]");
|
|
24
|
+
case "bigint":
|
|
25
|
+
case "boolean":
|
|
26
|
+
case "function":
|
|
27
|
+
case "object":
|
|
28
|
+
case "undefined":
|
|
29
|
+
default: return false;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
@@ -44,6 +50,12 @@ function isKeyOrDeepKey(key) {
|
|
|
44
50
|
case "number": return true;
|
|
45
51
|
case "symbol": return false;
|
|
46
52
|
case "string": return true;
|
|
53
|
+
case "bigint":
|
|
54
|
+
case "boolean":
|
|
55
|
+
case "function":
|
|
56
|
+
case "object":
|
|
57
|
+
case "undefined":
|
|
58
|
+
default: return false;
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-key.d.cts","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;
|
|
1
|
+
{"version":3,"file":"is-deep-key.d.cts","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;AAoCA;;;;;;;;;;;;;iBApCgB,SAAA,MAAe,qBAAqB;;;;;;;;;;;;;;;;;iBAoCpC,cAAA,MAAoB,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-key.d.mts","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;
|
|
1
|
+
{"version":3,"file":"is-deep-key.d.mts","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;AAoCA;;;;;;;;;;;;;iBApCgB,SAAA,MAAe,qBAAqB;;;;;;;;;;;;;;;;;iBAoCpC,cAAA,MAAoB,qBAAqB"}
|
package/dist/is-deep-key.mjs
CHANGED
|
@@ -20,6 +20,12 @@ function isDeepKey(key) {
|
|
|
20
20
|
case "number":
|
|
21
21
|
case "symbol": return false;
|
|
22
22
|
case "string": return key.includes(".") || key.includes("[") || key.includes("]");
|
|
23
|
+
case "bigint":
|
|
24
|
+
case "boolean":
|
|
25
|
+
case "function":
|
|
26
|
+
case "object":
|
|
27
|
+
case "undefined":
|
|
28
|
+
default: return false;
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
@@ -43,6 +49,12 @@ function isKeyOrDeepKey(key) {
|
|
|
43
49
|
case "number": return true;
|
|
44
50
|
case "symbol": return false;
|
|
45
51
|
case "string": return true;
|
|
52
|
+
case "bigint":
|
|
53
|
+
case "boolean":
|
|
54
|
+
case "function":
|
|
55
|
+
case "object":
|
|
56
|
+
case "undefined":
|
|
57
|
+
default: return false;
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
|
package/dist/is-deep-key.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-key.mjs","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey } from \"@stryke/types
|
|
1
|
+
{"version":3,"file":"is-deep-key.mjs","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey } from \"@stryke/types\";\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\":\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return key.includes(\".\") || key.includes(\"[\") || key.includes(\"]\");\n }\n case \"bigint\":\n case \"boolean\":\n case \"function\":\n case \"object\":\n case \"undefined\":\n default: {\n return false;\n }\n }\n}\n\n/**\n * Checks if a given key is a deep key or normal (shallow key).\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // true\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isKeyOrDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\": {\n return true;\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return true;\n }\n case \"bigint\":\n case \"boolean\":\n case \"function\":\n case \"object\":\n case \"undefined\":\n default: {\n return false;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAgB,UAAU,KAAuC;AAC/D,SAAQ,OAAO,KAAf;EACE,KAAK;EACL,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI;EAEpE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,QACE,QAAO;;;;;;;;;;;;;;;;;;;AAqBb,SAAgB,eAAe,KAAuC;AACpE,SAAQ,OAAO,KAAf;EACE,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO;EAET,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,QACE,QAAO"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_is_empty = require('./is-empty.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/is-empty-array.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is `[]`
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is of type `[]`
|
|
9
|
+
*/
|
|
10
|
+
const isEmptyArray = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return Array.isArray(value) && value.length === 0;
|
|
13
|
+
} catch {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Check if the provided value's type is `null` or `undefined` or `[]`
|
|
19
|
+
*
|
|
20
|
+
* @param value - The value to type check
|
|
21
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined` or `[]`
|
|
22
|
+
*/
|
|
23
|
+
const isEmptyOrEmptyArray = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
return require_is_empty.isEmpty(value) || isEmptyArray(value);
|
|
26
|
+
} catch {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.isEmptyArray = isEmptyArray;
|
|
33
|
+
exports.isEmptyOrEmptyArray = isEmptyOrEmptyArray;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/is-empty-array.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the provided value's type is `[]`
|
|
4
|
+
*
|
|
5
|
+
* @param value - The value to type check
|
|
6
|
+
* @returns An indicator specifying if the value provided is of type `[]`
|
|
7
|
+
*/
|
|
8
|
+
declare const isEmptyArray: (value: unknown) => value is [];
|
|
9
|
+
/**
|
|
10
|
+
* Check if the provided value's type is `null` or `undefined` or `[]`
|
|
11
|
+
*
|
|
12
|
+
* @param value - The value to type check
|
|
13
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined` or `[]`
|
|
14
|
+
*/
|
|
15
|
+
declare const isEmptyOrEmptyArray: (value: unknown) => boolean;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { isEmptyArray, isEmptyOrEmptyArray };
|
|
18
|
+
//# sourceMappingURL=is-empty-array.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-empty-array.d.cts","names":[],"sources":["../src/is-empty-array.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAcA;;;;cAda;;;;;;;cAcA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/is-empty-array.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the provided value's type is `[]`
|
|
4
|
+
*
|
|
5
|
+
* @param value - The value to type check
|
|
6
|
+
* @returns An indicator specifying if the value provided is of type `[]`
|
|
7
|
+
*/
|
|
8
|
+
declare const isEmptyArray: (value: unknown) => value is [];
|
|
9
|
+
/**
|
|
10
|
+
* Check if the provided value's type is `null` or `undefined` or `[]`
|
|
11
|
+
*
|
|
12
|
+
* @param value - The value to type check
|
|
13
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined` or `[]`
|
|
14
|
+
*/
|
|
15
|
+
declare const isEmptyOrEmptyArray: (value: unknown) => boolean;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { isEmptyArray, isEmptyOrEmptyArray };
|
|
18
|
+
//# sourceMappingURL=is-empty-array.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-empty-array.d.mts","names":[],"sources":["../src/is-empty-array.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAcA;;;;cAda;;;;;;;cAcA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isEmpty } from "./is-empty.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-empty-array.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is `[]`
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is of type `[]`
|
|
9
|
+
*/
|
|
10
|
+
const isEmptyArray = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return Array.isArray(value) && value.length === 0;
|
|
13
|
+
} catch {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Check if the provided value's type is `null` or `undefined` or `[]`
|
|
19
|
+
*
|
|
20
|
+
* @param value - The value to type check
|
|
21
|
+
* @returns An indicator specifying if the value provided is of type `null` or `undefined` or `[]`
|
|
22
|
+
*/
|
|
23
|
+
const isEmptyOrEmptyArray = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
return isEmpty(value) || isEmptyArray(value);
|
|
26
|
+
} catch {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { isEmptyArray, isEmptyOrEmptyArray };
|
|
33
|
+
//# sourceMappingURL=is-empty-array.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-empty-array.mjs","names":[],"sources":["../src/is-empty-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is `[]`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `[]`\n */\nexport const isEmptyArray = (value: unknown): value is [] => {\n try {\n return Array.isArray(value) && value.length === 0;\n } catch {\n return true;\n }\n};\n\n/**\n * Check if the provided value's type is `null` or `undefined` or `[]`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `[]`\n */\nexport const isEmptyOrEmptyArray = (value: unknown) => {\n try {\n return isEmpty(value) || isEmptyArray(value);\n } catch {\n return true;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,gBAAgB,UAAgC;AAC3D,KAAI;AACF,SAAO,MAAM,QAAQ,MAAM,IAAI,MAAM,WAAW;SAC1C;AACN,SAAO;;;;;;;;;AAUX,MAAa,uBAAuB,UAAmB;AACrD,KAAI;AACF,SAAO,QAAQ,MAAM,IAAI,aAAa,MAAM;SACtC;AACN,SAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty-object.d.cts","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"is-empty-object.d.cts","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":[],"mappings":";;AA4BA;AAcA;;;;cAda;;;;;;;cAcA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty-object.d.mts","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"is-empty-object.d.mts","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":[],"mappings":";;AA4BA;AAcA;;;;cAda;;;;;;;cAcA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty-object.mjs","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `{}`\n */\nexport const isEmptyObject = (value: unknown): value is {} => {\n try {\n return Boolean(value) || Object.keys(value ?? {}).length === 0;\n } catch {\n return true;\n }\n};\n\n/**\n * Check if the provided value's type is `null` or `undefined` or `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`\n */\nexport const isEmptyOrEmptyObject = (value: unknown) => {\n try {\n return isEmpty(value) || isEmptyObject(value);\n } catch {\n return true;\n }\n};\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"is-empty-object.mjs","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-empty-object-type */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `{}`\n */\nexport const isEmptyObject = (value: unknown): value is {} => {\n try {\n return Boolean(value) || Object.keys(value ?? {}).length === 0;\n } catch {\n return true;\n }\n};\n\n/**\n * Check if the provided value's type is `null` or `undefined` or `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`\n */\nexport const isEmptyOrEmptyObject = (value: unknown) => {\n try {\n return isEmpty(value) || isEmptyObject(value);\n } catch {\n return true;\n }\n};\n"],"mappings":";;;;;;;;;AA4BA,MAAa,iBAAiB,UAAgC;AAC5D,KAAI;AACF,SAAO,QAAQ,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,WAAW;SACvD;AACN,SAAO;;;;;;;;;AAUX,MAAa,wBAAwB,UAAmB;AACtD,KAAI;AACF,SAAO,QAAQ,MAAM,IAAI,cAAc,MAAM;SACvC;AACN,SAAO"}
|
package/dist/is-equal.cjs
CHANGED
|
@@ -8,9 +8,9 @@ const isEqual = (x, y) => {
|
|
|
8
8
|
const keysX = Reflect.ownKeys(x);
|
|
9
9
|
const keysY = Reflect.ownKeys(y);
|
|
10
10
|
if (keysX.length !== keysY.length) return false;
|
|
11
|
-
for (const
|
|
12
|
-
if (!Reflect.has(y,
|
|
13
|
-
if (!isEqual(x[
|
|
11
|
+
for (const element of keysX) {
|
|
12
|
+
if (!Reflect.has(y, element)) return false;
|
|
13
|
+
if (!isEqual(x[element], y[element])) return false;
|
|
14
14
|
}
|
|
15
15
|
return true;
|
|
16
16
|
};
|
package/dist/is-equal.mjs
CHANGED
|
@@ -7,9 +7,9 @@ const isEqual = (x, y) => {
|
|
|
7
7
|
const keysX = Reflect.ownKeys(x);
|
|
8
8
|
const keysY = Reflect.ownKeys(y);
|
|
9
9
|
if (keysX.length !== keysY.length) return false;
|
|
10
|
-
for (const
|
|
11
|
-
if (!Reflect.has(y,
|
|
12
|
-
if (!isEqual(x[
|
|
10
|
+
for (const element of keysX) {
|
|
11
|
+
if (!Reflect.has(y, element)) return false;
|
|
12
|
+
if (!isEqual(x[element], y[element])) return false;
|
|
13
13
|
}
|
|
14
14
|
return true;
|
|
15
15
|
};
|
package/dist/is-equal.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-equal.mjs","names":[],"sources":["../src/is-equal.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isEqual = <TType>(x: TType, y: TType): boolean => {\n if (Object.is(x, y)) return true;\n if (x instanceof Date && y instanceof Date) {\n return x.getTime() === y.getTime();\n }\n if (x instanceof RegExp && y instanceof RegExp) {\n return x.toString() === y.toString();\n }\n if (\n typeof x !== \"object\" ||\n x === null ||\n typeof y !== \"object\" ||\n y === null\n ) {\n return false;\n }\n const keysX = Reflect.ownKeys(x as unknown as object) as (keyof typeof x)[];\n const keysY = Reflect.ownKeys(y as unknown as object);\n if (keysX.length !== keysY.length) return false;\n for (const
|
|
1
|
+
{"version":3,"file":"is-equal.mjs","names":[],"sources":["../src/is-equal.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isEqual = <TType>(x: TType, y: TType): boolean => {\n if (Object.is(x, y)) return true;\n if (x instanceof Date && y instanceof Date) {\n return x.getTime() === y.getTime();\n }\n if (x instanceof RegExp && y instanceof RegExp) {\n return x.toString() === y.toString();\n }\n if (\n typeof x !== \"object\" ||\n x === null ||\n typeof y !== \"object\" ||\n y === null\n ) {\n return false;\n }\n\n const keysX = Reflect.ownKeys(x as unknown as object) as (keyof typeof x)[];\n const keysY = Reflect.ownKeys(y as unknown as object) as (keyof typeof y)[];\n if (keysX.length !== keysY.length) return false;\n for (const element of keysX) {\n if (!Reflect.has(y as unknown as object, element)) return false;\n if (!isEqual(x[element], y[element])) return false;\n }\n return true;\n};\n"],"mappings":";AAkBA,MAAa,WAAkB,GAAU,MAAsB;AAC7D,KAAI,OAAO,GAAG,GAAG,EAAE,CAAE,QAAO;AAC5B,KAAI,aAAa,QAAQ,aAAa,KACpC,QAAO,EAAE,SAAS,KAAK,EAAE,SAAS;AAEpC,KAAI,aAAa,UAAU,aAAa,OACtC,QAAO,EAAE,UAAU,KAAK,EAAE,UAAU;AAEtC,KACE,OAAO,MAAM,YACb,MAAM,QACN,OAAO,MAAM,YACb,MAAM,KAEN,QAAO;CAGT,MAAM,QAAQ,QAAQ,QAAQ,EAAuB;CACrD,MAAM,QAAQ,QAAQ,QAAQ,EAAuB;AACrD,KAAI,MAAM,WAAW,MAAM,OAAQ,QAAO;AAC1C,MAAK,MAAM,WAAW,OAAO;AAC3B,MAAI,CAAC,QAAQ,IAAI,GAAwB,QAAQ,CAAE,QAAO;AAC1D,MAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAE,QAAO;;AAE/C,QAAO"}
|
package/dist/is-object-index.cjs
CHANGED
|
@@ -12,6 +12,12 @@ function isObjectIndex(value) {
|
|
|
12
12
|
case "number": return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
13
13
|
case "symbol": return false;
|
|
14
14
|
case "string": return IS_UNSIGNED_INTEGER.test(value);
|
|
15
|
+
case "bigint":
|
|
16
|
+
case "boolean":
|
|
17
|
+
case "function":
|
|
18
|
+
case "object":
|
|
19
|
+
case "undefined":
|
|
20
|
+
default: return false;
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
|
package/dist/is-object-index.mjs
CHANGED
|
@@ -11,6 +11,12 @@ function isObjectIndex(value) {
|
|
|
11
11
|
case "number": return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
12
12
|
case "symbol": return false;
|
|
13
13
|
case "string": return IS_UNSIGNED_INTEGER.test(value);
|
|
14
|
+
case "bigint":
|
|
15
|
+
case "boolean":
|
|
16
|
+
case "function":
|
|
17
|
+
case "object":
|
|
18
|
+
case "undefined":
|
|
19
|
+
default: return false;
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-object-index.mjs","names":[],"sources":["../src/is-object-index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if the given value is an object index.\n *\n * @param value - The value to check.\n * @returns Returns `true` if the value is an object index, otherwise `false`.\n */\nexport function isObjectIndex(\n value: PropertyKey\n): value is string | number | symbol {\n switch (typeof value) {\n case \"number\": {\n return (\n Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER\n );\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}\n"],"mappings":";AAkBA,MAAM,sBAAsB;;;;;;;AAQ5B,SAAgB,cACd,OACmC;AACnC,SAAQ,OAAO,OAAf;EACE,KAAK,SACH,QACE,OAAO,UAAU,MAAM,IAAI,SAAS,KAAK,QAAQ,OAAO;EAG5D,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO,oBAAoB,KAAK,MAAM"}
|
|
1
|
+
{"version":3,"file":"is-object-index.mjs","names":[],"sources":["../src/is-object-index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if the given value is an object index.\n *\n * @param value - The value to check.\n * @returns Returns `true` if the value is an object index, otherwise `false`.\n */\nexport function isObjectIndex(\n value: PropertyKey\n): value is string | number | symbol {\n switch (typeof value) {\n case \"number\": {\n return (\n Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER\n );\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n case \"bigint\":\n case \"boolean\":\n case \"function\":\n case \"object\":\n case \"undefined\":\n default: {\n return false;\n }\n }\n}\n"],"mappings":";AAkBA,MAAM,sBAAsB;;;;;;;AAQ5B,SAAgB,cACd,OACmC;AACnC,SAAQ,OAAO,OAAf;EACE,KAAK,SACH,QACE,OAAO,UAAU,MAAM,IAAI,SAAS,KAAK,QAAQ,OAAO;EAG5D,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO,oBAAoB,KAAK,MAAM;EAExC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,QACE,QAAO"}
|
package/dist/is-plain-object.cjs
CHANGED
|
@@ -23,8 +23,8 @@ const require_get_object_tag = require('./get-object-tag.cjs');
|
|
|
23
23
|
* @param value - The value to check.
|
|
24
24
|
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
25
25
|
*/
|
|
26
|
-
const isObjectLike = (
|
|
27
|
-
return typeof
|
|
26
|
+
const isObjectLike = (value) => {
|
|
27
|
+
return typeof value === "object" && value !== null;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
@@ -24,7 +24,7 @@ import { PlainObject } from "./types/src/base.cjs";
|
|
|
24
24
|
* @param value - The value to check.
|
|
25
25
|
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
26
26
|
*/
|
|
27
|
-
declare const isObjectLike: (
|
|
27
|
+
declare const isObjectLike: (value: unknown) => value is object;
|
|
28
28
|
/**
|
|
29
29
|
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
30
30
|
*
|
|
@@ -24,7 +24,7 @@ import { PlainObject } from "./types/src/base.mjs";
|
|
|
24
24
|
* @param value - The value to check.
|
|
25
25
|
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
26
26
|
*/
|
|
27
|
-
declare const isObjectLike: (
|
|
27
|
+
declare const isObjectLike: (value: unknown) => value is object;
|
|
28
28
|
/**
|
|
29
29
|
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
30
30
|
*
|
package/dist/is-plain-object.mjs
CHANGED
|
@@ -23,8 +23,8 @@ import { getObjectTag } from "./get-object-tag.mjs";
|
|
|
23
23
|
* @param value - The value to check.
|
|
24
24
|
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
25
25
|
*/
|
|
26
|
-
const isObjectLike = (
|
|
27
|
-
return typeof
|
|
26
|
+
const isObjectLike = (value) => {
|
|
27
|
+
return typeof value === "object" && value !== null;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.mjs","names":[],"sources":["../src/is-plain-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (
|
|
1
|
+
{"version":3,"file":"is-plain-object.mjs","names":[],"sources":["../src/is-plain-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (value: unknown) => {\n return typeof value === \"object\" && value !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,gBAAgB,UAAmB;AAC9C,QAAO,OAAO,UAAU,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BhD,MAAa,iBAAiB,QAAqC;AACjE,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAC9C,QAAO;AAET,KAAI,OAAO,eAAe,IAAI,KAAK,KACjC,QAAO;CAET,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KACtC,SAAQ,OAAO,eAAe,MAAM;AAEtC,QAAO,OAAO,eAAe,IAAI,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-promise.d.cts","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":[],"mappings":";;AA2BA;
|
|
1
|
+
{"version":3,"file":"is-promise.d.cts","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAcA;;;;cAda,wCAAuC;;;;;;;;;;cAcvC,4CAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-promise.d.mts","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":[],"mappings":";;AA2BA;
|
|
1
|
+
{"version":3,"file":"is-promise.d.mts","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAcA;;;;cAda,wCAAuC;;;;;;;;;;cAcvC,4CAA2C"}
|
package/dist/is-promise.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-promise.mjs","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"./is-function\";\nimport { isObject } from \"./is-object\";\n\n/**\n * Check if the provided value's type is a promise\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type a promise\n */\nexport const isPromise = (value: unknown): value is Promise<unknown> => {\n return isObject(value) && isFunction((value as Promise<unknown>)?.then);\n};\n\n/**\n * Check if the provided value's type is a promise-like\n *\n * @remarks\n * A promise-like is an object that has a `then` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type a promise-like\n */\nexport const isPromiseLike = (value: unknown): value is PromiseLike<unknown> =>\n typeof (value as any)?.then === \"function\";\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,aAAa,UAA8C;
|
|
1
|
+
{"version":3,"file":"is-promise.mjs","names":[],"sources":["../src/is-promise.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isFunction } from \"./is-function\";\nimport { isObject } from \"./is-object\";\n\n/**\n * Check if the provided value's type is a promise\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type a promise\n */\nexport const isPromise = (value: unknown): value is Promise<unknown> => {\n // eslint-disable-next-line ts/unbound-method\n return isObject(value) && isFunction((value as Promise<unknown>)?.then);\n};\n\n/**\n * Check if the provided value's type is a promise-like\n *\n * @remarks\n * A promise-like is an object that has a `then` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type a promise-like\n */\nexport const isPromiseLike = (value: unknown): value is PromiseLike<unknown> =>\n typeof (value as any)?.then === \"function\";\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,aAAa,UAA8C;AAEtE,QAAO,SAAS,MAAM,IAAI,WAAY,OAA4B,KAAK;;;;;;;;;;;AAYzE,MAAa,iBAAiB,UAC5B,OAAQ,OAAe,SAAS"}
|
package/dist/type-detect.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_is_buffer = require('./is-buffer.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/type-detect.ts
|
|
4
|
-
const globalObject = ((
|
|
4
|
+
const globalObject = ((obj) => {
|
|
5
5
|
if (typeof globalThis === "object") return globalThis;
|
|
6
|
-
Object.defineProperty(
|
|
6
|
+
Object.defineProperty(obj, "typeDetectGlobalObject", {
|
|
7
7
|
get() {
|
|
8
8
|
return this;
|
|
9
9
|
},
|
package/dist/type-detect.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isBuffer } from "./is-buffer.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/type-detect.ts
|
|
4
|
-
const globalObject = ((
|
|
4
|
+
const globalObject = ((obj) => {
|
|
5
5
|
if (typeof globalThis === "object") return globalThis;
|
|
6
|
-
Object.defineProperty(
|
|
6
|
+
Object.defineProperty(obj, "typeDetectGlobalObject", {
|
|
7
7
|
get() {
|
|
8
8
|
return this;
|
|
9
9
|
},
|
package/dist/type-detect.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-detect.mjs","names":[],"sources":["../src/type-detect.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isBuffer } from \"./is-buffer\";\n\nconst globalObject = (
|
|
1
|
+
{"version":3,"file":"type-detect.mjs","names":[],"sources":["../src/type-detect.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isBuffer } from \"./is-buffer\";\n\nconst globalObject = (obj => {\n if (typeof globalThis === \"object\") {\n return globalThis;\n }\n Object.defineProperty(obj, \"typeDetectGlobalObject\", {\n get() {\n return this;\n },\n configurable: true\n });\n\n // // biome-ignore lint/correctness/noUndeclaredVariables: <explanation>\n // const global = typeDetectGlobalObject;\n\n // // biome-ignore lint/performance/noDelete: <explanation>\n // delete obj.typeDetectGlobalObject;\n return globalThis;\n})(Object.prototype);\n\nexport function typeDetect(obj: unknown): string {\n // NOTE: isBuffer must execute before type-detect,\n // because type-detect returns 'Uint8Array'.\n if (isBuffer(obj)) {\n return \"Buffer\";\n }\n\n const typeofObj = typeof obj;\n if (typeofObj !== \"object\") {\n return typeofObj;\n }\n\n if (obj === null) {\n return \"null\";\n }\n\n if (obj === globalObject) {\n return \"global\";\n }\n\n if (\n Array.isArray(obj) &&\n (Symbol.toStringTag === undefined || !(Symbol.toStringTag in obj))\n ) {\n return \"Array\";\n }\n\n // https://html.spec.whatwg.org/multipage/browsers.html#location\n if (typeof globalThis === \"object\" && globalThis !== null) {\n if (\n typeof (globalThis as any).location === \"object\" &&\n obj === (globalThis as any).location\n ) {\n return \"Location\";\n }\n\n // https://html.spec.whatwg.org/#document\n if (\n typeof (globalThis as any).document === \"object\" &&\n obj === (globalThis as any).document\n ) {\n return \"Document\";\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray\n if (typeof (globalThis as any).navigator === \"object\") {\n if (\n typeof (globalThis as any).navigator.mimeTypes === \"object\" &&\n obj === (globalThis as any).navigator.mimeTypes\n ) {\n return \"MimeTypeArray\";\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray\n if (\n typeof (globalThis as any).navigator.plugins === \"object\" &&\n obj === (globalThis as any).navigator.plugins\n ) {\n return \"PluginArray\";\n }\n }\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray\n if (\n (typeof (globalThis as any).HTMLElement === \"function\" ||\n typeof (globalThis as any).HTMLElement === \"object\") &&\n obj instanceof (globalThis as any).HTMLElement\n ) {\n if ((obj as any).tagName === \"BLOCKQUOTE\") {\n return \"HTMLQuoteElement\";\n }\n\n // https://html.spec.whatwg.org/#htmltabledatacellelement\n if ((obj as any).tagName === \"TD\") {\n return \"HTMLTableDataCellElement\";\n }\n\n // https://html.spec.whatwg.org/#htmltableheadercellelement\n if ((obj as any).tagName === \"TH\") {\n return \"HTMLTableHeaderCellElement\";\n }\n }\n }\n\n const stringTag =\n Symbol.toStringTag !== undefined && (obj as any)[Symbol.toStringTag];\n if (typeof stringTag === \"string\") {\n return stringTag;\n }\n\n const objPrototype = Object.getPrototypeOf(obj);\n if (objPrototype === RegExp.prototype) {\n return \"RegExp\";\n }\n\n if (objPrototype === Date.prototype) {\n return \"Date\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag\n if (typeof Promise !== \"undefined\" && objPrototype === Promise.prototype) {\n return \"Promise\";\n }\n\n if (typeof Set !== \"undefined\" && objPrototype === Set.prototype) {\n return \"Set\";\n }\n\n if (typeof Map !== \"undefined\" && objPrototype === Map.prototype) {\n return \"Map\";\n }\n\n if (typeof WeakSet !== \"undefined\" && objPrototype === WeakSet.prototype) {\n return \"WeakSet\";\n }\n\n if (typeof WeakMap !== \"undefined\" && objPrototype === WeakMap.prototype) {\n return \"WeakMap\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag\n if (typeof DataView !== \"undefined\" && objPrototype === DataView.prototype) {\n return \"DataView\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag\n if (\n typeof Map !== \"undefined\" &&\n objPrototype === Object.getPrototypeOf(new Map().entries())\n ) {\n return \"Map Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag\n if (\n typeof Set !== \"undefined\" &&\n objPrototype === Object.getPrototypeOf(new Set().entries())\n ) {\n return \"Set Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag\n if (\n typeof Array.prototype[Symbol.iterator] === \"function\" &&\n objPrototype === Object.getPrototypeOf([][Symbol.iterator]())\n ) {\n return \"Array Iterator\";\n }\n\n // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag\n if (\n Symbol.iterator !== undefined &&\n typeof String.prototype[Symbol.iterator] === \"function\" &&\n Object.getPrototypeOf(\"\"[Symbol.iterator]()) &&\n objPrototype === Object.getPrototypeOf(\"\"[Symbol.iterator]())\n ) {\n return \"String Iterator\";\n }\n\n if (objPrototype === null) {\n return \"Object\";\n }\n\n return Object.prototype.toString.call(obj).slice(8, -1);\n}\n"],"mappings":";;;AAoBA,MAAM,iBAAgB,QAAO;AAC3B,KAAI,OAAO,eAAe,SACxB,QAAO;AAET,QAAO,eAAe,KAAK,0BAA0B;EACnD,MAAM;AACJ,UAAO;;EAET,cAAc;EACf,CAAC;AAOF,QAAO;GACN,OAAO,UAAU;AAEpB,SAAgB,WAAW,KAAsB;AAG/C,KAAI,SAAS,IAAI,CACf,QAAO;CAGT,MAAM,YAAY,OAAO;AACzB,KAAI,cAAc,SAChB,QAAO;AAGT,KAAI,QAAQ,KACV,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO;AAGT,KACE,MAAM,QAAQ,IAAI,KACjB,OAAO,gBAAgB,UAAa,EAAE,OAAO,eAAe,MAE7D,QAAO;AAIT,KAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACzD,MACE,OAAQ,WAAmB,aAAa,YACxC,QAAS,WAAmB,SAE5B,QAAO;AAIT,MACE,OAAQ,WAAmB,aAAa,YACxC,QAAS,WAAmB,SAE5B,QAAO;AAIT,MAAI,OAAQ,WAAmB,cAAc,UAAU;AACrD,OACE,OAAQ,WAAmB,UAAU,cAAc,YACnD,QAAS,WAAmB,UAAU,UAEtC,QAAO;AAIT,OACE,OAAQ,WAAmB,UAAU,YAAY,YACjD,QAAS,WAAmB,UAAU,QAEtC,QAAO;;AAKX,OACG,OAAQ,WAAmB,gBAAgB,cAC1C,OAAQ,WAAmB,gBAAgB,aAC7C,eAAgB,WAAmB,aACnC;AACA,OAAK,IAAY,YAAY,aAC3B,QAAO;AAIT,OAAK,IAAY,YAAY,KAC3B,QAAO;AAIT,OAAK,IAAY,YAAY,KAC3B,QAAO;;;CAKb,MAAM,YACJ,OAAO,gBAAgB,UAAc,IAAY,OAAO;AAC1D,KAAI,OAAO,cAAc,SACvB,QAAO;CAGT,MAAM,eAAe,OAAO,eAAe,IAAI;AAC/C,KAAI,iBAAiB,OAAO,UAC1B,QAAO;AAGT,KAAI,iBAAiB,KAAK,UACxB,QAAO;AAIT,KAAI,OAAO,YAAY,eAAe,iBAAiB,QAAQ,UAC7D,QAAO;AAGT,KAAI,OAAO,QAAQ,eAAe,iBAAiB,IAAI,UACrD,QAAO;AAGT,KAAI,OAAO,QAAQ,eAAe,iBAAiB,IAAI,UACrD,QAAO;AAGT,KAAI,OAAO,YAAY,eAAe,iBAAiB,QAAQ,UAC7D,QAAO;AAGT,KAAI,OAAO,YAAY,eAAe,iBAAiB,QAAQ,UAC7D,QAAO;AAIT,KAAI,OAAO,aAAa,eAAe,iBAAiB,SAAS,UAC/D,QAAO;AAIT,KACE,OAAO,QAAQ,eACf,iBAAiB,OAAO,gCAAe,IAAI,KAAK,EAAC,SAAS,CAAC,CAE3D,QAAO;AAIT,KACE,OAAO,QAAQ,eACf,iBAAiB,OAAO,gCAAe,IAAI,KAAK,EAAC,SAAS,CAAC,CAE3D,QAAO;AAIT,KACE,OAAO,MAAM,UAAU,OAAO,cAAc,cAC5C,iBAAiB,OAAO,eAAe,EAAE,CAAC,OAAO,WAAW,CAAC,CAE7D,QAAO;AAIT,KACE,OAAO,aAAa,UACpB,OAAO,OAAO,UAAU,OAAO,cAAc,cAC7C,OAAO,eAAe,GAAG,OAAO,WAAW,CAAC,IAC5C,iBAAiB,OAAO,eAAe,GAAG,OAAO,WAAW,CAAC,CAE7D,QAAO;AAGT,KAAI,iBAAiB,KACnB,QAAO;AAGT,QAAO,OAAO,UAAU,SAAS,KAAK,IAAI,CAAC,MAAM,GAAG,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/type-checks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing various type-check functions to validate TypeScript values.",
|
|
6
6
|
"repository": {
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"require": "./dist/is-empty.cjs",
|
|
52
52
|
"import": "./dist/is-empty.mjs"
|
|
53
53
|
},
|
|
54
|
+
"./is-empty-array": {
|
|
55
|
+
"require": "./dist/is-empty-array.cjs",
|
|
56
|
+
"import": "./dist/is-empty-array.mjs"
|
|
57
|
+
},
|
|
54
58
|
"./is-empty-object": {
|
|
55
59
|
"require": "./dist/is-empty-object.cjs",
|
|
56
60
|
"import": "./dist/is-empty-object.mjs"
|
|
@@ -194,5 +198,5 @@
|
|
|
194
198
|
"types": "./dist/index.d.cts",
|
|
195
199
|
"devDependencies": { "tsdown": "^0.17.2" },
|
|
196
200
|
"publishConfig": { "access": "public" },
|
|
197
|
-
"gitHead": "
|
|
201
|
+
"gitHead": "ad0acb8f9d34c16300a0901dd4db448756480415"
|
|
198
202
|
}
|