@stryke/helpers 0.10.12 → 0.10.14

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 (193) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/arg-identity.cjs +1 -0
  3. package/dist/arg-identity.d.cts.map +1 -1
  4. package/dist/arg-identity.d.mts.map +1 -1
  5. package/dist/deep-clone.cjs +4 -5
  6. package/dist/deep-clone.d.cts.map +1 -1
  7. package/dist/deep-clone.d.mts.map +1 -1
  8. package/dist/deep-clone.mjs +1 -3
  9. package/dist/deep-clone.mjs.map +1 -1
  10. package/dist/deep-merge.cjs +7 -6
  11. package/dist/deep-merge.d.cts.map +1 -1
  12. package/dist/deep-merge.d.mts.map +1 -1
  13. package/dist/deep-merge.mjs +3 -3
  14. package/dist/deep-merge.mjs.map +1 -1
  15. package/dist/filter-empty.cjs +3 -2
  16. package/dist/filter-empty.d.cts.map +1 -1
  17. package/dist/filter-empty.d.mts.map +1 -1
  18. package/dist/filter-empty.mjs +1 -1
  19. package/dist/flatten-object.cjs +3 -3
  20. package/dist/flatten-object.d.cts +1 -2
  21. package/dist/flatten-object.d.cts.map +1 -1
  22. package/dist/flatten-object.d.mts +1 -2
  23. package/dist/flatten-object.d.mts.map +1 -1
  24. package/dist/flatten-object.mjs +1 -2
  25. package/dist/flatten-object.mjs.map +1 -1
  26. package/dist/get-field.cjs +5 -12
  27. package/dist/get-field.d.cts.map +1 -1
  28. package/dist/get-field.d.mts.map +1 -1
  29. package/dist/get-field.mjs +2 -10
  30. package/dist/get-field.mjs.map +1 -1
  31. package/dist/get-ordered-by.cjs +1 -0
  32. package/dist/get-ordered-by.d.cts.map +1 -1
  33. package/dist/get-ordered-by.d.mts.map +1 -1
  34. package/dist/get-unique.cjs +1 -0
  35. package/dist/get-unique.d.cts.map +1 -1
  36. package/dist/get-unique.d.mts.map +1 -1
  37. package/dist/identity.cjs +1 -0
  38. package/dist/identity.d.cts.map +1 -1
  39. package/dist/identity.d.mts.map +1 -1
  40. package/dist/index.cjs +1 -0
  41. package/dist/is-equal.cjs +5 -4
  42. package/dist/is-equal.d.cts.map +1 -1
  43. package/dist/is-equal.d.mts.map +1 -1
  44. package/dist/is-equal.mjs +2 -2
  45. package/dist/lru-cache.cjs +1 -0
  46. package/dist/lru-cache.d.cts.map +1 -1
  47. package/dist/lru-cache.d.mts.map +1 -1
  48. package/dist/match-sorter.cjs +1 -0
  49. package/dist/match-sorter.d.cts.map +1 -1
  50. package/dist/match-sorter.d.mts.map +1 -1
  51. package/dist/match-sorter.mjs.map +1 -1
  52. package/dist/memoize.cjs +1 -0
  53. package/dist/memoize.d.cts.map +1 -1
  54. package/dist/memoize.d.mts.map +1 -1
  55. package/dist/memoize.mjs.map +1 -1
  56. package/dist/noop.cjs +1 -0
  57. package/dist/noop.d.cts.map +1 -1
  58. package/dist/noop.d.mts.map +1 -1
  59. package/dist/omit.cjs +1 -0
  60. package/dist/omit.d.cts.map +1 -1
  61. package/dist/omit.d.mts.map +1 -1
  62. package/dist/pick.cjs +1 -0
  63. package/dist/pick.d.cts.map +1 -1
  64. package/dist/pick.d.mts.map +1 -1
  65. package/dist/remove-accents.cjs +1 -0
  66. package/dist/remove-accents.d.cts.map +1 -1
  67. package/dist/remove-accents.d.mts.map +1 -1
  68. package/dist/remove-accents.mjs.map +1 -1
  69. package/dist/remove-empty-items.cjs +1 -0
  70. package/dist/remove-empty-items.d.cts.map +1 -1
  71. package/dist/remove-empty-items.d.mts.map +1 -1
  72. package/dist/set-field.cjs +5 -4
  73. package/dist/set-field.d.cts +1 -2
  74. package/dist/set-field.d.cts.map +1 -1
  75. package/dist/set-field.d.mts +1 -2
  76. package/dist/set-field.d.mts.map +1 -1
  77. package/dist/set-field.mjs +2 -2
  78. package/dist/set-field.mjs.map +1 -1
  79. package/dist/to-deep-key.cjs +5 -4
  80. package/dist/to-deep-key.d.cts.map +1 -1
  81. package/dist/to-deep-key.d.mts.map +1 -1
  82. package/dist/to-deep-key.mjs +2 -2
  83. package/dist/to-path.cjs +1 -0
  84. package/dist/to-path.d.cts.map +1 -1
  85. package/dist/to-path.d.mts.map +1 -1
  86. package/dist/to-path.mjs.map +1 -1
  87. package/dist/unflatten-object.cjs +1 -0
  88. package/dist/unflatten-object.d.cts +1 -2
  89. package/dist/unflatten-object.d.cts.map +1 -1
  90. package/dist/unflatten-object.d.mts +1 -2
  91. package/dist/unflatten-object.d.mts.map +1 -1
  92. package/dist/union.cjs +1 -0
  93. package/dist/union.d.cts.map +1 -1
  94. package/dist/union.d.mts.map +1 -1
  95. package/package.json +51 -46
  96. package/dist/convert/src/index.cjs +0 -5
  97. package/dist/convert/src/index.mjs +0 -7
  98. package/dist/convert/src/parse-type-definition.cjs +0 -1
  99. package/dist/convert/src/parse-type-definition.mjs +0 -3
  100. package/dist/convert/src/string-to-utf8-array.cjs +0 -5
  101. package/dist/convert/src/string-to-utf8-array.mjs +0 -6
  102. package/dist/convert/src/string-to-utf8-array.mjs.map +0 -1
  103. package/dist/convert/src/to-bool.cjs +0 -1
  104. package/dist/convert/src/to-bool.mjs +0 -3
  105. package/dist/convert/src/to-string-key.cjs +0 -15
  106. package/dist/convert/src/to-string-key.mjs +0 -15
  107. package/dist/convert/src/to-string-key.mjs.map +0 -1
  108. package/dist/convert/src/utf8-array-to-string.cjs +0 -5
  109. package/dist/convert/src/utf8-array-to-string.mjs +0 -6
  110. package/dist/convert/src/utf8-array-to-string.mjs.map +0 -1
  111. package/dist/type-checks/src/get-object-tag.cjs +0 -15
  112. package/dist/type-checks/src/get-object-tag.mjs +0 -15
  113. package/dist/type-checks/src/get-object-tag.mjs.map +0 -1
  114. package/dist/type-checks/src/index.cjs +0 -21
  115. package/dist/type-checks/src/index.mjs +0 -23
  116. package/dist/type-checks/src/is-buffer.cjs +0 -13
  117. package/dist/type-checks/src/is-buffer.mjs +0 -14
  118. package/dist/type-checks/src/is-buffer.mjs.map +0 -1
  119. package/dist/type-checks/src/is-collection.cjs +0 -1
  120. package/dist/type-checks/src/is-collection.mjs +0 -3
  121. package/dist/type-checks/src/is-deep-key.cjs +0 -34
  122. package/dist/type-checks/src/is-deep-key.mjs +0 -34
  123. package/dist/type-checks/src/is-deep-key.mjs.map +0 -1
  124. package/dist/type-checks/src/is-empty.cjs +0 -20
  125. package/dist/type-checks/src/is-empty.mjs +0 -21
  126. package/dist/type-checks/src/is-empty.mjs.map +0 -1
  127. package/dist/type-checks/src/is-function.cjs +0 -27
  128. package/dist/type-checks/src/is-function.mjs +0 -26
  129. package/dist/type-checks/src/is-function.mjs.map +0 -1
  130. package/dist/type-checks/src/is-mergeable-object.cjs +0 -14
  131. package/dist/type-checks/src/is-mergeable-object.mjs +0 -15
  132. package/dist/type-checks/src/is-mergeable-object.mjs.map +0 -1
  133. package/dist/type-checks/src/is-non-null-object.cjs +0 -16
  134. package/dist/type-checks/src/is-non-null-object.mjs +0 -17
  135. package/dist/type-checks/src/is-non-null-object.mjs.map +0 -1
  136. package/dist/type-checks/src/is-null.cjs +0 -12
  137. package/dist/type-checks/src/is-null.mjs +0 -12
  138. package/dist/type-checks/src/is-null.mjs.map +0 -1
  139. package/dist/type-checks/src/is-number.cjs +0 -18
  140. package/dist/type-checks/src/is-number.mjs +0 -18
  141. package/dist/type-checks/src/is-number.mjs.map +0 -1
  142. package/dist/type-checks/src/is-object-index.cjs +0 -25
  143. package/dist/type-checks/src/is-object-index.mjs +0 -25
  144. package/dist/type-checks/src/is-object-index.mjs.map +0 -1
  145. package/dist/type-checks/src/is-object.cjs +0 -19
  146. package/dist/type-checks/src/is-object.mjs +0 -20
  147. package/dist/type-checks/src/is-object.mjs.map +0 -1
  148. package/dist/type-checks/src/is-plain-object.cjs +0 -64
  149. package/dist/type-checks/src/is-plain-object.mjs +0 -64
  150. package/dist/type-checks/src/is-plain-object.mjs.map +0 -1
  151. package/dist/type-checks/src/is-primitive.cjs +0 -12
  152. package/dist/type-checks/src/is-primitive.mjs +0 -12
  153. package/dist/type-checks/src/is-primitive.mjs.map +0 -1
  154. package/dist/type-checks/src/is-react-element.cjs +0 -8
  155. package/dist/type-checks/src/is-react-element.mjs +0 -8
  156. package/dist/type-checks/src/is-react-element.mjs.map +0 -1
  157. package/dist/type-checks/src/is-set-string.cjs +0 -20
  158. package/dist/type-checks/src/is-set-string.mjs +0 -21
  159. package/dist/type-checks/src/is-set-string.mjs.map +0 -1
  160. package/dist/type-checks/src/is-set.cjs +0 -19
  161. package/dist/type-checks/src/is-set.mjs +0 -20
  162. package/dist/type-checks/src/is-set.mjs.map +0 -1
  163. package/dist/type-checks/src/is-string.cjs +0 -12
  164. package/dist/type-checks/src/is-string.mjs +0 -12
  165. package/dist/type-checks/src/is-string.mjs.map +0 -1
  166. package/dist/type-checks/src/is-typed-array.cjs +0 -8
  167. package/dist/type-checks/src/is-typed-array.mjs +0 -8
  168. package/dist/type-checks/src/is-typed-array.mjs.map +0 -1
  169. package/dist/type-checks/src/is-undefined.cjs +0 -8
  170. package/dist/type-checks/src/is-undefined.mjs +0 -8
  171. package/dist/type-checks/src/is-undefined.mjs.map +0 -1
  172. package/dist/type-checks/src/property-exists.cjs +0 -31
  173. package/dist/type-checks/src/property-exists.mjs +0 -31
  174. package/dist/type-checks/src/property-exists.mjs.map +0 -1
  175. package/dist/type-checks/src/type-detect.cjs +0 -15
  176. package/dist/type-checks/src/type-detect.mjs +0 -17
  177. package/dist/type-checks/src/type-detect.mjs.map +0 -1
  178. package/dist/types/src/base.d.cts +0 -8
  179. package/dist/types/src/base.d.cts.map +0 -1
  180. package/dist/types/src/base.d.mts +0 -8
  181. package/dist/types/src/base.d.mts.map +0 -1
  182. package/dist/types/src/json.d.cts +0 -28
  183. package/dist/types/src/json.d.cts.map +0 -1
  184. package/dist/types/src/json.d.mts +0 -28
  185. package/dist/types/src/json.d.mts.map +0 -1
  186. package/dist/types/src/object.d.cts +0 -125
  187. package/dist/types/src/object.d.cts.map +0 -1
  188. package/dist/types/src/object.d.mts +0 -125
  189. package/dist/types/src/object.d.mts.map +0 -1
  190. package/dist/types/src/string.d.cts +0 -6
  191. package/dist/types/src/string.d.cts.map +0 -1
  192. package/dist/types/src/string.d.mts +0 -6
  193. package/dist/types/src/string.d.mts.map +0 -1
