@nejs/basic-extensions 2.7.0 → 2.9.0

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 (271) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/README.md +6250 -1574
  3. package/bin/version +100 -0
  4. package/dist/@nejs/basic-extensions.bundle.2.8.0.js +19 -0
  5. package/dist/@nejs/basic-extensions.bundle.2.8.0.js.map +7 -0
  6. package/dist/cjs/array.extensions.d.ts +39 -0
  7. package/dist/cjs/array.extensions.js +303 -0
  8. package/dist/cjs/array.extensions.js.map +1 -0
  9. package/dist/cjs/big.int.extension.d.ts +31 -0
  10. package/dist/cjs/big.int.extension.js +164 -0
  11. package/dist/cjs/big.int.extension.js.map +1 -0
  12. package/dist/cjs/{newClasses → classes}/asyncIterable.js +32 -44
  13. package/dist/cjs/classes/asyncIterable.js.map +1 -0
  14. package/dist/cjs/{newClasses → classes}/deferred.js +66 -138
  15. package/dist/cjs/classes/deferred.js.map +1 -0
  16. package/dist/cjs/{newClasses → classes}/descriptor.js +56 -90
  17. package/dist/cjs/classes/descriptor.js.map +1 -0
  18. package/dist/cjs/classes/index.d.ts +13 -0
  19. package/dist/cjs/classes/index.js +57 -0
  20. package/dist/cjs/classes/index.js.map +1 -0
  21. package/dist/cjs/classes/introspector.d.ts +20 -0
  22. package/dist/cjs/classes/introspector.js +130 -0
  23. package/dist/cjs/classes/introspector.js.map +1 -0
  24. package/dist/cjs/{newClasses → classes}/iterable.js +42 -63
  25. package/dist/cjs/classes/iterable.js.map +1 -0
  26. package/dist/cjs/classes/param.parser.d.ts +227 -0
  27. package/dist/cjs/classes/param.parser.js +242 -0
  28. package/dist/cjs/classes/param.parser.js.map +1 -0
  29. package/dist/cjs/classes/pluggable.proxy.d.ts +152 -0
  30. package/dist/cjs/classes/pluggable.proxy.js +444 -0
  31. package/dist/cjs/classes/pluggable.proxy.js.map +1 -0
  32. package/dist/cjs/{newClasses → classes}/refmap.js +18 -30
  33. package/dist/cjs/classes/refmap.js.map +1 -0
  34. package/dist/cjs/{newClasses → classes}/refset.js +28 -47
  35. package/dist/cjs/classes/refset.js.map +1 -0
  36. package/dist/cjs/classes/symkeys.d.ts +292 -0
  37. package/dist/cjs/classes/symkeys.js +424 -0
  38. package/dist/cjs/classes/symkeys.js.map +1 -0
  39. package/dist/cjs/classes/type.d.ts +56 -0
  40. package/dist/cjs/classes/type.js +405 -0
  41. package/dist/cjs/classes/type.js.map +1 -0
  42. package/dist/cjs/function.extensions.js +757 -0
  43. package/dist/cjs/function.extensions.js.map +1 -0
  44. package/dist/cjs/global.this.js +261 -0
  45. package/dist/cjs/global.this.js.map +1 -0
  46. package/dist/cjs/index.d.ts +4 -3
  47. package/dist/cjs/index.js +62 -32
  48. package/dist/cjs/index.js.map +1 -1
  49. package/dist/cjs/json.extensions.d.ts +2 -0
  50. package/dist/cjs/json.extensions.js +108 -0
  51. package/dist/cjs/json.extensions.js.map +1 -0
  52. package/dist/{mjs/mapextensions.d.ts → cjs/map.extensions.d.ts} +1 -0
  53. package/dist/cjs/map.extensions.js +142 -0
  54. package/dist/cjs/map.extensions.js.map +1 -0
  55. package/dist/cjs/number.extension.d.ts +44 -0
  56. package/dist/cjs/number.extension.js +260 -0
  57. package/dist/cjs/number.extension.js.map +1 -0
  58. package/dist/cjs/object.extensions.d.ts +62 -0
  59. package/dist/cjs/object.extensions.js +1128 -0
  60. package/dist/cjs/object.extensions.js.map +1 -0
  61. package/dist/cjs/proxy.extensions.d.ts +2 -0
  62. package/dist/cjs/proxy.extensions.js +207 -0
  63. package/dist/cjs/proxy.extensions.js.map +1 -0
  64. package/dist/cjs/reflect.extensions.js +316 -0
  65. package/dist/cjs/reflect.extensions.js.map +1 -0
  66. package/dist/cjs/regular.expression.extensions.d.ts +2 -0
  67. package/dist/cjs/regular.expression.extensions.js +423 -0
  68. package/dist/cjs/regular.expression.extensions.js.map +1 -0
  69. package/dist/cjs/set.extensions.d.ts +40 -0
  70. package/dist/cjs/{setextensions.js → set.extensions.js} +150 -2
  71. package/dist/cjs/set.extensions.js.map +1 -0
  72. package/dist/cjs/string.extensions.js +661 -0
  73. package/dist/cjs/string.extensions.js.map +1 -0
  74. package/dist/{mjs/symbolextensions.d.ts → cjs/symbol.extensions.d.ts} +1 -0
  75. package/dist/cjs/symbol.extensions.js +380 -0
  76. package/dist/cjs/symbol.extensions.js.map +1 -0
  77. package/dist/cjs/{weakrefextensions.js → weakref.extensions.js} +1 -1
  78. package/dist/cjs/weakref.extensions.js.map +1 -0
  79. package/dist/mjs/array.extensions.d.ts +39 -0
  80. package/dist/mjs/array.extensions.js +300 -0
  81. package/dist/mjs/array.extensions.js.map +1 -0
  82. package/dist/mjs/big.int.extension.d.ts +31 -0
  83. package/dist/mjs/big.int.extension.js +161 -0
  84. package/dist/mjs/big.int.extension.js.map +1 -0
  85. package/dist/mjs/classes/asyncIterable.js.map +1 -0
  86. package/dist/mjs/classes/deferred.js.map +1 -0
  87. package/dist/mjs/{newClasses → classes}/descriptor.js +7 -4
  88. package/dist/mjs/classes/descriptor.js.map +1 -0
  89. package/dist/mjs/classes/index.d.ts +13 -0
  90. package/dist/mjs/classes/index.js +40 -0
  91. package/dist/mjs/classes/index.js.map +1 -0
  92. package/dist/mjs/classes/introspector.d.ts +20 -0
  93. package/dist/mjs/classes/introspector.js +126 -0
  94. package/dist/mjs/classes/introspector.js.map +1 -0
  95. package/dist/mjs/classes/iterable.js.map +1 -0
  96. package/dist/mjs/classes/param.parser.d.ts +227 -0
  97. package/dist/mjs/classes/param.parser.js +238 -0
  98. package/dist/mjs/classes/param.parser.js.map +1 -0
  99. package/dist/mjs/classes/pluggable.proxy.d.ts +152 -0
  100. package/dist/mjs/classes/pluggable.proxy.js +438 -0
  101. package/dist/mjs/classes/pluggable.proxy.js.map +1 -0
  102. package/dist/mjs/{newClasses → classes}/refmap.js +3 -3
  103. package/dist/mjs/classes/refmap.js.map +1 -0
  104. package/dist/mjs/classes/refset.js.map +1 -0
  105. package/dist/mjs/classes/symkeys.d.ts +292 -0
  106. package/dist/mjs/classes/symkeys.js +420 -0
  107. package/dist/mjs/classes/symkeys.js.map +1 -0
  108. package/dist/mjs/classes/type.d.ts +56 -0
  109. package/dist/mjs/classes/type.js +401 -0
  110. package/dist/mjs/classes/type.js.map +1 -0
  111. package/dist/mjs/function.extensions.js +754 -0
  112. package/dist/mjs/function.extensions.js.map +1 -0
  113. package/dist/mjs/global.this.js +258 -0
  114. package/dist/mjs/global.this.js.map +1 -0
  115. package/dist/mjs/index.d.ts +4 -3
  116. package/dist/mjs/index.js +49 -19
  117. package/dist/mjs/index.js.map +1 -1
  118. package/dist/mjs/json.extensions.d.ts +2 -0
  119. package/dist/mjs/json.extensions.js +105 -0
  120. package/dist/mjs/json.extensions.js.map +1 -0
  121. package/dist/{cjs/mapextensions.d.ts → mjs/map.extensions.d.ts} +1 -0
  122. package/dist/mjs/map.extensions.js +139 -0
  123. package/dist/mjs/map.extensions.js.map +1 -0
  124. package/dist/mjs/number.extension.d.ts +44 -0
  125. package/dist/mjs/number.extension.js +257 -0
  126. package/dist/mjs/number.extension.js.map +1 -0
  127. package/dist/mjs/object.extensions.d.ts +62 -0
  128. package/dist/mjs/object.extensions.js +1124 -0
  129. package/dist/mjs/object.extensions.js.map +1 -0
  130. package/dist/mjs/proxy.extensions.d.ts +2 -0
  131. package/dist/mjs/proxy.extensions.js +204 -0
  132. package/dist/mjs/proxy.extensions.js.map +1 -0
  133. package/dist/mjs/reflect.extensions.js +313 -0
  134. package/dist/mjs/reflect.extensions.js.map +1 -0
  135. package/dist/mjs/regular.expression.extensions.d.ts +2 -0
  136. package/dist/mjs/regular.expression.extensions.js +420 -0
  137. package/dist/mjs/regular.expression.extensions.js.map +1 -0
  138. package/dist/mjs/set.extensions.d.ts +40 -0
  139. package/dist/mjs/{setextensions.js → set.extensions.js} +149 -1
  140. package/dist/mjs/set.extensions.js.map +1 -0
  141. package/dist/mjs/string.extensions.js +658 -0
  142. package/dist/mjs/string.extensions.js.map +1 -0
  143. package/dist/{cjs/symbolextensions.d.ts → mjs/symbol.extensions.d.ts} +1 -0
  144. package/dist/mjs/symbol.extensions.js +377 -0
  145. package/dist/mjs/symbol.extensions.js.map +1 -0
  146. package/dist/mjs/{weakrefextensions.js → weakref.extensions.js} +1 -1
  147. package/dist/mjs/weakref.extensions.js.map +1 -0
  148. package/docs/index.html +24452 -5692
  149. package/package.json +7 -5
  150. package/src/array.extensions.js +322 -0
  151. package/src/big.int.extension.js +163 -0
  152. package/src/{newClasses → classes}/descriptor.js +16 -12
  153. package/src/classes/index.js +51 -0
  154. package/src/classes/introspector.js +167 -0
  155. package/src/classes/param.parser.js +253 -0
  156. package/src/classes/pluggable.proxy.js +485 -0
  157. package/src/{newClasses → classes}/refmap.js +5 -3
  158. package/src/classes/symkeys.js +464 -0
  159. package/src/classes/type.js +427 -0
  160. package/src/function.extensions.js +818 -0
  161. package/src/global.this.js +304 -0
  162. package/src/index.js +56 -23
  163. package/src/json.extensions.js +109 -0
  164. package/src/map.extensions.js +144 -0
  165. package/src/number.extension.js +273 -0
  166. package/src/object.extensions.js +1237 -0
  167. package/src/proxy.extensions.js +229 -0
  168. package/src/reflect.extensions.js +346 -0
  169. package/src/regular.expression.extensions.js +451 -0
  170. package/src/{setextensions.js → set.extensions.js} +151 -2
  171. package/src/string.extensions.js +734 -0
  172. package/src/symbol.extensions.js +389 -0
  173. package/tests/newClasses/refmap.test.js +3 -2
  174. package/tsconfig.base.json +5 -3
  175. package/tsconfig.cjs.json +2 -2
  176. package/tsconfig.esm.json +2 -2
  177. package/dist/@nejs/basic-extensions.bundle.2.6.0.js +0 -17
  178. package/dist/@nejs/basic-extensions.bundle.2.6.0.js.map +0 -7
  179. package/dist/cjs/arrayextensions.d.ts +0 -10
  180. package/dist/cjs/arrayextensions.js +0 -73
  181. package/dist/cjs/arrayextensions.js.map +0 -1
  182. package/dist/cjs/functionextensions.js +0 -202
  183. package/dist/cjs/functionextensions.js.map +0 -1
  184. package/dist/cjs/globals.js +0 -166
  185. package/dist/cjs/globals.js.map +0 -1
  186. package/dist/cjs/mapextensions.js +0 -32
  187. package/dist/cjs/mapextensions.js.map +0 -1
  188. package/dist/cjs/newClasses/asyncIterable.js.map +0 -1
  189. package/dist/cjs/newClasses/deferred.js.map +0 -1
  190. package/dist/cjs/newClasses/descriptor.js.map +0 -1
  191. package/dist/cjs/newClasses/iterable.js.map +0 -1
  192. package/dist/cjs/newClasses/refmap.js.map +0 -1
  193. package/dist/cjs/newClasses/refset.js.map +0 -1
  194. package/dist/cjs/objectextensions.d.ts +0 -11
  195. package/dist/cjs/objectextensions.js +0 -232
  196. package/dist/cjs/objectextensions.js.map +0 -1
  197. package/dist/cjs/reflectextensions.js +0 -111
  198. package/dist/cjs/reflectextensions.js.map +0 -1
  199. package/dist/cjs/setextensions.d.ts +0 -2
  200. package/dist/cjs/setextensions.js.map +0 -1
  201. package/dist/cjs/stringextensions.js +0 -158
  202. package/dist/cjs/stringextensions.js.map +0 -1
  203. package/dist/cjs/symbolextensions.js +0 -69
  204. package/dist/cjs/symbolextensions.js.map +0 -1
  205. package/dist/cjs/weakrefextensions.js.map +0 -1
  206. package/dist/mjs/arrayextensions.d.ts +0 -10
  207. package/dist/mjs/arrayextensions.js +0 -70
  208. package/dist/mjs/arrayextensions.js.map +0 -1
  209. package/dist/mjs/functionextensions.js +0 -199
  210. package/dist/mjs/functionextensions.js.map +0 -1
  211. package/dist/mjs/globals.js +0 -163
  212. package/dist/mjs/globals.js.map +0 -1
  213. package/dist/mjs/mapextensions.js +0 -29
  214. package/dist/mjs/mapextensions.js.map +0 -1
  215. package/dist/mjs/newClasses/asyncIterable.js.map +0 -1
  216. package/dist/mjs/newClasses/deferred.js.map +0 -1
  217. package/dist/mjs/newClasses/descriptor.js.map +0 -1
  218. package/dist/mjs/newClasses/iterable.js.map +0 -1
  219. package/dist/mjs/newClasses/refmap.js.map +0 -1
  220. package/dist/mjs/newClasses/refset.js.map +0 -1
  221. package/dist/mjs/objectextensions.d.ts +0 -11
  222. package/dist/mjs/objectextensions.js +0 -229
  223. package/dist/mjs/objectextensions.js.map +0 -1
  224. package/dist/mjs/reflectextensions.js +0 -108
  225. package/dist/mjs/reflectextensions.js.map +0 -1
  226. package/dist/mjs/setextensions.d.ts +0 -2
  227. package/dist/mjs/setextensions.js.map +0 -1
  228. package/dist/mjs/stringextensions.js +0 -155
  229. package/dist/mjs/stringextensions.js.map +0 -1
  230. package/dist/mjs/symbolextensions.js +0 -66
  231. package/dist/mjs/symbolextensions.js.map +0 -1
  232. package/dist/mjs/weakrefextensions.js.map +0 -1
  233. package/src/arrayextensions.js +0 -75
  234. package/src/functionextensions.js +0 -225
  235. package/src/globals.js +0 -196
  236. package/src/mapextensions.js +0 -32
  237. package/src/objectextensions.js +0 -256
  238. package/src/reflectextensions.js +0 -118
  239. package/src/stringextensions.js +0 -166
  240. package/src/symbolextensions.js +0 -69
  241. /package/dist/cjs/{newClasses → classes}/asyncIterable.d.ts +0 -0
  242. /package/dist/cjs/{newClasses → classes}/deferred.d.ts +0 -0
  243. /package/dist/cjs/{newClasses → classes}/descriptor.d.ts +0 -0
  244. /package/dist/cjs/{newClasses → classes}/iterable.d.ts +0 -0
  245. /package/dist/cjs/{newClasses → classes}/refmap.d.ts +0 -0
  246. /package/dist/cjs/{newClasses → classes}/refset.d.ts +0 -0
  247. /package/dist/cjs/{functionextensions.d.ts → function.extensions.d.ts} +0 -0
  248. /package/dist/cjs/{globals.d.ts → global.this.d.ts} +0 -0
  249. /package/dist/cjs/{reflectextensions.d.ts → reflect.extensions.d.ts} +0 -0
  250. /package/dist/cjs/{stringextensions.d.ts → string.extensions.d.ts} +0 -0
  251. /package/dist/cjs/{weakrefextensions.d.ts → weakref.extensions.d.ts} +0 -0
  252. /package/dist/mjs/{newClasses → classes}/asyncIterable.d.ts +0 -0
  253. /package/dist/mjs/{newClasses → classes}/asyncIterable.js +0 -0
  254. /package/dist/mjs/{newClasses → classes}/deferred.d.ts +0 -0
  255. /package/dist/mjs/{newClasses → classes}/deferred.js +0 -0
  256. /package/dist/mjs/{newClasses → classes}/descriptor.d.ts +0 -0
  257. /package/dist/mjs/{newClasses → classes}/iterable.d.ts +0 -0
  258. /package/dist/mjs/{newClasses → classes}/iterable.js +0 -0
  259. /package/dist/mjs/{newClasses → classes}/refmap.d.ts +0 -0
  260. /package/dist/mjs/{newClasses → classes}/refset.d.ts +0 -0
  261. /package/dist/mjs/{newClasses → classes}/refset.js +0 -0
  262. /package/dist/mjs/{functionextensions.d.ts → function.extensions.d.ts} +0 -0
  263. /package/dist/mjs/{globals.d.ts → global.this.d.ts} +0 -0
  264. /package/dist/mjs/{reflectextensions.d.ts → reflect.extensions.d.ts} +0 -0
  265. /package/dist/mjs/{stringextensions.d.ts → string.extensions.d.ts} +0 -0
  266. /package/dist/mjs/{weakrefextensions.d.ts → weakref.extensions.d.ts} +0 -0
  267. /package/src/{newClasses → classes}/asyncIterable.js +0 -0
  268. /package/src/{newClasses → classes}/deferred.js +0 -0
  269. /package/src/{newClasses → classes}/iterable.js +0 -0
  270. /package/src/{newClasses → classes}/refset.js +0 -0
  271. /package/src/{weakrefextensions.js → weakref.extensions.js} +0 -0
