@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,27 @@
1
- const e=require(`./get-object-tag.cjs`);function t(t){return e.getObjectTag(t)===`[object Function]`}function n(t){return e.getObjectTag(t)===`[object AsyncFunction]`}const r=e=>{try{return e instanceof Function||typeof e==`function`||!!(e?.constructor&&e?.call&&e?.apply)||t(e)||n(e)}catch{return!1}};exports.isAsyncFunction=n,exports.isFunction=r,exports.isSyncFunction=t;
1
+ const require_get_object_tag = require('./get-object-tag.cjs');
2
+
3
+ //#region src/is-function.ts
4
+ function isSyncFunction(value) {
5
+ return require_get_object_tag.getObjectTag(value) === "[object Function]";
6
+ }
7
+ function isAsyncFunction(value) {
8
+ return require_get_object_tag.getObjectTag(value) === "[object AsyncFunction]";
9
+ }
10
+ /**
11
+ * Check if the provided value's type is `Function`
12
+ *
13
+ * @param value - The value to type check
14
+ * @returns An indicator specifying if the value provided is of type `Function`
15
+ */
16
+ const isFunction = (value) => {
17
+ try {
18
+ return value instanceof Function || typeof value === "function" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);
19
+ } catch {
20
+ return false;
21
+ }
22
+ };
23
+
24
+ //#endregion
25
+ exports.isAsyncFunction = isAsyncFunction;
26
+ exports.isFunction = isFunction;
27
+ exports.isSyncFunction = isSyncFunction;
@@ -1,2 +1,26 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";function t(t){return e(t)===`[object Function]`}function n(t){return e(t)===`[object AsyncFunction]`}const r=e=>{try{return e instanceof Function||typeof e==`function`||!!(e?.constructor&&e?.call&&e?.apply)||t(e)||n(e)}catch{return!1}};export{n as isAsyncFunction,r as isFunction,t as isSyncFunction};
1
+ import { getObjectTag } from "./get-object-tag.mjs";
2
+
3
+ //#region src/is-function.ts
4
+ function isSyncFunction(value) {
5
+ return getObjectTag(value) === "[object Function]";
6
+ }
7
+ function isAsyncFunction(value) {
8
+ return getObjectTag(value) === "[object AsyncFunction]";
9
+ }
10
+ /**
11
+ * Check if the provided value's type is `Function`
12
+ *
13
+ * @param value - The value to type check
14
+ * @returns An indicator specifying if the value provided is of type `Function`
15
+ */
16
+ const isFunction = (value) => {
17
+ try {
18
+ return value instanceof Function || typeof value === "function" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);
19
+ } catch {
20
+ return false;
21
+ }
22
+ };
23
+
24
+ //#endregion
25
+ export { isAsyncFunction, isFunction, isSyncFunction };
2
26
  //# sourceMappingURL=is-function.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-function.mjs","names":[],"sources":["../src/is-function.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 { AnyFunction } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\nexport function isSyncFunction(value?: any): value is AnyFunction {\n return getObjectTag(value) === \"[object Function]\";\n}\n\nexport function isAsyncFunction(value?: any): value is AnyFunction {\n return getObjectTag(value) === \"[object AsyncFunction]\";\n}\n\n/**\n * Check if the provided value's type is `Function`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Function`\n */\nexport const isFunction = (value: unknown): value is AnyFunction => {\n try {\n return (\n value instanceof Function ||\n typeof value === \"function\" ||\n Boolean(\n value?.constructor && (value as any)?.call && (value as any)?.apply\n ) ||\n isSyncFunction(value) ||\n isAsyncFunction(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"oDAqBA,SAAgB,EAAe,EAAmC,CAChE,OAAO,EAAa,EAAM,GAAK,oBAGjC,SAAgB,EAAgB,EAAmC,CACjE,OAAO,EAAa,EAAM,GAAK,yBASjC,MAAa,EAAc,GAAyC,CAClE,GAAI,CACF,OACE,aAAiB,UACjB,OAAO,GAAU,YACjB,GACE,GAAO,aAAgB,GAAe,MAAS,GAAe,QAEhE,EAAe,EAAM,EACrB,EAAgB,EAAM,MAElB,CACN,MAAO"}
