@stryke/helpers 0.9.34 → 0.9.36

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 (160) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/arg-identity.cjs +17 -1
  3. package/dist/arg-identity.mjs +16 -1
  4. package/dist/arg-identity.mjs.map +1 -1
  5. package/dist/convert/src/to-string-key.cjs +15 -1
  6. package/dist/convert/src/to-string-key.mjs +14 -1
  7. package/dist/convert/src/to-string-key.mjs.map +1 -1
  8. package/dist/debounce.cjs +62 -1
  9. package/dist/debounce.mjs +61 -1
  10. package/dist/debounce.mjs.map +1 -1
  11. package/dist/deep-clone.cjs +113 -1
  12. package/dist/deep-clone.mjs +113 -1
  13. package/dist/deep-clone.mjs.map +1 -1
  14. package/dist/deep-merge.cjs +60 -1
  15. package/dist/deep-merge.mjs +60 -1
  16. package/dist/deep-merge.mjs.map +1 -1
  17. package/dist/delay.cjs +90 -1
  18. package/dist/delay.mjs +89 -1
  19. package/dist/delay.mjs.map +1 -1
  20. package/dist/errors.cjs +24 -1
  21. package/dist/errors.mjs +22 -1
  22. package/dist/errors.mjs.map +1 -1
  23. package/dist/filter-empty.cjs +7 -1
  24. package/dist/filter-empty.mjs +7 -1
  25. package/dist/filter-empty.mjs.map +1 -1
  26. package/dist/flatten-object.cjs +48 -1
  27. package/dist/flatten-object.mjs +48 -1
  28. package/dist/flatten-object.mjs.map +1 -1
  29. package/dist/get-field.cjs +54 -1
  30. package/dist/get-field.mjs +54 -1
  31. package/dist/get-field.mjs.map +1 -1
  32. package/dist/get-ordered-by.cjs +54 -1
  33. package/dist/get-ordered-by.mjs +53 -1
  34. package/dist/get-ordered-by.mjs.map +1 -1
  35. package/dist/get-unique.cjs +37 -1
  36. package/dist/get-unique.mjs +35 -1
  37. package/dist/get-unique.mjs.map +1 -1
  38. package/dist/identity.cjs +21 -1
  39. package/dist/identity.mjs +20 -1
  40. package/dist/identity.mjs.map +1 -1
  41. package/dist/index.cjs +71 -1
  42. package/dist/index.mjs +33 -1
  43. package/dist/is-equal.cjs +87 -1
  44. package/dist/is-equal.mjs +87 -1
  45. package/dist/is-equal.mjs.map +1 -1
  46. package/dist/lru-cache.cjs +190 -1
  47. package/dist/lru-cache.mjs +189 -1
  48. package/dist/lru-cache.mjs.map +1 -1
  49. package/dist/match-sorter.cjs +264 -1
  50. package/dist/match-sorter.mjs +262 -1
  51. package/dist/match-sorter.mjs.map +1 -1
  52. package/dist/memoize.cjs +20 -1
  53. package/dist/memoize.mjs +19 -1
  54. package/dist/memoize.mjs.map +1 -1
  55. package/dist/mutex.cjs +80 -1
  56. package/dist/mutex.mjs +80 -1
  57. package/dist/mutex.mjs.map +1 -1
  58. package/dist/noop.cjs +24 -1
  59. package/dist/noop.mjs +22 -1
  60. package/dist/noop.mjs.map +1 -1
  61. package/dist/omit.cjs +30 -1
  62. package/dist/omit.mjs +29 -1
  63. package/dist/omit.mjs.map +1 -1
  64. package/dist/once.cjs +27 -1
  65. package/dist/once.mjs +25 -1
  66. package/dist/once.mjs.map +1 -1
  67. package/dist/pick.cjs +30 -1
  68. package/dist/pick.mjs +29 -1
  69. package/dist/pick.mjs.map +1 -1
  70. package/dist/remove-accents.cjs +416 -1
  71. package/dist/remove-accents.mjs +414 -1
  72. package/dist/remove-accents.mjs.map +1 -1
  73. package/dist/remove-empty-items.cjs +12 -1
  74. package/dist/remove-empty-items.mjs +11 -1
  75. package/dist/remove-empty-items.mjs.map +1 -1
  76. package/dist/semaphore.cjs +105 -1
  77. package/dist/semaphore.mjs +104 -1
  78. package/dist/semaphore.mjs.map +1 -1
  79. package/dist/set-field.cjs +30 -1
  80. package/dist/set-field.mjs +30 -1
  81. package/dist/set-field.mjs.map +1 -1
  82. package/dist/throttle.cjs +43 -1
  83. package/dist/throttle.mjs +42 -1
  84. package/dist/throttle.mjs.map +1 -1
  85. package/dist/timeout.cjs +18 -1
  86. package/dist/timeout.mjs +18 -1
  87. package/dist/timeout.mjs.map +1 -1
  88. package/dist/to-deep-key.cjs +54 -1
  89. package/dist/to-deep-key.mjs +53 -1
  90. package/dist/to-deep-key.mjs.map +1 -1
  91. package/dist/to-path.cjs +43 -1
  92. package/dist/to-path.mjs +42 -1
  93. package/dist/to-path.mjs.map +1 -1
  94. package/dist/type-checks/src/get-object-tag.cjs +15 -1
  95. package/dist/type-checks/src/get-object-tag.mjs +14 -1
  96. package/dist/type-checks/src/get-object-tag.mjs.map +1 -1
  97. package/dist/type-checks/src/is-deep-key.cjs +28 -1
  98. package/dist/type-checks/src/is-deep-key.mjs +27 -1
  99. package/dist/type-checks/src/is-deep-key.mjs.map +1 -1
  100. package/dist/type-checks/src/is-empty.cjs +20 -1
  101. package/dist/type-checks/src/is-empty.mjs +20 -1
  102. package/dist/type-checks/src/is-empty.mjs.map +1 -1
  103. package/dist/type-checks/src/is-function.cjs +25 -1
  104. package/dist/type-checks/src/is-function.mjs +25 -1
  105. package/dist/type-checks/src/is-function.mjs.map +1 -1
  106. package/dist/type-checks/src/is-mergeable-object.cjs +14 -1
  107. package/dist/type-checks/src/is-mergeable-object.mjs +14 -1
  108. package/dist/type-checks/src/is-mergeable-object.mjs.map +1 -1
  109. package/dist/type-checks/src/is-non-null-object.cjs +16 -1
  110. package/dist/type-checks/src/is-non-null-object.mjs +16 -1
  111. package/dist/type-checks/src/is-non-null-object.mjs.map +1 -1
  112. package/dist/type-checks/src/is-null.cjs +12 -1
  113. package/dist/type-checks/src/is-null.mjs +11 -1
  114. package/dist/type-checks/src/is-null.mjs.map +1 -1
  115. package/dist/type-checks/src/is-number.cjs +18 -1
  116. package/dist/type-checks/src/is-number.mjs +17 -1
  117. package/dist/type-checks/src/is-number.mjs.map +1 -1
  118. package/dist/type-checks/src/is-object-index.cjs +19 -1
  119. package/dist/type-checks/src/is-object-index.mjs +18 -1
  120. package/dist/type-checks/src/is-object-index.mjs.map +1 -1
  121. package/dist/type-checks/src/is-object.cjs +19 -1
  122. package/dist/type-checks/src/is-object.mjs +19 -1
  123. package/dist/type-checks/src/is-object.mjs.map +1 -1
  124. package/dist/type-checks/src/is-plain-object.cjs +63 -1
  125. package/dist/type-checks/src/is-plain-object.mjs +63 -1
  126. package/dist/type-checks/src/is-plain-object.mjs.map +1 -1
  127. package/dist/type-checks/src/is-primitive.cjs +12 -1
  128. package/dist/type-checks/src/is-primitive.mjs +11 -1
  129. package/dist/type-checks/src/is-primitive.mjs.map +1 -1
  130. package/dist/type-checks/src/is-react-element.cjs +8 -1
  131. package/dist/type-checks/src/is-react-element.mjs +7 -1
  132. package/dist/type-checks/src/is-react-element.mjs.map +1 -1
  133. package/dist/type-checks/src/is-set-string.cjs +20 -1
  134. package/dist/type-checks/src/is-set-string.mjs +20 -1
  135. package/dist/type-checks/src/is-set-string.mjs.map +1 -1
  136. package/dist/type-checks/src/is-set.cjs +19 -1
  137. package/dist/type-checks/src/is-set.mjs +19 -1
  138. package/dist/type-checks/src/is-set.mjs.map +1 -1
  139. package/dist/type-checks/src/is-string.cjs +12 -1
  140. package/dist/type-checks/src/is-string.mjs +11 -1
  141. package/dist/type-checks/src/is-string.mjs.map +1 -1
  142. package/dist/type-checks/src/is-typed-array.cjs +8 -1
  143. package/dist/type-checks/src/is-typed-array.mjs +7 -1
  144. package/dist/type-checks/src/is-typed-array.mjs.map +1 -1
  145. package/dist/type-checks/src/is-undefined.cjs +8 -1
  146. package/dist/type-checks/src/is-undefined.mjs +7 -1
  147. package/dist/type-checks/src/is-undefined.mjs.map +1 -1
  148. package/dist/type-checks/src/property-exists.cjs +30 -1
  149. package/dist/type-checks/src/property-exists.mjs +30 -1
  150. package/dist/type-checks/src/property-exists.mjs.map +1 -1
  151. package/dist/unflatten-object.cjs +38 -1
  152. package/dist/unflatten-object.mjs +38 -1
  153. package/dist/unflatten-object.mjs.map +1 -1
  154. package/dist/union.cjs +28 -1
  155. package/dist/union.mjs +28 -1
  156. package/dist/union.mjs.map +1 -1
  157. package/dist/with-timeout.cjs +28 -1
  158. package/dist/with-timeout.mjs +28 -1
  159. package/dist/with-timeout.mjs.map +1 -1
  160. package/package.json +2 -2