@@ -0,0 +1,658 @@
1
+ import { Patch } from '@nejs/extension';
2
+ const parenthesisPair = ['(', ')'];
3
+ /**
4
+ * `StringExtensions` is a patch for the JavaScript built-in `String` class. It
5
+ * adds utility methods to the `String` class without modifying the global namespace
6
+ * directly. This patch includes methods for key validation, object type checking,
7
+ * and retrieving the string tag of an object. These methods are useful for
8
+ * enhancing the capabilities of the standard `String` class with additional
9
+ * utility functions.
10
+ */
11
+ export const StringExtensions = new Patch(String, {
12
+ /**
13
+ * The `isString` method does exactly what one would it expect. It returns
14
+ * true if the string matches typeof or instanceof as a string.
15
+ *
16
+ * @param {*} value checks to see if the `value` is a string
17
+ * @returns {boolean} `true` if it is a `String`, `false` otherwise
18
+ */
19
+ isString(value) {
20
+ return (value !== null && value !== undefined &&
21
+ (typeof value === 'string' || value instanceof String));
22
+ },
23
+ /**
24
+ * Conditionally returns a value based on whether the supplied
25
+ * `value` is a `String` or not. If the `value` is a `String`,
26
+ * the `thenValue` will be returned. If it is not a `String`,
27
+ * the `elseValue` will be returned instead.
28
+ *
29
+ * @param {any} value the value to check to determine if it is a
30
+ * `String`
31
+ * @param {any} thenValue the value to return if the supplied
32
+ * `value` is a `String`
33
+ * @param {any} elseValue the value to return if the supplied
34
+ * `value` is not a `String`
35
+ * @returns {any} either the `thenValue` or `elseValue` depending
36
+ * on if the supplied `value` is a `String`
37
+ *
38
+ * @example
39
+ * const str = 'hello'
40
+ * const num = 42
41
+ * ifString(str, 'is a string', 'not a string') // 'is a string'
42
+ * ifString(num, 'is a string', 'not a string') // 'not a string'
43
+ */
44
+ ifString(value, thenValue, elseValue) {
45
+ return isThenElse(this.isString(value), thenValue, elseValue);
46
+ },
47
+ /**
48
+ * A getter property that returns a pair of parentheses as an array.
49
+ * This property can be used when operations require a clear distinction
50
+ * between the opening and closing parentheses, such as parsing or
51
+ * matching balanced expressions in strings.
52
+ *
53
+ * @returns {[string, string]} An array containing a pair of strings: the
54
+ * opening parenthesis '(' as the first element, and the closing parenthesis
55
+ * ')' as the second element.
56
+ */
57
+ get parenthesisPair() {
58
+ return ['(', ')'];
59
+ },
60
+ /**
61
+ * A getter property that returns a pair of square brackets as an array.
62
+ * This property is particularly useful for operations that require a clear
63
+ * distinction between the opening and closing square brackets, such as
64
+ * parsing arrays in strings or matching balanced expressions within
65
+ * square brackets.
66
+ *
67
+ * @returns {[string, string]} An array containing a pair of strings: the
68
+ * opening square bracket '[' as the first element, and the closing square
69
+ * bracket ']' as the second element.
70
+ */
71
+ get squareBracketsPair() {
72
+ return ['[', ']'];
73
+ },
74
+ /**
75
+ * A getter property that returns a pair of curly brackets as an array.
76
+ * This property is particularly useful for operations that require a clear
77
+ * distinction between the opening and closing curly brackets, such as
78
+ * parsing objects in strings or matching balanced expressions within
79
+ * curly brackets. The returned array consists of the opening curly bracket
80
+ * '{' as the first element, and the closing curly bracket '}' as the
81
+ * second element.
82
+ *
83
+ * @returns {[string, string]} An array containing a pair of strings: the
84
+ * opening curly bracket '{' as the first element, and the closing curly
85
+ * bracket '}' as the second element.
86
+ */
87
+ get curlyBracketsPair() {
88
+ return ['{', '}'];
89
+ },
90
+ /**
91
+ * Generates a random string using base 36 (numbers and lowercase letters).
92
+ * This method is useful when you need a random string that includes both
93
+ * numbers and letters. The generated string does not include the leading
94
+ * '0.' that is part of the string representation of a random number in
95
+ * base 36.
96
+ *
97
+ * @returns {string} A random string of characters in base 36.
98
+ *
99
+ * @example
100
+ * const randomStr = StringExtensions.random36();
101
+ * console.log(randomStr); // Output: "3n5yzxjkf2o"
102
+ */
103
+ random36() {
104
+ return Math.random().toString(36).slice(2);
105
+ },
106
+ /**
107
+ * Generates a random string using base 16 (hexadecimal numbers).
108
+ * This method is useful when you need a random string that includes both
109
+ * numbers and letters in hexadecimal format. The generated string does not
110
+ * include the leading '0.' that is part of the string representation of a
111
+ * random number in base 16.
112
+ *
113
+ * @returns {string} A random string of characters in base 16.
114
+ *
115
+ * @example
116
+ * const randomStr = StringExtensions.random16();
117
+ * console.log(randomStr); // Output: "3a5f4c"
118
+ */
119
+ random16() {
120
+ return Math.random().toString(16).slice(2);
121
+ },
122
+ /**
123
+ * Generates a random RGB color code.
124
+ *
125
+ * This method generates a random hexadecimal number, slices off the
126
+ * leading '0.' and takes the first 6 characters. It then pads the
127
+ * end of the string with '0' until it is 6 characters long. The
128
+ * result is a string that can be used as a color code in CSS.
129
+ *
130
+ * @param {string} [prefix='#'] - The prefix to prepend to the color
131
+ * code. Defaults to '#'.
132
+ *
133
+ * @returns {string} A random RGB color code.
134
+ *
135
+ * @example
136
+ * const randomColor = StringExtensions.randomRGB();
137
+ * console.log(randomColor); // Output: "#3a5f4c"
138
+ */
139
+ randomRGBHex(prefix = '#') {
140
+ const hex = Math.random().toString(16).slice(2).substring(0, 6);
141
+ return `${prefix}${hex.padEnd(6, '0')}`;
142
+ },
143
+ /**
144
+ * Generates a random ARGB color code.
145
+ *
146
+ * This method generates a random hexadecimal number, slices off the
147
+ * leading '0.' and takes the first 8 characters. It then pads the
148
+ * start of the string with '0' until it is 6 characters long and the
149
+ * end of the string with '0' until it is 8 characters long. The
150
+ * result is a string that can be used as a color code in CSS.
151
+ *
152
+ * @param {string} [prefix='#'] - The prefix to prepend to the color
153
+ * code. Defaults to '#'.
154
+ *
155
+ * @returns {string} A random ARGB color code.
156
+ *
157
+ * @example
158
+ * const randomColor = StringExtensions.randomARGB();
159
+ * console.log(randomColor); // Output: "#3a5f4c00"
160
+ */
161
+ randomARGBHex(prefix = '#') {
162
+ const hex = Math.random().toString(16).slice(2).substring(0, 8);
163
+ return `${prefix}${hex.padStart(6, '0').padEnd(8, '0')}`;
164
+ },
165
+ /**
166
+ * Generates a random RGBA color code.
167
+ *
168
+ * This method generates a random hexadecimal number, slices off the
169
+ * leading '0.' and takes the first 8 characters. It then pads the
170
+ * start of the string with '0' until it is 6 characters long and the
171
+ * end of the string with '0' until it is 8 characters long. The
172
+ * result is a string that can be used as a color code in CSS.
173
+ *
174
+ * @param {string} [prefix='#'] - The prefix to prepend to the color
175
+ * code. Defaults to '#'.
176
+ *
177
+ * @returns {string} A random RGBA color code.
178
+ *
179
+ * @example
180
+ * const randomColor = StringExtensions.randomRGBA();
181
+ * console.log(randomColor); // Output: "#3a5f4c00"
182
+ */
183
+ randomRGBAHex(prefix = '#') {
184
+ const hex = Math.random().toString(16).slice(2).substring(0, 8);
185
+ return `${prefix}${hex.padStart(6, '0').padStart(8, '0')}`;
186
+ },
187
+ /**
188
+ * Generates a random RGB color code.
189
+ *
190
+ * This method generates a random hexadecimal number, slices off the
191
+ * leading '0.' and pads the end of the string with '0' until it is
192
+ * 8 characters long. It then parses the first 6 characters into
193
+ * three separate 2-character strings, each representing a color
194
+ * component (red, green, blue) in hexadecimal format. These strings
195
+ * are then converted into decimal format and used to construct an
196
+ * RGB color code.
197
+ *
198
+ * @returns {string} A random RGB color code.
199
+ *
200
+ * @example
201
+ * const randomColor = StringExtensions.randomRGB();
202
+ * console.log(randomColor); // Output: "rgb(58,95,76)"
203
+ */
204
+ randomRGB() {
205
+ const hex = Math.random().toString(16).slice(2).padEnd(8, '0');
206
+ const red = parseInt(hex.substring(0, 2), 16);
207
+ const green = parseInt(hex.substring(2, 4), 16);
208
+ const blue = parseInt(hex.substring(4, 6), 16);
209
+ return `rgb(${red}, ${green}, ${blue})`;
210
+ },
211
+ /**
212
+ * Generates a random RGBA color code with optional forced color values.
213
+ *
214
+ * This method generates a random hexadecimal number, slices off the
215
+ * leading '0.' and pads the end of the string with '0' until it is
216
+ * 8 characters long. It then parses the first 8 characters into
217
+ * four separate 2-character strings, each representing a color
218
+ * component (red, green, blue, alpha) in hexadecimal format. These strings
219
+ * are then converted into decimal format and used to construct an
220
+ * RGBA color code.
221
+ *
222
+ * If a color component is provided in the `force` parameter, it will
223
+ * be used instead of a random value for that component.
224
+ *
225
+ * @param {Object} force - An object with properties for each color
226
+ * component (red, green, blue, alpha) that should be forced to a
227
+ * specific value. If a property is undefined or not provided, a
228
+ * random value will be used for that component.
229
+ * @param {number} force.red - The red component (0-255).
230
+ * @param {number} force.green - The green component (0-255).
231
+ * @param {number} force.blue - The blue component (0-255).
232
+ * @param {number} force.alpha - The alpha component (0.0-1.0).
233
+ *
234
+ * @returns {string} A random RGBA color code.
235
+ *
236
+ * @example
237
+ * const randomColor = StringExtensions.randomRGBA();
238
+ * console.log(randomColor); // Output: "rgba(58,95,76,0.50)"
239
+ *
240
+ * const forcedGreen = StringExtensions.randomRGBA({ green: 255 });
241
+ * console.log(forcedGreen); // Output: "rgba(58,255,76,0.50)"
242
+ */
243
+ randomRGBA(force = {
244
+ red: undefined,
245
+ green: undefined,
246
+ blue: undefined,
247
+ alpha: undefined
248
+ }) {
249
+ const hex = Math.random().toString(16).slice(2).padEnd(8, '0');
250
+ const red = force.red ?? parseInt(hex.substring(0, 2), 16);
251
+ const green = force.green ?? parseInt(hex.substring(2, 4), 16);
252
+ const blue = force.blue ?? parseInt(hex.substring(4, 6), 16);
253
+ const alpha = force.alpha ??
254
+ (parseInt(hex.substring(6, 8), 16) / 255.0) * 1.0;
255
+ return `rgba(${red}, ${green}, ${blue}, ${alpha.toFixed(2)})`;
256
+ },
257
+ /**
258
+ * Applies Select Graphic Rendition (SGR) parameters to a given message for
259
+ * styling in terminal environments. This function allows for the dynamic
260
+ * styling of text output using ANSI escape codes. It supports a variety of
261
+ * modes such as color, brightness, and text decorations like bold or underline.
262
+ *
263
+ * @param {string} message The message to be styled.
264
+ * @param {...string} useModes A series of strings representing the desired
265
+ * styling modes. Modes can include colors (e.g., 'red', 'blue'), brightness
266
+ * ('bright'), foreground/background ('fg', 'bg'), and text decorations
267
+ * ('bold', 'underline'). Modes can be combined in a single string using
268
+ * commas or passed as separate arguments.
269
+ *
270
+ * Colors:
271
+ * ```
272
+ * 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'
273
+ * ```
274
+ * Color Specifiers:
275
+ * ```
276
+ * 'fg' -> foreground | 'bg' -> background | 'bright' -> bright colors
277
+ * ```
278
+ *
279
+ * Modes:
280
+ * ```
281
+ * 'blink' or 'k' | 'conceal' or 'c' | 'italics' or 'i' | 'strike' or 's'
282
+ * 'bold' or 'b' | 'dim' or 'd' | 'negative' or 'n' | 'underline' or 'u'
283
+ * ```
284
+ *
285
+ * Examples:
286
+ * - `sgr('Hello', 'red')` applies red color to 'Hello'.
287
+ * - `sgr('World', 'green,bold')` applies green color and bold styling
288
+ * to 'World'.
289
+ * - `sgr('Example', 'bluebgbright')` applies bright blue
290
+ * background color.
291
+ *
292
+ * Short hand syntax is also allowed:
293
+ * - `sgr('hello', 'biu')` applies bold, italics and underline
294
+ * - `sgr('hello', 'bi,redfg')` applies bold, italics and red foreground
295
+ *
296
+ * As a bonus, there is a secret getter applied to the return string that
297
+ * allows you to invoke `sgr(...).show` to automatically log the output to
298
+ * `console.log`. This is done by wrapping the output string in `Object()`
299
+ * to make it a `String` instance and then adding the property descriptor.
300
+ * A custom `Symbol` is applied to make it evaluate in nodejs as though it
301
+ * were a normal string. To strip the extras, wrap the output in `String()`
302
+ *
303
+ * @returns {string} The message wrapped in ANSI escape codes corresponding
304
+ * to the specified modes. The returned string, when printed to a terminal,
305
+ * displays the styled message. Additional properties are attached to the
306
+ * result for utility purposes, such as 'show' for immediate console output.
307
+ */
308
+ sgr(message, ...useModes) {
309
+ const colors = Object.assign(['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'], {
310
+ isBG: a => !!/bg/i.exec(a),
311
+ isBright: a => !!/bright/i.exec(a),
312
+ isColor: a => {
313
+ let color = colors.find(c => new RegExp(c, 'i').exec(a));
314
+ return [!!color, colors.indexOf(color)];
315
+ },
316
+ });
317
+ const arrayifyString = s => {
318
+ if (Array.isArray(s)) {
319
+ let results = [];
320
+ for (const i of s) {
321
+ results = [...results, ...arrayifyString(i)];
322
+ }
323
+ return results.flat().filter(i => i.length);
324
+ }
325
+ if (!s || typeof s !== 'string') {
326
+ return [''];
327
+ }
328
+ else if (s.includes(',')) {
329
+ return arrayifyString(s.split(','));
330
+ }
331
+ else {
332
+ if (!colors.isColor(s)[0] && s.length > 1) {
333
+ return [...s];
334
+ }
335
+ else
336
+ return [s];
337
+ }
338
+ };
339
+ let modes = arrayifyString(useModes);
340
+ const sgrModes = {
341
+ blink: ['\x1b[5m', '\x1b[25m', 'k'],
342
+ bold: ['\x1b[1m', '\x1b[22m', 'b'],
343
+ conceal: ['\x1b[8m', '\x1b[28m', 'c'],
344
+ dim: ['\x1b[2m', '\x1b[22m', 'd'],
345
+ italics: ['\x1b[3m', '\x1b[23m', 'i'],
346
+ negative: ['\x1b[7m', '\x1b[27m', 'n'],
347
+ strike: ['\x1b[9m', '\x1b[29m', 's'],
348
+ underline: ['\x1b[4m', '\x1b[24m', 'u'],
349
+ };
350
+ Object.values(sgrModes).forEach(mode => sgrModes[mode[2]] = mode);
351
+ const codes = a => {
352
+ let open = '', close = '', mode = String(a).toLowerCase();
353
+ let [_isColor, colorIndex] = colors.isColor(mode);
354
+ if (_isColor) {
355
+ open = colors.isBG(mode)
356
+ ? `\x1b[${colors.isBright(mode) ? 10 : 4}${colorIndex}m`
357
+ : `\x1b[${colors.isBright(mode) ? 9 : 3}${colorIndex}m`;
358
+ close = colors.isBG(mode) ? '\x1b[49m' : `\x1b[39m`;
359
+ }
360
+ else if (sgrModes[mode]) {
361
+ open = sgrModes[mode][0];
362
+ close = sgrModes[mode][1];
363
+ }
364
+ return [open, close];
365
+ };
366
+ const onOrder = modes.map(key => codes(key)[0]).join('');
367
+ const offOrder = modes.map(key => codes(key)[1]).reverse().join('');
368
+ let result = Object(`${onOrder}${message}${offOrder}`);
369
+ Object.defineProperties(result, {
370
+ show: {
371
+ get() { console.log(String(this)); return this; },
372
+ enumerable: false,
373
+ },
374
+ [Symbol.for('nodejs.util.inspect.custom')]: {
375
+ value(depth, options, inspect) {
376
+ return inspect(String(this), options);
377
+ },
378
+ enumerable: false,
379
+ },
380
+ });
381
+ return result;
382
+ },
383
+ /**
384
+ * Wraps an object's properties into a formatted string.
385
+ *
386
+ * This method takes an object and a set of options to format the
387
+ * object's properties into a string. It allows customization of
388
+ * indentation, line endings, maximum line length, and more.
389
+ *
390
+ * @param {Object} [object=globalThis] - The object to wrap.
391
+ * @param {Object} [options={}] - The formatting options.
392
+ * @param {number} [options.indent=2] - The number of indentation
393
+ * characters to use.
394
+ * @param {string} [options.indentCharacter=' '] - The character to use
395
+ * for indentation.
396
+ * @param {Array} [options.inspector=[Object, 'getOwnPropertyNames']] -
397
+ * The inspector to use for retrieving object properties.
398
+ * @param {string} [options.lineEnding='\n'] - The line ending character.
399
+ * @param {number} [options.maxLen=78] - The maximum line length.
400
+ * @param {Function} [options.perLine=undefined] - A function to apply
401
+ * per line of output.
402
+ * @param {Function} [options.perLinePerProperty=undefined] - A function
403
+ * to apply per property per line of output.
404
+ * @param {Function} [options.preProcess=undefined] - A function to
405
+ * preprocess the object's properties.
406
+ * @param {Function} [options.preReturn=undefined] - A function to apply
407
+ * to the final output before returning.
408
+ * @param {string} [options.separator=', '] - The separator to use
409
+ * between properties.
410
+ *
411
+ * @returns {string} The formatted string representation of the object.
412
+ *
413
+ * @example
414
+ * const obj = { a: 1, b: 2, c: 3 }
415
+ * const wrapped = StringExtensions.wrap(obj, { maxLen: 20 })
416
+ * console.log(wrapped)
417
+ * // Output:
418
+ * // {
419
+ * // a: 1,
420
+ * // b: 2,
421
+ * // c: 3
422
+ * // }
423
+ */
424
+ wrap(objectOrLines, options = {
425
+ colorProperties: undefined,
426
+ indent: 2,
427
+ indentCharacter: ' ',
428
+ inspector: [Object, 'getOwnPropertyNames'],
429
+ lineEnding: '\n',
430
+ maxLen: 78,
431
+ perLine: undefined,
432
+ perLinePerProperty: undefined,
433
+ preProcess: undefined,
434
+ preReturn: undefined,
435
+ separator: ', ',
436
+ }) {
437
+ let { colorProperties = undefined, indent = options?.indent ?? 2, indentCharacter = options?.indentCharacter ?? ' ', inspector = options?.inspector ?? [Object, 'getOwnPropertyNames'], lineEnding = options?.lineEnding ?? '\n', maxLen = options?.maxLen ?? 78, perLine = options?.perLine ?? undefined, perLinePerProperty = options?.perLinePerProperty ?? undefined, preProcess = options?.preProcess ?? undefined, preReturn = options?.preReturn ?? undefined, separator = options?.separator ?? ', ', } = options ?? {};
438
+ let tab = indent === 0 ? ''
439
+ : indentCharacter.repeat(Number(indent) || 2);
440
+ maxLen = 78 - tab.length;
441
+ const sgr = this.sgr;
442
+ const validMapper = f => typeof f === 'function';
443
+ let line = [];
444
+ let getElements = inspector[0][inspector[1]];
445
+ let values = Array.isArray(objectOrLines)
446
+ ? objectOrLines : getElements(Object(objectOrLines));
447
+ if (validMapper(preProcess)) {
448
+ values = preProcess(values);
449
+ }
450
+ const context = { indent, indentCharacter, lineEnding, maxLen, tab, sgr };
451
+ let finalLines = values.reduce((acc, nextProp) => {
452
+ let ifCombined = [...line, nextProp].join(separator);
453
+ if ((tab.length + ifCombined.length) <= maxLen) {
454
+ line.push(nextProp);
455
+ }
456
+ else {
457
+ let lineProps = [...line];
458
+ if (validMapper(perLinePerProperty)) {
459
+ lineProps = lineProps.map((value, index, array) => {
460
+ return perLinePerProperty(value, index, array, context);
461
+ });
462
+ }
463
+ if (colorProperties) {
464
+ const sgrArgs = (Array.isArray(colorProperties)
465
+ ? colorProperties
466
+ : [colorProperties]);
467
+ lineProps = lineProps.map(v => sgr(v, ...sgrArgs));
468
+ }
469
+ lineProps = [tab, lineProps.join(separator)].join('');
470
+ if (validMapper(perLine)) {
471
+ lineProps = perLine(lineProps[0], 0, lineProps)?.[0] ?? lineProps[0];
472
+ }
473
+ acc.push(lineProps);
474
+ line = [];
475
+ }
476
+ return acc;
477
+ }, []);
478
+ if (validMapper(preReturn)) {
479
+ finalLines = finalLines.map((value, index, array) => {
480
+ return preReturn(value, index, array, context);
481
+ });
482
+ }
483
+ Symbol.for(`@nejs.string.wrap ${JSON.stringify({ lines: finalLines })}`);
484
+ if (lineEnding) {
485
+ finalLines = finalLines.join(lineEnding);
486
+ }
487
+ return finalLines;
488
+ },
489
+ });
490
+ const { isString: pIsString, ifString: pIfString } = StringExtensions.patches;
491
+ /**
492
+ * `StringPrototypeExtensions` provides a set of utility methods that are
493
+ * added to the `String` prototype. This allows all string instances to
494
+ * access new functionality directly, enhancing their capabilities beyond
495
+ * the standard `String` class methods. These extensions are applied using
496
+ * the `Patch` class from '@nejs/extension', ensuring that they do not
497
+ * interfere with the global namespace or existing properties.
498
+ *
499
+ * The extensions include methods for extracting substrings based on
500
+ * specific tokens, checking the presence of certain patterns, and more,
501
+ * making string manipulation tasks more convenient and expressive.
502
+ */
503
+ export const StringPrototypeExtensions = new Patch(String.prototype, {
504
+ [Patch.kMutablyHidden]: {
505
+ /**
506
+ * Determines if the current object is a string.
507
+ *
508
+ * This getter uses the `pIsString` function from the
509
+ * `StringExtensions` patch to check if the current object
510
+ * (`this`) is a string.
511
+ *
512
+ * @type {boolean}
513
+ * @readonly
514
+ *
515
+ * @example
516
+ * const str = "Hello, World!"
517
+ * console.log(str.isString) // Output: true
518
+ *
519
+ * const notStr = 123
520
+ * console.log(notStr.isString) // Output: false
521
+ */
522
+ get isString() {
523
+ return pIsString(this);
524
+ },
525
+ /**
526
+ * Checks if the current object is a string and returns the
527
+ * corresponding value based on the result.
528
+ *
529
+ * This method uses the `pIfString` function from the
530
+ * `StringExtensions` patch to determine if the current object
531
+ * (`this`) is a string. If it is a string, the `thenValue` is returned.
532
+ * Otherwise, the `elseValue` is returned.
533
+ *
534
+ * @param {any} thenValue - The value to return if the current object
535
+ * is a string.
536
+ * @param {any} elseValue - The value to return if the current object
537
+ * is not a string.
538
+ * @returns {any} The `thenValue` if the current object is a string, or
539
+ * the `elseValue` if it is not a string.
540
+ *
541
+ * @example
542
+ * const str = "Hello, World!"
543
+ * // 'Is a string'
544
+ * console.log(str.ifString('Is a string', 'Not a string'))
545
+ *
546
+ * const notStr = 123
547
+ * // 'Not a string'
548
+ * console.log(notStr.ifString('Is a string', 'Not a string'))
549
+ */
550
+ ifString(thenValue, elseValue) {
551
+ return pIfString(this, thenValue, elseValue);
552
+ },
553
+ /**
554
+ * Returns an object representation of the string instance.
555
+ *
556
+ * This getter method creates and returns an object that wraps
557
+ * the string instance, allowing it to be treated as an object.
558
+ * The returned object is created using the `Object()`
559
+ * constructor, which takes the string instance as its argument.
560
+ *
561
+ * @type {Object}
562
+ * @readonly
563
+ *
564
+ * @example
565
+ * const str = 'Hello, World!'
566
+ * console.log(typeof str) // 'string'
567
+ * console.log(typeof str.instance) // 'object'
568
+ */
569
+ get instance() {
570
+ return Object(this);
571
+ },
572
+ /**
573
+ * Extracts a substring from the current string, starting at a given offset
574
+ * and bounded by specified opening and closing tokens. This method is
575
+ * particularly useful for parsing nested structures or quoted strings,
576
+ * where the level of nesting or the presence of escape characters must
577
+ * be considered.
578
+ *
579
+ * @param {number} offset The position in the string from which to start the
580
+ * search for the substring.
581
+ * @param {[string, string]} tokens An array containing two strings: the
582
+ * opening and closing tokens that define the boundaries of the substring
583
+ * to be extracted.
584
+ * @returns {Object} An object with two properties: `extracted`, the
585
+ * extracted substring, and `newOffset`, the position in the original
586
+ * string immediately after the end of the extracted substring. If no
587
+ * substring is found, `extracted` is `null` and `newOffset` is the same
588
+ * as the input offset.
589
+ */
590
+ extractSubstring(offset = 0, tokens = parenthesisPair) {
591
+ let [openToken, closeToken] = tokens;
592
+ let depth = 0;
593
+ let start = -1;
594
+ let end = -1;
595
+ let leadingToken = '';
596
+ let firstToken = 0;
597
+ for (let i = offset; i < this.length; i++) {
598
+ const char = this[i];
599
+ if (char === openToken) {
600
+ depth++;
601
+ if (start === -1)
602
+ start = i;
603
+ }
604
+ else if (char === closeToken) {
605
+ depth--;
606
+ if (depth === 0) {
607
+ end = i;
608
+ break;
609
+ }
610
+ }
611
+ }
612
+ let lRange = [
613
+ Math.max(0, start - 100),
614
+ start
615
+ ];
616
+ let leading = [...this.substring(lRange[0], lRange[1])].reverse().join('');
617
+ let reversedLeadingToken;
618
+ try {
619
+ reversedLeadingToken = /([^ \,\"\'\`]+)/.exec(leading)[1] ?? '';
620
+ leadingToken = [...reversedLeadingToken].reverse().join('');
621
+ }
622
+ catch (ignored) { }
623
+ if (start !== -1 && end !== -1) {
624
+ const sliceRange = [start, end + 1];
625
+ const extracted = this.slice(sliceRange[0], sliceRange[1]);
626
+ return {
627
+ extracted,
628
+ range: [start, end],
629
+ newOffset: end + 1,
630
+ leadingToken,
631
+ };
632
+ }
633
+ else {
634
+ return {
635
+ extracted: null,
636
+ range: [start, end],
637
+ newOffset: offset,
638
+ leadingToken,
639
+ };
640
+ }
641
+ },
642
+ },
643
+ });
644
+ // NOTE to self; this is repeated here otherwise a circular reference from
645
+ // Object<->Function<->Global occurs. See original source in global.this.js
646
+ // {@see globalThis.isThenElse}
647
+ function isThenElse(bv, tv, ev) {
648
+ if (arguments.length > 1) {
649
+ var _then = isFunction(tv) ? tv(bv) : tv;
650
+ if (arguments.length > 2) {
651
+ var _else = isFunction(ev) ? tv(bv) : ev;
652
+ return bv ? _then : _else;
653
+ }
654
+ return bv || _then;
655
+ }
656
+ return bv;
657
+ }
658
+ //# sourceMappingURL=string.extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.extensions.js","sourceRoot":"","sources":["../../src/string.extensions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAElC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;IAChD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK;QACZ,OAAO,CACL,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YACrC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC,CACvD,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS;QAClC,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,eAAe;QACjB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,kBAAkB;QACpB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,iBAAiB;QACnB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,C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