1
+ {"version":3,"file":"is-function.mjs","names":[],"sources":["../src/is-function.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 { AnyFunction } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\nexport function isSyncFunction(value?: any): value is AnyFunction {\n return getObjectTag(value) === \"[object Function]\";\n}\n\nexport function isAsyncFunction(value?: any): value is AnyFunction {\n return getObjectTag(value) === \"[object AsyncFunction]\";\n}\n\n/**\n * Check if the provided value's type is `Function`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Function`\n */\nexport const isFunction = (value: unknown): value is AnyFunction => {\n try {\n return (\n value instanceof Function ||\n typeof value === \"function\" ||\n Boolean(\n value?.constructor && (value as any)?.call && (value as any)?.apply\n ) ||\n isSyncFunction(value) ||\n isAsyncFunction(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;AAqBA,SAAgB,eAAe,OAAmC;AAChE,QAAO,aAAa,MAAM,KAAK;;AAGjC,SAAgB,gBAAgB,OAAmC;AACjE,QAAO,aAAa,MAAM,KAAK;;;;;;;;AASjC,MAAa,cAAc,UAAyC;AAClE,KAAI;AACF,SACE,iBAAiB,YACjB,OAAO,UAAU,cACjB,QACE,OAAO,eAAgB,OAAe,QAAS,OAAe,MAC/D,IACD,eAAe,MAAM,IACrB,gBAAgB,MAAM;SAElB;AACN,SAAO"}
@@ -1 +1,14 @@
1
- const e=require(`./is-number.cjs`),t=require(`./is-string.cjs`),n=n=>!t.isString(n)&&e.isNumber(n)&&n%1==0;exports.isInteger=n;
1
+ const require_is_number = require('./is-number.cjs');
2
+ const require_is_string = require('./is-string.cjs');
3
+
4
+ //#region src/is-integer.ts
5
+ /**
6
+ * Check if the provided value's type is an integer
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `number` and is an integer
10
+ */
11
+ const isInteger = (value) => !require_is_string.isString(value) && require_is_number.isNumber(value) && value % 1 === 0;
12
+
13
+ //#endregion
14
+ exports.isInteger = isInteger;
@@ -1,2 +1,15 @@
1
- import{isNumber as e}from"./is-number.mjs";import{isString as t}from"./is-string.mjs";const n=n=>!t(n)&&e(n)&&n%1==0;export{n as isInteger};
1
+ import { isNumber } from "./is-number.mjs";
2
+ import { isString } from "./is-string.mjs";
3
+
4
+ //#region src/is-integer.ts
5
+ /**
6
+ * Check if the provided value's type is an integer
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `number` and is an integer
10
+ */
11
+ const isInteger = (value) => !isString(value) && isNumber(value) && value % 1 === 0;
12
+
13
+ //#endregion
14
+ export { isInteger };
2
15
  //# sourceMappingURL=is-integer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-integer.mjs","names":[],"sources":["../src/is-integer.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 { isNumber } from \"./is-number\";\nimport { isString } from \"./is-string\";\n\n/**\n * Check if the provided value's type is an integer\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number` and is an integer\n */\nexport const isInteger = (value: unknown): boolean =>\n !isString(value) && isNumber(value) && value % 1 === 0;\n"],"mappings":"sFA2BA,MAAa,EAAa,GACxB,CAAC,EAAS,EAAM,EAAI,EAAS,EAAM,EAAI,EAAQ,GAAM"}
1
+ {"version":3,"file":"is-integer.mjs","names":[],"sources":["../src/is-integer.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 { isNumber } from \"./is-number\";\nimport { isString } from \"./is-string\";\n\n/**\n * Check if the provided value's type is an integer\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number` and is an integer\n */\nexport const isInteger = (value: unknown): boolean =>\n !isString(value) && isNumber(value) && value % 1 === 0;\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,aAAa,UACxB,CAAC,SAAS,MAAM,IAAI,SAAS,MAAM,IAAI,QAAQ,MAAM"}
@@ -1 +1,14 @@
1
- const e=require(`./is-non-null-object.cjs`),t=require(`./is-react-element.cjs`),n=e=>{let n=Object.prototype.toString.call(e);return n===`[object RegExp]`||n===`[object Date]`||t.isReactElement(e)},r=t=>e.isNonNullObject(t)&&!n(t);exports.isMergeableObject=r;
1
+ const require_is_non_null_object = require('./is-non-null-object.cjs');
2
+ const require_is_react_element = require('./is-react-element.cjs');
3
+
4
+ //#region src/is-mergeable-object.ts
5
+ const isSpecialType = (value) => {
6
+ const stringValue = Object.prototype.toString.call(value);
7
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || require_is_react_element.isReactElement(value);
8
+ };
9
+ const isMergeableObject = (value) => {
10
+ return require_is_non_null_object.isNonNullObject(value) && !isSpecialType(value);
11
+ };
12
+
13
+ //#endregion
14
+ exports.isMergeableObject = isMergeableObject;
@@ -1,2 +1,15 @@
1
- import{isNonNullObject as e}from"./is-non-null-object.mjs";import{isReactElement as t}from"./is-react-element.mjs";const n=e=>{let n=Object.prototype.toString.call(e);return n===`[object RegExp]`||n===`[object Date]`||t(e)},r=t=>e(t)&&!n(t);export{r as isMergeableObject};
1
+ import { isNonNullObject } from "./is-non-null-object.mjs";
2
+ import { isReactElement } from "./is-react-element.mjs";
3
+
4
+ //#region src/is-mergeable-object.ts
5
+ const isSpecialType = (value) => {
6
+ const stringValue = Object.prototype.toString.call(value);
7
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
8
+ };
9
+ const isMergeableObject = (value) => {
10
+ return isNonNullObject(value) && !isSpecialType(value);
11
+ };
12
+
13
+ //#endregion
14
+ export { isMergeableObject };
2
15
  //# sourceMappingURL=is-mergeable-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-mergeable-object.mjs","names":[],"sources":["../src/is-mergeable-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\";\nimport { isReactElement } from \"./is-react-element\";\n\nconst isSpecialType = (value: any) => {\n const stringValue = Object.prototype.toString.call(value);\n\n return (\n stringValue === \"[object RegExp]\" ||\n stringValue === \"[object Date]\" ||\n isReactElement(value)\n );\n};\n\nexport const isMergeableObject = (value: any): boolean => {\n return isNonNullObject(value) && !isSpecialType(value);\n};\n"],"mappings":"mHAqBA,MAAM,EAAiB,GAAe,CACpC,IAAM,EAAc,OAAO,UAAU,SAAS,KAAK,EAAM,CAEzD,OACE,IAAgB,mBAChB,IAAgB,iBAChB,EAAe,EAAM,EAIZ,EAAqB,GACzB,EAAgB,EAAM,EAAI,CAAC,EAAc,EAAM"}
1
+ {"version":3,"file":"is-mergeable-object.mjs","names":[],"sources":["../src/is-mergeable-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\";\nimport { isReactElement } from \"./is-react-element\";\n\nconst isSpecialType = (value: any) => {\n const stringValue = Object.prototype.toString.call(value);\n\n return (\n stringValue === \"[object RegExp]\" ||\n stringValue === \"[object Date]\" ||\n isReactElement(value)\n );\n};\n\nexport const isMergeableObject = (value: any): boolean => {\n return isNonNullObject(value) && !isSpecialType(value);\n};\n"],"mappings":";;;;AAqBA,MAAM,iBAAiB,UAAe;CACpC,MAAM,cAAc,OAAO,UAAU,SAAS,KAAK,MAAM;AAEzD,QACE,gBAAgB,qBAChB,gBAAgB,mBAChB,eAAe,MAAM;;AAIzB,MAAa,qBAAqB,UAAwB;AACxD,QAAO,gBAAgB,MAAM,IAAI,CAAC,cAAc,MAAM"}
@@ -1 +1,16 @@
1
- const e=require(`./is-object.cjs`),t=require(`./is-set.cjs`),n=n=>t.isSet(n)&&e.isObject(n);exports.isNonNullObject=n;
1
+ const require_is_object = require('./is-object.cjs');
2
+ const require_is_set = require('./is-set.cjs');
3
+
4
+ //#region src/is-non-null-object.ts
5
+ /**
6
+ * Check if the provided value's type is `Object` and is not `null` or `undefined`
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
10
+ */
11
+ const isNonNullObject = (value) => {
12
+ return require_is_set.isSet(value) && require_is_object.isObject(value);
13
+ };
14
+
15
+ //#endregion
16
+ exports.isNonNullObject = isNonNullObject;
@@ -1,2 +1,17 @@
1
- import{isObject as e}from"./is-object.mjs";import{isSet as t}from"./is-set.mjs";const n=n=>t(n)&&e(n);export{n as isNonNullObject};
1
+ import { isObject } from "./is-object.mjs";
2
+ import { isSet } from "./is-set.mjs";
3
+
4
+ //#region src/is-non-null-object.ts
5
+ /**
6
+ * Check if the provided value's type is `Object` and is not `null` or `undefined`
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
10
+ */
11
+ const isNonNullObject = (value) => {
12
+ return isSet(value) && isObject(value);
13
+ };
14
+
15
+ //#endregion
16
+ export { isNonNullObject };
2
17
  //# sourceMappingURL=is-non-null-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-null-object.mjs","names":[],"sources":["../src/is-non-null-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 { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(value);\n};\n"],"mappings":"gFA2BA,MAAa,EAAmB,GACvB,EAAM,EAAM,EAAI,EAAS,EAAM"}
1
+ {"version":3,"file":"is-non-null-object.mjs","names":[],"sources":["../src/is-non-null-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 { isObject } from \"./is-object\";\nimport { isSet } from \"./is-set\";\n\n/**\n * Check if the provided value's type is `Object` and is not `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n */\nexport const isNonNullObject = (value: any): value is NonNullable<object> => {\n return isSet(value) && isObject(value);\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,mBAAmB,UAA6C;AAC3E,QAAO,MAAM,MAAM,IAAI,SAAS,MAAM"}
@@ -1 +1,21 @@
1
- const e=require(`./is-empty.cjs`),t=require(`./is-empty-object.cjs`),n=require(`./is-empty-string.cjs`),r=r=>{try{return!e.isEmpty(r)&&!n.isEmptyString(r)&&!t.isEmptyObject(r)}catch{return!1}};exports.isNotEmpty=r;
1
+ const require_is_empty = require('./is-empty.cjs');
2
+ const require_is_empty_object = require('./is-empty-object.cjs');
3
+ const require_is_empty_string = require('./is-empty-string.cjs');
4
+
5
+ //#region src/is-not-empty.ts
6
+ /**
7
+ * The inverse of the `isEmptyObject` function
8
+ *
9
+ * @param value - The value to type check
10
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined` or `{}`
11
+ */
12
+ const isNotEmpty = (value) => {
13
+ try {
14
+ return !require_is_empty.isEmpty(value) && !require_is_empty_string.isEmptyString(value) && !require_is_empty_object.isEmptyObject(value);
15
+ } catch {
16
+ return false;
17
+ }
18
+ };
19
+
20
+ //#endregion
21
+ exports.isNotEmpty = isNotEmpty;
@@ -1,2 +1,22 @@
1
- import{isEmpty as e}from"./is-empty.mjs";import{isEmptyObject as t}from"./is-empty-object.mjs";import{isEmptyString as n}from"./is-empty-string.mjs";const r=r=>{try{return!e(r)&&!n(r)&&!t(r)}catch{return!1}};export{r as isNotEmpty};
1
+ import { isEmpty } from "./is-empty.mjs";
2
+ import { isEmptyObject } from "./is-empty-object.mjs";
3
+ import { isEmptyString } from "./is-empty-string.mjs";
4
+
5
+ //#region src/is-not-empty.ts
6
+ /**
7
+ * The inverse of the `isEmptyObject` function
8
+ *
9
+ * @param value - The value to type check
10
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined` or `{}`
11
+ */
12
+ const isNotEmpty = (value) => {
13
+ try {
14
+ return !isEmpty(value) && !isEmptyString(value) && !isEmptyObject(value);
15
+ } catch {
16
+ return false;
17
+ }
18
+ };
19
+
20
+ //#endregion
21
+ export { isNotEmpty };
2
22
  //# sourceMappingURL=is-not-empty.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-not-empty.mjs","names":[],"sources":["../src/is-not-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 { isEmpty } from \"./is-empty\";\nimport { isEmptyObject } from \"./is-empty-object\";\nimport { isEmptyString } from \"./is-empty-string\";\n\n/**\n * The inverse of the `isEmptyObject` 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` or `{}`\n */\nexport const isNotEmpty = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value) && !isEmptyString(value) && !isEmptyObject(value);\n } catch {\n return false;\n }\n};\n"],"mappings":"qJA4BA,MAAa,EAAc,GAAkD,CAC3E,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,EAAI,CAAC,EAAc,EAAM,EAAI,CAAC,EAAc,EAAM,MAClE,CACN,MAAO"}
1
+ {"version":3,"file":"is-not-empty.mjs","names":[],"sources":["../src/is-not-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 { isEmpty } from \"./is-empty\";\nimport { isEmptyObject } from \"./is-empty-object\";\nimport { isEmptyString } from \"./is-empty-string\";\n\n/**\n * The inverse of the `isEmptyObject` 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` or `{}`\n */\nexport const isNotEmpty = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value) && !isEmptyString(value) && !isEmptyObject(value);\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;AA4BA,MAAa,cAAc,UAAkD;AAC3E,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM,IAAI,CAAC,cAAc,MAAM,IAAI,CAAC,cAAc,MAAM;SAClE;AACN,SAAO"}
package/dist/is-null.cjs CHANGED
@@ -1 +1,12 @@
1
- const e=e=>{try{return e===null}catch{return!1}};exports.isNull=e;
1
+
2
+ //#region src/is-null.ts
3
+ const isNull = (value) => {
4
+ try {
5
+ return value === null;
6
+ } catch {
7
+ return false;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ exports.isNull = isNull;
package/dist/is-null.mjs CHANGED
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return e===null}catch{return!1}};export{e as isNull};
1
+ //#region src/is-null.ts
2
+ const isNull = (value) => {
3
+ try {
4
+ return value === null;
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+
10
+ //#endregion
11
+ export { isNull };
2
12
  //# sourceMappingURL=is-null.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-null.mjs","names":[],"sources":["../src/is-null.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 isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,EAAU,GAAkC,CACvD,GAAI,CACF,OAAO,IAAU,UACX,CACN,MAAO"}
1
+ {"version":3,"file":"is-null.mjs","names":[],"sources":["../src/is-null.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 isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO"}
@@ -1 +1,29 @@
1
- const e=require(`./get-object-tag.cjs`),t=e=>{try{return e instanceof Number||typeof e==`number`||Number(e)===e}catch{return!1}};function n(n){return t(n)||e.getObjectTag(n)===`[object Number]`}exports.isAnyNumber=n,exports.isNumber=t;
1
+ const require_get_object_tag = require('./get-object-tag.cjs');
2
+
3
+ //#region src/is-number.ts
4
+ /**
5
+ * Check if the provided value's type is `number`
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `number`
9
+ */
10
+ const isNumber = (value) => {
11
+ try {
12
+ return value instanceof Number || typeof value === "number" || Number(value) === value;
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+ /**
18
+ * Check if the provided value's type is `AnyNumber`
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is of type `AnyNumber`
22
+ */
23
+ function isAnyNumber(value) {
24
+ return isNumber(value) || require_get_object_tag.getObjectTag(value) === "[object Number]";
25
+ }
26
+
27
+ //#endregion
28
+ exports.isAnyNumber = isAnyNumber;
29
+ exports.isNumber = isNumber;
@@ -1,2 +1,29 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";const t=e=>{try{return e instanceof Number||typeof e==`number`||Number(e)===e}catch{return!1}};function n(n){return t(n)||e(n)===`[object Number]`}export{n as isAnyNumber,t as isNumber};
1
+ import { getObjectTag } from "./get-object-tag.mjs";
2
+
3
+ //#region src/is-number.ts
4
+ /**
5
+ * Check if the provided value's type is `number`
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `number`
9
+ */
10
+ const isNumber = (value) => {
11
+ try {
12
+ return value instanceof Number || typeof value === "number" || Number(value) === value;
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+ /**
18
+ * Check if the provided value's type is `AnyNumber`
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is of type `AnyNumber`
22
+ */
23
+ function isAnyNumber(value) {
24
+ return isNumber(value) || getObjectTag(value) === "[object Number]";
25
+ }
26
+
27
+ //#endregion
28
+ export { isAnyNumber, isNumber };
2
29
  //# sourceMappingURL=is-number.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-number.mjs","names":[],"sources":["../src/is-number.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 { AnyNumber } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Check if the provided value's type is `number`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number`\n */\nexport const isNumber = (value: unknown): value is number => {\n try {\n return (\n value instanceof Number ||\n typeof value === \"number\" ||\n Number(value) === value\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided value's type is `AnyNumber`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `AnyNumber`\n */\nexport function isAnyNumber(value?: any): value is AnyNumber {\n return isNumber(value) || getObjectTag(value) === \"[object Number]\";\n}\n"],"mappings":"oDA2BA,MAAa,EAAY,GAAoC,CAC3D,GAAI,CACF,OACE,aAAiB,QACjB,OAAO,GAAU,UACjB,OAAO,EAAM,GAAK,OAEd,CACN,MAAO,KAUX,SAAgB,EAAY,EAAiC,CAC3D,OAAO,EAAS,EAAM,EAAI,EAAa,EAAM,GAAK"}
1
+ {"version":3,"file":"is-number.mjs","names":[],"sources":["../src/is-number.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 { AnyNumber } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Check if the provided value's type is `number`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number`\n */\nexport const isNumber = (value: unknown): value is number => {\n try {\n return (\n value instanceof Number ||\n typeof value === \"number\" ||\n Number(value) === value\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided value's type is `AnyNumber`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `AnyNumber`\n */\nexport function isAnyNumber(value?: any): value is AnyNumber {\n return isNumber(value) || getObjectTag(value) === \"[object Number]\";\n}\n"],"mappings":";;;;;;;;;AA2BA,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,iBAAiB,UACjB,OAAO,UAAU,YACjB,OAAO,MAAM,KAAK;SAEd;AACN,SAAO;;;;;;;;;AAUX,SAAgB,YAAY,OAAiC;AAC3D,QAAO,SAAS,MAAM,IAAI,aAAa,MAAM,KAAK"}
@@ -1 +1,19 @@
1
- const e=/^(?:0|[1-9]\d*)$/;function t(t){switch(typeof t){case`number`:return Number.isInteger(t)&&t>=0&&t<2**53-1;case`symbol`:return!1;case`string`:return e.test(t)}}exports.isObjectIndex=t;
1
+
2
+ //#region src/is-object-index.ts
3
+ const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
4
+ /**
5
+ * Checks if the given value is an object index.
6
+ *
7
+ * @param value - The value to check.
8
+ * @returns Returns `true` if the value is an object index, otherwise `false`.
9
+ */
10
+ function isObjectIndex(value) {
11
+ switch (typeof value) {
12
+ case "number": return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
13
+ case "symbol": return false;
14
+ case "string": return IS_UNSIGNED_INTEGER.test(value);
15
+ }
16
+ }
17
+
18
+ //#endregion
19
+ exports.isObjectIndex = isObjectIndex;
@@ -1,2 +1,19 @@
1
- const e=/^(?:0|[1-9]\d*)$/;function t(t){switch(typeof t){case`number`:return Number.isInteger(t)&&t>=0&&t<2**53-1;case`symbol`:return!1;case`string`:return e.test(t)}}export{t as isObjectIndex};
1
+ //#region src/is-object-index.ts
2
+ const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
3
+ /**
4
+ * Checks if the given value is an object index.
5
+ *
6
+ * @param value - The value to check.
7
+ * @returns Returns `true` if the value is an object index, otherwise `false`.
8
+ */
9
+ function isObjectIndex(value) {
10
+ switch (typeof value) {
11
+ case "number": return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
12
+ case "symbol": return false;
13
+ case "string": return IS_UNSIGNED_INTEGER.test(value);
14
+ }
15
+ }
16
+
17
+ //#endregion
18
+ export { isObjectIndex };
2
19
  //# sourceMappingURL=is-object-index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-object-index.mjs","names":[],"sources":["../src/is-object-index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if the given value is an object index.\n *\n * @param value - The value to check.\n * @returns Returns `true` if the value is an object index, otherwise `false`.\n */\nexport function isObjectIndex(\n value: PropertyKey\n): value is string | number | symbol {\n switch (typeof value) {\n case \"number\": {\n return (\n Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER\n );\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}\n"],"mappings":"AAkBA,MAAM,EAAsB,mBAQ5B,SAAgB,EACd,EACmC,CACnC,OAAQ,OAAO,EAAf,CACE,IAAK,SACH,OACE,OAAO,UAAU,EAAM,EAAI,GAAS,GAAK,UAG7C,IAAK,SACH,MAAO,GAET,IAAK,SACH,OAAO,EAAoB,KAAK,EAAM"}
1
+ {"version":3,"file":"is-object-index.mjs","names":[],"sources":["../src/is-object-index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if the given value is an object index.\n *\n * @param value - The value to check.\n * @returns Returns `true` if the value is an object index, otherwise `false`.\n */\nexport function isObjectIndex(\n value: PropertyKey\n): value is string | number | symbol {\n switch (typeof value) {\n case \"number\": {\n return (\n Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER\n );\n }\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}\n"],"mappings":";AAkBA,MAAM,sBAAsB;;;;;;;AAQ5B,SAAgB,cACd,OACmC;AACnC,SAAQ,OAAO,OAAf;EACE,KAAK,SACH,QACE,OAAO,UAAU,MAAM,IAAI,SAAS,KAAK,QAAQ,OAAO;EAG5D,KAAK,SACH,QAAO;EAET,KAAK,SACH,QAAO,oBAAoB,KAAK,MAAM"}
@@ -1 +1,47 @@
1
- const e=require(`./is-plain-object.cjs`),t=/^class\s|^function\s+[A-Z]/,n=/^function\s+[A-Z]/,r=/^class\s/;function i(e){return typeof e==`function`&&r.test(e.toString())}function a(e){return typeof e==`function`&&n.test(e.toString())}function o(e){return typeof e==`function`&&t.test(e.toString())}const s=t=>{try{return typeof t==`object`||!!t&&t?.constructor===Object||e.isPlainObject(t)}catch{return!1}};exports.isClass=o,exports.isConventionalClass=a,exports.isNativeClass=i,exports.isObject=s;
1
+ const require_is_plain_object = require('./is-plain-object.cjs');
2
+
3
+ //#region src/is-object.ts
4
+ const isClassRegex = /^class\s|^function\s+[A-Z]/;
5
+ const isConventionalClassRegex = /^function\s+[A-Z]/;
6
+ const isNativeClassRegex = /^class\s/;
7
+ /** Is ES6+ class */
8
+ function isNativeClass(value) {
9
+ return typeof value === "function" && isNativeClassRegex.test(value.toString());
10
+ }
11
+ /**
12
+ * Check if the provided value's type is a conventional class
13
+ *
14
+ * @remarks
15
+ * Is Conventional Class
16
+ * Looks for function with capital first letter MyClass
17
+ * First letter is the 9th character
18
+ * If changed, isClass must also be updated
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is a conventional class
22
+ */
23
+ function isConventionalClass(value) {
24
+ return typeof value === "function" && isConventionalClassRegex.test(value.toString());
25
+ }
26
+ function isClass(value) {
27
+ return typeof value === "function" && isClassRegex.test(value.toString());
28
+ }
29
+ /**
30
+ * Check if the provided value's type is `Object`
31
+ *
32
+ * @param value - The value to type check
33
+ * @returns An indicator specifying if the value provided is of type `Object`
34
+ */
35
+ const isObject = (value) => {
36
+ try {
37
+ return typeof value === "object" || Boolean(value) && value?.constructor === Object || require_is_plain_object.isPlainObject(value);
38
+ } catch {
39
+ return false;
40
+ }
41
+ };
42
+
43
+ //#endregion
44
+ exports.isClass = isClass;
45
+ exports.isConventionalClass = isConventionalClass;
46
+ exports.isNativeClass = isNativeClass;
47
+ exports.isObject = isObject;
@@ -1,2 +1,45 @@
1
- import{isPlainObject as e}from"./is-plain-object.mjs";const t=/^class\s|^function\s+[A-Z]/,n=/^function\s+[A-Z]/,r=/^class\s/;function i(e){return typeof e==`function`&&r.test(e.toString())}function a(e){return typeof e==`function`&&n.test(e.toString())}function o(e){return typeof e==`function`&&t.test(e.toString())}const s=t=>{try{return typeof t==`object`||!!t&&t?.constructor===Object||e(t)}catch{return!1}};export{o as isClass,a as isConventionalClass,i as isNativeClass,s as isObject};
1
+ import { isPlainObject } from "./is-plain-object.mjs";
2
+
3
+ //#region src/is-object.ts
4
+ const isClassRegex = /^class\s|^function\s+[A-Z]/;
5
+ const isConventionalClassRegex = /^function\s+[A-Z]/;
6
+ const isNativeClassRegex = /^class\s/;
7
+ /** Is ES6+ class */
8
+ function isNativeClass(value) {
9
+ return typeof value === "function" && isNativeClassRegex.test(value.toString());
10
+ }
11
+ /**
12
+ * Check if the provided value's type is a conventional class
13
+ *
14
+ * @remarks
15
+ * Is Conventional Class
16
+ * Looks for function with capital first letter MyClass
17
+ * First letter is the 9th character
18
+ * If changed, isClass must also be updated
19
+ *
20
+ * @param value - The value to type check
21
+ * @returns An indicator specifying if the value provided is a conventional class
22
+ */
23
+ function isConventionalClass(value) {
24
+ return typeof value === "function" && isConventionalClassRegex.test(value.toString());
25
+ }
26
+ function isClass(value) {
27
+ return typeof value === "function" && isClassRegex.test(value.toString());
28
+ }
29
+ /**
30
+ * Check if the provided value's type is `Object`
31
+ *
32
+ * @param value - The value to type check
33
+ * @returns An indicator specifying if the value provided is of type `Object`
34
+ */
35
+ const isObject = (value) => {
36
+ try {
37
+ return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
38
+ } catch {
39
+ return false;
40
+ }
41
+ };
42
+
43
+ //#endregion
44
+ export { isClass, isConventionalClass, isNativeClass, isObject };
2
45
  //# sourceMappingURL=is-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-object.mjs","names":[],"sources":["../src/is-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"sDAyBA,MAAM,EAAe,6BACf,EAA2B,oBAC3B,EAAqB,WAG3B,SAAgB,EAAc,EAAmC,CAE/D,OACE,OAAO,GAAU,YAAc,EAAmB,KAAK,EAAM,UAAU,CAAC,CAgB5E,SAAgB,EAAoB,EAAgC,CAClE,OACE,OAAO,GAAU,YACjB,EAAyB,KAAK,EAAM,UAAU,CAAC,CAWnD,SAAgB,EAAQ,EAAsB,CAC5C,OAAO,OAAO,GAAU,YAAc,EAAa,KAAK,EAAM,UAAU,CAAC,CAS3E,MAAa,EAAY,GAAoC,CAC3D,GAAI,CACF,OACE,OAAO,GAAU,UAChB,EAAQ,GAAU,GAAO,cAAgB,QAC1C,EAAc,EAAM,MAEhB,CACN,MAAO"}
1
+ {"version":3,"file":"is-object.mjs","names":[],"sources":["../src/is-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;AAyBA,MAAM,eAAe;AACrB,MAAM,2BAA2B;AACjC,MAAM,qBAAqB;;AAG3B,SAAgB,cAAc,OAAmC;AAE/D,QACE,OAAO,UAAU,cAAc,mBAAmB,KAAK,MAAM,UAAU,CAAC;;;;;;;;;;;;;;AAgB5E,SAAgB,oBAAoB,OAAgC;AAClE,QACE,OAAO,UAAU,cACjB,yBAAyB,KAAK,MAAM,UAAU,CAAC;;AAWnD,SAAgB,QAAQ,OAAsB;AAC5C,QAAO,OAAO,UAAU,cAAc,aAAa,KAAK,MAAM,UAAU,CAAC;;;;;;;;AAS3E,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SACE,OAAO,UAAU,YAChB,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAC1C,cAAc,MAAM;SAEhB;AACN,SAAO"}
@@ -1 +1,64 @@
1
- const e=require(`./get-object-tag.cjs`),t=e=>typeof e==`object`&&!!e,n=n=>{if(!t(n)||e.getObjectTag(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};exports.isObjectLike=t,exports.isPlainObject=n;
1
+ const require_get_object_tag = require('./get-object-tag.cjs');
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) || require_get_object_tag.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
+ exports.isObjectLike = isObjectLike;
64
+ exports.isPlainObject = isPlainObject;