@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 +1,52 @@
1
- function e(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function t(e){switch(typeof e){case`number`:return!0;case`symbol`:return!1;case`string`:return!0}}exports.isDeepKey=e,exports.isKeyOrDeepKey=t;
1
+
2
+ //#region src/is-deep-key.ts
3
+ /**
4
+ * Checks if a given key is a deep key.
5
+ *
6
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
7
+ *
8
+ * @example
9
+ * isDeepKey('a.b') // true
10
+ * isDeepKey('a[b]') // true
11
+ * isDeepKey('a') // false
12
+ * isDeepKey(123) // false
13
+ * isDeepKey('a.b.c') // true
14
+ * isDeepKey('a[b][c]') // true
15
+ *
16
+ * @param key - The key to check.
17
+ * @returns Returns true if the key is a deep key, otherwise false.
18
+ */
19
+ function isDeepKey(key) {
20
+ switch (typeof key) {
21
+ case "number":
22
+ case "symbol": return false;
23
+ case "string": return key.includes(".") || key.includes("[") || key.includes("]");
24
+ }
25
+ }
26
+ /**
27
+ * Checks if a given key is a deep key or normal (shallow key).
28
+ *
29
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
30
+ *
31
+ * @example
32
+ * isDeepKey('a.b') // true
33
+ * isDeepKey('a[b]') // true
34
+ * isDeepKey('a') // true
35
+ * isDeepKey(123) // false
36
+ * isDeepKey('a.b.c') // true
37
+ * isDeepKey('a[b][c]') // true
38
+ *
39
+ * @param key - The key to check.
40
+ * @returns Returns true if the key is a deep key, otherwise false.
41
+ */
42
+ function isKeyOrDeepKey(key) {
43
+ switch (typeof key) {
44
+ case "number": return true;
45
+ case "symbol": return false;
46
+ case "string": return true;
47
+ }
48
+ }
49
+
50
+ //#endregion
51
+ exports.isDeepKey = isDeepKey;
52
+ exports.isKeyOrDeepKey = isKeyOrDeepKey;
@@ -1,2 +1,51 @@
1
- function e(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function t(e){switch(typeof e){case`number`:return!0;case`symbol`:return!1;case`string`:return!0}}export{e as isDeepKey,t as isKeyOrDeepKey};
1
+ //#region src/is-deep-key.ts
2
+ /**
3
+ * Checks if a given key is a deep key.
4
+ *
5
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
6
+ *
7
+ * @example
8
+ * isDeepKey('a.b') // true
9
+ * isDeepKey('a[b]') // true
10
+ * isDeepKey('a') // false
11
+ * isDeepKey(123) // false
12
+ * isDeepKey('a.b.c') // true
13
+ * isDeepKey('a[b][c]') // true
14
+ *
15
+ * @param key - The key to check.
16
+ * @returns Returns true if the key is a deep key, otherwise false.
17
+ */
18
+ function isDeepKey(key) {
19
+ switch (typeof key) {
20
+ case "number":
21
+ case "symbol": return false;
22
+ case "string": return key.includes(".") || key.includes("[") || key.includes("]");
23
+ }
24
+ }
25
+ /**
26
+ * Checks if a given key is a deep key or normal (shallow key).
27
+ *
28
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
29
+ *
30
+ * @example
31
+ * isDeepKey('a.b') // true
32
+ * isDeepKey('a[b]') // true
33
+ * isDeepKey('a') // true
34
+ * isDeepKey(123) // false
35
+ * isDeepKey('a.b.c') // true
36
+ * isDeepKey('a[b][c]') // true
37
+ *
38
+ * @param key - The key to check.
39
+ * @returns Returns true if the key is a deep key, otherwise false.
40
+ */
41
+ function isKeyOrDeepKey(key) {
42
+ switch (typeof key) {
43
+ case "number": return true;
44
+ case "symbol": return false;
45
+ case "string": return true;
46
+ }
47
+ }
48
+
49
+ //#endregion
50
+ export { isDeepKey, isKeyOrDeepKey };
2
51
  //# sourceMappingURL=is-deep-key.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-deep-key.mjs","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey } from \"@stryke/types/object\";\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\":\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return key.includes(\".\") || key.includes(\"[\") || key.includes(\"]\");\n }\n }\n}\n\n/**\n * Checks if a given key is a deep key or normal (shallow key).\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // true\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isKeyOrDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\": {\n return true;\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return true;\n }\n }\n}\n"],"mappings":"AAoCA,SAAgB,EAAU,EAAuC,CAC/D,OAAQ,OAAO,EAAf,CACE,IAAK,SACL,IAAK,SACH,MAAO,GAET,IAAK,SACH,OAAO,EAAI,SAAS,IAAI,EAAI,EAAI,SAAS,IAAI,EAAI,EAAI,SAAS,IAAI,EAqBxE,SAAgB,EAAe,EAAuC,CACpE,OAAQ,OAAO,EAAf,CACE,IAAK,SACH,MAAO,GAET,IAAK,SACH,MAAO,GAET,IAAK,SACH,MAAO"}
1
+ {"version":3,"file":"is-deep-key.mjs","names":[],"sources":["../src/is-deep-key.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey } from \"@stryke/types/object\";\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\":\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return key.includes(\".\") || key.includes(\"[\") || key.includes(\"]\");\n }\n }\n}\n\n/**\n * Checks if a given key is a deep key or normal (shallow key).\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @example\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // true\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n *\n * @param key - The key to check.\n * @returns Returns true if the key is a deep key, otherwise false.\n */\nexport function isKeyOrDeepKey(key: PropertyKey): key is DeepKey<any> {\n switch (typeof key) {\n case \"number\": {\n return true;\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return true;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAgB,UAAU,KAAuC;AAC/D,SAAQ,OAAO,KAAf;EACE,KAAK;EACL,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI;;;;;;;;;;;;;;;;;;;AAqBxE,SAAgB,eAAe,KAAuC;AACpE,SAAQ,OAAO,KAAf;EACE,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO"}
@@ -1 +1,33 @@
1
- const e=require(`./is-empty.cjs`),t=e=>{try{return!!e||Object.keys(e??{}).length===0}catch{return!0}},n=n=>{try{return e.isEmpty(n)||t(n)}catch{return!0}};exports.isEmptyObject=t,exports.isEmptyOrEmptyObject=n;
1
+ const require_is_empty = require('./is-empty.cjs');
2
+
3
+ //#region src/is-empty-object.ts
4
+ /**
5
+ * Check if the provided value's type is `{}`
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `{}`
9
+ */
10
+ const isEmptyObject = (value) => {
11
+ try {
12
+ return Boolean(value) || Object.keys(value ?? {}).length === 0;
13
+ } catch {
14
+ return true;
15
+ }
16
+ };
17
+ /**
18
+ * Check if the provided value's type is `null` or `undefined` or `{}`
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`
22
+ */
23
+ const isEmptyOrEmptyObject = (value) => {
24
+ try {
25
+ return require_is_empty.isEmpty(value) || isEmptyObject(value);
26
+ } catch {
27
+ return true;
28
+ }
29
+ };
30
+
31
+ //#endregion
32
+ exports.isEmptyObject = isEmptyObject;
33
+ exports.isEmptyOrEmptyObject = isEmptyOrEmptyObject;
@@ -1,2 +1,33 @@
1
- import{isEmpty as e}from"./is-empty.mjs";const t=e=>{try{return!!e||Object.keys(e??{}).length===0}catch{return!0}},n=n=>{try{return e(n)||t(n)}catch{return!0}};export{t as isEmptyObject,n as isEmptyOrEmptyObject};
1
+ import { isEmpty } from "./is-empty.mjs";
2
+
3
+ //#region src/is-empty-object.ts
4
+ /**
5
+ * Check if the provided value's type is `{}`
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `{}`
9
+ */
10
+ const isEmptyObject = (value) => {
11
+ try {
12
+ return Boolean(value) || Object.keys(value ?? {}).length === 0;
13
+ } catch {
14
+ return true;
15
+ }
16
+ };
17
+ /**
18
+ * Check if the provided value's type is `null` or `undefined` or `{}`
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`
22
+ */
23
+ const isEmptyOrEmptyObject = (value) => {
24
+ try {
25
+ return isEmpty(value) || isEmptyObject(value);
26
+ } catch {
27
+ return true;
28
+ }
29
+ };
30
+
31
+ //#endregion
32
+ export { isEmptyObject, isEmptyOrEmptyObject };
2
33
  //# sourceMappingURL=is-empty-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty-object.mjs","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `{}`\n */\nexport const isEmptyObject = (value: unknown): value is {} => {\n try {\n return Boolean(value) || Object.keys(value ?? {}).length === 0;\n } catch {\n return true;\n }\n};\n\n/**\n * Check if the provided value's type is `null` or `undefined` or `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`\n */\nexport const isEmptyOrEmptyObject = (value: unknown) => {\n try {\n return isEmpty(value) || isEmptyObject(value);\n } catch {\n return true;\n }\n};\n"],"mappings":"yCA0BA,MAAa,EAAiB,GAAgC,CAC5D,GAAI,CACF,MAAO,EAAQ,GAAU,OAAO,KAAK,GAAS,EAAE,CAAC,CAAC,SAAW,OACvD,CACN,MAAO,KAUE,EAAwB,GAAmB,CACtD,GAAI,CACF,OAAO,EAAQ,EAAM,EAAI,EAAc,EAAM,MACvC,CACN,MAAO"}
1
+ {"version":3,"file":"is-empty-object.mjs","names":[],"sources":["../src/is-empty-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * Check if the provided value's type is `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `{}`\n */\nexport const isEmptyObject = (value: unknown): value is {} => {\n try {\n return Boolean(value) || Object.keys(value ?? {}).length === 0;\n } catch {\n return true;\n }\n};\n\n/**\n * Check if the provided value's type is `null` or `undefined` or `{}`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`\n */\nexport const isEmptyOrEmptyObject = (value: unknown) => {\n try {\n return isEmpty(value) || isEmptyObject(value);\n } catch {\n return true;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,iBAAiB,UAAgC;AAC5D,KAAI;AACF,SAAO,QAAQ,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,WAAW;SACvD;AACN,SAAO;;;;;;;;;AAUX,MAAa,wBAAwB,UAAmB;AACtD,KAAI;AACF,SAAO,QAAQ,MAAM,IAAI,cAAc,MAAM;SACvC;AACN,SAAO"}
@@ -1 +1,20 @@
1
- const e=require(`./types/src/base.cjs`),t=require(`./is-string.cjs`),n=n=>{try{return t.isString(n)&&n===e.EMPTY_STRING}catch{return!1}};exports.isEmptyString=n;
1
+ const require_base = require('./types/src/base.cjs');
2
+ const require_is_string = require('./is-string.cjs');
3
+
4
+ //#region src/is-empty-string.ts
5
+ /**
6
+ * Determine if the type is string and is empty
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `""`
10
+ */
11
+ const isEmptyString = (value) => {
12
+ try {
13
+ return require_is_string.isString(value) && value === require_base.EMPTY_STRING;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ exports.isEmptyString = isEmptyString;
@@ -1,2 +1,21 @@
1
- import{EMPTY_STRING as e}from"./types/src/base.mjs";import{isString as t}from"./is-string.mjs";const n=n=>{try{return t(n)&&n===e}catch{return!1}};export{n as isEmptyString};
1
+ import { EMPTY_STRING } from "./types/src/base.mjs";
2
+ import { isString } from "./is-string.mjs";
3
+
4
+ //#region src/is-empty-string.ts
5
+ /**
6
+ * Determine if the type is string and is empty
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `""`
10
+ */
11
+ const isEmptyString = (value) => {
12
+ try {
13
+ return isString(value) && value === EMPTY_STRING;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ export { isEmptyString };
2
21
  //# sourceMappingURL=is-empty-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty-string.mjs","names":[],"sources":["../src/is-empty-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 { EMPTY_STRING } from \"@stryke/types/base\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is empty\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `\"\"`\n */\nexport const isEmptyString = (value: unknown): value is string => {\n try {\n return isString(value) && value === EMPTY_STRING;\n } catch {\n return false;\n }\n};\n"],"mappings":"+FA2BA,MAAa,EAAiB,GAAoC,CAChE,GAAI,CACF,OAAO,EAAS,EAAM,EAAI,IAAU,OAC9B,CACN,MAAO"}
1
+ {"version":3,"file":"is-empty-string.mjs","names":[],"sources":["../src/is-empty-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 { EMPTY_STRING } from \"@stryke/types/base\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is empty\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `\"\"`\n */\nexport const isEmptyString = (value: unknown): value is string => {\n try {\n return isString(value) && value === EMPTY_STRING;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,iBAAiB,UAAoC;AAChE,KAAI;AACF,SAAO,SAAS,MAAM,IAAI,UAAU;SAC9B;AACN,SAAO"}
package/dist/is-empty.cjs CHANGED
@@ -1 +1,38 @@
1
- const e=require(`./is-date.cjs`),t=require(`./is-function.cjs`),n=require(`./is-null.cjs`),r=require(`./is-number.cjs`),i=require(`./is-symbol.cjs`),a=require(`./is-undefined.cjs`),o=e=>{try{return a.isUndefined(e)||n.isNull(e)}catch{return!1}},s=n=>{if(n===!0||n===!1||n==null)return!0;if(r.isNumber(n))return n===0;if(e.isDate(n))return Number.isNaN(n.getTime());if(t.isFunction(n)||i.isSymbol(n))return!1;let{length:a}=n;if(r.isNumber(a))return a===0;let{size:o}=n;return r.isNumber(o)?o===0:Object.keys(n).length===0};exports.isEmpty=o,exports.isEmptyAnything=s;
1
+ const require_is_date = require('./is-date.cjs');
2
+ const require_is_function = require('./is-function.cjs');
3
+ const require_is_null = require('./is-null.cjs');
4
+ const require_is_number = require('./is-number.cjs');
5
+ const require_is_symbol = require('./is-symbol.cjs');
6
+ const require_is_undefined = require('./is-undefined.cjs');
7
+
8
+ //#region src/is-empty.ts
9
+ /**
10
+ * Check if the provided value's type is `null` or `undefined`
11
+ *
12
+ * @param value - The value to type check
13
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined`
14
+ */
15
+ const isEmpty = (value) => {
16
+ try {
17
+ return require_is_undefined.isUndefined(value) || require_is_null.isNull(value);
18
+ } catch {
19
+ return false;
20
+ }
21
+ };
22
+ const isEmptyAnything = (value) => {
23
+ if (value === true || value === false) return true;
24
+ if (value === null || value === void 0) return true;
25
+ if (require_is_number.isNumber(value)) return value === 0;
26
+ if (require_is_date.isDate(value)) return Number.isNaN(value.getTime());
27
+ if (require_is_function.isFunction(value)) return false;
28
+ if (require_is_symbol.isSymbol(value)) return false;
29
+ const { length } = value;
30
+ if (require_is_number.isNumber(length)) return length === 0;
31
+ const { size } = value;
32
+ if (require_is_number.isNumber(size)) return size === 0;
33
+ return Object.keys(value).length === 0;
34
+ };
35
+
36
+ //#endregion
37
+ exports.isEmpty = isEmpty;
38
+ exports.isEmptyAnything = isEmptyAnything;
package/dist/is-empty.mjs CHANGED
@@ -1,2 +1,38 @@
1
- import{isDate as e}from"./is-date.mjs";import{isFunction as t}from"./is-function.mjs";import{isNull as n}from"./is-null.mjs";import{isNumber as r}from"./is-number.mjs";import{isSymbol as i}from"./is-symbol.mjs";import{isUndefined as a}from"./is-undefined.mjs";const o=e=>{try{return a(e)||n(e)}catch{return!1}},s=n=>{if(n===!0||n===!1||n==null)return!0;if(r(n))return n===0;if(e(n))return Number.isNaN(n.getTime());if(t(n)||i(n))return!1;let{length:a}=n;if(r(a))return a===0;let{size:o}=n;return r(o)?o===0:Object.keys(n).length===0};export{o as isEmpty,s as isEmptyAnything};
1
+ import { isDate } from "./is-date.mjs";
2
+ import { isFunction } from "./is-function.mjs";
3
+ import { isNull } from "./is-null.mjs";
4
+ import { isNumber } from "./is-number.mjs";
5
+ import { isSymbol } from "./is-symbol.mjs";
6
+ import { isUndefined } from "./is-undefined.mjs";
7
+
8
+ //#region src/is-empty.ts
9
+ /**
10
+ * Check if the provided value's type is `null` or `undefined`
11
+ *
12
+ * @param value - The value to type check
13
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined`
14
+ */
15
+ const isEmpty = (value) => {
16
+ try {
17
+ return isUndefined(value) || isNull(value);
18
+ } catch {
19
+ return false;
20
+ }
21
+ };
22
+ const isEmptyAnything = (value) => {
23
+ if (value === true || value === false) return true;
24
+ if (value === null || value === void 0) return true;
25
+ if (isNumber(value)) return value === 0;
26
+ if (isDate(value)) return Number.isNaN(value.getTime());
27
+ if (isFunction(value)) return false;
28
+ if (isSymbol(value)) return false;
29
+ const { length } = value;
30
+ if (isNumber(length)) return length === 0;
31
+ const { size } = value;
32
+ if (isNumber(size)) return size === 0;
33
+ return Object.keys(value).length === 0;
34
+ };
35
+
36
+ //#endregion
37
+ export { isEmpty, isEmptyAnything };
2
38
  //# sourceMappingURL=is-empty.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty.mjs","names":[],"sources":["../src/is-empty.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 { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":"oQA+BA,MAAa,EAAW,GAAmB,CACzC,GAAI,CACF,OAAO,EAAY,EAAM,EAAI,EAAO,EAAM,MACpC,CACN,MAAO,KAIE,EAAmB,GAAe,CAE7C,GADI,IAAU,IAAQ,IAAU,IAC5B,GAAU,KAA6B,MAAO,GAClD,GAAI,EAAS,EAAM,CAAE,OAAO,IAAU,EACtC,GAAI,EAAO,EAAM,CAAE,OAAO,OAAO,MAAM,EAAM,SAAS,CAAC,CAEvD,GADI,EAAW,EAAM,EACjB,EAAS,EAAM,CAAE,MAAO,GAC5B,GAAM,CAAE,UAAW,EACnB,GAAI,EAAS,EAAO,CAAE,OAAO,IAAW,EACxC,GAAM,CAAE,QAAS,EAIjB,OAHI,EAAS,EAAK,CAAS,IAAS,EACvB,OAAO,KAAK,EAAM,CAAC,SAEhB"}
1
+ {"version":3,"file":"is-empty.mjs","names":[],"sources":["../src/is-empty.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 { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO;;;AAIX,MAAa,mBAAmB,UAAe;AAC7C,KAAI,UAAU,QAAQ,UAAU,MAAO,QAAO;AAC9C,KAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,KAAI,SAAS,MAAM,CAAE,QAAO,UAAU;AACtC,KAAI,OAAO,MAAM,CAAE,QAAO,OAAO,MAAM,MAAM,SAAS,CAAC;AACvD,KAAI,WAAW,MAAM,CAAE,QAAO;AAC9B,KAAI,SAAS,MAAM,CAAE,QAAO;CAC5B,MAAM,EAAE,WAAW;AACnB,KAAI,SAAS,OAAO,CAAE,QAAO,WAAW;CACxC,MAAM,EAAE,SAAS;AACjB,KAAI,SAAS,KAAK,CAAE,QAAO,SAAS;AAGpC,QAFa,OAAO,KAAK,MAAM,CAAC,WAEhB"}
package/dist/is-equal.cjs CHANGED
@@ -1 +1,19 @@
1
- const e=(t,n)=>{if(Object.is(t,n))return!0;if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();if(t instanceof RegExp&&n instanceof RegExp)return t.toString()===n.toString();if(typeof t!=`object`||!t||typeof n!=`object`||!n)return!1;let r=Reflect.ownKeys(t),i=Reflect.ownKeys(n);if(r.length!==i.length)return!1;for(let i of r)if(!Reflect.has(n,i)||!e(t[i],n[i]))return!1;return!0};exports.isEqual=e;
1
+
2
+ //#region src/is-equal.ts
3
+ const isEqual = (x, y) => {
4
+ if (Object.is(x, y)) return true;
5
+ if (x instanceof Date && y instanceof Date) return x.getTime() === y.getTime();
6
+ if (x instanceof RegExp && y instanceof RegExp) return x.toString() === y.toString();
7
+ if (typeof x !== "object" || x === null || typeof y !== "object" || y === null) return false;
8
+ const keysX = Reflect.ownKeys(x);
9
+ const keysY = Reflect.ownKeys(y);
10
+ if (keysX.length !== keysY.length) return false;
11
+ for (const element_ of keysX) {
12
+ if (!Reflect.has(y, element_)) return false;
13
+ if (!isEqual(x[element_], y[element_])) return false;
14
+ }
15
+ return true;
16
+ };
17
+
18
+ //#endregion
19
+ exports.isEqual = isEqual;
package/dist/is-equal.mjs CHANGED
@@ -1,2 +1,19 @@
1
- const e=(t,n)=>{if(Object.is(t,n))return!0;if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();if(t instanceof RegExp&&n instanceof RegExp)return t.toString()===n.toString();if(typeof t!=`object`||!t||typeof n!=`object`||!n)return!1;let r=Reflect.ownKeys(t),i=Reflect.ownKeys(n);if(r.length!==i.length)return!1;for(let i of r)if(!Reflect.has(n,i)||!e(t[i],n[i]))return!1;return!0};export{e as isEqual};
1
+ //#region src/is-equal.ts
2
+ const isEqual = (x, y) => {
3
+ if (Object.is(x, y)) return true;
4
+ if (x instanceof Date && y instanceof Date) return x.getTime() === y.getTime();
5
+ if (x instanceof RegExp && y instanceof RegExp) return x.toString() === y.toString();
6
+ if (typeof x !== "object" || x === null || typeof y !== "object" || y === null) return false;
7
+ const keysX = Reflect.ownKeys(x);
8
+ const keysY = Reflect.ownKeys(y);
9
+ if (keysX.length !== keysY.length) return false;
10
+ for (const element_ of keysX) {
11
+ if (!Reflect.has(y, element_)) return false;
12
+ if (!isEqual(x[element_], y[element_])) return false;
13
+ }
14
+ return true;
15
+ };
16
+
17
+ //#endregion
18
+ export { isEqual };
2
19
  //# sourceMappingURL=is-equal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-equal.mjs","names":[],"sources":["../src/is-equal.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isEqual = <TType>(x: TType, y: TType): boolean => {\n if (Object.is(x, y)) return true;\n if (x instanceof Date && y instanceof Date) {\n return x.getTime() === y.getTime();\n }\n if (x instanceof RegExp && y instanceof RegExp) {\n return x.toString() === y.toString();\n }\n if (\n typeof x !== \"object\" ||\n x === null ||\n typeof y !== \"object\" ||\n y === null\n ) {\n return false;\n }\n const keysX = Reflect.ownKeys(x as unknown as object) as (keyof typeof x)[];\n const keysY = Reflect.ownKeys(y as unknown as object);\n if (keysX.length !== keysY.length) return false;\n for (const element_ of keysX) {\n if (!Reflect.has(y as unknown as object, element_)) return false;\n if (!isEqual(x[element_], y[element_])) return false;\n }\n return true;\n};\n"],"mappings":"AAkBA,MAAa,GAAkB,EAAU,IAAsB,CAC7D,GAAI,OAAO,GAAG,EAAG,EAAE,CAAE,MAAO,GAC5B,GAAI,aAAa,MAAQ,aAAa,KACpC,OAAO,EAAE,SAAS,GAAK,EAAE,SAAS,CAEpC,GAAI,aAAa,QAAU,aAAa,OACtC,OAAO,EAAE,UAAU,GAAK,EAAE,UAAU,CAEtC,GACE,OAAO,GAAM,WACb,GACA,OAAO,GAAM,WACb,EAEA,MAAO,GAET,IAAM,EAAQ,QAAQ,QAAQ,EAAuB,CAC/C,EAAQ,QAAQ,QAAQ,EAAuB,CACrD,GAAI,EAAM,SAAW,EAAM,OAAQ,MAAO,GAC1C,IAAK,IAAM,KAAY,EAErB,GADI,CAAC,QAAQ,IAAI,EAAwB,EAAS,EAC9C,CAAC,EAAQ,EAAE,GAAW,EAAE,GAAU,CAAE,MAAO,GAEjD,MAAO"}
1
+ {"version":3,"file":"is-equal.mjs","names":[],"sources":["../src/is-equal.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isEqual = <TType>(x: TType, y: TType): boolean => {\n if (Object.is(x, y)) return true;\n if (x instanceof Date && y instanceof Date) {\n return x.getTime() === y.getTime();\n }\n if (x instanceof RegExp && y instanceof RegExp) {\n return x.toString() === y.toString();\n }\n if (\n typeof x !== \"object\" ||\n x === null ||\n typeof y !== \"object\" ||\n y === null\n ) {\n return false;\n }\n const keysX = Reflect.ownKeys(x as unknown as object) as (keyof typeof x)[];\n const keysY = Reflect.ownKeys(y as unknown as object);\n if (keysX.length !== keysY.length) return false;\n for (const element_ of keysX) {\n if (!Reflect.has(y as unknown as object, element_)) return false;\n if (!isEqual(x[element_], y[element_])) return false;\n }\n return true;\n};\n"],"mappings":";AAkBA,MAAa,WAAkB,GAAU,MAAsB;AAC7D,KAAI,OAAO,GAAG,GAAG,EAAE,CAAE,QAAO;AAC5B,KAAI,aAAa,QAAQ,aAAa,KACpC,QAAO,EAAE,SAAS,KAAK,EAAE,SAAS;AAEpC,KAAI,aAAa,UAAU,aAAa,OACtC,QAAO,EAAE,UAAU,KAAK,EAAE,UAAU;AAEtC,KACE,OAAO,MAAM,YACb,MAAM,QACN,OAAO,MAAM,YACb,MAAM,KAEN,QAAO;CAET,MAAM,QAAQ,QAAQ,QAAQ,EAAuB;CACrD,MAAM,QAAQ,QAAQ,QAAQ,EAAuB;AACrD,KAAI,MAAM,WAAW,MAAM,OAAQ,QAAO;AAC1C,MAAK,MAAM,YAAY,OAAO;AAC5B,MAAI,CAAC,QAAQ,IAAI,GAAwB,SAAS,CAAE,QAAO;AAC3D,MAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAE,QAAO;;AAEjD,QAAO"}
package/dist/is-error.cjs CHANGED
@@ -1 +1,29 @@
1
- const e=require(`./get-object-tag.cjs`),t=require(`./is-plain-object.cjs`),n=require(`./is-object.cjs`),r=r=>{if(!n.isObject(r))return!1;let i=e.getObjectTag(r);return i===`[object Error]`||i===`[object DOMException]`||typeof r?.message==`string`&&typeof r?.name==`string`&&!t.isPlainObject(r)};exports.isError=r;
1
+ const require_get_object_tag = require('./get-object-tag.cjs');
2
+ const require_is_plain_object = require('./is-plain-object.cjs');
3
+ const require_is_object = require('./is-object.cjs');
4
+
5
+ //#region src/is-error.ts
6
+ /**
7
+ * Checks if `obj` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
8
+ * `SyntaxError`, `TypeError`, or `URIError` object.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * isError(new Error)
13
+ * // => true
14
+ *
15
+ * isError(Error)
16
+ * // => false
17
+ * ```
18
+ *
19
+ * @param obj - The obj to check.
20
+ * @returns Returns `true` if `obj` is an error object, else `false`.
21
+ */
22
+ const isError = (obj) => {
23
+ if (!require_is_object.isObject(obj)) return false;
24
+ const tag = require_get_object_tag.getObjectTag(obj);
25
+ return tag === "[object Error]" || tag === "[object DOMException]" || typeof obj?.message === "string" && typeof obj?.name === "string" && !require_is_plain_object.isPlainObject(obj);
26
+ };
27
+
28
+ //#endregion
29
+ exports.isError = isError;
package/dist/is-error.mjs CHANGED
@@ -1,2 +1,30 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";import{isPlainObject as t}from"./is-plain-object.mjs";import{isObject as n}from"./is-object.mjs";const r=r=>{if(!n(r))return!1;let i=e(r);return i===`[object Error]`||i===`[object DOMException]`||typeof r?.message==`string`&&typeof r?.name==`string`&&!t(r)};export{r as isError};
1
+ import { getObjectTag } from "./get-object-tag.mjs";
2
+ import { isPlainObject } from "./is-plain-object.mjs";
3
+ import { isObject } from "./is-object.mjs";
4
+
5
+ //#region src/is-error.ts
6
+ /**
7
+ * Checks if `obj` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
8
+ * `SyntaxError`, `TypeError`, or `URIError` object.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * isError(new Error)
13
+ * // => true
14
+ *
15
+ * isError(Error)
16
+ * // => false
17
+ * ```
18
+ *
19
+ * @param obj - The obj to check.
20
+ * @returns Returns `true` if `obj` is an error object, else `false`.
21
+ */
22
+ const isError = (obj) => {
23
+ if (!isObject(obj)) return false;
24
+ const tag = getObjectTag(obj);
25
+ return tag === "[object Error]" || tag === "[object DOMException]" || typeof obj?.message === "string" && typeof obj?.name === "string" && !isPlainObject(obj);
26
+ };
27
+
28
+ //#endregion
29
+ export { isError };
2
30
  //# sourceMappingURL=is-error.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-error.mjs","names":[],"sources":["../src/is-error.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 { isObject } from \"./is-object\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n/**\n * Checks if `obj` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @example\n * ```typescript\n * isError(new Error)\n * // => true\n *\n * isError(Error)\n * // => false\n * ```\n *\n * @param obj - The obj to check.\n * @returns Returns `true` if `obj` is an error object, else `false`.\n */\nexport const isError = (obj: unknown): obj is Error => {\n if (!isObject(obj)) {\n return false;\n }\n\n const tag = getObjectTag(obj);\n\n return (\n tag === \"[object Error]\" ||\n tag === \"[object DOMException]\" ||\n (typeof (obj as Error)?.message === \"string\" &&\n typeof (obj as Error)?.name === \"string\" &&\n !isPlainObject(obj))\n );\n};\n"],"mappings":"qJAsCA,MAAa,EAAW,GAA+B,CACrD,GAAI,CAAC,EAAS,EAAI,CAChB,MAAO,GAGT,IAAM,EAAM,EAAa,EAAI,CAE7B,OACE,IAAQ,kBACR,IAAQ,yBACP,OAAQ,GAAe,SAAY,UAClC,OAAQ,GAAe,MAAS,UAChC,CAAC,EAAc,EAAI"}
1
+ {"version":3,"file":"is-error.mjs","names":[],"sources":["../src/is-error.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 { isObject } from \"./is-object\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n/**\n * Checks if `obj` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @example\n * ```typescript\n * isError(new Error)\n * // => true\n *\n * isError(Error)\n * // => false\n * ```\n *\n * @param obj - The obj to check.\n * @returns Returns `true` if `obj` is an error object, else `false`.\n */\nexport const isError = (obj: unknown): obj is Error => {\n if (!isObject(obj)) {\n return false;\n }\n\n const tag = getObjectTag(obj);\n\n return (\n tag === \"[object Error]\" ||\n tag === \"[object DOMException]\" ||\n (typeof (obj as Error)?.message === \"string\" &&\n typeof (obj as Error)?.name === \"string\" &&\n !isPlainObject(obj))\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,WAAW,QAA+B;AACrD,KAAI,CAAC,SAAS,IAAI,CAChB,QAAO;CAGT,MAAM,MAAM,aAAa,IAAI;AAE7B,QACE,QAAQ,oBACR,QAAQ,2BACP,OAAQ,KAAe,YAAY,YAClC,OAAQ,KAAe,SAAS,YAChC,CAAC,cAAc,IAAI"}
@@ -1 +1,21 @@
1
- const e=require(`./is-set-object.cjs`),t=require(`./is-set-string.cjs`),n=n=>e.isSetObject(n)&&`status`in n&&[`initialized`,`validated`,`uploaded`,`failed`].includes(n.status)&&(t.isSetString(n?.uri)||e.isSetObject(n?.file));exports.isFileResult=n;
1
+ const require_is_set_object = require('./is-set-object.cjs');
2
+ const require_is_set_string = require('./is-set-string.cjs');
3
+
4
+ //#region src/is-file-result.ts
5
+ /**
6
+ * Check if the provided value is a `FileResult` object
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is a `FileResult` object
10
+ */
11
+ const isFileResult = (value) => {
12
+ return require_is_set_object.isSetObject(value) && "status" in value && [
13
+ "initialized",
14
+ "validated",
15
+ "uploaded",
16
+ "failed"
17
+ ].includes(value.status) && (require_is_set_string.isSetString(value?.uri) || require_is_set_object.isSetObject(value?.file));
18
+ };
19
+
20
+ //#endregion
21
+ exports.isFileResult = isFileResult;
@@ -1,2 +1,22 @@
1
- import{isSetObject as e}from"./is-set-object.mjs";import{isSetString as t}from"./is-set-string.mjs";const n=n=>e(n)&&`status`in n&&[`initialized`,`validated`,`uploaded`,`failed`].includes(n.status)&&(t(n?.uri)||e(n?.file));export{n as isFileResult};
1
+ import { isSetObject } from "./is-set-object.mjs";
2
+ import { isSetString } from "./is-set-string.mjs";
3
+
4
+ //#region src/is-file-result.ts
5
+ /**
6
+ * Check if the provided value is a `FileResult` object
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is a `FileResult` object
10
+ */
11
+ const isFileResult = (value) => {
12
+ return isSetObject(value) && "status" in value && [
13
+ "initialized",
14
+ "validated",
15
+ "uploaded",
16
+ "failed"
17
+ ].includes(value.status) && (isSetString(value?.uri) || isSetObject(value?.file));
18
+ };
19
+
20
+ //#endregion
21
+ export { isFileResult };
2
22
  //# sourceMappingURL=is-file-result.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-file-result.mjs","names":[],"sources":["../src/is-file-result.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 { FileResult, FileStatus } from \"@stryke/types/file\";\nimport { isSetObject } from \"./is-set-object\";\nimport { isSetString } from \"./is-set-string\";\n\n/**\n * Check if the provided value is a `FileResult` object\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a `FileResult` object\n */\nexport const isFileResult = (value: any): value is FileResult => {\n return (\n isSetObject(value) &&\n \"status\" in value &&\n [\"initialized\", \"validated\", \"uploaded\", \"failed\"].includes(\n value.status as FileStatus\n ) &&\n (isSetString((value as FileResult)?.uri) ||\n isSetObject((value as FileResult)?.file))\n );\n};\n"],"mappings":"oGA4BA,MAAa,EAAgB,GAEzB,EAAY,EAAM,EAClB,WAAY,GACZ,CAAC,cAAe,YAAa,WAAY,SAAS,CAAC,SACjD,EAAM,OACP,GACA,EAAa,GAAsB,IAAI,EACtC,EAAa,GAAsB,KAAK"}
1
+ {"version":3,"file":"is-file-result.mjs","names":[],"sources":["../src/is-file-result.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 { FileResult, FileStatus } from \"@stryke/types/file\";\nimport { isSetObject } from \"./is-set-object\";\nimport { isSetString } from \"./is-set-string\";\n\n/**\n * Check if the provided value is a `FileResult` object\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a `FileResult` object\n */\nexport const isFileResult = (value: any): value is FileResult => {\n return (\n isSetObject(value) &&\n \"status\" in value &&\n [\"initialized\", \"validated\", \"uploaded\", \"failed\"].includes(\n value.status as FileStatus\n ) &&\n (isSetString((value as FileResult)?.uri) ||\n isSetObject((value as FileResult)?.file))\n );\n};\n"],"mappings":";;;;;;;;;;AA4BA,MAAa,gBAAgB,UAAoC;AAC/D,QACE,YAAY,MAAM,IAClB,YAAY,SACZ;EAAC;EAAe;EAAa;EAAY;EAAS,CAAC,SACjD,MAAM,OACP,KACA,YAAa,OAAsB,IAAI,IACtC,YAAa,OAAsB,KAAK"}
package/dist/is-float.cjs CHANGED
@@ -1 +1,13 @@
1
- const e=require(`./is-number.cjs`),t=t=>e.isNumber(t)&&t%1!=0;exports.isFloat=t;
1
+ const require_is_number = require('./is-number.cjs');
2
+
3
+ //#region src/is-float.ts
4
+ /**
5
+ * Check if the provided value's type is a float
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `number` and is a float
9
+ */
10
+ const isFloat = (value) => require_is_number.isNumber(value) && value % 1 !== 0;
11
+
12
+ //#endregion
13
+ exports.isFloat = isFloat;
package/dist/is-float.mjs CHANGED
@@ -1,2 +1,14 @@
1
- import{isNumber as e}from"./is-number.mjs";const t=t=>e(t)&&t%1!=0;export{t as isFloat};
1
+ import { isNumber } from "./is-number.mjs";
2
+
3
+ //#region src/is-float.ts
4
+ /**
5
+ * Check if the provided value's type is a float
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `number` and is a float
9
+ */
10
+ const isFloat = (value) => isNumber(value) && value % 1 !== 0;
11
+
12
+ //#endregion
13
+ export { isFloat };
2
14
  //# sourceMappingURL=is-float.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-float.mjs","names":[],"sources":["../src/is-float.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 { Float } from \"@stryke/types/number\";\nimport { isNumber } from \"./is-number\";\n\n/**\n * Check if the provided value's type is a float\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number` and is a float\n */\nexport const isFloat = <T extends number>(value: T): value is Float<T> =>\n isNumber(value) && value % 1 !== 0;\n"],"mappings":"2CA2BA,MAAa,EAA6B,GACxC,EAAS,EAAM,EAAI,EAAQ,GAAM"}
1
+ {"version":3,"file":"is-float.mjs","names":[],"sources":["../src/is-float.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 { Float } from \"@stryke/types/number\";\nimport { isNumber } from \"./is-number\";\n\n/**\n * Check if the provided value's type is a float\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number` and is a float\n */\nexport const isFloat = <T extends number>(value: T): value is Float<T> =>\n isNumber(value) && value % 1 !== 0;\n"],"mappings":";;;;;;;;;AA2BA,MAAa,WAA6B,UACxC,SAAS,MAAM,IAAI,QAAQ,MAAM"}