@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/get-object-tag.cjs +15 -1
  3. package/dist/get-object-tag.mjs +14 -1
  4. package/dist/get-object-tag.mjs.map +1 -1
  5. package/dist/index.cjs +100 -1
  6. package/dist/index.mjs +45 -1
  7. package/dist/is-array-like.cjs +17 -1
  8. package/dist/is-array-like.mjs +17 -1
  9. package/dist/is-array-like.mjs.map +1 -1
  10. package/dist/is-async-iterable.cjs +16 -1
  11. package/dist/is-async-iterable.mjs +16 -1
  12. package/dist/is-async-iterable.mjs.map +1 -1
  13. package/dist/is-bigint.cjs +22 -1
  14. package/dist/is-bigint.mjs +22 -1
  15. package/dist/is-bigint.mjs.map +1 -1
  16. package/dist/is-boolean.cjs +18 -1
  17. package/dist/is-boolean.mjs +17 -1
  18. package/dist/is-boolean.mjs.map +1 -1
  19. package/dist/is-buffer.cjs +13 -1
  20. package/dist/is-buffer.mjs +11 -1
  21. package/dist/is-buffer.mjs.map +1 -1
  22. package/dist/is-collection.cjs +22 -1
  23. package/dist/is-collection.mjs +22 -1
  24. package/dist/is-collection.mjs.map +1 -1
  25. package/dist/is-date.cjs +23 -1
  26. package/dist/is-date.mjs +23 -1
  27. package/dist/is-date.mjs.map +1 -1
  28. package/dist/is-deep-key.cjs +52 -1
  29. package/dist/is-deep-key.mjs +50 -1
  30. package/dist/is-deep-key.mjs.map +1 -1
  31. package/dist/is-empty-object.cjs +33 -1
  32. package/dist/is-empty-object.mjs +32 -1
  33. package/dist/is-empty-object.mjs.map +1 -1
  34. package/dist/is-empty-string.cjs +20 -1
  35. package/dist/is-empty-string.mjs +20 -1
  36. package/dist/is-empty-string.mjs.map +1 -1
  37. package/dist/is-empty.cjs +38 -1
  38. package/dist/is-empty.mjs +37 -1
  39. package/dist/is-empty.mjs.map +1 -1
  40. package/dist/is-equal.cjs +19 -1
  41. package/dist/is-equal.mjs +18 -1
  42. package/dist/is-equal.mjs.map +1 -1
  43. package/dist/is-error.cjs +29 -1
  44. package/dist/is-error.mjs +29 -1
  45. package/dist/is-error.mjs.map +1 -1
  46. package/dist/is-file-result.cjs +21 -1
  47. package/dist/is-file-result.mjs +21 -1
  48. package/dist/is-file-result.mjs.map +1 -1
  49. package/dist/is-float.cjs +13 -1
  50. package/dist/is-float.mjs +13 -1
  51. package/dist/is-float.mjs.map +1 -1
  52. package/dist/is-function.cjs +27 -1
  53. package/dist/is-function.mjs +25 -1
  54. package/dist/is-function.mjs.map +1 -1
  55. package/dist/is-integer.cjs +14 -1
  56. package/dist/is-integer.mjs +14 -1
  57. package/dist/is-integer.mjs.map +1 -1
  58. package/dist/is-mergeable-object.cjs +14 -1
  59. package/dist/is-mergeable-object.mjs +14 -1
  60. package/dist/is-mergeable-object.mjs.map +1 -1
  61. package/dist/is-non-null-object.cjs +16 -1
  62. package/dist/is-non-null-object.mjs +16 -1
  63. package/dist/is-non-null-object.mjs.map +1 -1
  64. package/dist/is-not-empty.cjs +21 -1
  65. package/dist/is-not-empty.mjs +21 -1
  66. package/dist/is-not-empty.mjs.map +1 -1
  67. package/dist/is-null.cjs +12 -1
  68. package/dist/is-null.mjs +11 -1
  69. package/dist/is-null.mjs.map +1 -1
  70. package/dist/is-number.cjs +29 -1
  71. package/dist/is-number.mjs +28 -1
  72. package/dist/is-number.mjs.map +1 -1
  73. package/dist/is-object-index.cjs +19 -1
  74. package/dist/is-object-index.mjs +18 -1
  75. package/dist/is-object-index.mjs.map +1 -1
  76. package/dist/is-object.cjs +47 -1
  77. package/dist/is-object.mjs +44 -1
  78. package/dist/is-object.mjs.map +1 -1
  79. package/dist/is-plain-object.cjs +64 -1
  80. package/dist/is-plain-object.mjs +63 -1
  81. package/dist/is-plain-object.mjs.map +1 -1
  82. package/dist/is-primitive.cjs +12 -1
  83. package/dist/is-primitive.mjs +11 -1
  84. package/dist/is-primitive.mjs.map +1 -1
  85. package/dist/is-promise.cjs +27 -1
  86. package/dist/is-promise.mjs +26 -1
  87. package/dist/is-promise.mjs.map +1 -1
  88. package/dist/is-react-element.cjs +8 -1
  89. package/dist/is-react-element.mjs +7 -1
  90. package/dist/is-react-element.mjs.map +1 -1
  91. package/dist/is-ref.cjs +18 -1
  92. package/dist/is-ref.mjs +17 -1
  93. package/dist/is-ref.mjs.map +1 -1
  94. package/dist/is-regexp.cjs +23 -1
  95. package/dist/is-regexp.mjs +23 -1
  96. package/dist/is-regexp.mjs.map +1 -1
  97. package/dist/is-select-option.cjs +19 -1
  98. package/dist/is-select-option.mjs +19 -1
  99. package/dist/is-select-option.mjs.map +1 -1
  100. package/dist/is-set-array.cjs +15 -1
  101. package/dist/is-set-array.mjs +15 -1
  102. package/dist/is-set-array.mjs.map +1 -1
  103. package/dist/is-set-object.cjs +19 -1
  104. package/dist/is-set-object.mjs +19 -1
  105. package/dist/is-set-object.mjs.map +1 -1
  106. package/dist/is-set-string.cjs +20 -1
  107. package/dist/is-set-string.mjs +20 -1
  108. package/dist/is-set-string.mjs.map +1 -1
  109. package/dist/is-set.cjs +19 -1
  110. package/dist/is-set.mjs +19 -1
  111. package/dist/is-set.mjs.map +1 -1
  112. package/dist/is-string.cjs +12 -1
  113. package/dist/is-string.mjs +11 -1
  114. package/dist/is-string.mjs.map +1 -1
  115. package/dist/is-symbol.cjs +12 -1
  116. package/dist/is-symbol.mjs +11 -1
  117. package/dist/is-symbol.mjs.map +1 -1
  118. package/dist/is-typed-array.cjs +8 -1
  119. package/dist/is-typed-array.mjs +7 -1
  120. package/dist/is-typed-array.mjs.map +1 -1
  121. package/dist/is-typed.cjs +20 -1
  122. package/dist/is-typed.mjs +20 -1
  123. package/dist/is-typed.mjs.map +1 -1
  124. package/dist/is-undefined.cjs +8 -1
  125. package/dist/is-undefined.mjs +7 -1
  126. package/dist/is-undefined.mjs.map +1 -1
  127. package/dist/is-url.cjs +16 -1
  128. package/dist/is-url.mjs +16 -1
  129. package/dist/is-url.mjs.map +1 -1
  130. package/dist/property-exists.cjs +31 -1
  131. package/dist/property-exists.mjs +30 -1
  132. package/dist/property-exists.mjs.map +1 -1
  133. package/dist/type-detect.cjs +54 -1
  134. package/dist/type-detect.mjs +54 -1
  135. package/dist/type-detect.mjs.map +1 -1
  136. package/dist/types/src/base.cjs +6 -1
  137. package/dist/types/src/base.mjs +5 -1
  138. package/dist/types/src/base.mjs.map +1 -1
  139. package/package.json +2 -2