@@ -1,7 +1,6 @@
1
- import { DeepKey } from "./types/src/object.mjs";
1
+ import { DeepKey } from "@stryke/types/object";
2
2
 
3
3
  //#region src/set-field.d.ts
4
-
5
4
  /**
6
5
  * Sets a value at a given deep path in an object.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"set-field.d.mts","names":[],"sources":["../src/set-field.ts"],"sourcesContent":[],"mappings":";;;;;;AA+BA;;;;;;AAE4D,iBAF5C,QAE4C,CAAA,gBAD1C,MAC0C,CAAA,MAAA,EAAA,GAAA,CAAA,GADpB,MACoB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,MAAA,EAAlD,OAAkD,EAAA,IAAA,EAAnC,OAAmC,CAA3B,OAA2B,CAAA,EAAA,KAAA,EAAA,OAAA,CAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"set-field.d.mts","names":[],"sources":["../src/set-field.ts"],"mappings":";;;;;AA+BA;;;;;;iBAAgB,QAAA,iBACE,MAAA,gBAAsB,MAAA,cAAA,CACtC,MAAA,EAAQ,OAAA,EAAS,IAAA,EAAM,OAAA,CAAQ,OAAA,GAAU,KAAA,YAAiB,OAAA"}
@@ -1,6 +1,6 @@
1
- import { isString } from "./type-checks/src/is-string.mjs";
2
- import { isObjectIndex } from "./type-checks/src/is-object-index.mjs";
3
1
  import { toPath } from "./to-path.mjs";
2
+ import { isObjectIndex } from "@stryke/type-checks/is-object-index";
3
+ import { isString } from "@stryke/type-checks/is-string";
4
4
 
5
5
  //#region src/set-field.ts
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"set-field.mjs","names":["current: any"],"sources":["../src/set-field.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 { isObjectIndex } from \"@stryke/type-checks/is-object-index\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type { DeepKey } from \"@stryke/types/object\";\nimport { toPath } from \"./to-path\";\n\n/**\n * Sets a value at a given deep path in an object.\n *\n * @param object - The object to set the value in.\n * @param path - The deep path to set the value at.\n * @param value - The value to set.\n * @returns The object with the value set at the given deep path.\n */\nexport function setField<\n TObject extends Record<string, any> = Record<string, any>\n>(object: TObject, path: DeepKey<TObject>, value: unknown): TObject {\n const resolvedPath = Array.isArray(path)\n ? path\n : isString(path)\n ? toPath(path)\n : [path];\n\n // Validate resolvedPath to prevent prototype pollution\n for (const key of resolvedPath) {\n if (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") {\n throw new Error(`Invalid key in path: ${key}`);\n }\n }\n\n let current: any = object;\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n\n if (current[key] === null) {\n current[key] = isObjectIndex(nextKey) ? [] : {};\n }\n\n current = current[key];\n }\n\n const lastKey = resolvedPath.at(-1);\n if (lastKey) {\n current[lastKey] = value;\n }\n\n return object;\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,SAEd,QAAiB,MAAwB,OAAyB;CAClE,MAAM,eAAe,MAAM,QAAQ,KAAK,GACpC,OACA,SAAS,KAAK,GACZ,OAAO,KAAK,GACZ,CAAC,KAAK;AAGZ,MAAK,MAAM,OAAO,aAChB,KAAI,QAAQ,eAAe,QAAQ,iBAAiB,QAAQ,YAC1D,OAAM,IAAI,MAAM,wBAAwB,MAAM;CAIlD,IAAIA,UAAe;AACnB,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,SAAS,GAAG,KAAK;EAChD,MAAM,MAAM,aAAa;EACzB,MAAM,UAAU,aAAa,IAAI;AAEjC,MAAI,QAAQ,SAAS,KACnB,SAAQ,OAAO,cAAc,QAAQ,GAAG,EAAE,GAAG,EAAE;AAGjD,YAAU,QAAQ;;CAGpB,MAAM,UAAU,aAAa,GAAG,GAAG;AACnC,KAAI,QACF,SAAQ,WAAW;AAGrB,QAAO"}
1
+ {"version":3,"file":"set-field.mjs","names":[],"sources":["../src/set-field.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 { isObjectIndex } from \"@stryke/type-checks/is-object-index\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport type { DeepKey } from \"@stryke/types/object\";\nimport { toPath } from \"./to-path\";\n\n/**\n * Sets a value at a given deep path in an object.\n *\n * @param object - The object to set the value in.\n * @param path - The deep path to set the value at.\n * @param value - The value to set.\n * @returns The object with the value set at the given deep path.\n */\nexport function setField<\n TObject extends Record<string, any> = Record<string, any>\n>(object: TObject, path: DeepKey<TObject>, value: unknown): TObject {\n const resolvedPath = Array.isArray(path)\n ? path\n : isString(path)\n ? toPath(path)\n : [path];\n\n // Validate resolvedPath to prevent prototype pollution\n for (const key of resolvedPath) {\n if (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") {\n throw new Error(`Invalid key in path: ${key}`);\n }\n }\n\n let current: any = object;\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n\n if (current[key] === null) {\n current[key] = isObjectIndex(nextKey) ? [] : {};\n }\n\n current = current[key];\n }\n\n const lastKey = resolvedPath.at(-1);\n if (lastKey) {\n current[lastKey] = value;\n }\n\n return object;\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,SAEd,QAAiB,MAAwB,OAAyB;CAClE,MAAM,eAAe,MAAM,QAAQ,KAAK,GACpC,OACA,SAAS,KAAK,GACZ,OAAO,KAAK,GACZ,CAAC,KAAK;AAGZ,MAAK,MAAM,OAAO,aAChB,KAAI,QAAQ,eAAe,QAAQ,iBAAiB,QAAQ,YAC1D,OAAM,IAAI,MAAM,wBAAwB,MAAM;CAIlD,IAAI,UAAe;AACnB,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,SAAS,GAAG,KAAK;EAChD,MAAM,MAAM,aAAa;EACzB,MAAM,UAAU,aAAa,IAAI;AAEjC,MAAI,QAAQ,SAAS,KACnB,SAAQ,OAAO,cAAc,QAAQ,GAAG,EAAE,GAAG,EAAE;AAGjD,YAAU,QAAQ;;CAGpB,MAAM,UAAU,aAAa,GAAG,GAAG;AACnC,KAAI,QACF,SAAQ,WAAW;AAGrB,QAAO"}
@@ -1,5 +1,6 @@
1
- const require_is_number = require('./type-checks/src/is-number.cjs');
2
- const require_is_set_string = require('./type-checks/src/is-set-string.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
3
+ let _stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
3
4
 
4
5
  //#region src/to-deep-key.ts
5
6
  /**
@@ -44,8 +45,8 @@ function toDeepKey(path) {
44
45
  * @returns A new deep key string.
45
46
  */
46
47
  function addPathToDeepKey(deepKey, path) {
47
- if (require_is_number.isNumber(path) || Number.isInteger(path)) return `${deepKey}[${path}]`;
48
- if (require_is_set_string.isSetString(path)) return `${deepKey}.${path}`;
48
+ if ((0, _stryke_type_checks_is_number.isNumber)(path) || Number.isInteger(path)) return `${deepKey}[${path}]`;
49
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(path)) return `${deepKey}.${path}`;
49
50
  return deepKey;
50
51
  }