@@ -1,2 +1,64 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";const t=e=>typeof e==`object`&&!!e,n=n=>{if(!t(n)||e(n)!==`[object Object]`)return!1;if(Object.getPrototypeOf(n)===null)return!0;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r};export{n as isPlainObject};
1
+ import { getObjectTag } from "./get-object-tag.mjs";
2
+
3
+ //#region ../type-checks/src/is-plain-object.ts
4
+ /**
5
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
6
+ * and has a `typeof` result of "object".
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * isObjectLike({})
11
+ * // => true
12
+ *
13
+ * isObjectLike([1, 2, 3])
14
+ * // => true
15
+ *
16
+ * isObjectLike(Function)
17
+ * // => false
18
+ *
19
+ * isObjectLike(null)
20
+ * // => false
21
+ * ```
22
+ *
23
+ * @param value - The value to check.
24
+ * @returns Returns `true` if `value` is object-like, else `false`.
25
+ */
26
+ const isObjectLike = (obj) => {
27
+ return typeof obj === "object" && obj !== null;
28
+ };
29
+ /**
30
+ * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * function Foo() {
35
+ * this.a = 1
36
+ * }
37
+ *
38
+ * isPlainObject(new Foo)
39
+ * // => false
40
+ *
41
+ * isPlainObject([1, 2, 3])
42
+ * // => false
43
+ *
44
+ * isPlainObject({ 'x': 0, 'y': 0 })
45
+ * // => true
46
+ *
47
+ * isPlainObject(Object.create(null))
48
+ * // => true
49
+ * ```
50
+ *
51
+ * @param obj - The value to check.
52
+ * @returns Returns `true` if `obj` is a plain object, else `false`.
53
+ */
54
+ const isPlainObject = (obj) => {
55
+ if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
56
+ if (Object.getPrototypeOf(obj) === null) return true;
57
+ let proto = obj;
58
+ while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
59
+ return Object.getPrototypeOf(obj) === proto;
60
+ };
61
+
62
+ //#endregion
63
+ export { isPlainObject };
2
64
  //# sourceMappingURL=is-plain-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-plain-object.mjs","names":[],"sources":["../../../../type-checks/src/is-plain-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n"],"mappings":"oDA2CA,MAAa,EAAgB,GACpB,OAAO,GAAQ,YAAY,EA4BvB,EAAiB,GAAqC,CACjE,GAAI,CAAC,EAAa,EAAI,EAAI,EAAa,EAAI,GAAK,kBAC9C,MAAO,GAET,GAAI,OAAO,eAAe,EAAI,GAAK,KACjC,MAAO,GAET,IAAI,EAAQ,EACZ,KAAO,OAAO,eAAe,EAAM,GAAK,MACtC,EAAQ,OAAO,eAAe,EAAM,CAEtC,OAAO,OAAO,eAAe,EAAI,GAAK"}