@@ -1,2 +1,64 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";const t=e=>typeof e==`object`&&!!e,n=n=>{if(!t(n)||e(n)!==`[object Object]`)return!1;if(Object.getPrototypeOf(n)===null)return!0;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r};export{t as isObjectLike,n as isPlainObject};
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":"oDA2CA,MAAa,EAAgB,GACpB,OAAO,GAAQ,YAAY,EA4BvB,EAAiB,GAAqC,CACjE,GAAI,CAAC,EAAa,EAAI,EAAI,EAAa,EAAI,GAAK,kBAC9C,MAAO,GAET,GAAI,OAAO,eAAe,EAAI,GAAK,KACjC,MAAO,GAET,IAAI,EAAQ,EACZ,KAAO,OAAO,eAAe,EAAM,GAAK,MACtC,EAAQ,OAAO,eAAe,EAAM,CAEtC,OAAO,OAAO,eAAe,EAAI,GAAK"}
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"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};exports.isPrimitive=e;
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;
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};export{e as isPrimitive};
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,EAAe,GAA4B,CACtD,GAAI,CACF,OACE,GACU,MACT,OAAO,GAAU,UAAY,OAAO,GAAU,gBAE3C,CACN,MAAO"}
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"}
@@ -1 +1,27 @@
1
- const e=require(`./is-function.cjs`),t=require(`./is-object.cjs`),n=n=>t.isObject(n)&&e.isFunction(n?.then),r=e=>typeof e?.then==`function`;exports.isPromise=n,exports.isPromiseLike=r;
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;
@@ -1,2 +1,27 @@
1
- import{isFunction as e}from"./is-function.mjs";import{isObject as t}from"./is-object.mjs";const n=n=>t(n)&&e(n?.then),r=e=>typeof e?.then==`function`;export{n as isPromise,r as isPromiseLike};
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
@@ -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":"0FA2BA,MAAa,EAAa,GACjB,EAAS,EAAM,EAAI,EAAY,GAA4B,KAAK,CAY5D,EAAiB,GAC5B,OAAQ,GAAe,MAAS"}
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
- const e=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103);exports.isReactElement=e;
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
- const e=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103);export{e as isReactElement};
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,EAAkB,GAE3B,EAAM,YACL,OAAO,QAAW,YAAc,OAAO,IACpC,OAAO,IAAI,gBAAgB,CAC3B"}
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
- const e=e=>{try{return e?.current!==void 0}catch{return!1}};exports.isRef=e;
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
- const e=e=>{try{return e?.current!==void 0}catch{return!1}};export{e as isRef};
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
@@ -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,EACX,GAC6B,CAC7B,GAAI,CACF,OAAQ,GAA2B,UAAY,IAAA,QACzC,CACN,MAAO"}
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"}
@@ -1 +1,23 @@
1
- const e=require(`./get-object-tag.cjs`),t=require(`./is-plain-object.cjs`),n=n=>t.isObjectLike(n)&&e.getObjectTag(n)===`[object RegExp]`;exports.isRegExp=n;
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;
@@ -1,2 +1,24 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";import{isObjectLike as t}from"./is-plain-object.mjs";const n=n=>t(n)&&e(n)===`[object RegExp]`;export{n as isRegExp};
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
@@ -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":"yGAoCA,MAAa,EAAY,GACvB,EAAa,EAAM,EAAI,EAAa,EAAM,GAAK"}
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 e=require(`./is-empty.cjs`),t=t=>{try{return!e.isEmpty(t?.name)&&`value`in t}catch{return!1}};exports.isSelectOption=t;
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 as e}from"./is-empty.mjs";const t=t=>{try{return!e(t?.name)&&`value`in t}catch{return!1}};export{t as isSelectOption};
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":"yCA2BA,MAAa,EAAkB,GAA0C,CACvE,GAAI,CACF,MACE,CAAC,EAAS,GAAwB,KAAK,EACvC,UAAY,OAER,CACN,MAAO"}
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"}
@@ -1 +1,15 @@
1
- const e=require(`./is-array-like.cjs`),t=t=>(Array.isArray(t)||e.isArrayLike(t))&&t.length>0;exports.isSetArray=t;
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;
@@ -1,2 +1,16 @@
1
- import{isArrayLike as e}from"./is-array-like.mjs";const t=t=>(Array.isArray(t)||e(t))&&t.length>0;export{t as isSetArray};
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":"kDA0BA,MAAa,EAAc,IACjB,MAAM,QAAQ,EAAM,EAAI,EAAY,EAAM,GAAK,EAAM,OAAS"}
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"}
@@ -1 +1,19 @@
1
- const e=require(`./is-non-null-object.cjs`),t=t=>{try{return e.isNonNullObject(t)&&Object.keys(t).length>0}catch{return!1}};exports.isSetObject=t;
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;
@@ -1,2 +1,20 @@
1
- import{isNonNullObject as e}from"./is-non-null-object.mjs";const t=t=>{try{return e(t)&&Object.keys(t).length>0}catch{return!1}};export{t as isSetObject};
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":"2DA0BA,MAAa,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAgB,EAAM,EAAI,OAAO,KAAK,EAAM,CAAC,OAAS,OACvD,CACN,MAAO"}
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"}
@@ -1 +1,20 @@
1
- const e=require(`./is-string.cjs`),t=require(`./is-set.cjs`),n=n=>{try{return t.isSet(n)&&e.isString(n)&&n.length>0}catch{return!1}};exports.isSetString=n;
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;
@@ -1,2 +1,21 @@
1
- import{isString as e}from"./is-string.mjs";import{isSet as t}from"./is-set.mjs";const n=n=>{try{return t(n)&&e(n)&&n.length>0}catch{return!1}};export{n as isSetString};
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":"gFA2BA,MAAa,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAM,EAAM,EAAI,EAAS,EAAM,EAAI,EAAM,OAAS,OACnD,CACN,MAAO"}
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 e=require(`./is-empty.cjs`),t=t=>{try{return!e.isEmpty(t)}catch{return!1}};exports.isSet=t;
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 as e}from"./is-empty.mjs";const t=t=>{try{return!e(t)}catch{return!1}};export{t as isSet};
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
@@ -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":"yCA0BA,MAAa,EAAS,GAAkD,CACtE,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,MAChB,CACN,MAAO"}
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"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return typeof e==`string`}catch{return!1}};exports.isString=e;
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;