@stryke/type-checks 0.5.18 → 0.5.19
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 +6 -0
- package/dist/get-object-tag.cjs +15 -1
- package/dist/get-object-tag.mjs +14 -1
- package/dist/get-object-tag.mjs.map +1 -1
- package/dist/index.cjs +100 -1
- package/dist/index.mjs +45 -1
- package/dist/is-array-like.cjs +17 -1
- package/dist/is-array-like.mjs +17 -1
- package/dist/is-array-like.mjs.map +1 -1
- package/dist/is-async-iterable.cjs +16 -1
- package/dist/is-async-iterable.mjs +16 -1
- package/dist/is-async-iterable.mjs.map +1 -1
- package/dist/is-bigint.cjs +22 -1
- package/dist/is-bigint.mjs +22 -1
- package/dist/is-bigint.mjs.map +1 -1
- package/dist/is-boolean.cjs +18 -1
- package/dist/is-boolean.mjs +17 -1
- package/dist/is-boolean.mjs.map +1 -1
- package/dist/is-buffer.cjs +13 -1
- package/dist/is-buffer.mjs +11 -1
- package/dist/is-buffer.mjs.map +1 -1
- package/dist/is-collection.cjs +22 -1
- package/dist/is-collection.mjs +22 -1
- package/dist/is-collection.mjs.map +1 -1
- package/dist/is-date.cjs +23 -1
- package/dist/is-date.mjs +23 -1
- package/dist/is-date.mjs.map +1 -1
- package/dist/is-deep-key.cjs +52 -1
- package/dist/is-deep-key.mjs +50 -1
- package/dist/is-deep-key.mjs.map +1 -1
- package/dist/is-empty-object.cjs +33 -1
- package/dist/is-empty-object.mjs +32 -1
- package/dist/is-empty-object.mjs.map +1 -1
- package/dist/is-empty-string.cjs +20 -1
- package/dist/is-empty-string.mjs +20 -1
- package/dist/is-empty-string.mjs.map +1 -1
- package/dist/is-empty.cjs +38 -1
- package/dist/is-empty.mjs +37 -1
- package/dist/is-empty.mjs.map +1 -1
- package/dist/is-equal.cjs +19 -1
- package/dist/is-equal.mjs +18 -1
- package/dist/is-equal.mjs.map +1 -1
- package/dist/is-error.cjs +29 -1
- package/dist/is-error.mjs +29 -1
- package/dist/is-error.mjs.map +1 -1
- package/dist/is-file-result.cjs +21 -1
- package/dist/is-file-result.mjs +21 -1
- package/dist/is-file-result.mjs.map +1 -1
- package/dist/is-float.cjs +13 -1
- package/dist/is-float.mjs +13 -1
- package/dist/is-float.mjs.map +1 -1
- package/dist/is-function.cjs +27 -1
- package/dist/is-function.mjs +25 -1
- package/dist/is-function.mjs.map +1 -1
- package/dist/is-integer.cjs +14 -1
- package/dist/is-integer.mjs +14 -1
- package/dist/is-integer.mjs.map +1 -1
- package/dist/is-mergeable-object.cjs +14 -1
- package/dist/is-mergeable-object.mjs +14 -1
- package/dist/is-mergeable-object.mjs.map +1 -1
- package/dist/is-non-null-object.cjs +16 -1
- package/dist/is-non-null-object.mjs +16 -1
- package/dist/is-non-null-object.mjs.map +1 -1
- package/dist/is-not-empty.cjs +21 -1
- package/dist/is-not-empty.mjs +21 -1
- package/dist/is-not-empty.mjs.map +1 -1
- package/dist/is-null.cjs +12 -1
- package/dist/is-null.mjs +11 -1
- package/dist/is-null.mjs.map +1 -1
- package/dist/is-number.cjs +29 -1
- package/dist/is-number.mjs +28 -1
- package/dist/is-number.mjs.map +1 -1
- package/dist/is-object-index.cjs +19 -1
- package/dist/is-object-index.mjs +18 -1
- package/dist/is-object-index.mjs.map +1 -1
- package/dist/is-object.cjs +47 -1
- package/dist/is-object.mjs +44 -1
- package/dist/is-object.mjs.map +1 -1
- package/dist/is-plain-object.cjs +64 -1
- package/dist/is-plain-object.mjs +63 -1
- package/dist/is-plain-object.mjs.map +1 -1
- package/dist/is-primitive.cjs +12 -1
- package/dist/is-primitive.mjs +11 -1
- package/dist/is-primitive.mjs.map +1 -1
- package/dist/is-promise.cjs +27 -1
- package/dist/is-promise.mjs +26 -1
- package/dist/is-promise.mjs.map +1 -1
- package/dist/is-react-element.cjs +8 -1
- package/dist/is-react-element.mjs +7 -1
- package/dist/is-react-element.mjs.map +1 -1
- package/dist/is-ref.cjs +18 -1
- package/dist/is-ref.mjs +17 -1
- package/dist/is-ref.mjs.map +1 -1
- package/dist/is-regexp.cjs +23 -1
- package/dist/is-regexp.mjs +23 -1
- package/dist/is-regexp.mjs.map +1 -1
- package/dist/is-select-option.cjs +19 -1
- package/dist/is-select-option.mjs +19 -1
- package/dist/is-select-option.mjs.map +1 -1
- package/dist/is-set-array.cjs +15 -1
- package/dist/is-set-array.mjs +15 -1
- package/dist/is-set-array.mjs.map +1 -1
- package/dist/is-set-object.cjs +19 -1
- package/dist/is-set-object.mjs +19 -1
- package/dist/is-set-object.mjs.map +1 -1
- package/dist/is-set-string.cjs +20 -1
- package/dist/is-set-string.mjs +20 -1
- package/dist/is-set-string.mjs.map +1 -1
- package/dist/is-set.cjs +19 -1
- package/dist/is-set.mjs +19 -1
- package/dist/is-set.mjs.map +1 -1
- package/dist/is-string.cjs +12 -1
- package/dist/is-string.mjs +11 -1
- package/dist/is-string.mjs.map +1 -1
- package/dist/is-symbol.cjs +12 -1
- package/dist/is-symbol.mjs +11 -1
- package/dist/is-symbol.mjs.map +1 -1
- package/dist/is-typed-array.cjs +8 -1
- package/dist/is-typed-array.mjs +7 -1
- package/dist/is-typed-array.mjs.map +1 -1
- package/dist/is-typed.cjs +20 -1
- package/dist/is-typed.mjs +20 -1
- package/dist/is-typed.mjs.map +1 -1
- package/dist/is-undefined.cjs +8 -1
- package/dist/is-undefined.mjs +7 -1
- package/dist/is-undefined.mjs.map +1 -1
- package/dist/is-url.cjs +16 -1
- package/dist/is-url.mjs +16 -1
- package/dist/is-url.mjs.map +1 -1
- package/dist/property-exists.cjs +31 -1
- package/dist/property-exists.mjs +30 -1
- package/dist/property-exists.mjs.map +1 -1
- package/dist/type-detect.cjs +54 -1
- package/dist/type-detect.mjs +54 -1
- package/dist/type-detect.mjs.map +1 -1
- package/dist/types/src/base.cjs +6 -1
- package/dist/types/src/base.mjs +5 -1
- package/dist/types/src/base.mjs.map +1 -1
- package/package.json +2 -2
package/dist/is-plain-object.mjs
CHANGED
|
@@ -1,2 +1,64 @@
|
|
|
1
|
-
import{getObjectTag
|
|
1
|
+
import { getObjectTag } from "./get-object-tag.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-plain-object.ts
|
|
4
|
+
/**
|
|
5
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
6
|
+
* and has a `typeof` result of "object".
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* isObjectLike({})
|
|
11
|
+
* // => true
|
|
12
|
+
*
|
|
13
|
+
* isObjectLike([1, 2, 3])
|
|
14
|
+
* // => true
|
|
15
|
+
*
|
|
16
|
+
* isObjectLike(Function)
|
|
17
|
+
* // => false
|
|
18
|
+
*
|
|
19
|
+
* isObjectLike(null)
|
|
20
|
+
* // => false
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to check.
|
|
24
|
+
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
25
|
+
*/
|
|
26
|
+
const isObjectLike = (obj) => {
|
|
27
|
+
return typeof obj === "object" && obj !== null;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* function Foo() {
|
|
35
|
+
* this.a = 1
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* isPlainObject(new Foo)
|
|
39
|
+
* // => false
|
|
40
|
+
*
|
|
41
|
+
* isPlainObject([1, 2, 3])
|
|
42
|
+
* // => false
|
|
43
|
+
*
|
|
44
|
+
* isPlainObject({ 'x': 0, 'y': 0 })
|
|
45
|
+
* // => true
|
|
46
|
+
*
|
|
47
|
+
* isPlainObject(Object.create(null))
|
|
48
|
+
* // => true
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param obj - The value to check.
|
|
52
|
+
* @returns Returns `true` if `obj` is a plain object, else `false`.
|
|
53
|
+
*/
|
|
54
|
+
const isPlainObject = (obj) => {
|
|
55
|
+
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
56
|
+
if (Object.getPrototypeOf(obj) === null) return true;
|
|
57
|
+
let proto = obj;
|
|
58
|
+
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
59
|
+
return Object.getPrototypeOf(obj) === proto;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { isObjectLike, isPlainObject };
|
|
2
64
|
//# sourceMappingURL=is-plain-object.mjs.map
|
|
@@ -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 = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== 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":"
|
|
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 = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== 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,QAAiB;AAC5C,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B5C,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"}
|
package/dist/is-primitive.cjs
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/is-primitive.ts
|
|
3
|
+
const isPrimitive = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.isPrimitive = isPrimitive;
|
package/dist/is-primitive.mjs
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/is-primitive.ts
|
|
2
|
+
const isPrimitive = (value) => {
|
|
3
|
+
try {
|
|
4
|
+
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
5
|
+
} catch {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isPrimitive };
|
|
2
12
|
//# sourceMappingURL=is-primitive.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-primitive.mjs","names":[],"sources":["../src/is-primitive.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 isPrimitive = (value: unknown): boolean => {\n try {\n return (\n value === undefined ||\n value === null ||\n (typeof value !== \"object\" && typeof value !== \"function\")\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-primitive.mjs","names":[],"sources":["../src/is-primitive.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 isPrimitive = (value: unknown): boolean => {\n try {\n return (\n value === undefined ||\n value === null ||\n (typeof value !== \"object\" && typeof value !== \"function\")\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAA4B;AACtD,KAAI;AACF,SACE,UAAU,UACV,UAAU,QACT,OAAO,UAAU,YAAY,OAAO,UAAU;SAE3C;AACN,SAAO"}
|
package/dist/is-promise.cjs
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_function = require('./is-function.cjs');
|
|
2
|
+
const require_is_object = require('./is-object.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/is-promise.ts
|
|
5
|
+
/**
|
|
6
|
+
* Check if the provided value's type is a promise
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the object provided is of type a promise
|
|
10
|
+
*/
|
|
11
|
+
const isPromise = (value) => {
|
|
12
|
+
return require_is_object.isObject(value) && require_is_function.isFunction(value?.then);
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Check if the provided value's type is a promise-like
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* A promise-like is an object that has a `then` function
|
|
19
|
+
*
|
|
20
|
+
* @param value - The value to type check
|
|
21
|
+
* @returns An indicator specifying if the object provided is of type a promise-like
|
|
22
|
+
*/
|
|
23
|
+
const isPromiseLike = (value) => typeof value?.then === "function";
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.isPromise = isPromise;
|
|
27
|
+
exports.isPromiseLike = isPromiseLike;
|
package/dist/is-promise.mjs
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
import{isFunction
|
|
1
|
+
import { isFunction } from "./is-function.mjs";
|
|
2
|
+
import { isObject } from "./is-object.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/is-promise.ts
|
|
5
|
+
/**
|
|
6
|
+
* Check if the provided value's type is a promise
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the object provided is of type a promise
|
|
10
|
+
*/
|
|
11
|
+
const isPromise = (value) => {
|
|
12
|
+
return isObject(value) && isFunction(value?.then);
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Check if the provided value's type is a promise-like
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* A promise-like is an object that has a `then` function
|
|
19
|
+
*
|
|
20
|
+
* @param value - The value to type check
|
|
21
|
+
* @returns An indicator specifying if the object provided is of type a promise-like
|
|
22
|
+
*/
|
|
23
|
+
const isPromiseLike = (value) => typeof value?.then === "function";
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { isPromise, isPromiseLike };
|
|
2
27
|
//# sourceMappingURL=is-promise.mjs.map
|
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":"
|
|
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;AACtE,QAAO,SAAS,MAAM,IAAI,WAAY,OAA4B,KAAK;;;;;;;;;;;AAYzE,MAAa,iBAAiB,UAC5B,OAAQ,OAAe,SAAS"}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/is-react-element.ts
|
|
3
|
+
const isReactElement = (value) => {
|
|
4
|
+
return value.$$typeof === (typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.isReactElement = isReactElement;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/is-react-element.ts
|
|
2
|
+
const isReactElement = (value) => {
|
|
3
|
+
return value.$$typeof === (typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103);
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isReactElement };
|
|
2
8
|
//# sourceMappingURL=is-react-element.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-react-element.mjs","names":[],"sources":["../src/is-react-element.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 isReactElement = (value: any) => {\n return (\n value.$$typeof ===\n (typeof Symbol === \"function\" && Symbol.for\n ? Symbol.for(\"react.element\")\n : 0xea_c7)\n );\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-react-element.mjs","names":[],"sources":["../src/is-react-element.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 isReactElement = (value: any) => {\n return (\n value.$$typeof ===\n (typeof Symbol === \"function\" && Symbol.for\n ? Symbol.for(\"react.element\")\n : 0xea_c7)\n );\n};\n"],"mappings":";AAkBA,MAAa,kBAAkB,UAAe;AAC5C,QACE,MAAM,cACL,OAAO,WAAW,cAAc,OAAO,MACpC,OAAO,IAAI,gBAAgB,GAC3B"}
|
package/dist/is-ref.cjs
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/is-ref.ts
|
|
3
|
+
/**
|
|
4
|
+
* Check if the provided value's type is a ref
|
|
5
|
+
*
|
|
6
|
+
* @param value - The value to type check
|
|
7
|
+
* @returns An indicator specifying if the object provided is of type ref
|
|
8
|
+
*/
|
|
9
|
+
const isRef = (value) => {
|
|
10
|
+
try {
|
|
11
|
+
return value?.current !== void 0;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.isRef = isRef;
|
package/dist/is-ref.mjs
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/is-ref.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the provided value's type is a ref
|
|
4
|
+
*
|
|
5
|
+
* @param value - The value to type check
|
|
6
|
+
* @returns An indicator specifying if the object provided is of type ref
|
|
7
|
+
*/
|
|
8
|
+
const isRef = (value) => {
|
|
9
|
+
try {
|
|
10
|
+
return value?.current !== void 0;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { isRef };
|
|
2
18
|
//# sourceMappingURL=is-ref.mjs.map
|
package/dist/is-ref.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-ref.mjs","names":[],"sources":["../src/is-ref.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 { RefObject } from \"@stryke/types/base\";\n\n/**\n * Check if the provided value's type is a ref\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type ref\n */\nexport const isRef = <TRef = unknown>(\n value: unknown\n): value is RefObject<TRef> => {\n try {\n return (value as RefObject<TRef>)?.current !== undefined;\n } catch {\n return false;\n }\n};\n"],"mappings":"AA0BA,MAAa,
|
|
1
|
+
{"version":3,"file":"is-ref.mjs","names":[],"sources":["../src/is-ref.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 { RefObject } from \"@stryke/types/base\";\n\n/**\n * Check if the provided value's type is a ref\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type ref\n */\nexport const isRef = <TRef = unknown>(\n value: unknown\n): value is RefObject<TRef> => {\n try {\n return (value as RefObject<TRef>)?.current !== undefined;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;AA0BA,MAAa,SACX,UAC6B;AAC7B,KAAI;AACF,SAAQ,OAA2B,YAAY;SACzC;AACN,SAAO"}
|
package/dist/is-regexp.cjs
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_get_object_tag = require('./get-object-tag.cjs');
|
|
2
|
+
const require_is_plain_object = require('./is-plain-object.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/is-regexp.ts
|
|
5
|
+
/**
|
|
6
|
+
* Checks if `value` is classified as a `isRegExp` object.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* isRegExp(new Date)
|
|
11
|
+
* // => true
|
|
12
|
+
*
|
|
13
|
+
* isRegExp('Mon April 23 2012')
|
|
14
|
+
* // => false
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param value - The value to check.
|
|
18
|
+
* @returns Returns `true` if `obj` is a isRegExp object, else `false`.
|
|
19
|
+
*/
|
|
20
|
+
const isRegExp = (value) => require_is_plain_object.isObjectLike(value) && require_get_object_tag.getObjectTag(value) === "[object RegExp]";
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.isRegExp = isRegExp;
|
package/dist/is-regexp.mjs
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import{getObjectTag
|
|
1
|
+
import { getObjectTag } from "./get-object-tag.mjs";
|
|
2
|
+
import { isObjectLike } from "./is-plain-object.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/is-regexp.ts
|
|
5
|
+
/**
|
|
6
|
+
* Checks if `value` is classified as a `isRegExp` object.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* isRegExp(new Date)
|
|
11
|
+
* // => true
|
|
12
|
+
*
|
|
13
|
+
* isRegExp('Mon April 23 2012')
|
|
14
|
+
* // => false
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param value - The value to check.
|
|
18
|
+
* @returns Returns `true` if `obj` is a isRegExp object, else `false`.
|
|
19
|
+
*/
|
|
20
|
+
const isRegExp = (value) => isObjectLike(value) && getObjectTag(value) === "[object RegExp]";
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isRegExp };
|
|
2
24
|
//# sourceMappingURL=is-regexp.mjs.map
|
package/dist/is-regexp.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-regexp.mjs","names":[],"sources":["../src/is-regexp.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 { getObjectTag } from \"./get-object-tag\";\nimport { isObjectLike } from \"./is-plain-object\";\n\n/**\n * Checks if `value` is classified as a `isRegExp` object.\n *\n * @example\n * ```typescript\n * isRegExp(new Date)\n * // => true\n *\n * isRegExp('Mon April 23 2012')\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `obj` is a isRegExp object, else `false`.\n */\nexport const isRegExp = (value: unknown): value is RegExp =>\n isObjectLike(value) && getObjectTag(value) === \"[object RegExp]\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-regexp.mjs","names":[],"sources":["../src/is-regexp.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 { getObjectTag } from \"./get-object-tag\";\nimport { isObjectLike } from \"./is-plain-object\";\n\n/**\n * Checks if `value` is classified as a `isRegExp` object.\n *\n * @example\n * ```typescript\n * isRegExp(new Date)\n * // => true\n *\n * isRegExp('Mon April 23 2012')\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `obj` is a isRegExp object, else `false`.\n */\nexport const isRegExp = (value: unknown): value is RegExp =>\n isObjectLike(value) && getObjectTag(value) === \"[object RegExp]\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,MAAa,YAAY,UACvB,aAAa,MAAM,IAAI,aAAa,MAAM,KAAK"}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_empty = require('./is-empty.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/is-select-option.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is SelectOption
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the object provided is of type SelectOption
|
|
9
|
+
*/
|
|
10
|
+
const isSelectOption = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !require_is_empty.isEmpty(value?.name) && "value" in value;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.isSelectOption = isSelectOption;
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import{isEmpty
|
|
1
|
+
import { isEmpty } from "./is-empty.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-select-option.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is SelectOption
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the object provided is of type SelectOption
|
|
9
|
+
*/
|
|
10
|
+
const isSelectOption = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !isEmpty(value?.name) && "value" in value;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isSelectOption };
|
|
2
20
|
//# sourceMappingURL=is-select-option.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-select-option.mjs","names":[],"sources":["../src/is-select-option.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 { SelectOption } from \"@stryke/types/form\";\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is SelectOption\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type SelectOption\n */\nexport const isSelectOption = (value: unknown): value is SelectOption => {\n try {\n return (\n !isEmpty((value as SelectOption)?.name) &&\n \"value\" in (value as SelectOption)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-select-option.mjs","names":[],"sources":["../src/is-select-option.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 { SelectOption } from \"@stryke/types/form\";\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is SelectOption\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is of type SelectOption\n */\nexport const isSelectOption = (value: unknown): value is SelectOption => {\n try {\n return (\n !isEmpty((value as SelectOption)?.name) &&\n \"value\" in (value as SelectOption)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA2BA,MAAa,kBAAkB,UAA0C;AACvE,KAAI;AACF,SACE,CAAC,QAAS,OAAwB,KAAK,IACvC,WAAY;SAER;AACN,SAAO"}
|
package/dist/is-set-array.cjs
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_array_like = require('./is-array-like.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/is-set-array.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value is a non-empty array-like object
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the object provided is a non-empty array-like object
|
|
9
|
+
*/
|
|
10
|
+
const isSetArray = (value) => {
|
|
11
|
+
return (Array.isArray(value) || require_is_array_like.isArrayLike(value)) && value.length > 0;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.isSetArray = isSetArray;
|
package/dist/is-set-array.mjs
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import{isArrayLike
|
|
1
|
+
import { isArrayLike } from "./is-array-like.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-set-array.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value is a non-empty array-like object
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the object provided is a non-empty array-like object
|
|
9
|
+
*/
|
|
10
|
+
const isSetArray = (value) => {
|
|
11
|
+
return (Array.isArray(value) || isArrayLike(value)) && value.length > 0;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isSetArray };
|
|
2
16
|
//# sourceMappingURL=is-set-array.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-array.mjs","names":[],"sources":["../src/is-set-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 { isArrayLike } from \"./is-array-like\";\n\n/**\n * Check if the provided value is a non-empty array-like object\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is a non-empty array-like object\n */\nexport const isSetArray = (value: any): boolean => {\n return (Array.isArray(value) || isArrayLike(value)) && value.length > 0;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set-array.mjs","names":[],"sources":["../src/is-set-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 { isArrayLike } from \"./is-array-like\";\n\n/**\n * Check if the provided value is a non-empty array-like object\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the object provided is a non-empty array-like object\n */\nexport const isSetArray = (value: any): boolean => {\n return (Array.isArray(value) || isArrayLike(value)) && value.length > 0;\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,cAAc,UAAwB;AACjD,SAAQ,MAAM,QAAQ,MAAM,IAAI,YAAY,MAAM,KAAK,MAAM,SAAS"}
|
package/dist/is-set-object.cjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_non_null_object = require('./is-non-null-object.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/is-set-object.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is an object with some fields set
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
9
|
+
*/
|
|
10
|
+
const isSetObject = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return require_is_non_null_object.isNonNullObject(value) && Object.keys(value).length > 0;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.isSetObject = isSetObject;
|
package/dist/is-set-object.mjs
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import{isNonNullObject
|
|
1
|
+
import { isNonNullObject } from "./is-non-null-object.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-set-object.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if the provided value's type is an object with some fields set
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
9
|
+
*/
|
|
10
|
+
const isSetObject = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return isNonNullObject(value) && Object.keys(value).length > 0;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isSetObject };
|
|
2
20
|
//# sourceMappingURL=is-set-object.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-object.mjs","names":[],"sources":["../src/is-set-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 { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n try {\n return isNonNullObject(value) && Object.keys(value).length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set-object.mjs","names":[],"sources":["../src/is-set-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 { isNonNullObject } from \"./is-non-null-object\";\n\n/**\n * Check if the provided value's type is an object with some fields set\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is an object with some fields se\n */\nexport const isSetObject = (value: unknown): value is NonNullable<object> => {\n try {\n return isNonNullObject(value) && Object.keys(value).length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,gBAAgB,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS;SACvD;AACN,SAAO"}
|
package/dist/is-set-string.cjs
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_string = require('./is-string.cjs');
|
|
2
|
+
const require_is_set = require('./is-set.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/is-set-string.ts
|
|
5
|
+
/**
|
|
6
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
10
|
+
*/
|
|
11
|
+
const isSetString = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return require_is_set.isSet(value) && require_is_string.isString(value) && value.length > 0;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.isSetString = isSetString;
|
package/dist/is-set-string.mjs
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import{isString
|
|
1
|
+
import { isString } from "./is-string.mjs";
|
|
2
|
+
import { isSet } from "./is-set.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/is-set-string.ts
|
|
5
|
+
/**
|
|
6
|
+
* Determine if the type is string and is not empty (length greater than zero)
|
|
7
|
+
*
|
|
8
|
+
* @param value - The value to type check
|
|
9
|
+
* @returns An indicator specifying if the value provided is of type `string` and length greater than zero
|
|
10
|
+
*/
|
|
11
|
+
const isSetString = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return isSet(value) && isString(value) && value.length > 0;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isSetString };
|
|
2
21
|
//# sourceMappingURL=is-set-string.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-string.mjs","names":[],"sources":["../src/is-set-string.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 { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set-string.mjs","names":[],"sources":["../src/is-set-string.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 { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,MAAM,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS;SACnD;AACN,SAAO"}
|
package/dist/is-set.cjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_is_empty = require('./is-empty.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/is-set.ts
|
|
4
|
+
/**
|
|
5
|
+
* The inverse of the `isEmpty` function
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
+
*/
|
|
10
|
+
const isSet = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !require_is_empty.isEmpty(value);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.isSet = isSet;
|
package/dist/is-set.mjs
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import{isEmpty
|
|
1
|
+
import { isEmpty } from "./is-empty.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/is-set.ts
|
|
4
|
+
/**
|
|
5
|
+
* The inverse of the `isEmpty` function
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to type check
|
|
8
|
+
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
+
*/
|
|
10
|
+
const isSet = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
return !isEmpty(value);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isSet };
|
|
2
20
|
//# sourceMappingURL=is-set.mjs.map
|
package/dist/is-set.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-set.mjs","names":[],"sources":["../src/is-set.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 * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-set.mjs","names":[],"sources":["../src/is-set.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 * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO"}
|
package/dist/is-string.cjs
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/is-string.ts
|
|
3
|
+
const isString = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return typeof value === "string";
|
|
6
|
+
} catch {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.isString = isString;
|