51
52
 
@@ -1 +1 @@
1
- {"version":3,"file":"to-deep-key.d.cts","names":[],"sources":["../src/to-deep-key.ts"],"sourcesContent":[],"mappings":";;AAqCA;AA0BA;;;;;;;;;;;;;;iBA1BgB,SAAA;;;;;;;;;;;;;;;;;;;;;iBA0BA,gBAAA"}
1
+ {"version":3,"file":"to-deep-key.d.cts","names":[],"sources":["../src/to-deep-key.ts"],"mappings":";;AAqCA;;;;;AA0BA;;;;;;;;;;iBA1BgB,SAAA,CAAU,IAAA;;;;;;;;;;;;;;;;;;;;;iBA0BV,gBAAA,CACd,OAAA,UACA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-deep-key.d.mts","names":[],"sources":["../src/to-deep-key.ts"],"sourcesContent":[],"mappings":";;AAqCA;AA0BA;;;;;;;;;;;;;;iBA1BgB,SAAA;;;;;;;;;;;;;;;;;;;;;iBA0BA,gBAAA"}
1
+ {"version":3,"file":"to-deep-key.d.mts","names":[],"sources":["../src/to-deep-key.ts"],"mappings":";;AAqCA;;;;;AA0BA;;;;;;;;;;iBA1BgB,SAAA,CAAU,IAAA;;;;;;;;;;;;;;;;;;;;;iBA0BV,gBAAA,CACd,OAAA,UACA,IAAA"}
@@ -1,5 +1,5 @@
1
- import { isNumber } from "./type-checks/src/is-number.mjs";
2
- import { isSetString } from "./type-checks/src/is-set-string.mjs";
1
+ import { isSetString } from "@stryke/type-checks/is-set-string";
2
+ import { isNumber } from "@stryke/type-checks/is-number";
3
3
 
