@aglyn/shared-util-tools 1.0.0-beta.143

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 (288) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +39 -0
  4. package/src/index.d.ts +72 -0
  5. package/src/index.js +87 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/apply-mixins.d.ts +24 -0
  8. package/src/lib/apply-mixins.js +31 -0
  9. package/src/lib/apply-mixins.js.map +1 -0
  10. package/src/lib/array/array-copy-deep.d.ts +6 -0
  11. package/src/lib/array/array-copy-deep.js +25 -0
  12. package/src/lib/array/array-copy-deep.js.map +1 -0
  13. package/src/lib/array/array-copy-shallow.d.ts +19 -0
  14. package/src/lib/array/array-copy-shallow.js +20 -0
  15. package/src/lib/array/array-copy-shallow.js.map +1 -0
  16. package/src/lib/array/array-from-length.d.ts +18 -0
  17. package/src/lib/array/array-from-length.js +23 -0
  18. package/src/lib/array/array-from-length.js.map +1 -0
  19. package/src/lib/array/array-from.d.ts +24 -0
  20. package/src/lib/array/array-from.js +26 -0
  21. package/src/lib/array/array-from.js.map +1 -0
  22. package/src/lib/array/array-move-at-index.d.ts +24 -0
  23. package/src/lib/array/array-move-at-index.js +32 -0
  24. package/src/lib/array/array-move-at-index.js.map +1 -0
  25. package/src/lib/array/array-of-entries-to-object.d.ts +23 -0
  26. package/src/lib/array/array-of-entries-to-object.js +26 -0
  27. package/src/lib/array/array-of-entries-to-object.js.map +1 -0
  28. package/src/lib/array/array-overrides.d.ts +29 -0
  29. package/src/lib/array/array-overrides.js +71 -0
  30. package/src/lib/array/array-overrides.js.map +1 -0
  31. package/src/lib/array/array-push-at-index.d.ts +28 -0
  32. package/src/lib/array/array-push-at-index.js +32 -0
  33. package/src/lib/array/array-push-at-index.js.map +1 -0
  34. package/src/lib/array/array-remove-at-index.d.ts +23 -0
  35. package/src/lib/array/array-remove-at-index.js +26 -0
  36. package/src/lib/array/array-remove-at-index.js.map +1 -0
  37. package/src/lib/array/array-remove-item.d.ts +23 -0
  38. package/src/lib/array/array-remove-item.js +27 -0
  39. package/src/lib/array/array-remove-item.js.map +1 -0
  40. package/src/lib/array/array-safe.d.ts +21 -0
  41. package/src/lib/array/array-safe.js +29 -0
  42. package/src/lib/array/array-safe.js.map +1 -0
  43. package/src/lib/array/array-sort-by-deep-property.d.ts +26 -0
  44. package/src/lib/array/array-sort-by-deep-property.js +39 -0
  45. package/src/lib/array/array-sort-by-deep-property.js.map +1 -0
  46. package/src/lib/array/array-sort-by.d.ts +26 -0
  47. package/src/lib/array/array-sort-by.js +36 -0
  48. package/src/lib/array/array-sort-by.js.map +1 -0
  49. package/src/lib/array/array-update-at-index.d.ts +18 -0
  50. package/src/lib/array/array-update-at-index.js +22 -0
  51. package/src/lib/array/array-update-at-index.js.map +1 -0
  52. package/src/lib/array/array-update.d.ts +23 -0
  53. package/src/lib/array/array-update.js +25 -0
  54. package/src/lib/array/array-update.js.map +1 -0
  55. package/src/lib/bitwise/bitwise-has-all-attributes.d.ts +18 -0
  56. package/src/lib/bitwise/bitwise-has-all-attributes.js +21 -0
  57. package/src/lib/bitwise/bitwise-has-all-attributes.js.map +1 -0
  58. package/src/lib/bitwise/bitwise-has-attribute.d.ts +18 -0
  59. package/src/lib/bitwise/bitwise-has-attribute.js +21 -0
  60. package/src/lib/bitwise/bitwise-has-attribute.js.map +1 -0
  61. package/src/lib/bitwise/bitwise-has-only-attributes.d.ts +18 -0
  62. package/src/lib/bitwise/bitwise-has-only-attributes.js +21 -0
  63. package/src/lib/bitwise/bitwise-has-only-attributes.js.map +1 -0
  64. package/src/lib/contrast.d.ts +65 -0
  65. package/src/lib/contrast.js +78 -0
  66. package/src/lib/contrast.js.map +1 -0
  67. package/src/lib/copy-shallow.d.ts +19 -0
  68. package/src/lib/copy-shallow.js +20 -0
  69. package/src/lib/copy-shallow.js.map +1 -0
  70. package/src/lib/copy.d.ts +19 -0
  71. package/src/lib/copy.js +20 -0
  72. package/src/lib/copy.js.map +1 -0
  73. package/src/lib/create-chained-function.d.ts +38 -0
  74. package/src/lib/create-chained-function.js +46 -0
  75. package/src/lib/create-chained-function.js.map +1 -0
  76. package/src/lib/crud.d.ts +46 -0
  77. package/src/lib/crud.js +55 -0
  78. package/src/lib/crud.js.map +1 -0
  79. package/src/lib/css.d.ts +41 -0
  80. package/src/lib/css.js +54 -0
  81. package/src/lib/css.js.map +1 -0
  82. package/src/lib/escape-html.d.ts +38 -0
  83. package/src/lib/escape-html.js +47 -0
  84. package/src/lib/escape-html.js.map +1 -0
  85. package/src/lib/falsy.d.ts +23 -0
  86. package/src/lib/falsy.js +25 -0
  87. package/src/lib/falsy.js.map +1 -0
  88. package/src/lib/get-display-name.d.ts +46 -0
  89. package/src/lib/get-display-name.js +64 -0
  90. package/src/lib/get-display-name.js.map +1 -0
  91. package/src/lib/get-property.d.ts +30 -0
  92. package/src/lib/get-property.js +36 -0
  93. package/src/lib/get-property.js.map +1 -0
  94. package/src/lib/get-static-field.d.ts +23 -0
  95. package/src/lib/get-static-field.js +25 -0
  96. package/src/lib/get-static-field.js.map +1 -0
  97. package/src/lib/guards/index.d.ts +46 -0
  98. package/src/lib/guards/index.js +47 -0
  99. package/src/lib/guards/index.js.map +1 -0
  100. package/src/lib/guards/lib/_has-own-property.d.ts +24 -0
  101. package/src/lib/guards/lib/_has-own-property.js +27 -0
  102. package/src/lib/guards/lib/_has-own-property.js.map +1 -0
  103. package/src/lib/guards/lib/_is-arr-empty.d.ts +23 -0
  104. package/src/lib/guards/lib/_is-arr-empty.js +25 -0
  105. package/src/lib/guards/lib/_is-arr-empty.js.map +1 -0
  106. package/src/lib/guards/lib/_is-arr-of-arr.d.ts +25 -0
  107. package/src/lib/guards/lib/_is-arr-of-arr.js +31 -0
  108. package/src/lib/guards/lib/_is-arr-of-arr.js.map +1 -0
  109. package/src/lib/guards/lib/_is-arr.d.ts +21 -0
  110. package/src/lib/guards/lib/_is-arr.js +23 -0
  111. package/src/lib/guards/lib/_is-arr.js.map +1 -0
  112. package/src/lib/guards/lib/_is-big.d.ts +25 -0
  113. package/src/lib/guards/lib/_is-big.js +27 -0
  114. package/src/lib/guards/lib/_is-big.js.map +1 -0
  115. package/src/lib/guards/lib/_is-bool.d.ts +25 -0
  116. package/src/lib/guards/lib/_is-bool.js +27 -0
  117. package/src/lib/guards/lib/_is-bool.js.map +1 -0
  118. package/src/lib/guards/lib/_is-buff.d.ts +25 -0
  119. package/src/lib/guards/lib/_is-buff.js +29 -0
  120. package/src/lib/guards/lib/_is-buff.js.map +1 -0
  121. package/src/lib/guards/lib/_is-ctor.d.ts +25 -0
  122. package/src/lib/guards/lib/_is-ctor.js +30 -0
  123. package/src/lib/guards/lib/_is-ctor.js.map +1 -0
  124. package/src/lib/guards/lib/_is-empty-str-or-arr.d.ts +25 -0
  125. package/src/lib/guards/lib/_is-empty-str-or-arr.js +29 -0
  126. package/src/lib/guards/lib/_is-empty-str-or-arr.js.map +1 -0
  127. package/src/lib/guards/lib/_is-equality-same-type.d.ts +25 -0
  128. package/src/lib/guards/lib/_is-equality-same-type.js +33 -0
  129. package/src/lib/guards/lib/_is-equality-same-type.js.map +1 -0
  130. package/src/lib/guards/lib/_is-fn-t.d.ts +25 -0
  131. package/src/lib/guards/lib/_is-fn-t.js +27 -0
  132. package/src/lib/guards/lib/_is-fn-t.js.map +1 -0
  133. package/src/lib/guards/lib/_is-length-of.d.ts +47 -0
  134. package/src/lib/guards/lib/_is-length-of.js +49 -0
  135. package/src/lib/guards/lib/_is-length-of.js.map +1 -0
  136. package/src/lib/guards/lib/_is-length.d.ts +25 -0
  137. package/src/lib/guards/lib/_is-length.js +34 -0
  138. package/src/lib/guards/lib/_is-length.js.map +1 -0
  139. package/src/lib/guards/lib/_is-null.d.ts +25 -0
  140. package/src/lib/guards/lib/_is-null.js +27 -0
  141. package/src/lib/guards/lib/_is-null.js.map +1 -0
  142. package/src/lib/guards/lib/_is-num-neg.d.ts +25 -0
  143. package/src/lib/guards/lib/_is-num-neg.js +28 -0
  144. package/src/lib/guards/lib/_is-num-neg.js.map +1 -0
  145. package/src/lib/guards/lib/_is-num-pos.d.ts +25 -0
  146. package/src/lib/guards/lib/_is-num-pos.js +28 -0
  147. package/src/lib/guards/lib/_is-num-pos.js.map +1 -0
  148. package/src/lib/guards/lib/_is-num-t.d.ts +25 -0
  149. package/src/lib/guards/lib/_is-num-t.js +27 -0
  150. package/src/lib/guards/lib/_is-num-t.js.map +1 -0
  151. package/src/lib/guards/lib/_is-num-zero.d.ts +25 -0
  152. package/src/lib/guards/lib/_is-num-zero.js +28 -0
  153. package/src/lib/guards/lib/_is-num-zero.js.map +1 -0
  154. package/src/lib/guards/lib/_is-num.d.ts +26 -0
  155. package/src/lib/guards/lib/_is-num.js +29 -0
  156. package/src/lib/guards/lib/_is-num.js.map +1 -0
  157. package/src/lib/guards/lib/_is-obj-t.d.ts +26 -0
  158. package/src/lib/guards/lib/_is-obj-t.js +28 -0
  159. package/src/lib/guards/lib/_is-obj-t.js.map +1 -0
  160. package/src/lib/guards/lib/_is-obj.d.ts +27 -0
  161. package/src/lib/guards/lib/_is-obj.js +32 -0
  162. package/src/lib/guards/lib/_is-obj.js.map +1 -0
  163. package/src/lib/guards/lib/_is-prim.d.ts +27 -0
  164. package/src/lib/guards/lib/_is-prim.js +35 -0
  165. package/src/lib/guards/lib/_is-prim.js.map +1 -0
  166. package/src/lib/guards/lib/_is-promise-like.d.ts +24 -0
  167. package/src/lib/guards/lib/_is-promise-like.js +28 -0
  168. package/src/lib/guards/lib/_is-promise-like.js.map +1 -0
  169. package/src/lib/guards/lib/_is-str-empty.d.ts +25 -0
  170. package/src/lib/guards/lib/_is-str-empty.js +28 -0
  171. package/src/lib/guards/lib/_is-str-empty.js.map +1 -0
  172. package/src/lib/guards/lib/_is-str-t.d.ts +26 -0
  173. package/src/lib/guards/lib/_is-str-t.js +28 -0
  174. package/src/lib/guards/lib/_is-str-t.js.map +1 -0
  175. package/src/lib/guards/lib/_is-sym-t.d.ts +25 -0
  176. package/src/lib/guards/lib/_is-sym-t.js +27 -0
  177. package/src/lib/guards/lib/_is-sym-t.js.map +1 -0
  178. package/src/lib/guards/lib/_is-und-or-null.d.ts +25 -0
  179. package/src/lib/guards/lib/_is-und-or-null.js +29 -0
  180. package/src/lib/guards/lib/_is-und-or-null.js.map +1 -0
  181. package/src/lib/guards/lib/_is-und-t.d.ts +25 -0
  182. package/src/lib/guards/lib/_is-und-t.js +27 -0
  183. package/src/lib/guards/lib/_is-und-t.js.map +1 -0
  184. package/src/lib/interop-default.d.ts +18 -0
  185. package/src/lib/interop-default.js +21 -0
  186. package/src/lib/interop-default.js.map +1 -0
  187. package/src/lib/length.d.ts +22 -0
  188. package/src/lib/length.js +28 -0
  189. package/src/lib/length.js.map +1 -0
  190. package/src/lib/linear-regex.d.ts +136 -0
  191. package/src/lib/linear-regex.js +1140 -0
  192. package/src/lib/linear-regex.js.map +1 -0
  193. package/src/lib/no-side-effects.d.ts +29 -0
  194. package/src/lib/no-side-effects.js +33 -0
  195. package/src/lib/no-side-effects.js.map +1 -0
  196. package/src/lib/noop.d.ts +21 -0
  197. package/src/lib/noop.js +22 -0
  198. package/src/lib/noop.js.map +1 -0
  199. package/src/lib/normalized.d.ts +164 -0
  200. package/src/lib/normalized.js +232 -0
  201. package/src/lib/normalized.js.map +1 -0
  202. package/src/lib/number/number-from-hexadecimal.d.ts +24 -0
  203. package/src/lib/number/number-from-hexadecimal.js +29 -0
  204. package/src/lib/number/number-from-hexadecimal.js.map +1 -0
  205. package/src/lib/number/number-to-hexadecimal.d.ts +22 -0
  206. package/src/lib/number/number-to-hexadecimal.js +24 -0
  207. package/src/lib/number/number-to-hexadecimal.js.map +1 -0
  208. package/src/lib/number/to-num.d.ts +41 -0
  209. package/src/lib/number/to-num.js +41 -0
  210. package/src/lib/number/to-num.js.map +1 -0
  211. package/src/lib/numeronym.d.ts +41 -0
  212. package/src/lib/numeronym.js +54 -0
  213. package/src/lib/numeronym.js.map +1 -0
  214. package/src/lib/object/object-clone-deep.d.ts +21 -0
  215. package/src/lib/object/object-clone-deep.js +24 -0
  216. package/src/lib/object/object-clone-deep.js.map +1 -0
  217. package/src/lib/object/object-clone.d.ts +21 -0
  218. package/src/lib/object/object-clone.js +24 -0
  219. package/src/lib/object/object-clone.js.map +1 -0
  220. package/src/lib/object/object-delete-property.d.ts +28 -0
  221. package/src/lib/object/object-delete-property.js +32 -0
  222. package/src/lib/object/object-delete-property.js.map +1 -0
  223. package/src/lib/object/object-get-deep-property.d.ts +35 -0
  224. package/src/lib/object/object-get-deep-property.js +40 -0
  225. package/src/lib/object/object-get-deep-property.js.map +1 -0
  226. package/src/lib/object/object-get-keys-and-symbol-properties.d.ts +23 -0
  227. package/src/lib/object/object-get-keys-and-symbol-properties.js +30 -0
  228. package/src/lib/object/object-get-keys-and-symbol-properties.js.map +1 -0
  229. package/src/lib/object/object-remap.d.ts +33 -0
  230. package/src/lib/object/object-remap.js +36 -0
  231. package/src/lib/object/object-remap.js.map +1 -0
  232. package/src/lib/object/object-safe.d.ts +27 -0
  233. package/src/lib/object/object-safe.js +30 -0
  234. package/src/lib/object/object-safe.js.map +1 -0
  235. package/src/lib/object/object-set-deep-property.d.ts +35 -0
  236. package/src/lib/object/object-set-deep-property.js +44 -0
  237. package/src/lib/object/object-set-deep-property.js.map +1 -0
  238. package/src/lib/object/object-update.d.ts +28 -0
  239. package/src/lib/object/object-update.js +32 -0
  240. package/src/lib/object/object-update.js.map +1 -0
  241. package/src/lib/operator/compare.d.ts +26 -0
  242. package/src/lib/operator/compare.js +42 -0
  243. package/src/lib/operator/compare.js.map +1 -0
  244. package/src/lib/operator/definitions.d.ts +184 -0
  245. package/src/lib/operator/definitions.js +110 -0
  246. package/src/lib/operator/definitions.js.map +1 -0
  247. package/src/lib/operator/index.d.ts +19 -0
  248. package/src/lib/operator/index.js +20 -0
  249. package/src/lib/operator/index.js.map +1 -0
  250. package/src/lib/operator/inference.d.ts +66 -0
  251. package/src/lib/operator/inference.js +60 -0
  252. package/src/lib/operator/inference.js.map +1 -0
  253. package/src/lib/secret-box.d.ts +152 -0
  254. package/src/lib/secret-box.js +263 -0
  255. package/src/lib/secret-box.js.map +1 -0
  256. package/src/lib/serialize/base64-isomorphic-decode.d.ts +23 -0
  257. package/src/lib/serialize/base64-isomorphic-decode.js +28 -0
  258. package/src/lib/serialize/base64-isomorphic-decode.js.map +1 -0
  259. package/src/lib/serialize/base64-isomorphic-encode.d.ts +23 -0
  260. package/src/lib/serialize/base64-isomorphic-encode.js +28 -0
  261. package/src/lib/serialize/base64-isomorphic-encode.js.map +1 -0
  262. package/src/lib/serialize/json-deserialize.d.ts +25 -0
  263. package/src/lib/serialize/json-deserialize.js +27 -0
  264. package/src/lib/serialize/json-deserialize.js.map +1 -0
  265. package/src/lib/serialize/json-serialize.d.ts +25 -0
  266. package/src/lib/serialize/json-serialize.js +27 -0
  267. package/src/lib/serialize/json-serialize.js.map +1 -0
  268. package/src/lib/serialize/php-serial-deserialize-from-byte-stream.d.ts +77 -0
  269. package/src/lib/serialize/php-serial-deserialize-from-byte-stream.js +77 -0
  270. package/src/lib/serialize/php-serial-deserialize-from-byte-stream.js.map +1 -0
  271. package/src/lib/serialize/php-serial-is-serialized-byte-stream.d.ts +77 -0
  272. package/src/lib/serialize/php-serial-is-serialized-byte-stream.js +77 -0
  273. package/src/lib/serialize/php-serial-is-serialized-byte-stream.js.map +1 -0
  274. package/src/lib/serialize/php-serial-serialize-to-byte-stream.d.ts +77 -0
  275. package/src/lib/serialize/php-serial-serialize-to-byte-stream.js +77 -0
  276. package/src/lib/serialize/php-serial-serialize-to-byte-stream.js.map +1 -0
  277. package/src/lib/split-display-name.d.ts +36 -0
  278. package/src/lib/split-display-name.js +47 -0
  279. package/src/lib/split-display-name.js.map +1 -0
  280. package/src/lib/str.d.ts +21 -0
  281. package/src/lib/str.js +23 -0
  282. package/src/lib/str.js.map +1 -0
  283. package/src/lib/trim.d.ts +25 -0
  284. package/src/lib/trim.js +28 -0
  285. package/src/lib/trim.js.map +1 -0
  286. package/src/lib/truthy.d.ts +23 -0
  287. package/src/lib/truthy.js +30 -0
  288. package/src/lib/truthy.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-clone.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Shallow copy iterable properties in iterable or array\n */\nexport function objectClone<T>(\n target: Record<keyof any, T>,\n): Record<keyof any, T> {\n return { ...target }\n}\n\nexport default objectClone\n"],"names":["objectClone","target"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;CAEC,GACD,OAAO,SAASA,YACdC,MAA4B;IAE5B,OAAO,aAAKA;AACd;AAEA,eAAeD,YAAW"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Removes a named property in an object.Modifies the existing object unless
