@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,25 @@
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
+ * Generates a string with **_JSON_** representation of a value
19
+ *
20
+ * @see {@link jsonDeserialize}
21
+ * @see {@link JSON.parse}
22
+ * @see {@link JSON.stringify}
23
+ */
24
+ export declare function jsonSerialize(...args: Parameters<typeof JSON.stringify>): ReturnType<typeof JSON.stringify>;
25
+ export default jsonSerialize;
@@ -0,0 +1,27 @@
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
+ * Generates a string with **_JSON_** representation of a value
18
+ *
19
+ * @see {@link jsonDeserialize}
20
+ * @see {@link JSON.parse}
21
+ * @see {@link JSON.stringify}
22
+ */ export function jsonSerialize(...args) {
23
+ return JSON.stringify(...args);
24
+ }
25
+ export default jsonSerialize;
26
+
27
+ //# sourceMappingURL=json-serialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/serialize/json-serialize.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 * Generates a string with **_JSON_** representation of a value\n *\n * @see {@link jsonDeserialize}\n * @see {@link JSON.parse}\n * @see {@link JSON.stringify}\n */\nexport function jsonSerialize(...args: Parameters<typeof JSON.stringify>): ReturnType<typeof JSON.stringify> {\n return JSON.stringify(...args)\n}\nexport default jsonSerialize\n"],"names":["jsonSerialize","args","JSON","stringify"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GACD,OAAO,SAASA,cAAc,GAAGC,IAAuC;IACtE,OAAOC,KAAKC,SAAS,IAAIF;AAC3B;AACA,eAAeD,cAAa"}
@@ -0,0 +1,77 @@
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
+ import { unserialize as phpSerialDeserializeFromByteStream } from 'php-serialize';
18
+ /**
19
+ * Generates a string with **_byte-stream_** representation of a value.
20
+ *
21
+ * **Note:**
22
+ * that this is a binary string which may include null bytes, and needs to be
23
+ * stored and handled as such. For example, serialize() output should generally
24
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
25
+ *
26
+ * ---
27
+ *
28
+ * @example
29
+ * export function serialize(
30
+ * item: any,
31
+ * phpToJsScope: Object = {},
32
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
33
+ * ): string
34
+ *
35
+ * @example
36
+ * class User {
37
+ * constructor({ name, age }) {
38
+ * this.name = name
39
+ * this.age = age
40
+ * }
41
+ * serialize() {
42
+ * return JSON.stringify({ name: this.name, age: this.age })
43
+ * }
44
+ * unserialize(rawData) {
45
+ * const { name, age } = JSON.parse(rawData)
46
+ * this.name = name
47
+ * this.age = age
48
+ * }
49
+ * }
50
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
51
+ *
52
+ *
53
+ * // Serialize to byte stream string
54
+ * const serialized = serializeToByteStream(steel)
55
+ *
56
+ * // Serialize User class to given name
57
+ * const serializedForNamespace = serializeToByteStream(steel, {
58
+ * 'MyApp\\User': User,
59
+ * })
60
+ *
61
+ * @example
62
+ * // Result: serialized
63
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
64
+ *
65
+ * // Result: serializedForNamespace
66
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
67
+ *
68
+ * @example
69
+ * // Result: unserialized
70
+ * unserialized instanceof User = true
71
+ *
72
+ * @see {@link phpSerialIsSerialized}
73
+ * @see {@link phpSerialSerialize}
74
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
75
+ */
76
+ export { phpSerialDeserializeFromByteStream };
77
+ export default phpSerialDeserializeFromByteStream;
@@ -0,0 +1,77 @@
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
+ */ import { unserialize as phpSerialDeserializeFromByteStream } from "php-serialize";
17
+ /**
18
+ * Generates a string with **_byte-stream_** representation of a value.
19
+ *
20
+ * **Note:**
21
+ * that this is a binary string which may include null bytes, and needs to be
22
+ * stored and handled as such. For example, serialize() output should generally
23
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
24
+ *
25
+ * ---
26
+ *
27
+ * @example
28
+ * export function serialize(
29
+ * item: any,
30
+ * phpToJsScope: Object = {},
31
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
32
+ * ): string
33
+ *
34
+ * @example
35
+ * class User {
36
+ * constructor({ name, age }) {
37
+ * this.name = name
38
+ * this.age = age
39
+ * }
40
+ * serialize() {
41
+ * return JSON.stringify({ name: this.name, age: this.age })
42
+ * }
43
+ * unserialize(rawData) {
44
+ * const { name, age } = JSON.parse(rawData)
45
+ * this.name = name
46
+ * this.age = age
47
+ * }
48
+ * }
49
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
50
+ *
51
+ *
52
+ * // Serialize to byte stream string
53
+ * const serialized = serializeToByteStream(steel)
54
+ *
55
+ * // Serialize User class to given name
56
+ * const serializedForNamespace = serializeToByteStream(steel, {
57
+ * 'MyApp\\User': User,
58
+ * })
59
+ *
60
+ * @example
61
+ * // Result: serialized
62
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
63
+ *
64
+ * // Result: serializedForNamespace
65
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
66
+ *
67
+ * @example
68
+ * // Result: unserialized
69
+ * unserialized instanceof User = true
70
+ *
71
+ * @see {@link phpSerialIsSerialized}
72
+ * @see {@link phpSerialSerialize}
73
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
74
+ */ export { phpSerialDeserializeFromByteStream };
75
+ export default phpSerialDeserializeFromByteStream;
76
+
77
+ //# sourceMappingURL=php-serial-deserialize-from-byte-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/serialize/php-serial-deserialize-from-byte-stream.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\nimport {unserialize as phpSerialDeserializeFromByteStream} from 'php-serialize'\n\n\n/**\n * Generates a string with **_byte-stream_** representation of a value.\n *\n * **Note:**\n * that this is a binary string which may include null bytes, and needs to be\n * stored and handled as such. For example, serialize() output should generally\n * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.\n *\n * ---\n *\n * @example\n * export function serialize(\n * item: any,\n * phpToJsScope: Object = {},\n * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }\n * ): string\n *\n * @example\n * class User {\n * constructor({ name, age }) {\n * this.name = name\n * this.age = age\n * }\n * serialize() {\n * return JSON.stringify({ name: this.name, age: this.age })\n * }\n * unserialize(rawData) {\n * const { name, age } = JSON.parse(rawData)\n * this.name = name\n * this.age = age\n * }\n * }\n * const steel = new User({ name: 'Steel Brain', age: 17 })\n *\n *\n * // Serialize to byte stream string\n * const serialized = serializeToByteStream(steel)\n *\n * // Serialize User class to given name\n * const serializedForNamespace = serializeToByteStream(steel, {\n * 'MyApp\\\\User': User,\n * })\n *\n * @example\n * // Result: serialized\n * \"C:4:\\\"User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * // Result: serializedForNamespace\n * \"C:10:\\\"MyApp\\\\User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * @example\n * // Result: unserialized\n * unserialized instanceof User = true\n *\n * @see {@link phpSerialIsSerialized}\n * @see {@link phpSerialSerialize}\n * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}\n */\nexport {phpSerialDeserializeFromByteStream}\nexport default phpSerialDeserializeFromByteStream\n"],"names":["unserialize","phpSerialDeserializeFromByteStream"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAAQA,eAAeC,kCAAkC,QAAO,gBAAe;AAG/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDC,GACD,SAAQA,kCAAkC,GAAC;AAC3C,eAAeA,mCAAkC"}
@@ -0,0 +1,77 @@
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
+ import { isSerialized as phpSerialIsSerializedByteStream } from 'php-serialize';
18
+ /**
19
+ * Generates a string with **_byte-stream_** representation of a value.
20
+ *
21
+ * **Note:**
22
+ * that this is a binary string which may include null bytes, and needs to be
23
+ * stored and handled as such. For example, serialize() output should generally
24
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
25
+ *
26
+ * ---
27
+ *
28
+ * @example
29
+ * export function serialize(
30
+ * item: any,
31
+ * phpToJsScope: Object = {},
32
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
33
+ * ): string
34
+ *
35
+ * @example
36
+ * class User {
37
+ * constructor({ name, age }) {
38
+ * this.name = name
39
+ * this.age = age
40
+ * }
41
+ * serialize() {
42
+ * return JSON.stringify({ name: this.name, age: this.age })
43
+ * }
44
+ * unserialize(rawData) {
45
+ * const { name, age } = JSON.parse(rawData)
46
+ * this.name = name
47
+ * this.age = age
48
+ * }
49
+ * }
50
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
51
+ *
52
+ *
53
+ * // Serialize to byte stream string
54
+ * const serialized = serializeToByteStream(steel)
55
+ *
56
+ * // Serialize User class to given name
57
+ * const serializedForNamespace = serializeToByteStream(steel, {
58
+ * 'MyApp\\User': User,
59
+ * })
60
+ *
61
+ * @example
62
+ * // Result: serialized
63
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
64
+ *
65
+ * // Result: serializedForNamespace
66
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
67
+ *
68
+ * @example
69
+ * // Result: unserialized
70
+ * unserialized instanceof User = true
71
+ *
72
+ * @see {@link phpSerialIsSerialized}
73
+ * @see {@link phpSerialSerialize}
74
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
75
+ */
76
+ export { phpSerialIsSerializedByteStream };
77
+ export default phpSerialIsSerializedByteStream;
@@ -0,0 +1,77 @@
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
+ */ import { isSerialized as phpSerialIsSerializedByteStream } from "php-serialize";
17
+ /**
18
+ * Generates a string with **_byte-stream_** representation of a value.
19
+ *
20
+ * **Note:**
21
+ * that this is a binary string which may include null bytes, and needs to be
22
+ * stored and handled as such. For example, serialize() output should generally
23
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
24
+ *
25
+ * ---
26
+ *
27
+ * @example
28
+ * export function serialize(
29
+ * item: any,
30
+ * phpToJsScope: Object = {},
31
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
32
+ * ): string
33
+ *
34
+ * @example
35
+ * class User {
36
+ * constructor({ name, age }) {
37
+ * this.name = name
38
+ * this.age = age
39
+ * }
40
+ * serialize() {
41
+ * return JSON.stringify({ name: this.name, age: this.age })
42
+ * }
43
+ * unserialize(rawData) {
44
+ * const { name, age } = JSON.parse(rawData)
45
+ * this.name = name
46
+ * this.age = age
47
+ * }
48
+ * }
49
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
50
+ *
51
+ *
52
+ * // Serialize to byte stream string
53
+ * const serialized = serializeToByteStream(steel)
54
+ *
55
+ * // Serialize User class to given name
56
+ * const serializedForNamespace = serializeToByteStream(steel, {
57
+ * 'MyApp\\User': User,
58
+ * })
59
+ *
60
+ * @example
61
+ * // Result: serialized
62
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
63
+ *
64
+ * // Result: serializedForNamespace
65
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
66
+ *
67
+ * @example
68
+ * // Result: unserialized
69
+ * unserialized instanceof User = true
70
+ *
71
+ * @see {@link phpSerialIsSerialized}
72
+ * @see {@link phpSerialSerialize}
73
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
74
+ */ export { phpSerialIsSerializedByteStream };
75
+ export default phpSerialIsSerializedByteStream;
76
+
77
+ //# sourceMappingURL=php-serial-is-serialized-byte-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/serialize/php-serial-is-serialized-byte-stream.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\nimport {isSerialized as phpSerialIsSerializedByteStream} from 'php-serialize'\n\n\n/**\n * Generates a string with **_byte-stream_** representation of a value.\n *\n * **Note:**\n * that this is a binary string which may include null bytes, and needs to be\n * stored and handled as such. For example, serialize() output should generally\n * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.\n *\n * ---\n *\n * @example\n * export function serialize(\n * item: any,\n * phpToJsScope: Object = {},\n * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }\n * ): string\n *\n * @example\n * class User {\n * constructor({ name, age }) {\n * this.name = name\n * this.age = age\n * }\n * serialize() {\n * return JSON.stringify({ name: this.name, age: this.age })\n * }\n * unserialize(rawData) {\n * const { name, age } = JSON.parse(rawData)\n * this.name = name\n * this.age = age\n * }\n * }\n * const steel = new User({ name: 'Steel Brain', age: 17 })\n *\n *\n * // Serialize to byte stream string\n * const serialized = serializeToByteStream(steel)\n *\n * // Serialize User class to given name\n * const serializedForNamespace = serializeToByteStream(steel, {\n * 'MyApp\\\\User': User,\n * })\n *\n * @example\n * // Result: serialized\n * \"C:4:\\\"User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * // Result: serializedForNamespace\n * \"C:10:\\\"MyApp\\\\User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * @example\n * // Result: unserialized\n * unserialized instanceof User = true\n *\n * @see {@link phpSerialIsSerialized}\n * @see {@link phpSerialSerialize}\n * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}\n */\nexport {phpSerialIsSerializedByteStream}\nexport default phpSerialIsSerializedByteStream\n"],"names":["isSerialized","phpSerialIsSerializedByteStream"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAAQA,gBAAgBC,+BAA+B,QAAO,gBAAe;AAG7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDC,GACD,SAAQA,+BAA+B,GAAC;AACxC,eAAeA,gCAA+B"}
@@ -0,0 +1,77 @@
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
+ import { serialize as phpSerialSerializeToByteStream } from 'php-serialize';
18
+ /**
19
+ * Generates a string with **_byte-stream_** representation of a value.
20
+ *
21
+ * **Note:**
22
+ * that this is a binary string which may include null bytes, and needs to be
23
+ * stored and handled as such. For example, serialize() output should generally
24
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
25
+ *
26
+ * ---
27
+ *
28
+ * @example
29
+ * export function serialize(
30
+ * item: any,
31
+ * phpToJsScope: Object = {},
32
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
33
+ * ): string
34
+ *
35
+ * @example
36
+ * class User {
37
+ * constructor({ name, age }) {
38
+ * this.name = name
39
+ * this.age = age
40
+ * }
41
+ * serialize() {
42
+ * return JSON.stringify({ name: this.name, age: this.age })
43
+ * }
44
+ * unserialize(rawData) {
45
+ * const { name, age } = JSON.parse(rawData)
46
+ * this.name = name
47
+ * this.age = age
48
+ * }
49
+ * }
50
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
51
+ *
52
+ *
53
+ * // Serialize to byte stream string
54
+ * const serialized = serializeToByteStream(steel)
55
+ *
56
+ * // Serialize User class to given name
57
+ * const serializedForNamespace = serializeToByteStream(steel, {
58
+ * 'MyApp\\User': User,
59
+ * })
60
+ *
61
+ * @example
62
+ * // Result: serialized
63
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
64
+ *
65
+ * // Result: serializedForNamespace
66
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
67
+ *
68
+ * @example
69
+ * // Result: unserialized
70
+ * unserialized instanceof User = true
71
+ *
72
+ * @see {@link phpSerialIsSerialized}
73
+ * @see {@link phpSerialSerialize}
74
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
75
+ */
76
+ export { phpSerialSerializeToByteStream };
77
+ export default phpSerialSerializeToByteStream;
@@ -0,0 +1,77 @@
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
+ */ import { serialize as phpSerialSerializeToByteStream } from "php-serialize";
17
+ /**
18
+ * Generates a string with **_byte-stream_** representation of a value.
19
+ *
20
+ * **Note:**
21
+ * that this is a binary string which may include null bytes, and needs to be
22
+ * stored and handled as such. For example, serialize() output should generally
23
+ * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
24
+ *
25
+ * ---
26
+ *
27
+ * @example
28
+ * export function serialize(
29
+ * item: any,
30
+ * phpToJsScope: Object = {},
31
+ * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }
32
+ * ): string
33
+ *
34
+ * @example
35
+ * class User {
36
+ * constructor({ name, age }) {
37
+ * this.name = name
38
+ * this.age = age
39
+ * }
40
+ * serialize() {
41
+ * return JSON.stringify({ name: this.name, age: this.age })
42
+ * }
43
+ * unserialize(rawData) {
44
+ * const { name, age } = JSON.parse(rawData)
45
+ * this.name = name
46
+ * this.age = age
47
+ * }
48
+ * }
49
+ * const steel = new User({ name: 'Steel Brain', age: 17 })
50
+ *
51
+ *
52
+ * // Serialize to byte stream string
53
+ * const serialized = serializeToByteStream(steel)
54
+ *
55
+ * // Serialize User class to given name
56
+ * const serializedForNamespace = serializeToByteStream(steel, {
57
+ * 'MyApp\\User': User,
58
+ * })
59
+ *
60
+ * @example
61
+ * // Result: serialized
62
+ * "C:4:\"User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
63
+ *
64
+ * // Result: serializedForNamespace
65
+ * "C:10:\"MyApp\\User\":31:{{\"name\":\"Steel Brain\",\"age\":17}}"
66
+ *
67
+ * @example
68
+ * // Result: unserialized
69
+ * unserialized instanceof User = true
70
+ *
71
+ * @see {@link phpSerialIsSerialized}
72
+ * @see {@link phpSerialSerialize}
73
+ * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}
74
+ */ export { phpSerialSerializeToByteStream };
75
+ export default phpSerialSerializeToByteStream;
76
+
77
+ //# sourceMappingURL=php-serial-serialize-to-byte-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/serialize/php-serial-serialize-to-byte-stream.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\nimport {serialize as phpSerialSerializeToByteStream} from 'php-serialize'\n\n\n/**\n * Generates a string with **_byte-stream_** representation of a value.\n *\n * **Note:**\n * that this is a binary string which may include null bytes, and needs to be\n * stored and handled as such. For example, serialize() output should generally\n * be stored in a BLOB field in a database, rather than a CHAR or TEXT field.\n *\n * ---\n *\n * @example\n * export function serialize(\n * item: any,\n * phpToJsScope: Object = {},\n * options: { encoding: 'utf8' | 'binary' } = { encoding: 'utf8' }\n * ): string\n *\n * @example\n * class User {\n * constructor({ name, age }) {\n * this.name = name\n * this.age = age\n * }\n * serialize() {\n * return JSON.stringify({ name: this.name, age: this.age })\n * }\n * unserialize(rawData) {\n * const { name, age } = JSON.parse(rawData)\n * this.name = name\n * this.age = age\n * }\n * }\n * const steel = new User({ name: 'Steel Brain', age: 17 })\n *\n *\n * // Serialize to byte stream string\n * const serialized = serializeToByteStream(steel)\n *\n * // Serialize User class to given name\n * const serializedForNamespace = serializeToByteStream(steel, {\n * 'MyApp\\\\User': User,\n * })\n *\n * @example\n * // Result: serialized\n * \"C:4:\\\"User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * // Result: serializedForNamespace\n * \"C:10:\\\"MyApp\\\\User\\\":31:{{\\\"name\\\":\\\"Steel Brain\\\",\\\"age\\\":17}}\"\n *\n * @example\n * // Result: unserialized\n * unserialized instanceof User = true\n *\n * @see {@link phpSerialIsSerialized}\n * @see {@link phpSerialSerialize}\n * @see {@link https://github.com/steelbrain/php-serialize|PHP Serializer}\n */\nexport {phpSerialSerializeToByteStream}\nexport default phpSerialSerializeToByteStream\n"],"names":["serialize","phpSerialSerializeToByteStream"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAAQA,aAAaC,8BAA8B,QAAO,gBAAe;AAGzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDC,GACD,SAAQA,8BAA8B,GAAC;AACvC,eAAeA,+BAA8B"}
@@ -0,0 +1,36 @@
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
+ export interface SplitDisplayName {
18
+ firstName: string;
19
+ lastName: string;
20
+ }
21
+ /**
22
+ * A single `displayName` split into the first/last pair the console profile
23
+ * stores (AGL-1127). Identity providers hand us one string — Google and a
24
+ * SAML assertion both do — while `users/{uid}` and the Basic info form are
25
+ * two fields, so seeding a profile from a provider needs a split.
26
+ *
27
+ * Everything after the first space is the last name, so multi-word family
28
+ * names ("Ada Lovelace King") survive intact. A single word is a first name
29
+ * with no last name rather than a guess, and an empty/absent value yields two
30
+ * empty strings — the caller decides whether that is worth writing.
31
+ *
32
+ * Deliberately naive: this is a SEED for a form the user can edit, not an
33
+ * attempt to parse names correctly, which is not something a splitter can do.
34
+ */
35
+ export declare function splitDisplayName(displayName?: string | null): SplitDisplayName;
36
+ export default splitDisplayName;
@@ -0,0 +1,47 @@
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
+ * A single `displayName` split into the first/last pair the console profile
18
+ * stores (AGL-1127). Identity providers hand us one string — Google and a
19
+ * SAML assertion both do — while `users/{uid}` and the Basic info form are
20
+ * two fields, so seeding a profile from a provider needs a split.
21
+ *
22
+ * Everything after the first space is the last name, so multi-word family
23
+ * names ("Ada Lovelace King") survive intact. A single word is a first name
24
+ * with no last name rather than a guess, and an empty/absent value yields two
25
+ * empty strings — the caller decides whether that is worth writing.
26
+ *
27
+ * Deliberately naive: this is a SEED for a form the user can edit, not an
28
+ * attempt to parse names correctly, which is not something a splitter can do.
29
+ */ export function splitDisplayName(displayName) {
30
+ const cleaned = String(displayName != null ? displayName : '').replace(/\s+/g, ' ').trim();
31
+ if (!cleaned) return {
32
+ firstName: '',
33
+ lastName: ''
34
+ };
35
+ const boundary = cleaned.indexOf(' ');
36
+ if (boundary === -1) return {
37
+ firstName: cleaned,
38
+ lastName: ''
39
+ };
40
+ return {
41
+ firstName: cleaned.slice(0, boundary),
42
+ lastName: cleaned.slice(boundary + 1)
43
+ };
44
+ }
45
+ export default splitDisplayName;
46
+
47
+ //# sourceMappingURL=split-display-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/shared/util/tools/src/lib/split-display-name.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\nexport interface SplitDisplayName {\n firstName: string\n lastName: string\n}\n\n/**\n * A single `displayName` split into the first/last pair the console profile\n * stores (AGL-1127). Identity providers hand us one string — Google and a\n * SAML assertion both do — while `users/{uid}` and the Basic info form are\n * two fields, so seeding a profile from a provider needs a split.\n *\n * Everything after the first space is the last name, so multi-word family\n * names (\"Ada Lovelace King\") survive intact. A single word is a first name\n * with no last name rather than a guess, and an empty/absent value yields two\n * empty strings — the caller decides whether that is worth writing.\n *\n * Deliberately naive: this is a SEED for a form the user can edit, not an\n * attempt to parse names correctly, which is not something a splitter can do.\n */\nexport function splitDisplayName(\n displayName?: string | null,\n): SplitDisplayName {\n const cleaned = String(displayName ?? '')\n .replace(/\\s+/g, ' ')\n .trim()\n if (!cleaned) return { firstName: '', lastName: '' }\n const boundary = cleaned.indexOf(' ')\n if (boundary === -1) return { firstName: cleaned, lastName: '' }\n return {\n firstName: cleaned.slice(0, boundary),\n lastName: cleaned.slice(boundary + 1),\n }\n}\n\nexport default splitDisplayName\n"],"names":["splitDisplayName","displayName","cleaned","String","replace","trim","firstName","lastName","boundary","indexOf","slice"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAOD;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASA,iBACdC,WAA2B;IAE3B,MAAMC,UAAUC,OAAOF,sBAAAA,cAAe,IACnCG,OAAO,CAAC,QAAQ,KAChBC,IAAI;IACP,IAAI,CAACH,SAAS,OAAO;QAAEI,WAAW;QAAIC,UAAU;IAAG;IACnD,MAAMC,WAAWN,QAAQO,OAAO,CAAC;IACjC,IAAID,aAAa,CAAC,GAAG,OAAO;QAAEF,WAAWJ;QAASK,UAAU;IAAG;IAC/D,OAAO;QACLD,WAAWJ,QAAQQ,KAAK,CAAC,GAAGF;QAC5BD,UAAUL,QAAQQ,KAAK,CAACF,WAAW;IACrC;AACF;AAEA,eAAeR,iBAAgB"}
@@ -0,0 +1,21 @@
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 spreading multiple strings String(...)
19
+ */
20
+ export declare function str(...val: any[]): string;
21
+ export default str;