4
4
  //#region src/to-deep-key.ts
5
5
  /**
package/dist/to-path.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/to-path.ts
3
4
  const DOTS_KEY = /^[\w.]+$/g;
@@ -1 +1 @@
1
- {"version":3,"file":"to-path.d.cts","names":[],"sources":["../src/to-path.ts"],"sourcesContent":[],"mappings":";;AAyDA;;;;;;;;;;;;;;;;;;iBAAgB,MAAA"}
1
+ {"version":3,"file":"to-path.d.cts","names":[],"sources":["../src/to-path.ts"],"mappings":";;AAyDA;;;;;;;;;;;;;;;;;;iBAAgB,MAAA,CAAO,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-path.d.mts","names":[],"sources":["../src/to-path.ts"],"sourcesContent":[],"mappings":";;AAyDA;;;;;;;;;;;;;;;;;;iBAAgB,MAAA"}
1
+ {"version":3,"file":"to-path.d.mts","names":[],"sources":["../src/to-path.ts"],"mappings":";;AAyDA;;;;;;;;;;;;;;;;;;iBAAgB,MAAA,CAAO,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-path.mjs","names":["result: string[]"],"sources":["../src/to-path.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 DOTS_KEY = /^[\\w.]+$/g;\n\nconst ESCAPE_REGEXP = /\\\\(?<temp1>\\\\)?/g;\nconst PROPERTY_REGEXP = new RegExp(\n // Match anything that isn't a dot or bracket.\n `${String.raw`[^.[\\]]+`}|${\n // Or match property names within brackets.\n String.raw`\\[(?:`\n // Match a non-string expression.\n }([^\"'][^[]*)` +\n `|${\n // Or match strings (supports escaping characters).\n String.raw`([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2`\n }${String.raw`)\\]`}|${\n // Or match \"\" as the space between consecutive dots or empty brackets.\n String.raw`(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`\n }`,\n \"g\"\n);\n\n/**\n * Converts a deep key string into an array of path segments.\n *\n * @remarks\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @example\n * ```ts\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n * ```\n *\n * @param deepKey - The deep key string to convert.\n * @returns An array of strings, each representing a segment of the path.\n */\nexport function toPath(deepKey: string): string[] {\n if (DOTS_KEY.test(deepKey)) {\n return deepKey.split(\".\");\n }\n\n const result: string[] = [];\n\n if (deepKey[0] === \".\") {\n result.push(\"\");\n }\n\n const matches = deepKey.matchAll(PROPERTY_REGEXP);\n\n for (const match of matches) {\n let key = match[0];\n const expr = match[1];\n const quote = match[2];\n const substr = match[3];\n\n if (quote && substr) {\n key = substr.replace(ESCAPE_REGEXP, \"$1\");\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n }\n\n return result;\n}\n"],"mappings":";AAkBA,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AACtB,MAAM,kBAAkB,IAAI,OAE1B,GAAG,OAAO,GAAG,WAAW,GAEtB,OAAO,GAAG,QAEX,eAGG,OAAO,GAAG,oCACT,OAAO,GAAG,MAAM,GAEjB,OAAO,GAAG,kCAEd,IACD;;;;;;;;;;;;;;;;;;;;AAqBD,SAAgB,OAAO,SAA2B;AAChD,KAAI,SAAS,KAAK,QAAQ,CACxB,QAAO,QAAQ,MAAM,IAAI;CAG3B,MAAMA,SAAmB,EAAE;AAE3B,KAAI,QAAQ,OAAO,IACjB,QAAO,KAAK,GAAG;CAGjB,MAAM,UAAU,QAAQ,SAAS,gBAAgB;AAEjD,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,MAAM,MAAM;EAChB,MAAM,OAAO,MAAM;EACnB,MAAM,QAAQ,MAAM;EACpB,MAAM,SAAS,MAAM;AAErB,MAAI,SAAS,OACX,OAAM,OAAO,QAAQ,eAAe,KAAK;WAChC,KACT,OAAM;AAGR,SAAO,KAAK,IAAI;;AAGlB,QAAO"}
1
+ {"version":3,"file":"to-path.mjs","names":[],"sources":["../src/to-path.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 DOTS_KEY = /^[\\w.]+$/g;\n\nconst ESCAPE_REGEXP = /\\\\(?<temp1>\\\\)?/g;\nconst PROPERTY_REGEXP = new RegExp(\n // Match anything that isn't a dot or bracket.\n `${String.raw`[^.[\\]]+`}|${\n // Or match property names within brackets.\n String.raw`\\[(?:`\n // Match a non-string expression.\n }([^\"'][^[]*)` +\n `|${\n // Or match strings (supports escaping characters).\n String.raw`([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2`\n }${String.raw`)\\]`}|${\n // Or match \"\" as the space between consecutive dots or empty brackets.\n String.raw`(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`\n }`,\n \"g\"\n);\n\n/**\n * Converts a deep key string into an array of path segments.\n *\n * @remarks\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @example\n * ```ts\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n * ```\n *\n * @param deepKey - The deep key string to convert.\n * @returns An array of strings, each representing a segment of the path.\n */\nexport function toPath(deepKey: string): string[] {\n if (DOTS_KEY.test(deepKey)) {\n return deepKey.split(\".\");\n }\n\n const result: string[] = [];\n\n if (deepKey[0] === \".\") {\n result.push(\"\");\n }\n\n const matches = deepKey.matchAll(PROPERTY_REGEXP);\n\n for (const match of matches) {\n let key = match[0];\n const expr = match[1];\n const quote = match[2];\n const substr = match[3];\n\n if (quote && substr) {\n key = substr.replace(ESCAPE_REGEXP, \"$1\");\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n }\n\n return result;\n}\n"],"mappings":";AAkBA,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AACtB,MAAM,kBAAkB,IAAI,OAE1B,GAAG,OAAO,GAAG,WAAW,GAEtB,OAAO,GAAG,QAEX,eAGG,OAAO,GAAG,oCACT,OAAO,GAAG,MAAM,GAEjB,OAAO,GAAG,kCAEd,IACD;;;;;;;;;;;;;;;;;;;;AAqBD,SAAgB,OAAO,SAA2B;AAChD,KAAI,SAAS,KAAK,QAAQ,CACxB,QAAO,QAAQ,MAAM,IAAI;CAG3B,MAAM,SAAmB,EAAE;AAE3B,KAAI,QAAQ,OAAO,IACjB,QAAO,KAAK,GAAG;CAGjB,MAAM,UAAU,QAAQ,SAAS,gBAAgB;AAEjD,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,MAAM,MAAM;EAChB,MAAM,OAAO,MAAM;EACnB,MAAM,QAAQ,MAAM;EACpB,MAAM,SAAS,MAAM;AAErB,MAAI,SAAS,OACX,OAAM,OAAO,QAAQ,eAAe,KAAK;WAChC,KACT,OAAM;AAGR,SAAO,KAAK,IAAI;;AAGlB,QAAO"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_set_field = require('./set-field.cjs');
2
3
 
3
4
  //#region src/unflatten-object.ts
@@ -1,7 +1,6 @@
1
- import { DeepKey, DeepValue } from "./types/src/object.cjs";
1
+ import { DeepKey, DeepValue } from "@stryke/types";
2
2
 
3
3
  //#region src/unflatten-object.d.ts
4
-
5
4
  /**
6
5
  * Flattens a nested object into a single level object with dot-separated keys.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unflatten-object.d.cts","names":[],"sources":["../src/unflatten-object.ts"],"sourcesContent":[],"mappings":";;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gCACE,sBAAsB,uDAE3B,QAAQ,WAAW,UAAU,SAAS,qBAClC,QAAQ,WAAW,UAAU,SAAS,wBACtC,iBAAiB"}
1
+ {"version":3,"file":"unflatten-object.d.cts","names":[],"sources":["../src/unflatten-object.ts"],"mappings":";;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,eAAA,iBACE,MAAA,gBAAsB,MAAA,iDAE3B,OAAA,CAAQ,OAAA,IAAW,SAAA,CAAU,OAAA,EAAS,IAAA,iBAClC,OAAA,CAAQ,OAAA,IAAW,SAAA,CAAU,OAAA,EAAS,IAAA,IAAA,CACrD,aAAA,EAAe,cAAA,GAAiB,OAAA"}
@@ -1,7 +1,6 @@
1
- import { DeepKey, DeepValue } from "./types/src/object.mjs";
1
+ import { DeepKey, DeepValue } from "@stryke/types";
2
2
 
3
3
  //#region src/unflatten-object.d.ts
4
-
5
4
  /**
6
5
  * Flattens a nested object into a single level object with dot-separated keys.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unflatten-object.d.mts","names":[],"sources":["../src/unflatten-object.ts"],"sourcesContent":[],"mappings":";;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,gCACE,sBAAsB,uDAE3B,QAAQ,WAAW,UAAU,SAAS,qBAClC,QAAQ,WAAW,UAAU,SAAS,wBACtC,iBAAiB"}
1
+ {"version":3,"file":"unflatten-object.d.mts","names":[],"sources":["../src/unflatten-object.ts"],"mappings":";;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,eAAA,iBACE,MAAA,gBAAsB,MAAA,iDAE3B,OAAA,CAAQ,OAAA,IAAW,SAAA,CAAU,OAAA,EAAS,IAAA,iBAClC,OAAA,CAAQ,OAAA,IAAW,SAAA,CAAU,OAAA,EAAS,IAAA,IAAA,CACrD,aAAA,EAAe,cAAA,GAAiB,OAAA"}
package/dist/union.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_get_unique = require('./get-unique.cjs');
2
3
 
3
4
  //#region src/union.ts
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.cts","names":[],"sources":["../src/union.ts"],"sourcesContent":[],"mappings":";;AAuCA;;;;;;;;;;;;;;;;;;iBAAgB,wBAAwB,oBAAoB,MAAM"}
1
+ {"version":3,"file":"union.d.cts","names":[],"sources":["../src/union.ts"],"mappings":";;AAuCA;;;;;;;;;;;;;;;;;;iBAAgB,KAAA,GAAA,CAAS,IAAA,WAAe,CAAA,IAAK,IAAA,WAAe,CAAA,KAAM,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.mts","names":[],"sources":["../src/union.ts"],"sourcesContent":[],"mappings":";;AAuCA;;;;;;;;;;;;;;;;;;iBAAgB,wBAAwB,oBAAoB,MAAM"}
1
+ {"version":3,"file":"union.d.mts","names":[],"sources":["../src/union.ts"],"mappings":";;AAuCA;;;;;;;;;;;;;;;;;;iBAAgB,KAAA,GAAA,CAAS,IAAA,WAAe,CAAA,IAAK,IAAA,WAAe,CAAA,KAAM,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/helpers",
3
- "version": "0.10.12",
3
+ "version": "0.10.14",
4
4
  "private": false,
5
5
  "description": "A package containing miscellaneous helper functions that are used across many different Storm Software projects.",
6
6
  "repository": {
@@ -10,93 +10,98 @@
10
10
  },
11
11
  "type": "module",
12
12
  "exports": {
13
- ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
13
+ ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
14
14
  "./arg-identity": {
15
- "require": "./dist/arg-identity.cjs",
16
- "import": "./dist/arg-identity.mjs"
15
+ "import": "./dist/arg-identity.mjs",
16
+ "require": "./dist/arg-identity.cjs"
17
17
  },
18
18
  "./deep-clone": {
19
- "require": "./dist/deep-clone.cjs",
20
- "import": "./dist/deep-clone.mjs"
19
+ "import": "./dist/deep-clone.mjs",
20
+ "require": "./dist/deep-clone.cjs"
21
21
  },
22
22
  "./deep-merge": {
23
- "require": "./dist/deep-merge.cjs",
24
- "import": "./dist/deep-merge.mjs"
23
+ "import": "./dist/deep-merge.mjs",
24
+ "require": "./dist/deep-merge.cjs"
25
25
  },
26
26
  "./filter-empty": {
27
- "require": "./dist/filter-empty.cjs",
28
- "import": "./dist/filter-empty.mjs"
27
+ "import": "./dist/filter-empty.mjs",
28
+ "require": "./dist/filter-empty.cjs"
29
29
  },
30
30
  "./flatten-object": {
31
- "require": "./dist/flatten-object.cjs",
32
- "import": "./dist/flatten-object.mjs"
31
+ "import": "./dist/flatten-object.mjs",
32
+ "require": "./dist/flatten-object.cjs"
33
33
  },
34
34
  "./get-field": {
35
- "require": "./dist/get-field.cjs",
36
- "import": "./dist/get-field.mjs"
35
+ "import": "./dist/get-field.mjs",
36
+ "require": "./dist/get-field.cjs"
37
37
  },
38
38
  "./get-ordered-by": {
39
- "require": "./dist/get-ordered-by.cjs",
40
- "import": "./dist/get-ordered-by.mjs"
39
+ "import": "./dist/get-ordered-by.mjs",
40
+ "require": "./dist/get-ordered-by.cjs"
41
41
  },
42
42
  "./get-unique": {
43
- "require": "./dist/get-unique.cjs",
44
- "import": "./dist/get-unique.mjs"
43
+ "import": "./dist/get-unique.mjs",
44
+ "require": "./dist/get-unique.cjs"
45
45
  },
46
46
  "./identity": {
47
- "require": "./dist/identity.cjs",
48
- "import": "./dist/identity.mjs"
47
+ "import": "./dist/identity.mjs",
48
+ "require": "./dist/identity.cjs"
49
49
  },
50
50
  "./is-equal": {
51
- "require": "./dist/is-equal.cjs",
52
- "import": "./dist/is-equal.mjs"
51
+ "import": "./dist/is-equal.mjs",
52
+ "require": "./dist/is-equal.cjs"
53
53
  },
54
54
  "./lru-cache": {
55
- "require": "./dist/lru-cache.cjs",
56
- "import": "./dist/lru-cache.mjs"
55
+ "import": "./dist/lru-cache.mjs",
56
+ "require": "./dist/lru-cache.cjs"
57
57
  },
58
58
  "./match-sorter": {
59
- "require": "./dist/match-sorter.cjs",
60
- "import": "./dist/match-sorter.mjs"
59
+ "import": "./dist/match-sorter.mjs",
60
+ "require": "./dist/match-sorter.cjs"
61
61
  },
62
62
  "./memoize": {
63
- "require": "./dist/memoize.cjs",
64
- "import": "./dist/memoize.mjs"
63
+ "import": "./dist/memoize.mjs",
64
+ "require": "./dist/memoize.cjs"
65
65
  },
66
- "./noop": { "require": "./dist/noop.cjs", "import": "./dist/noop.mjs" },
67
- "./omit": { "require": "./dist/omit.cjs", "import": "./dist/omit.mjs" },
68
- "./pick": { "require": "./dist/pick.cjs", "import": "./dist/pick.mjs" },
66
+ "./noop": { "import": "./dist/noop.mjs", "require": "./dist/noop.cjs" },
67
+ "./omit": { "import": "./dist/omit.mjs", "require": "./dist/omit.cjs" },
68
+ "./pick": { "import": "./dist/pick.mjs", "require": "./dist/pick.cjs" },
69
69
  "./remove-accents": {
70
- "require": "./dist/remove-accents.cjs",
71
- "import": "./dist/remove-accents.mjs"
70
+ "import": "./dist/remove-accents.mjs",
71
+ "require": "./dist/remove-accents.cjs"
72
72
  },
73
73
  "./remove-empty-items": {
74
- "require": "./dist/remove-empty-items.cjs",
75
- "import": "./dist/remove-empty-items.mjs"
74
+ "import": "./dist/remove-empty-items.mjs",
75
+ "require": "./dist/remove-empty-items.cjs"
76
76
  },
77
77
  "./set-field": {
78
- "require": "./dist/set-field.cjs",
79
- "import": "./dist/set-field.mjs"
78
+ "import": "./dist/set-field.mjs",
79
+ "require": "./dist/set-field.cjs"
80
80
  },
81
81
  "./to-deep-key": {
82
- "require": "./dist/to-deep-key.cjs",
83
- "import": "./dist/to-deep-key.mjs"
82
+ "import": "./dist/to-deep-key.mjs",
83
+ "require": "./dist/to-deep-key.cjs"
84
84
  },
85
85
  "./to-path": {
86
- "require": "./dist/to-path.cjs",
87
- "import": "./dist/to-path.mjs"
86
+ "import": "./dist/to-path.mjs",
87
+ "require": "./dist/to-path.cjs"
88
88
  },
89
89
  "./unflatten-object": {
90
- "require": "./dist/unflatten-object.cjs",
91
- "import": "./dist/unflatten-object.mjs"
90
+ "import": "./dist/unflatten-object.mjs",
91
+ "require": "./dist/unflatten-object.cjs"
92
92
  },
93
- "./union": { "require": "./dist/union.cjs", "import": "./dist/union.mjs" },
93
+ "./union": { "import": "./dist/union.mjs", "require": "./dist/union.cjs" },
94
94
  "./*": "./*"
95
95
  },
96
96
  "main": "./dist/index.cjs",
97
97
  "module": "./dist/index.mjs",
98
98
  "types": "./dist/index.d.cts",
99
- "devDependencies": { "tsdown": "^0.17.2" },
99
+ "dependencies": {
100
+ "@stryke/convert": "^0.7.5",
101
+ "@stryke/type-checks": "^0.6.7",
102
+ "@stryke/types": "^0.12.2"
103
+ },
104
+ "devDependencies": { "tsdown": "^0.21.10" },
100
105
  "publishConfig": { "access": "public" },
101
- "gitHead": "1483b450abaad8ecaa28225e7af6d412b694edd9"
106
+ "gitHead": "2ed697a18e476a0415c784f7e12e46770ea397e0"
102
107
  }
@@ -1,5 +0,0 @@
1
- require('./parse-type-definition.cjs');
2
- require('./string-to-utf8-array.cjs');
3
- require('./to-bool.cjs');
4
- const require_to_string_key = require('./to-string-key.cjs');
5
- require('./utf8-array-to-string.cjs');
@@ -1,7 +0,0 @@
1
- import "./parse-type-definition.mjs";
2
- import "./string-to-utf8-array.mjs";
3
- import "./to-bool.mjs";
4
- import { toStringKey } from "./to-string-key.mjs";
5
- import "./utf8-array-to-string.mjs";
6
-
7
- export { };
@@ -1 +0,0 @@
1
- require('../../type-checks/src/index.cjs');
@@ -1,3 +0,0 @@
1
- import "../../type-checks/src/index.mjs";
2
-
3
- export { };
@@ -1,5 +0,0 @@
1
-
2
- //#region ../convert/src/string-to-utf8-array.ts
3
- const encoder = new TextEncoder();
4
-
5
- //#endregion
@@ -1,6 +0,0 @@
1
- //#region ../convert/src/string-to-utf8-array.ts
2
- const encoder = new TextEncoder();
3
-
4
- //#endregion
5
- export { };
6
- //# sourceMappingURL=string-to-utf8-array.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-to-utf8-array.mjs","names":[],"sources":["../../../../convert/src/string-to-utf8-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\nconst encoder = new TextEncoder();\n\n/**\n * Convert a string to a utf-8 array\n *\n * @param input - The string to convert\n * @returns The converted utf-8 array\n */\nexport function stringToUtf8Array(input: string): Uint8Array {\n return encoder.encode(input);\n}\n"],"mappings":";AAkBA,MAAM,UAAU,IAAI,aAAa"}
@@ -1 +0,0 @@
1
- require('../../type-checks/src/index.cjs');
@@ -1,3 +0,0 @@
1
- import "../../type-checks/src/index.mjs";
2
-
3
- export { };
@@ -1,15 +0,0 @@
1
-
2
- //#region ../convert/src/to-string-key.ts
3
- /**
4
- * Converts `value` to a string key if it's not a string or symbol.
5
- *
6
- * @param value - The value to inspect.
7
- * @returns Returns the key.
8
- */
9
- function toStringKey(value) {
10
- if (Object.is(value, -0)) return "-0";
11
- return value.toString();
12
- }
13
-
14
- //#endregion
15
- exports.toStringKey = toStringKey;
@@ -1,15 +0,0 @@
1
- //#region ../convert/src/to-string-key.ts
2
- /**
3
- * Converts `value` to a string key if it's not a string or symbol.
4
- *
5
- * @param value - The value to inspect.
6
- * @returns Returns the key.
7
- */
8
- function toStringKey(value) {
9
- if (Object.is(value, -0)) return "-0";
10
- return value.toString();
11
- }
12
-
13
- //#endregion
14
- export { toStringKey };
15
- //# sourceMappingURL=to-string-key.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-string-key.mjs","names":[],"sources":["../../../../convert/src/to-string-key.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @param value - The value to inspect.\n * @returns Returns the key.\n */\nexport function toStringKey(value: number): string | symbol {\n if (Object.is(value, -0)) {\n return \"-0\";\n }\n\n return value.toString();\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,YAAY,OAAgC;AAC1D,KAAI,OAAO,GAAG,OAAO,GAAG,CACtB,QAAO;AAGT,QAAO,MAAM,UAAU"}
@@ -1,5 +0,0 @@
1
-
2
- //#region ../convert/src/utf8-array-to-string.ts
3
- const decoder = new TextDecoder();
4
-
5
- //#endregion
@@ -1,6 +0,0 @@
1
- //#region ../convert/src/utf8-array-to-string.ts
2
- const decoder = new TextDecoder();
3
-
4
- //#endregion
5
- export { };
6
- //# sourceMappingURL=utf8-array-to-string.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utf8-array-to-string.mjs","names":[],"sources":["../../../../convert/src/utf8-array-to-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\nconst decoder = new TextDecoder();\n\n/**\n * Convert a utf-8 array to string\n *\n * @param input - Utf-8 Array\n * @returns The converted string\n */\nexport function utf8ArrayToString(\n input: NodeJS.ArrayBufferView | ArrayBuffer\n): string {\n return decoder.decode(input);\n}\n"],"mappings":";AAkBA,MAAM,UAAU,IAAI,aAAa"}
@@ -1,15 +0,0 @@
1
-
2
- //#region ../type-checks/src/get-object-tag.ts
3
- /**
4
- * Gets the `toStringTag` of `obj`.
5
- *
6
- * @param value - The obj to query.
7
- * @returns Returns the `toStringTag`.
8
- */
9
- const getObjectTag = (value) => {
10
- if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
11
- return Object.prototype.toString.call(value);
12
- };
13
-
14
- //#endregion
15
- exports.getObjectTag = getObjectTag;
@@ -1,15 +0,0 @@
1
- //#region ../type-checks/src/get-object-tag.ts
2
- /**
3
- * Gets the `toStringTag` of `obj`.
4
- *
5
- * @param value - The obj to query.
6
- * @returns Returns the `toStringTag`.
7
- */
8
- const getObjectTag = (value) => {
9
- if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
10
- return Object.prototype.toString.call(value);
11
- };
12
-
13
- //#endregion
14
- export { getObjectTag };
15
- //# sourceMappingURL=get-object-tag.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../type-checks/src/get-object-tag.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/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\n"],"mappings":";;;;;;;AAwBA,MAAa,gBAAgB,UAA2B;AACtD,KAAI,SAAS,KACX,QAAO,UAAU,SAAY,uBAAuB;AAEtD,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM"}
@@ -1,21 +0,0 @@
1
- const require_get_object_tag = require('./get-object-tag.cjs');
2
- const require_is_plain_object = require('./is-plain-object.cjs');
3
- const require_is_function = require('./is-function.cjs');
4
- const require_is_null = require('./is-null.cjs');
5
- const require_is_number = require('./is-number.cjs');
6
- const require_is_undefined = require('./is-undefined.cjs');
7
- const require_is_empty = require('./is-empty.cjs');
8
- const require_is_object = require('./is-object.cjs');
9
- const require_is_buffer = require('./is-buffer.cjs');
10
- require('./type-detect.cjs');
11
- require('./is-collection.cjs');
12
- const require_is_deep_key = require('./is-deep-key.cjs');
13
- const require_is_string = require('./is-string.cjs');
14
- const require_is_set = require('./is-set.cjs');
15
- const require_is_set_string = require('./is-set-string.cjs');
16
- const require_is_react_element = require('./is-react-element.cjs');
17
- const require_is_mergeable_object = require('./is-mergeable-object.cjs');
18
- const require_is_object_index = require('./is-object-index.cjs');
19
- const require_is_primitive = require('./is-primitive.cjs');
20
- const require_is_typed_array = require('./is-typed-array.cjs');
21
- const require_property_exists = require('./property-exists.cjs');
@@ -1,23 +0,0 @@
1
- import { getObjectTag } from "./get-object-tag.mjs";
2
- import { isObjectLike, isPlainObject } from "./is-plain-object.mjs";
3
- import { isAsyncFunction, isFunction, isSyncFunction } from "./is-function.mjs";
4
- import { isNull } from "./is-null.mjs";
5
- import { isNumber } from "./is-number.mjs";
6
- import { isUndefined } from "./is-undefined.mjs";
7
- import { isEmpty } from "./is-empty.mjs";
8
- import { isObject } from "./is-object.mjs";
9
- import { isBufferExists } from "./is-buffer.mjs";
10
- import "./type-detect.mjs";
11
- import "./is-collection.mjs";
12
- import { isDeepKey } from "./is-deep-key.mjs";
13
- import { isString } from "./is-string.mjs";
14
- import { isSet } from "./is-set.mjs";
15
- import { isSetString } from "./is-set-string.mjs";
16
- import { isReactElement } from "./is-react-element.mjs";
17
- import { isMergeableObject } from "./is-mergeable-object.mjs";
18
- import { isObjectIndex } from "./is-object-index.mjs";
19
- import { isPrimitive } from "./is-primitive.mjs";
20
- import { isTypedArray } from "./is-typed-array.mjs";
21
- import { propertyExists, propertyUnsafe } from "./property-exists.mjs";
22
-
23
- export { };
@@ -1,13 +0,0 @@
1
- let node_buffer = require("node:buffer");
2
-
3
- //#region ../type-checks/src/is-buffer.ts
4
- const isBufferExists = typeof node_buffer.Buffer !== "undefined";
5
- /**
6
- * Check if the provided value's type is `Buffer`
7
- */
8
- const isBuffer = isBufferExists ? node_buffer.Buffer.isBuffer.bind(node_buffer.Buffer) : function isBuffer$1(_) {
9
- return false;
10
- };
11
-
12
- //#endregion
13
- exports.isBufferExists = isBufferExists;
@@ -1,14 +0,0 @@
1
- import { Buffer } from "node:buffer";
2
-
3
- //#region ../type-checks/src/is-buffer.ts
4
- const isBufferExists = typeof Buffer !== "undefined";
5
- /**
6
- * Check if the provided value's type is `Buffer`
7
- */
8
- const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(_) {
9
- return false;
10
- };
11
-
12
- //#endregion
13
- export { isBufferExists };
14
- //# sourceMappingURL=is-buffer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../../../../type-checks/src/is-buffer.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 { Buffer } from \"node:buffer\";\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param _ - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(_: Parameters<typeof Buffer.isBuffer>[0]): _ is Buffer {\n return false;\n };\n"],"mappings":";;;AAoBA,MAAa,iBAAiB,OAAO,WAAW;;;;AAKhD,MAAaA,WAAmC,iBAC5C,OAAO,SAAS,KAAK,OAAO,GAO5B,SAASC,WAAS,GAAuD;AACvE,QAAO"}
@@ -1 +0,0 @@
1
- require('./type-detect.cjs');
@@ -1,3 +0,0 @@
1
- import "./type-detect.mjs";
2
-
3
- export { };
@@ -1,34 +0,0 @@
1
-
2
- //#region ../type-checks/src/is-deep-key.ts
3
- /**
4
- * Checks if a given key is a deep key.
5
- *
6
- * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
7
- *
8
- * @example
9
- * isDeepKey('a.b') // true
10
- * isDeepKey('a[b]') // true
11
- * isDeepKey('a') // false
12
- * isDeepKey(123) // false
13
- * isDeepKey('a.b.c') // true
14
- * isDeepKey('a[b][c]') // true
15
- *
16
- * @param key - The key to check.
17
- * @returns Returns true if the key is a deep key, otherwise false.
18
- */
19
- function isDeepKey(key) {
20
- switch (typeof key) {
21
- case "number":
22
- case "symbol": return false;
23
- case "string": return key.includes(".") || key.includes("[") || key.includes("]");
24
- case "bigint":
25
- case "boolean":
26
- case "function":
27
- case "object":
28
- case "undefined":
29
- default: return false;
30
- }
31
- }
32
-
33
- //#endregion
34
- exports.isDeepKey = isDeepKey;