19
+ * provided `{copy: true}` for options
20
+ *
21
+ * @example
22
+ * const alpha = `{ping: 'foo', pong: 'bar'}`
23
+ * const bravo = `objectDeleteProperty(alpha, 'ping') // {pong: 'bar'}`
24
+ */
25
+ export declare function objectDeleteProperty<T, K extends keyof T>(obj: T, key: K, options?: {
26
+ copy: boolean;
27
+ }): Omit<T, K>;
28
+ export default objectDeleteProperty;
@@ -0,0 +1,32 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ /**
18
+ * Removes a named property in an object.Modifies the existing object unless
19
+ * provided `{copy: true}` for options
20
+ *
21
+ * @example
22
+ * const alpha = `{ping: 'foo', pong: 'bar'}`
23
+ * const bravo = `objectDeleteProperty(alpha, 'ping') // {pong: 'bar'}`
24
+ */ export function objectDeleteProperty(obj, key, options) {
25
+ const { copy } = _extends({}, options);
26
+ const res = copy ? _extends({}, obj) : obj;
27
+ delete res[key];
28
+ return res;
29
+ }
30
+ export default objectDeleteProperty;
31
+
32
+ //# sourceMappingURL=object-delete-property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-delete-property.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Removes a named property in an object.Modifies the existing object unless\n * provided `{copy: true}` for options\n *\n * @example\n * const alpha = `{ping: 'foo', pong: 'bar'}`\n * const bravo = `objectDeleteProperty(alpha, 'ping') // {pong: 'bar'}`\n */\nexport function objectDeleteProperty<T, K extends keyof T>(\n obj: T,\n key: K,\n options?: { copy: boolean },\n): Omit<T, K> {\n const { copy } = { ...options }\n const res = copy ? { ...obj } : obj\n delete res[key]\n return res\n}\n\nexport default objectDeleteProperty\n"],"names":["objectDeleteProperty","obj","key","options","copy","res"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;CAOC,GACD,OAAO,SAASA,qBACdC,GAAM,EACNC,GAAM,EACNC,OAA2B;IAE3B,MAAM,EAAEC,IAAI,EAAE,GAAG,aAAKD;IACtB,MAAME,MAAMD,OAAO,aAAKH,OAAQA;IAChC,OAAOI,GAAG,CAACH,IAAI;IACf,OAAOG;AACT;AAEA,eAAeL,qBAAoB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Get a nested property within an object literal
19
+ *
20
+ * EXAMPLE:
21
+ * const obj = {'a': {'prop': {'that': 'exists'}}};
22
+ * getNestedProperty(obj, 'a.very.deep.prop', 'value')
23
+ *
24
+ * @see getProperty
25
+ * @see objectSetDeepProperty
26
+ *
27
+ * @export
28
+ * @template T
29
+ * @param {T} obj
30
+ * @param {string} path
31
+ * @param {string} [separator='.']
32
+ * @returns {*}
33
+ */
34
+ export declare function objectGetDeepProperty<U, T = any>(obj: T, path: string, separator?: string): U;
35
+ export default objectGetDeepProperty;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Get a nested property within an object literal
18
+ *
19
+ * EXAMPLE:
20
+ * const obj = {'a': {'prop': {'that': 'exists'}}};
21
+ * getNestedProperty(obj, 'a.very.deep.prop', 'value')
22
+ *
23
+ * @see getProperty
24
+ * @see objectSetDeepProperty
25
+ *
26
+ * @export
27
+ * @template T
28
+ * @param {T} obj
29
+ * @param {string} path
30
+ * @param {string} [separator='.']
31
+ * @returns {*}
32
+ */ export function objectGetDeepProperty(obj, path, separator = '.') {
33
+ const keys = path.split(separator);
34
+ const lastKey = keys.pop();
35
+ const lastObj = keys.reduce((v, k)=>v == null ? void 0 : v[k], obj);
36
+ return lastObj == null ? void 0 : lastObj[lastKey];
37
+ }
38
+ export default objectGetDeepProperty;
39
+
40
+ //# sourceMappingURL=object-get-deep-property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-get-deep-property.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Get a nested property within an object literal\n *\n * EXAMPLE:\n * const obj = {'a': {'prop': {'that': 'exists'}}};\n * getNestedProperty(obj, 'a.very.deep.prop', 'value')\n *\n * @see getProperty\n * @see objectSetDeepProperty\n *\n * @export\n * @template T\n * @param {T} obj\n * @param {string} path\n * @param {string} [separator='.']\n * @returns {*}\n */\nexport function objectGetDeepProperty<U, T = any>(\n obj: T,\n path: string,\n separator = '.',\n): U {\n const keys = path.split(separator)\n const lastKey = keys.pop()\n const lastObj = keys.reduce((v: any, k) => v?.[k], obj as any)\n return lastObj?.[lastKey]\n}\n\nexport default objectGetDeepProperty\n"],"names":["objectGetDeepProperty","obj","path","separator","keys","split","lastKey","pop","lastObj","reduce","v","k"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASA,sBACdC,GAAM,EACNC,IAAY,EACZC,YAAY,GAAG;IAEf,MAAMC,OAAOF,KAAKG,KAAK,CAACF;IACxB,MAAMG,UAAUF,KAAKG,GAAG;IACxB,MAAMC,UAAUJ,KAAKK,MAAM,CAAC,CAACC,GAAQC,IAAMD,qBAAAA,CAAG,CAACC,EAAE,EAAEV;IACnD,OAAOO,2BAAAA,OAAS,CAACF,QAAQ;AAC3B;AAEA,eAAeN,sBAAqB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Retrieve all keys of source object and symbol properties found directly
19
+ * @param {T} obj
20
+ * @returns {K[]}
21
+ */
22
+ export declare function objectGetKeysAndSymbolProperties<T, K extends keyof T>(obj: T): K[];
23
+ export default objectGetKeysAndSymbolProperties;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Retrieve all keys of source object and symbol properties found directly
18
+ * @param {T} obj
19
+ * @returns {K[]}
20
+ */ export function objectGetKeysAndSymbolProperties(obj) {
21
+ const keys = Object.keys(obj);
22
+ if (Object.getOwnPropertySymbols) {
23
+ const propertySymbols = Object.getOwnPropertySymbols(obj);
24
+ return keys.concat(propertySymbols);
25
+ }
26
+ return keys;
27
+ }
28
+ export default objectGetKeysAndSymbolProperties;
29
+
30
+ //# sourceMappingURL=object-get-keys-and-symbol-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-get-keys-and-symbol-properties.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Retrieve all keys of source object and symbol properties found directly\n * @param {T} obj\n * @returns {K[]}\n */\nexport function objectGetKeysAndSymbolProperties<T, K extends keyof T>(\n obj: T,\n): K[] {\n const keys: K[] = Object.keys(obj) as K[]\n if (Object.getOwnPropertySymbols) {\n const propertySymbols = Object.getOwnPropertySymbols(obj)\n return keys.concat(propertySymbols as K[])\n }\n return keys\n}\n\nexport default objectGetKeysAndSymbolProperties\n"],"names":["objectGetKeysAndSymbolProperties","obj","keys","Object","getOwnPropertySymbols","propertySymbols","concat"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;CAIC,GACD,OAAO,SAASA,iCACdC,GAAM;IAEN,MAAMC,OAAYC,OAAOD,IAAI,CAACD;IAC9B,IAAIE,OAAOC,qBAAqB,EAAE;QAChC,MAAMC,kBAAkBF,OAAOC,qBAAqB,CAACH;QACrD,OAAOC,KAAKI,MAAM,CAACD;IACrB;IACA,OAAOH;AACT;AAEA,eAAeF,iCAAgC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export type RemapOptions = {
18
+ /** When true will remove 'undefined' values */
19
+ remove?: boolean;
20
+ copy?: 'deep' | 'shallow' | boolean;
21
+ };
22
+ export type RemapTarget<K extends PKey, V = unknown> = Record<K, V>;
23
+ export type RemapCallback<K extends PKey, V, U = V> = (value: V, key: K, target: RemapTarget<K, V>) => U;
24
+ export type RemapOutputDefault<T extends RemapTarget<K, V>, K extends PKey, V, U = V> = RemapTarget<K, U>;
25
+ export type RemapOutputFiltered<T extends RemapTarget<K, V>, K extends PKey, V, U = V> = OmitIndexOfType<RemapOutputDefault<T, K, V, U>, NUN>;
26
+ export type RemapOutput<T extends RemapTarget<K, V>, K extends PKey, V, U = V, O extends RemapOptions = any> = O extends {
27
+ remove: true;
28
+ } ? RemapOutputFiltered<T, K, V, U> : RemapOutputDefault<T, K, V, U>;
29
+ /**
30
+ * Map an object keys and values
31
+ */
32
+ export declare function objectRemap<K extends PKey, V, U = V, T = RemapTarget<K, V>>(target: RemapTarget<K, V>, callbackFn: RemapCallback<K, V, U>, options?: RemapOptions, thisArg?: ThisType<T>): RemapOutput<typeof target, K, V, U, typeof options>;
33
+ export default objectRemap;
@@ -0,0 +1,36 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2023 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { _isUndT } from "../guards/lib/_is-und-t.js";
18
+ import cloneDeep from "../copy.js";
19
+ /**
20
+ * Map an object keys and values
21
+ */ export function objectRemap(target, callbackFn, options, thisArg) {
22
+ // prettier-ignore
23
+ const remapped = (options == null ? void 0 : options.copy) === 'deep' ? cloneDeep(target) : (options == null ? void 0 : options.copy) === 'shallow' || (options == null ? void 0 : options.copy) === true ? _extends({}, target) : target;
24
+ const _thisArg = thisArg != null ? thisArg : remapped;
25
+ for(const key in target){
26
+ if (Object.hasOwn(target, key)) {
27
+ const value = callbackFn.call(_thisArg, target[key], key, target);
28
+ if ((options == null ? void 0 : options.remove) && _isUndT(value)) delete remapped[key];
29
+ else remapped[key] = value;
30
+ }
31
+ }
32
+ return remapped;
33
+ }
34
+ export default objectRemap;
35
+
36
+ //# sourceMappingURL=object-remap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-remap.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _isUndT } from '../guards/lib/_is-und-t'\nimport cloneDeep from '../copy'\n\nexport type RemapOptions = {\n /** When true will remove 'undefined' values */\n remove?: boolean\n copy?: 'deep' | 'shallow' | boolean\n}\n\nexport type RemapTarget<K extends PKey, V = unknown> = Record<K, V>\n\nexport type RemapCallback<K extends PKey, V, U = V> = (\n value: V,\n key: K,\n target: RemapTarget<K, V>,\n) => U\n\nexport type RemapOutputDefault<\n T extends RemapTarget<K, V>,\n K extends PKey,\n V,\n U = V,\n> = RemapTarget<K, U>\n\n// prettier-ignore\nexport type RemapOutputFiltered<\n T extends RemapTarget<K, V>,\n K extends PKey,\n V,\n U = V,\n> = OmitIndexOfType<\n RemapOutputDefault<T, K, V, U>,\n NUN\n>\n\n// prettier-ignore\nexport type RemapOutput<\n T extends RemapTarget<K, V>,\n K extends PKey,\n V,\n U = V,\n O extends RemapOptions = any\n> =\n O extends {remove: true}\n ? RemapOutputFiltered<T, K, V, U>\n : RemapOutputDefault<T, K, V, U>\n\n/**\n * Map an object keys and values\n */\nexport function objectRemap<K extends PKey, V, U = V, T = RemapTarget<K, V>>(\n target: RemapTarget<K, V>,\n callbackFn: RemapCallback<K, V, U>,\n options?: RemapOptions,\n thisArg?: ThisType<T>,\n): RemapOutput<typeof target, K, V, U, typeof options> {\n type ThisArg = Conditional<typeof thisArg, NUN, typeof target, typeof thisArg>\n type Output = RemapOutput<typeof target, K, V, U, typeof options>\n\n // prettier-ignore\n const remapped = (\n options?.copy === 'deep'\n ? cloneDeep(target)\n : (\n options?.copy === 'shallow' || options?.copy === true\n ? {...target}\n : target\n )\n ) as unknown as Output\n\n const _thisArg = (thisArg ?? remapped) as ThisArg\n\n for (const key in target) {\n if (Object.hasOwn(target, key)) {\n const value = callbackFn.call(_thisArg, target[key], key, target)\n if (options?.remove && _isUndT(value)) delete remapped[key]\n else remapped[key] = value\n }\n }\n\n return remapped\n}\n\nexport default objectRemap\n"],"names":["_isUndT","cloneDeep","objectRemap","target","callbackFn","options","thisArg","remapped","copy","_thisArg","key","Object","hasOwn","value","call","remove"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,OAAO,QAAQ,6BAAyB;AACjD,OAAOC,eAAe,aAAS;AA8C/B;;CAEC,GACD,OAAO,SAASC,YACdC,MAAyB,EACzBC,UAAkC,EAClCC,OAAsB,EACtBC,OAAqB;IAKrB,kBAAkB;IAClB,MAAMC,WACJF,CAAAA,2BAAAA,QAASG,IAAI,MAAK,SACdP,UAAUE,UAEVE,CAAAA,2BAAAA,QAASG,IAAI,MAAK,aAAaH,CAAAA,2BAAAA,QAASG,IAAI,MAAK,OAC7C,aAAIL,UACJA;IAIV,MAAMM,WAAYH,kBAAAA,UAAWC;IAE7B,IAAK,MAAMG,OAAOP,OAAQ;QACxB,IAAIQ,OAAOC,MAAM,CAACT,QAAQO,MAAM;YAC9B,MAAMG,QAAQT,WAAWU,IAAI,CAACL,UAAUN,MAAM,CAACO,IAAI,EAAEA,KAAKP;YAC1D,IAAIE,CAAAA,2BAAAA,QAASU,MAAM,KAAIf,QAAQa,QAAQ,OAAON,QAAQ,CAACG,IAAI;iBACtDH,QAAQ,CAACG,IAAI,GAAGG;QACvB;IACF;IAEA,OAAON;AACT;AAEA,eAAeL,YAAW"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Safe object/{} will always return an object
19
+ *
20
+ * @export
21
+ * @template T
22
+ * @param {T} val
23
+ * @param {Record<string, unknown>} [or]
24
+ * @returns {Record<string, unknown>}
25
+ */
26
+ export declare function objectSafe<T>(val: T, or?: Record<string, unknown>): Record<string, unknown>;
27
+ export default objectSafe;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { _isObj } from "../guards/index.js";
17
+ /**
18
+ * Safe object/{} will always return an object
19
+ *
20
+ * @export
21
+ * @template T
22
+ * @param {T} val
23
+ * @param {Record<string, unknown>} [or]
24
+ * @returns {Record<string, unknown>}
25
+ */ export function objectSafe(val, or) {
26
+ return _isObj(val) ? val : _isObj(or) ? or : {};
27
+ }
28
+ export default objectSafe;
29
+
30
+ //# sourceMappingURL=object-safe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-safe.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _isObj } from '../guards'\n\n\n/**\n * Safe object/{} will always return an object\n *\n * @export\n * @template T\n * @param {T} val\n * @param {Record<string, unknown>} [or]\n * @returns {Record<string, unknown>}\n */\nexport function objectSafe<T>(\n val: T,\n or?: Record<string, unknown>,\n): Record<string, unknown> {\n return _isObj(val) ? val : _isObj(or) ? or : {}\n}\n\nexport default objectSafe\n"],"names":["_isObj","objectSafe","val","or"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,QAAQ,qBAAW;AAGlC;;;;;;;;CAQC,GACD,OAAO,SAASC,WACdC,GAAM,EACNC,EAA4B;IAE5B,OAAOH,OAAOE,OAAOA,MAAMF,OAAOG,MAAMA,KAAK,CAAC;AAChD;AAEA,eAAeF,WAAU"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Set a nested property within an object literal
19
+ *
20
+ * EXAMPLE:
21
+ * const obj = {'a': {'prop': {'that': 'exists'}}};
22
+ * setNestedProperty(obj, 'a.very.deep.prop', 'value')
23
+ *
24
+ * @see getProperty
25
+ * @see objectGetDeepProperty
26
+ *
27
+ * @export
28
+ * @template T
29
+ * @param {T} obj
30
+ * @param {string} path
31
+ * @param {*} val
32
+ * @param {string} [separator='.']
33
+ */
34
+ export declare function objectSetDeepProperty<T>(obj: T, path: string, val: any, separator?: string): T;
35
+ export default objectSetDeepProperty;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Set a nested property within an object literal
18
+ *
19
+ * EXAMPLE:
20
+ * const obj = {'a': {'prop': {'that': 'exists'}}};
21
+ * setNestedProperty(obj, 'a.very.deep.prop', 'value')
22
+ *
23
+ * @see getProperty
24
+ * @see objectGetDeepProperty
25
+ *
26
+ * @export
27
+ * @template T
28
+ * @param {T} obj
29
+ * @param {string} path
30
+ * @param {*} val
31
+ * @param {string} [separator='.']
32
+ */ export function objectSetDeepProperty(obj, path, val, separator = '.') {
33
+ const keys = path.split(separator);
34
+ const lastKey = keys.pop();
35
+ const lastObj = keys.reduce((acc, item)=>{
36
+ var _acc, _item, _;
37
+ return (_ = (_acc = acc)[_item = item]) != null ? _ : _acc[_item] = {};
38
+ }, obj);
39
+ lastObj[lastKey] = val;
40
+ return obj;
41
+ }
42
+ export default objectSetDeepProperty;
43
+
44
+ //# sourceMappingURL=object-set-deep-property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-set-deep-property.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Set a nested property within an object literal\n *\n * EXAMPLE:\n * const obj = {'a': {'prop': {'that': 'exists'}}};\n * setNestedProperty(obj, 'a.very.deep.prop', 'value')\n *\n * @see getProperty\n * @see objectGetDeepProperty\n *\n * @export\n * @template T\n * @param {T} obj\n * @param {string} path\n * @param {*} val\n * @param {string} [separator='.']\n */\nexport function objectSetDeepProperty<T>(\n obj: T,\n path: string,\n val: any,\n separator = '.',\n): T {\n const keys = path.split(separator)\n const lastKey = keys.pop()\n const lastObj = keys.reduce((acc: any, item) => (acc[item] ??= {}), obj as any)\n lastObj[lastKey] = val\n return obj\n}\n\nexport default objectSetDeepProperty\n"],"names":["objectSetDeepProperty","obj","path","val","separator","keys","split","lastKey","pop","lastObj","reduce","acc","item"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASA,sBACdC,GAAM,EACNC,IAAY,EACZC,GAAQ,EACRC,YAAY,GAAG;IAEf,MAAMC,OAAOH,KAAKI,KAAK,CAACF;IACxB,MAAMG,UAAUF,KAAKG,GAAG;IACxB,MAAMC,UAAUJ,KAAKK,MAAM,CAAC,CAACC,KAAUC;YAAUD,MAAIC,OAAJD;gBAAAA,IAAAA,CAAAA,OAAAA,IAAG,CAACC,QAAAA,KAAK,YAATD,IAAAA,IAAG,CAACC,MAAK,GAAK,CAAC;OAAIX;IACpEQ,OAAO,CAACF,QAAQ,GAAGJ;IACnB,OAAOF;AACT;AAEA,eAAeD,sBAAqB"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Shortcut for Object.assign({}, target, ...otherTargets)
19
+ *
20
+ * @export
21
+ * @template T
22
+ * @template U
23
+ * @param {T} target
24
+ * @param {...U[]} source
25
+ * @returns {(T & U)}
26
+ */
27
+ export declare function objectUpdate<T, U>(target: T, ...source: U[]): T & U;
28
+ export default objectUpdate;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Shortcut for Object.assign({}, target, ...otherTargets)
18
+ *
19
+ * @export
20
+ * @template T
21
+ * @template U
22
+ * @param {T} target
23
+ * @param {...U[]} source
24
+ * @returns {(T & U)}
25
+ */ export function objectUpdate(target, ...source) {
26
+ // Encapsulate the idea of passing a new object as the first parameter
27
+ // to Object.assign to ensure we correctly copy data instead of mutating
28
+ return Object.assign({}, target, ...source);
29
+ }
30
+ export default objectUpdate;
31
+
32
+ //# sourceMappingURL=object-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/object/object-update.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Shortcut for Object.assign({}, target, ...otherTargets)\n *\n * @export\n * @template T\n * @template U\n * @param {T} target\n * @param {...U[]} source\n * @returns {(T & U)}\n */\nexport function objectUpdate<T, U>(target: T, ...source: U[]): T & U {\n // Encapsulate the idea of passing a new object as the first parameter\n // to Object.assign to ensure we correctly copy data instead of mutating\n return Object.assign({}, target, ...source)\n}\n\nexport default objectUpdate\n"],"names":["objectUpdate","target","source","Object","assign"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GACD,OAAO,SAASA,aAAmBC,MAAS,EAAE,GAAGC,MAAW;IAC1D,sEAAsE;IACtE,wEAAwE;IACxE,OAAOC,OAAOC,MAAM,CAAC,CAAC,GAAGH,WAAWC;AACtC;AAEA,eAAeF,aAAY"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { ComparisonOperator } from './definitions';
18
+ /**
19
+ * Perform comparison operation to check provided equality operator. If no
20
+ * operator is provided defaults to strict equality check
21
+ * @param left - left-hand side operand for operation
22
+ * @param right - right-hand side operand for operation
23
+ * @param operator - provide js comparison operator syntax as string literal
24
+ */
25
+ export declare function compare<T>(left: Iterable<T> | ArrayLike<T> | number | string, right: Iterable<T> | ArrayLike<T> | number | string, operator?: ComparisonOperator): boolean;
26
+ export default compare;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Perform comparison operation to check provided equality operator. If no
18
+ * operator is provided defaults to strict equality check
19
+ * @param left - left-hand side operand for operation
20
+ * @param right - right-hand side operand for operation
21
+ * @param operator - provide js comparison operator syntax as string literal
22
+ */ export function compare(left, right, operator = '===') {
23
+ switch(operator){
24
+ case '==':
25
+ // noinspection EqualityComparisonWithCoercionJS
26
+ return left == right;
27
+ case '<':
28
+ return left < right;
29
+ case '<=':
30
+ return left <= right;
31
+ case '>=':
32
+ return left >= right;
33
+ case '>':
34
+ return left > right;
35
+ case '===':
36
+ default:
37
+ return left === right;
38
+ }
39
+ }
40
+ export default compare;
41
+
42
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/operator/compare.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComparisonOperator } from './definitions'\n\n\n/**\n * Perform comparison operation to check provided equality operator. If no\n * operator is provided defaults to strict equality check\n * @param left - left-hand side operand for operation\n * @param right - right-hand side operand for operation\n * @param operator - provide js comparison operator syntax as string literal\n */\nexport function compare<T>(\n left: Iterable<T> | ArrayLike<T> | number | string,\n right: Iterable<T> | ArrayLike<T> | number | string,\n operator: ComparisonOperator = '===',\n): boolean {\n switch (operator) {\n case '==':\n // noinspection EqualityComparisonWithCoercionJS\n return left == right\n case '<':\n return left < right\n case '<=':\n return left <= right\n case '>=':\n return left >= right\n case '>':\n return left > right\n case '===':\n default:\n return left === right\n }\n}\n\nexport default compare\n"],"names":["compare","left","right","operator"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAKD;;;;;;CAMC,GACD,OAAO,SAASA,QACdC,IAAkD,EAClDC,KAAmD,EACnDC,WAA+B,KAAK;IAEpC,OAAQA;QACN,KAAK;YACH,gDAAgD;YAChD,OAAOF,QAAQC;QACjB,KAAK;YACH,OAAOD,OAAOC;QAChB,KAAK;YACH,OAAOD,QAAQC;QACjB,KAAK;YACH,OAAOD,QAAQC;QACjB,KAAK;YACH,OAAOD,OAAOC;QAChB,KAAK;QACL;YACE,OAAOD,SAASC;IACpB;AACF;AAEA,eAAeF,QAAO"}