1
+ {"version":3,"file":"is-plain-object.mjs","names":[],"sources":["../../../../type-checks/src/is-plain-object.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,gBAAgB,QAAiB;AAC5C,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B5C,MAAa,iBAAiB,QAAqC;AACjE,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAC9C,QAAO;AAET,KAAI,OAAO,eAAe,IAAI,KAAK,KACjC,QAAO;CAET,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KACtC,SAAQ,OAAO,eAAe,MAAM;AAEtC,QAAO,OAAO,eAAe,IAAI,KAAK"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};exports.isPrimitive=e;
1
+
2
+ //#region ../type-checks/src/is-primitive.ts
3
+ const isPrimitive = (value) => {
4
+ try {
5
+ return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
6
+ } catch {
7
+ return false;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ exports.isPrimitive = isPrimitive;
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return e==null||typeof e!=`object`&&typeof e!=`function`}catch{return!1}};export{e as isPrimitive};
1
+ //#region ../type-checks/src/is-primitive.ts
2
+ const isPrimitive = (value) => {
3
+ try {
4
+ return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+
10
+ //#endregion
11
+ export { isPrimitive };
2
12
  //# sourceMappingURL=is-primitive.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-primitive.mjs","names":[],"sources":["../../../../type-checks/src/is-primitive.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isPrimitive = (value: unknown): boolean => {\n try {\n return (\n value === undefined ||\n value === null ||\n (typeof value !== \"object\" && typeof value !== \"function\")\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,EAAe,GAA4B,CACtD,GAAI,CACF,OACE,GACU,MACT,OAAO,GAAU,UAAY,OAAO,GAAU,gBAE3C,CACN,MAAO"}
1
+ {"version":3,"file":"is-primitive.mjs","names":[],"sources":["../../../../type-checks/src/is-primitive.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isPrimitive = (value: unknown): boolean => {\n try {\n return (\n value === undefined ||\n value === null ||\n (typeof value !== \"object\" && typeof value !== \"function\")\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAA4B;AACtD,KAAI;AACF,SACE,UAAU,UACV,UAAU,QACT,OAAO,UAAU,YAAY,OAAO,UAAU;SAE3C;AACN,SAAO"}
@@ -1 +1,8 @@
1
- const e=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103);exports.isReactElement=e;
1
+
2
+ //#region ../type-checks/src/is-react-element.ts
3
+ const isReactElement = (value) => {
4
+ return value.$$typeof === (typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103);
5
+ };
6
+
7
+ //#endregion
8
+ exports.isReactElement = isReactElement;
@@ -1,2 +1,8 @@
1
- const e=e=>e.$$typeof===(typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103);export{e as isReactElement};
1
+ //#region ../type-checks/src/is-react-element.ts
2
+ const isReactElement = (value) => {
3
+ return value.$$typeof === (typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103);
4
+ };
5
+
6
+ //#endregion
7
+ export { isReactElement };
2
8
  //# sourceMappingURL=is-react-element.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-react-element.mjs","names":[],"sources":["../../../../type-checks/src/is-react-element.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isReactElement = (value: any) => {\n return (\n value.$$typeof ===\n (typeof Symbol === \"function\" && Symbol.for\n ? Symbol.for(\"react.element\")\n : 0xea_c7)\n );\n};\n"],"mappings":"AAkBA,MAAa,EAAkB,GAE3B,EAAM,YACL,OAAO,QAAW,YAAc,OAAO,IACpC,OAAO,IAAI,gBAAgB,CAC3B"}
1
+ {"version":3,"file":"is-react-element.mjs","names":[],"sources":["../../../../type-checks/src/is-react-element.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isReactElement = (value: any) => {\n return (\n value.$$typeof ===\n (typeof Symbol === \"function\" && Symbol.for\n ? Symbol.for(\"react.element\")\n : 0xea_c7)\n );\n};\n"],"mappings":";AAkBA,MAAa,kBAAkB,UAAe;AAC5C,QACE,MAAM,cACL,OAAO,WAAW,cAAc,OAAO,MACpC,OAAO,IAAI,gBAAgB,GAC3B"}
@@ -1 +1,20 @@
1
- const e=require(`./is-set.cjs`),t=require(`./is-string.cjs`),n=n=>{try{return e.isSet(n)&&t.isString(n)&&n.length>0}catch{return!1}};exports.isSetString=n;
1
+ const require_is_set = require('./is-set.cjs');
2
+ const require_is_string = require('./is-string.cjs');
3
+
4
+ //#region ../type-checks/src/is-set-string.ts
5
+ /**
6
+ * Determine if the type is string and is not empty (length greater than zero)
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `string` and length greater than zero
10
+ */
11
+ const isSetString = (value) => {
12
+ try {
13
+ return require_is_set.isSet(value) && require_is_string.isString(value) && value.length > 0;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ exports.isSetString = isSetString;
@@ -1,2 +1,21 @@
1
- import{isSet as e}from"./is-set.mjs";import{isString as t}from"./is-string.mjs";const n=n=>{try{return e(n)&&t(n)&&n.length>0}catch{return!1}};export{n as isSetString};
1
+ import { isSet } from "./is-set.mjs";
2
+ import { isString } from "./is-string.mjs";
3
+
4
+ //#region ../type-checks/src/is-set-string.ts
5
+ /**
6
+ * Determine if the type is string and is not empty (length greater than zero)
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `string` and length greater than zero
10
+ */
11
+ const isSetString = (value) => {
12
+ try {
13
+ return isSet(value) && isString(value) && value.length > 0;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ export { isSetString };
2
21
  //# sourceMappingURL=is-set-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"gFA2BA,MAAa,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAM,EAAM,EAAI,EAAS,EAAM,EAAI,EAAM,OAAS,OACnD,CACN,MAAO"}
1
+ {"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,MAAM,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS;SACnD;AACN,SAAO"}
@@ -1 +1,19 @@
1
- const e=require(`./is-empty.cjs`),t=t=>{try{return!e.isEmpty(t)}catch{return!1}};exports.isSet=t;
1
+ const require_is_empty = require('./is-empty.cjs');
2
+
3
+ //#region ../type-checks/src/is-set.ts
4
+ /**
5
+ * The inverse of the `isEmpty` function
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
9
+ */
10
+ const isSet = (value) => {
11
+ try {
12
+ return !require_is_empty.isEmpty(value);
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+
18
+ //#endregion
19
+ exports.isSet = isSet;
@@ -1,2 +1,20 @@
1
- import{isEmpty as e}from"./is-empty.mjs";const t=t=>{try{return!e(t)}catch{return!1}};export{t as isSet};
1
+ import { isEmpty } from "./is-empty.mjs";
2
+
3
+ //#region ../type-checks/src/is-set.ts
4
+ /**
5
+ * The inverse of the `isEmpty` function
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
9
+ */
10
+ const isSet = (value) => {
11
+ try {
12
+ return !isEmpty(value);
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+
18
+ //#endregion
19
+ export { isSet };
2
20
  //# sourceMappingURL=is-set.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":"yCA0BA,MAAa,EAAS,GAAkD,CACtE,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,MAChB,CACN,MAAO"}
1
+ {"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return typeof e==`string`}catch{return!1}};exports.isString=e;
1
+
2
+ //#region ../type-checks/src/is-string.ts
3
+ const isString = (value) => {
4
+ try {
5
+ return typeof value === "string";
6
+ } catch {
7
+ return false;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ exports.isString = isString;
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return typeof e==`string`}catch{return!1}};export{e as isString};
1
+ //#region ../type-checks/src/is-string.ts
2
+ const isString = (value) => {
3
+ try {
4
+ return typeof value === "string";
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+
10
+ //#endregion
11
+ export { isString };
2
12
  //# sourceMappingURL=is-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-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\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,EAAY,GAAoC,CAC3D,GAAI,CACF,OAAO,OAAO,GAAU,cAClB,CACN,MAAO"}
1
+ {"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-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\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SAAO,OAAO,UAAU;SAClB;AACN,SAAO"}
@@ -1 +1,8 @@
1
- function e(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}exports.isTypedArray=e;
1
+
2
+ //#region ../type-checks/src/is-typed-array.ts
3
+ function isTypedArray(obj) {
4
+ return obj instanceof Uint8Array || obj instanceof Uint8ClampedArray || obj instanceof Uint16Array || obj instanceof Uint32Array || obj instanceof BigUint64Array || obj instanceof Int8Array || obj instanceof Int16Array || obj instanceof Int32Array || obj instanceof BigInt64Array || obj instanceof Float32Array || obj instanceof Float64Array;
5
+ }
6
+
7
+ //#endregion
8
+ exports.isTypedArray = isTypedArray;
@@ -1,2 +1,8 @@
1
- function e(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}export{e as isTypedArray};
1
+ //#region ../type-checks/src/is-typed-array.ts
2
+ function isTypedArray(obj) {
3
+ return obj instanceof Uint8Array || obj instanceof Uint8ClampedArray || obj instanceof Uint16Array || obj instanceof Uint32Array || obj instanceof BigUint64Array || obj instanceof Int8Array || obj instanceof Int16Array || obj instanceof Int32Array || obj instanceof BigInt64Array || obj instanceof Float32Array || obj instanceof Float64Array;
4
+ }
5
+
6
+ //#endregion
7
+ export { isTypedArray };
2
8
  //# sourceMappingURL=is-typed-array.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-typed-array.mjs","names":[],"sources":["../../../../type-checks/src/is-typed-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport function isTypedArray(\n obj: any\n): obj is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n"],"mappings":"AAkBA,SAAgB,EACd,EAYe,CACf,OACE,aAAe,YACf,aAAe,mBACf,aAAe,aACf,aAAe,aACf,aAAe,gBACf,aAAe,WACf,aAAe,YACf,aAAe,YACf,aAAe,eACf,aAAe,cACf,aAAe"}
1
+ {"version":3,"file":"is-typed-array.mjs","names":[],"sources":["../../../../type-checks/src/is-typed-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport function isTypedArray(\n obj: any\n): obj is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n"],"mappings":";AAkBA,SAAgB,aACd,KAYe;AACf,QACE,eAAe,cACf,eAAe,qBACf,eAAe,eACf,eAAe,eACf,eAAe,kBACf,eAAe,aACf,eAAe,cACf,eAAe,cACf,eAAe,iBACf,eAAe,gBACf,eAAe"}
@@ -1 +1,8 @@
1
- const e=e=>e===void 0;exports.isUndefined=e;
1
+
2
+ //#region ../type-checks/src/is-undefined.ts
3
+ const isUndefined = (value) => {
4
+ return value === void 0;
5
+ };
6
+
7
+ //#endregion
8
+ exports.isUndefined = isUndefined;
@@ -1,2 +1,8 @@
1
- const e=e=>e===void 0;export{e as isUndefined};
1
+ //#region ../type-checks/src/is-undefined.ts
2
+ const isUndefined = (value) => {
3
+ return value === void 0;
4
+ };
5
+
6
+ //#endregion
7
+ export { isUndefined };
2
8
  //# sourceMappingURL=is-undefined.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.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 isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":"AAkBA,MAAa,EAAe,GACnB,IAAU,IAAA"}
1
+ {"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.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 isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU"}
@@ -1 +1,30 @@
1
- const e=require(`./is-object.cjs`),t=(t,n)=>{try{return e.isObject(t)&&n in t}catch{return!1}},n=(e,n)=>t(e,n)&&!(Object.hasOwnProperty.call(e,n)&&Object.propertyIsEnumerable.call(e,n));exports.propertyUnsafe=n;
1
+ const require_is_object = require('./is-object.cjs');
2
+
3
+ //#region ../type-checks/src/property-exists.ts
4
+ /**
5
+ * Check if the provided object has the provided property
6
+ *
7
+ * @param object - The object to check
8
+ * @param propertyKey - The property to check
9
+ * @returns An indicator specifying if the object has the provided property
10
+ */
11
+ const propertyExists = (object, propertyKey) => {
12
+ try {
13
+ return require_is_object.isObject(object) && propertyKey in object;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+ /**
19
+ * Check if the provided object has the provided property and if it's safe to merge
20
+ *
21
+ * @param object - The object to check
22
+ * @param propertyKey - The property to check
23
+ * @returns An indicator specifying if the object has the provided property and if it's safe to merge
24
+ */
25
+ const propertyUnsafe = (object, propertyKey) => {
26
+ return propertyExists(object, propertyKey) && !(Object.hasOwnProperty.call(object, propertyKey) && Object.propertyIsEnumerable.call(object, propertyKey));
27
+ };
28
+
29
+ //#endregion
30
+ exports.propertyUnsafe = propertyUnsafe;
@@ -1,2 +1,31 @@
1
- import{isObject as e}from"./is-object.mjs";const t=(t,n)=>{try{return e(t)&&n in t}catch{return!1}},n=(e,n)=>t(e,n)&&!(Object.hasOwnProperty.call(e,n)&&Object.propertyIsEnumerable.call(e,n));export{n as propertyUnsafe};
1
+ import { isObject } from "./is-object.mjs";
2
+
3
+ //#region ../type-checks/src/property-exists.ts
4
+ /**
5
+ * Check if the provided object has the provided property
6
+ *
7
+ * @param object - The object to check
8
+ * @param propertyKey - The property to check
9
+ * @returns An indicator specifying if the object has the provided property
10
+ */
11
+ const propertyExists = (object, propertyKey) => {
12
+ try {
13
+ return isObject(object) && propertyKey in object;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+ /**
19
+ * Check if the provided object has the provided property and if it's safe to merge
20
+ *
21
+ * @param object - The object to check
22
+ * @param propertyKey - The property to check
23
+ * @returns An indicator specifying if the object has the provided property and if it's safe to merge
24
+ */
25
+ const propertyUnsafe = (object, propertyKey) => {
26
+ return propertyExists(object, propertyKey) && !(Object.hasOwnProperty.call(object, propertyKey) && Object.propertyIsEnumerable.call(object, propertyKey));
27
+ };
28
+
29
+ //#endregion
30
+ export { propertyUnsafe };
2
31
  //# sourceMappingURL=property-exists.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"property-exists.mjs","names":[],"sources":["../../../../type-checks/src/property-exists.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\";\n\n/**\n * Check if the provided object has the provided property\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property\n */\nexport const propertyExists = (object: any, propertyKey: PropertyKey) => {\n try {\n return isObject(object) && propertyKey in object;\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided object has the provided property and if it's safe to merge\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property and if it's safe to merge\n */\nexport const propertyUnsafe = (object: any, propertyKey: PropertyKey) => {\n return (\n propertyExists(object, propertyKey) && // Properties are safe to merge if they don't exist in the target yet,\n !(\n Object.hasOwnProperty.call(object, propertyKey) && // unsafe if they exist up the prototype chain,\n Object.propertyIsEnumerable.call(object, propertyKey)\n )\n ); // and also unsafe if they're non-enumerable.\n};\n"],"mappings":"2CA2BA,MAAa,GAAkB,EAAa,IAA6B,CACvE,GAAI,CACF,OAAO,EAAS,EAAO,EAAI,KAAe,OACpC,CACN,MAAO,KAWE,GAAkB,EAAa,IAExC,EAAe,EAAQ,EAAY,EACnC,EACE,OAAO,eAAe,KAAK,EAAQ,EAAY,EAC/C,OAAO,qBAAqB,KAAK,EAAQ,EAAY"}
1
+ {"version":3,"file":"property-exists.mjs","names":[],"sources":["../../../../type-checks/src/property-exists.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\";\n\n/**\n * Check if the provided object has the provided property\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property\n */\nexport const propertyExists = (object: any, propertyKey: PropertyKey) => {\n try {\n return isObject(object) && propertyKey in object;\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided object has the provided property and if it's safe to merge\n *\n * @param object - The object to check\n * @param propertyKey - The property to check\n * @returns An indicator specifying if the object has the provided property and if it's safe to merge\n */\nexport const propertyUnsafe = (object: any, propertyKey: PropertyKey) => {\n return (\n propertyExists(object, propertyKey) && // Properties are safe to merge if they don't exist in the target yet,\n !(\n Object.hasOwnProperty.call(object, propertyKey) && // unsafe if they exist up the prototype chain,\n Object.propertyIsEnumerable.call(object, propertyKey)\n )\n ); // and also unsafe if they're non-enumerable.\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,kBAAkB,QAAa,gBAA6B;AACvE,KAAI;AACF,SAAO,SAAS,OAAO,IAAI,eAAe;SACpC;AACN,SAAO;;;;;;;;;;AAWX,MAAa,kBAAkB,QAAa,gBAA6B;AACvE,QACE,eAAe,QAAQ,YAAY,IACnC,EACE,OAAO,eAAe,KAAK,QAAQ,YAAY,IAC/C,OAAO,qBAAqB,KAAK,QAAQ,YAAY"}
@@ -1 +1,38 @@
1
- const e=require(`./set-field.cjs`);function t(t){return Object.entries(t).reduce((t,[n,r])=>e.setField(t,n,r),{})}exports.unflattenObject=t;
1
+ const require_set_field = require('./set-field.cjs');
2
+
3
+ //#region src/unflatten-object.ts
4
+ /**
5
+ * Flattens a nested object into a single level object with dot-separated keys.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const nestedObject = {
10
+ * a: {
11
+ * b: {
12
+ * c: 1
13
+ * }
14
+ * },
15
+ * d: [2, 3]
16
+ * };
17
+ *
18
+ * const flattened = flattenObject(nestedObject);
19
+ * console.log(flattened);
20
+ * // Output:
21
+ * // {
22
+ * // 'a.b.c': 1,
23
+ * // 'd.0': 2,
24
+ * // 'd.1': 3
25
+ * // }
26
+ * ```
27
+ *
28
+ * @param object - The object to flatten.
29
+ * @returns - The flattened object.
30
+ */
31
+ function unflattenObject(deepKeyObject) {
32
+ return Object.entries(deepKeyObject).reduce((ret, [key, value]) => {
33
+ return require_set_field.setField(ret, key, value);
34
+ }, {});
35
+ }
36
+
37
+ //#endregion
38
+ exports.unflattenObject = unflattenObject;
@@ -1,2 +1,39 @@
1
- import{setField as e}from"./set-field.mjs";function t(t){return Object.entries(t).reduce((t,[n,r])=>e(t,n,r),{})}export{t as unflattenObject};
1
+ import { setField } from "./set-field.mjs";
2
+
3
+ //#region src/unflatten-object.ts
4
+ /**
5
+ * Flattens a nested object into a single level object with dot-separated keys.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const nestedObject = {
10
+ * a: {
11
+ * b: {
12
+ * c: 1
13
+ * }
14
+ * },
15
+ * d: [2, 3]
16
+ * };
17
+ *
18
+ * const flattened = flattenObject(nestedObject);
19
+ * console.log(flattened);
20
+ * // Output:
21
+ * // {
22
+ * // 'a.b.c': 1,
23
+ * // 'd.0': 2,
24
+ * // 'd.1': 3
25
+ * // }
26
+ * ```
27
+ *
28
+ * @param object - The object to flatten.
29
+ * @returns - The flattened object.
30
+ */
31
+ function unflattenObject(deepKeyObject) {
32
+ return Object.entries(deepKeyObject).reduce((ret, [key, value]) => {
33
+ return setField(ret, key, value);
34
+ }, {});
35
+ }
36
+
37
+ //#endregion
38
+ export { unflattenObject };
2
39
  //# sourceMappingURL=unflatten-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"unflatten-object.mjs","names":[],"sources":["../src/unflatten-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.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey, DeepValue } from \"@stryke/types/object\";\nimport { setField } from \"./set-field\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n *\n * @example\n * ```typescript\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n *\n * const flattened = flattenObject(nestedObject);\n * console.log(flattened);\n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n * ```\n *\n * @param object - The object to flatten.\n * @returns - The flattened object.\n */\nexport function unflattenObject<\n TObject extends Record<string, any> = Record<string, any>,\n TDeepKeyObject extends {\n [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey>;\n } = { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> }\n>(deepKeyObject: TDeepKeyObject): TObject {\n return Object.entries(deepKeyObject).reduce(\n (ret: TObject, [key, value]: [string, any]) => {\n return setField<TObject>(ret, key as DeepKey<TObject>, value);\n },\n {} as TObject\n );\n}\n"],"mappings":"2CA+CA,SAAgB,EAKd,EAAwC,CACxC,OAAO,OAAO,QAAQ,EAAc,CAAC,QAClC,EAAc,CAAC,EAAK,KACZ,EAAkB,EAAK,EAAyB,EAAM,CAE/D,EAAE,CACH"}
1
+ {"version":3,"file":"unflatten-object.mjs","names":[],"sources":["../src/unflatten-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.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport type { DeepKey, DeepValue } from \"@stryke/types/object\";\nimport { setField } from \"./set-field\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n *\n * @example\n * ```typescript\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n *\n * const flattened = flattenObject(nestedObject);\n * console.log(flattened);\n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n * ```\n *\n * @param object - The object to flatten.\n * @returns - The flattened object.\n */\nexport function unflattenObject<\n TObject extends Record<string, any> = Record<string, any>,\n TDeepKeyObject extends {\n [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey>;\n } = { [TKey in DeepKey<TObject>]: DeepValue<TObject, TKey> }\n>(deepKeyObject: TDeepKeyObject): TObject {\n return Object.entries(deepKeyObject).reduce(\n (ret: TObject, [key, value]: [string, any]) => {\n return setField<TObject>(ret, key as DeepKey<TObject>, value);\n },\n {} as TObject\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,gBAKd,eAAwC;AACxC,QAAO,OAAO,QAAQ,cAAc,CAAC,QAClC,KAAc,CAAC,KAAK,WAA0B;AAC7C,SAAO,SAAkB,KAAK,KAAyB,MAAM;IAE/D,EAAE,CACH"}
package/dist/union.cjs CHANGED
@@ -1 +1,28 @@
1
- const e=require(`./get-unique.cjs`);function t(t,n){return e.getUnique([...t,...n])}exports.union=t;
1
+ const require_get_unique = require('./get-unique.cjs');
2
+
3
+ //#region src/union.ts
4
+ /**
5
+ * Creates an array of unique values from all given arrays.
6
+ *
7
+ * @remarks
8
+ * This function takes two arrays, merges them into a single array, and returns a new array
9
+ * containing only the unique values from the merged array.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const array1 = [1, 2, 3];
14
+ * const array2 = [3, 4, 5];
15
+ * const result = union(array1, array2);
16
+ * // result will be [1, 2, 3, 4, 5]
17
+ * ```
18
+ *
19
+ * @param arr1 - The first array to merge and filter for unique values.
20
+ * @param arr2 - The second array to merge and filter for unique values.
21
+ * @returns A new array of unique values.
22
+ */
23
+ function union(arr1, arr2) {
24
+ return require_get_unique.getUnique([...arr1, ...arr2]);
25
+ }
26
+
27
+ //#endregion
28
+ exports.union = union;
package/dist/union.mjs CHANGED
@@ -1,2 +1,29 @@
1
- import{getUnique as e}from"./get-unique.mjs";function t(t,n){return e([...t,...n])}export{t as union};
1
+ import { getUnique } from "./get-unique.mjs";
2
+
3
+ //#region src/union.ts
4
+ /**
5
+ * Creates an array of unique values from all given arrays.
6
+ *
7
+ * @remarks
8
+ * This function takes two arrays, merges them into a single array, and returns a new array
9
+ * containing only the unique values from the merged array.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const array1 = [1, 2, 3];
14
+ * const array2 = [3, 4, 5];
15
+ * const result = union(array1, array2);
16
+ * // result will be [1, 2, 3, 4, 5]
17
+ * ```
18
+ *
19
+ * @param arr1 - The first array to merge and filter for unique values.
20
+ * @param arr2 - The second array to merge and filter for unique values.
21
+ * @returns A new array of unique values.
22
+ */
23
+ function union(arr1, arr2) {
24
+ return getUnique([...arr1, ...arr2]);
25
+ }
26
+
27
+ //#endregion
28
+ export { union };
2
29
  //# sourceMappingURL=union.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.mjs","names":[],"sources":["../src/union.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.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport { getUnique } from \"./get-unique\";\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * @remarks\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @example\n * ```ts\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n * ```\n *\n * @param arr1 - The first array to merge and filter for unique values.\n * @param arr2 - The second array to merge and filter for unique values.\n * @returns A new array of unique values.\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return getUnique([...arr1, ...arr2]);\n}\n"],"mappings":"6CAsCA,SAAgB,EAAS,EAAoB,EAAyB,CACpE,OAAO,EAAU,CAAC,GAAG,EAAM,GAAG,EAAK,CAAC"}
1
+ {"version":3,"file":"union.mjs","names":[],"sources":["../src/union.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.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://stormsoftware.com/projects/stryke/docs\n Contact: https://stormsoftware.com/contact\n License: https://stormsoftware.com/projects/stryke/license\n\n ------------------------------------------------------------------- */\n\nimport { getUnique } from \"./get-unique\";\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * @remarks\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @example\n * ```ts\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n * ```\n *\n * @param arr1 - The first array to merge and filter for unique values.\n * @param arr2 - The second array to merge and filter for unique values.\n * @returns A new array of unique values.\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return getUnique([...arr1, ...arr2]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,MAAS,MAAoB,MAAyB;AACpE,QAAO,UAAU,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC"}