@nejs/basic-extensions 2.21.5 → 2.22.6

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 (266) hide show
  1. package/README.md +78 -4
  2. package/dist/@nejs/basic-extensions.bundle.2.22.6.js +25 -0
  3. package/dist/@nejs/basic-extensions.bundle.2.22.6.js.map +7 -0
  4. package/dist/cjs/classes/index.cjs +11129 -0
  5. package/dist/cjs/classes/index.cjs.map +7 -0
  6. package/dist/cjs/index.cjs +15191 -0
  7. package/dist/cjs/index.cjs.map +7 -0
  8. package/dist/cjs/utils/index.cjs +3954 -0
  9. package/dist/cjs/utils/index.cjs.map +7 -0
  10. package/dist/esm/basic-extensions.mjs +25 -0
  11. package/dist/esm/basic-extensions.mjs.map +7 -0
  12. package/package.json +16 -22
  13. package/repl.bootstrap.js +4 -7
  14. package/repl.history +26 -26
  15. package/src/classes/enumeration.js +466 -0
  16. package/src/classes/index.js +5 -1
  17. package/src/index.js +3 -1
  18. package/src/regular.expression.extensions.js +0 -35
  19. package/src/utils/toolkit.js +699 -516
  20. package/tests/arrayextensions.test.js +3 -3
  21. package/tests/index.test.js +3 -1
  22. package/tests/newClasses/asyncIterable.test.js +3 -3
  23. package/tests/newClasses/deferred.test.js +3 -3
  24. package/tests/newClasses/descriptor.test.js +3 -3
  25. package/tests/newClasses/iterable.test.js +3 -3
  26. package/tests/newClasses/refmap.test.js +3 -3
  27. package/tests/newClasses/refset.test.js +3 -3
  28. package/tests/objectextensions.test.js +3 -3
  29. package/tests/setextensions.test.js +3 -3
  30. package/tests/stringextensions.test.js +3 -2
  31. package/tests/utils/descriptor.utils.test.js +1 -1
  32. package/tests/utils/toolkit.test.js +429 -163
  33. package/.esdoc.json +0 -9
  34. package/.vscode/settings.json +0 -5
  35. package/bin/build +0 -27
  36. package/bin/clean +0 -14
  37. package/bin/esbuild +0 -91
  38. package/bin/fixup +0 -13
  39. package/bin/repl.basics.js +0 -584
  40. package/bin/repl.signature.js +0 -63
  41. package/bin/version +0 -100
  42. package/dist/@nejs/basic-extensions.bundle.2.21.5.js +0 -25
  43. package/dist/@nejs/basic-extensions.bundle.2.21.5.js.map +0 -7
  44. package/dist/cjs/array.extensions.d.ts +0 -39
  45. package/dist/cjs/array.extensions.js +0 -477
  46. package/dist/cjs/array.extensions.js.map +0 -1
  47. package/dist/cjs/big.int.extension.d.ts +0 -31
  48. package/dist/cjs/big.int.extension.js +0 -273
  49. package/dist/cjs/big.int.extension.js.map +0 -1
  50. package/dist/cjs/classes/asyncIterable.d.ts +0 -126
  51. package/dist/cjs/classes/asyncIterable.js +0 -209
  52. package/dist/cjs/classes/asyncIterable.js.map +0 -1
  53. package/dist/cjs/classes/deferred.d.ts +0 -146
  54. package/dist/cjs/classes/deferred.js +0 -291
  55. package/dist/cjs/classes/deferred.js.map +0 -1
  56. package/dist/cjs/classes/descriptor.d.ts +0 -334
  57. package/dist/cjs/classes/descriptor.js +0 -537
  58. package/dist/cjs/classes/descriptor.js.map +0 -1
  59. package/dist/cjs/classes/enum.d.ts +0 -50
  60. package/dist/cjs/classes/enum.js +0 -405
  61. package/dist/cjs/classes/enum.js.map +0 -1
  62. package/dist/cjs/classes/index.d.ts +0 -15
  63. package/dist/cjs/classes/index.js +0 -63
  64. package/dist/cjs/classes/index.js.map +0 -1
  65. package/dist/cjs/classes/introspector.d.ts +0 -20
  66. package/dist/cjs/classes/introspector.js +0 -130
  67. package/dist/cjs/classes/introspector.js.map +0 -1
  68. package/dist/cjs/classes/iterable.d.ts +0 -169
  69. package/dist/cjs/classes/iterable.js +0 -268
  70. package/dist/cjs/classes/iterable.js.map +0 -1
  71. package/dist/cjs/classes/param.parser.d.ts +0 -221
  72. package/dist/cjs/classes/param.parser.js +0 -242
  73. package/dist/cjs/classes/param.parser.js.map +0 -1
  74. package/dist/cjs/classes/pluggable.proxy.d.ts +0 -153
  75. package/dist/cjs/classes/pluggable.proxy.js +0 -444
  76. package/dist/cjs/classes/pluggable.proxy.js.map +0 -1
  77. package/dist/cjs/classes/property.d.ts +0 -79
  78. package/dist/cjs/classes/property.js +0 -284
  79. package/dist/cjs/classes/property.js.map +0 -1
  80. package/dist/cjs/classes/refmap.d.ts +0 -238
  81. package/dist/cjs/classes/refmap.js +0 -421
  82. package/dist/cjs/classes/refmap.js.map +0 -1
  83. package/dist/cjs/classes/refset.d.ts +0 -186
  84. package/dist/cjs/classes/refset.js +0 -370
  85. package/dist/cjs/classes/refset.js.map +0 -1
  86. package/dist/cjs/classes/symkeys.d.ts +0 -349
  87. package/dist/cjs/classes/symkeys.js +0 -510
  88. package/dist/cjs/classes/symkeys.js.map +0 -1
  89. package/dist/cjs/classes/type.d.ts +0 -56
  90. package/dist/cjs/classes/type.js +0 -405
  91. package/dist/cjs/classes/type.js.map +0 -1
  92. package/dist/cjs/function.extensions.d.ts +0 -12
  93. package/dist/cjs/function.extensions.js +0 -758
  94. package/dist/cjs/function.extensions.js.map +0 -1
  95. package/dist/cjs/global.this.d.ts +0 -2
  96. package/dist/cjs/global.this.js +0 -300
  97. package/dist/cjs/global.this.js.map +0 -1
  98. package/dist/cjs/index.d.ts +0 -31
  99. package/dist/cjs/index.js +0 -228
  100. package/dist/cjs/index.js.map +0 -1
  101. package/dist/cjs/json.extensions.d.ts +0 -2
  102. package/dist/cjs/json.extensions.js +0 -109
  103. package/dist/cjs/json.extensions.js.map +0 -1
  104. package/dist/cjs/map.extensions.d.ts +0 -3
  105. package/dist/cjs/map.extensions.js +0 -143
  106. package/dist/cjs/map.extensions.js.map +0 -1
  107. package/dist/cjs/math.extension.d.ts +0 -14
  108. package/dist/cjs/math.extension.js +0 -71
  109. package/dist/cjs/math.extension.js.map +0 -1
  110. package/dist/cjs/number.extension.d.ts +0 -44
  111. package/dist/cjs/number.extension.js +0 -278
  112. package/dist/cjs/number.extension.js.map +0 -1
  113. package/dist/cjs/object.extensions.d.ts +0 -33
  114. package/dist/cjs/object.extensions.js +0 -1091
  115. package/dist/cjs/object.extensions.js.map +0 -1
  116. package/dist/cjs/package.json +0 -3
  117. package/dist/cjs/proxy.extensions.d.ts +0 -2
  118. package/dist/cjs/proxy.extensions.js +0 -207
  119. package/dist/cjs/proxy.extensions.js.map +0 -1
  120. package/dist/cjs/reflect.extensions.d.ts +0 -14
  121. package/dist/cjs/reflect.extensions.js +0 -316
  122. package/dist/cjs/reflect.extensions.js.map +0 -1
  123. package/dist/cjs/regular.expression.extensions.d.ts +0 -2
  124. package/dist/cjs/regular.expression.extensions.js +0 -423
  125. package/dist/cjs/regular.expression.extensions.js.map +0 -1
  126. package/dist/cjs/set.extensions.d.ts +0 -40
  127. package/dist/cjs/set.extensions.js +0 -355
  128. package/dist/cjs/set.extensions.js.map +0 -1
  129. package/dist/cjs/string.extensions.d.ts +0 -23
  130. package/dist/cjs/string.extensions.js +0 -704
  131. package/dist/cjs/string.extensions.js.map +0 -1
  132. package/dist/cjs/symbol.extensions.d.ts +0 -11
  133. package/dist/cjs/symbol.extensions.js +0 -735
  134. package/dist/cjs/symbol.extensions.js.map +0 -1
  135. package/dist/cjs/utils/copy.object.d.ts +0 -408
  136. package/dist/cjs/utils/copy.object.js +0 -720
  137. package/dist/cjs/utils/copy.object.js.map +0 -1
  138. package/dist/cjs/utils/descriptor.utils.d.ts +0 -298
  139. package/dist/cjs/utils/descriptor.utils.js +0 -889
  140. package/dist/cjs/utils/descriptor.utils.js.map +0 -1
  141. package/dist/cjs/utils/index.d.ts +0 -75
  142. package/dist/cjs/utils/index.js +0 -61
  143. package/dist/cjs/utils/index.js.map +0 -1
  144. package/dist/cjs/utils/stdout.d.ts +0 -742
  145. package/dist/cjs/utils/stdout.js +0 -1042
  146. package/dist/cjs/utils/stdout.js.map +0 -1
  147. package/dist/cjs/utils/toolkit.d.ts +0 -1898
  148. package/dist/cjs/utils/toolkit.js +0 -1378
  149. package/dist/cjs/utils/toolkit.js.map +0 -1
  150. package/dist/cjs/weakref.extensions.d.ts +0 -2
  151. package/dist/cjs/weakref.extensions.js +0 -19
  152. package/dist/cjs/weakref.extensions.js.map +0 -1
  153. package/dist/mjs/array.extensions.d.ts +0 -39
  154. package/dist/mjs/array.extensions.js +0 -474
  155. package/dist/mjs/array.extensions.js.map +0 -1
  156. package/dist/mjs/big.int.extension.d.ts +0 -31
  157. package/dist/mjs/big.int.extension.js +0 -270
  158. package/dist/mjs/big.int.extension.js.map +0 -1
  159. package/dist/mjs/classes/asyncIterable.d.ts +0 -126
  160. package/dist/mjs/classes/asyncIterable.js +0 -204
  161. package/dist/mjs/classes/asyncIterable.js.map +0 -1
  162. package/dist/mjs/classes/deferred.d.ts +0 -146
  163. package/dist/mjs/classes/deferred.js +0 -287
  164. package/dist/mjs/classes/deferred.js.map +0 -1
  165. package/dist/mjs/classes/descriptor.d.ts +0 -334
  166. package/dist/mjs/classes/descriptor.js +0 -533
  167. package/dist/mjs/classes/descriptor.js.map +0 -1
  168. package/dist/mjs/classes/enum.d.ts +0 -50
  169. package/dist/mjs/classes/enum.js +0 -400
  170. package/dist/mjs/classes/enum.js.map +0 -1
  171. package/dist/mjs/classes/index.d.ts +0 -15
  172. package/dist/mjs/classes/index.js +0 -46
  173. package/dist/mjs/classes/index.js.map +0 -1
  174. package/dist/mjs/classes/introspector.d.ts +0 -20
  175. package/dist/mjs/classes/introspector.js +0 -126
  176. package/dist/mjs/classes/introspector.js.map +0 -1
  177. package/dist/mjs/classes/iterable.d.ts +0 -169
  178. package/dist/mjs/classes/iterable.js +0 -263
  179. package/dist/mjs/classes/iterable.js.map +0 -1
  180. package/dist/mjs/classes/param.parser.d.ts +0 -221
  181. package/dist/mjs/classes/param.parser.js +0 -238
  182. package/dist/mjs/classes/param.parser.js.map +0 -1
  183. package/dist/mjs/classes/pluggable.proxy.d.ts +0 -153
  184. package/dist/mjs/classes/pluggable.proxy.js +0 -438
  185. package/dist/mjs/classes/pluggable.proxy.js.map +0 -1
  186. package/dist/mjs/classes/property.d.ts +0 -79
  187. package/dist/mjs/classes/property.js +0 -280
  188. package/dist/mjs/classes/property.js.map +0 -1
  189. package/dist/mjs/classes/refmap.d.ts +0 -238
  190. package/dist/mjs/classes/refmap.js +0 -417
  191. package/dist/mjs/classes/refmap.js.map +0 -1
  192. package/dist/mjs/classes/refset.d.ts +0 -186
  193. package/dist/mjs/classes/refset.js +0 -366
  194. package/dist/mjs/classes/refset.js.map +0 -1
  195. package/dist/mjs/classes/symkeys.d.ts +0 -349
  196. package/dist/mjs/classes/symkeys.js +0 -506
  197. package/dist/mjs/classes/symkeys.js.map +0 -1
  198. package/dist/mjs/classes/type.d.ts +0 -56
  199. package/dist/mjs/classes/type.js +0 -401
  200. package/dist/mjs/classes/type.js.map +0 -1
  201. package/dist/mjs/function.extensions.d.ts +0 -12
  202. package/dist/mjs/function.extensions.js +0 -755
  203. package/dist/mjs/function.extensions.js.map +0 -1
  204. package/dist/mjs/global.this.d.ts +0 -2
  205. package/dist/mjs/global.this.js +0 -264
  206. package/dist/mjs/global.this.js.map +0 -1
  207. package/dist/mjs/index.d.ts +0 -31
  208. package/dist/mjs/index.js +0 -206
  209. package/dist/mjs/index.js.map +0 -1
  210. package/dist/mjs/json.extensions.d.ts +0 -2
  211. package/dist/mjs/json.extensions.js +0 -106
  212. package/dist/mjs/json.extensions.js.map +0 -1
  213. package/dist/mjs/map.extensions.d.ts +0 -3
  214. package/dist/mjs/map.extensions.js +0 -140
  215. package/dist/mjs/map.extensions.js.map +0 -1
  216. package/dist/mjs/math.extension.d.ts +0 -14
  217. package/dist/mjs/math.extension.js +0 -68
  218. package/dist/mjs/math.extension.js.map +0 -1
  219. package/dist/mjs/number.extension.d.ts +0 -44
  220. package/dist/mjs/number.extension.js +0 -275
  221. package/dist/mjs/number.extension.js.map +0 -1
  222. package/dist/mjs/object.extensions.d.ts +0 -33
  223. package/dist/mjs/object.extensions.js +0 -1088
  224. package/dist/mjs/object.extensions.js.map +0 -1
  225. package/dist/mjs/package.json +0 -3
  226. package/dist/mjs/proxy.extensions.d.ts +0 -2
  227. package/dist/mjs/proxy.extensions.js +0 -204
  228. package/dist/mjs/proxy.extensions.js.map +0 -1
  229. package/dist/mjs/reflect.extensions.d.ts +0 -14
  230. package/dist/mjs/reflect.extensions.js +0 -313
  231. package/dist/mjs/reflect.extensions.js.map +0 -1
  232. package/dist/mjs/regular.expression.extensions.d.ts +0 -2
  233. package/dist/mjs/regular.expression.extensions.js +0 -420
  234. package/dist/mjs/regular.expression.extensions.js.map +0 -1
  235. package/dist/mjs/set.extensions.d.ts +0 -40
  236. package/dist/mjs/set.extensions.js +0 -352
  237. package/dist/mjs/set.extensions.js.map +0 -1
  238. package/dist/mjs/string.extensions.d.ts +0 -23
  239. package/dist/mjs/string.extensions.js +0 -701
  240. package/dist/mjs/string.extensions.js.map +0 -1
  241. package/dist/mjs/symbol.extensions.d.ts +0 -11
  242. package/dist/mjs/symbol.extensions.js +0 -732
  243. package/dist/mjs/symbol.extensions.js.map +0 -1
  244. package/dist/mjs/utils/copy.object.d.ts +0 -408
  245. package/dist/mjs/utils/copy.object.js +0 -702
  246. package/dist/mjs/utils/copy.object.js.map +0 -1
  247. package/dist/mjs/utils/descriptor.utils.d.ts +0 -298
  248. package/dist/mjs/utils/descriptor.utils.js +0 -875
  249. package/dist/mjs/utils/descriptor.utils.js.map +0 -1
  250. package/dist/mjs/utils/index.d.ts +0 -75
  251. package/dist/mjs/utils/index.js +0 -45
  252. package/dist/mjs/utils/index.js.map +0 -1
  253. package/dist/mjs/utils/stdout.d.ts +0 -742
  254. package/dist/mjs/utils/stdout.js +0 -1037
  255. package/dist/mjs/utils/stdout.js.map +0 -1
  256. package/dist/mjs/utils/toolkit.d.ts +0 -1898
  257. package/dist/mjs/utils/toolkit.js +0 -1373
  258. package/dist/mjs/utils/toolkit.js.map +0 -1
  259. package/dist/mjs/weakref.extensions.d.ts +0 -2
  260. package/dist/mjs/weakref.extensions.js +0 -16
  261. package/dist/mjs/weakref.extensions.js.map +0 -1
  262. package/jsdoc-config.json +0 -31
  263. package/tsconfig.base.json +0 -28
  264. package/tsconfig.cjs.json +0 -8
  265. package/tsconfig.esm.json +0 -8
  266. package/vitest.config.js +0 -7
@@ -1,270 +0,0 @@
1
- import { Patch } from '@nejs/extension';
2
- /**
3
- * `BigIntExtensions` is a patch for the JavaScript built-in `BigInt` class.
4
- * It adds utility methods to the `BigInt` class without modifying the global
5
- * namespace directly. This patch includes methods for checking if a value is
6
- * a `BigInt` and conditionally returning a value based on whether the supplied
7
- * value is a `BigInt` or not.
8
- *
9
- * @type {Patch}
10
- * @example
11
- * import { BigIntExtensions } from 'big.int.extension.js'
12
- *
13
- * BigIntExtensions.apply()
14
- * // Now the `BigInt` class has additional methods available
15
- */
16
- export const BigIntExtensions = new Patch(BigInt, {
17
- [Patch.kMutablyHidden]: {
18
- /**
19
- * Checks if all or some of the supplied values are numbers.
20
- *
21
- * This method uses the `Array.prototype.every` or `Array.prototype.some`
22
- * method to check if all or some of the supplied values are numbers,
23
- * respectively. The method to use is determined by the `which` parameter.
24
- *
25
- * @param {string} [which='every'] - Determines the method to use for the
26
- * check. Can be either 'every' or 'some'. Defaults to 'every'.
27
- * @param {...*} values - The values to check.
28
- * @returns {boolean} - Returns `true` if all or some of the values are
29
- * numbers (based on the `which` parameter), `false` otherwise.
30
- *
31
- * @example
32
- * areNumbers('every', 1, 2, 3) // true
33
- * areNumbers('some', 1, '2', 3) // true
34
- * areNumbers('every', 1, '2', 3) // false
35
- */
36
- areBigInts(which = ['every', 'some'][0], ...values) {
37
- if (which !== 'every' && which !== 'some') {
38
- return false;
39
- }
40
- return values[which](num => this.isBigInt(num));
41
- },
42
- /**
43
- * Determines if the supplied `value` is a `BigInt`. This check is
44
- * performed by first checking the `typeof` the `value` and then
45
- * checking to see if the `value` is an `instanceof` `BigInt`
46
- *
47
- * @param {*} value The value that needs to be checked to determine
48
- * if it is a `BigInt` or not
49
- * @returns {boolean} `true` if the supplied `value` is a `BigInt`,
50
- * `false` otherwise
51
- *
52
- * @example
53
- * const bigInt = 1234567890123456789012345678901234567890n
54
- * isBigInt(bigInt) // true
55
- * isBigInt(1234567890123456789012345678901234567890) // false
56
- * isBigInt('1234567890123456789012345678901234567890') // false
57
- * isBigInt(BigInt('1234567890123456789012345678901234567890')) // true
58
- */
59
- isBigInt(value) {
60
- return typeof value === 'bigint' || value instanceof BigInt;
61
- },
62
- /**
63
- * Conditionally returns a value based on whether the supplied
64
- * `value` is a `BigInt` or not. If the `value` is a `BigInt`,
65
- * the `thenValue` will be returned. If it is not a `BigInt`,
66
- * the `elseValue` will be returned instead.
67
- *
68
- * @param {any} value The value to check to determine if it is a
69
- * `BigInt`
70
- * @param {any} thenValue The value to return if the supplied
71
- * `value` is a `BigInt`
72
- * @param {any} elseValue The value to return if the supplied
73
- * `value` is not a `BigInt`
74
- * @returns {any} Either the `thenValue` or `elseValue` depending
75
- * on if the supplied `value` is a `BigInt`
76
- *
77
- * @example
78
- * const bigInt = 1234567890123456789012345678901234567890n
79
- * const num = 42
80
- * ifBigInt(bigInt, 'is a BigInt', 'not a BigInt')
81
- * // 'is a BigInt'
82
- * ifBigInt(num, 'is a BigInt', 'not a BigInt')
83
- * // 'not a BigInt'
84
- */
85
- ifBigInt(value, thenValue, elseValue) {
86
- return isThenElse(this.isBigInt(value), thenValue, elseValue);
87
- },
88
- /**
89
- * The Math.min() static method returns the smallest of the numbers given
90
- * as input parameters, or Infinity if there are no parameters.
91
- *
92
- * @param {bigint|number} values value1, …, valueN – Zero or more numbers
93
- * among which the lowest value will be selected and returned.
94
- * @returns {bigint|number|Infinity} The smallest of the given numbers.
95
- * Returns Infinity if no parameters are provided.
96
- */
97
- min(...values) {
98
- const sorter = (l, r) => l < r ? -1 : l > r ? 1 : 0;
99
- if (!values.length)
100
- return Infinity;
101
- if (values.every(n => typeof n === 'bigint')) {
102
- return values.toSorted(sorter).at(0);
103
- }
104
- else {
105
- throw new TypeError('All supplied values must be of type bigint');
106
- }
107
- },
108
- /**
109
- * The Math.max() static method returns the largest of the numbers given
110
- * as input parameters, or Infinity if there are no parameters.
111
- *
112
- * @param {bigint|number} values value1, …, valueN – Zero or more numbers
113
- * among which the largest value will be selected and returned.
114
- * @returns {bigint|number|Infinity} The largest of the given numbers.
115
- * Returns Infinity if no parameters are provided.
116
- */
117
- max(...values) {
118
- const sorter = (l, r) => l < r ? -1 : l > r ? 1 : 0;
119
- if (!values.length)
120
- return Infinity;
121
- if (values.every(n => typeof n === 'bigint')) {
122
- return values.toSorted(sorter).at(-1);
123
- }
124
- else {
125
- throw new TypeError('All supplied values must be of type bigint');
126
- }
127
- },
128
- },
129
- });
130
- const { isBigInt: pIsBigInt, ifBigInt: pIfBigInt } = BigIntExtensions.patches;
131
- /**
132
- * `BigIntPrototypeExtensions` is a patch for the JavaScript built-in
133
- * `BigInt.prototype`. It adds utility methods to the `BigInt` prototype
134
- * without modifying the global namespace directly. This patch includes
135
- * methods for checking if a value is a BigInt and conditionally returning
136
- * a value based on whether the supplied value is a BigInt or not.
137
- *
138
- * @type {Patch}
139
- * @example
140
- * import { BigIntPrototypeExtensions } from 'big.int.extension.js'
141
- *
142
- * BigIntPrototypeExtensions.apply()
143
- * // Now the `BigInt` prototype has additional methods available
144
- */
145
- export const BigIntPrototypeExtensions = new Patch(BigInt.prototype, {
146
- /**
147
- * Clamps a value between a minimum and maximum value.
148
- *
149
- * This method checks if the provided value and the min and max bounds are
150
- * numbers. If they are not, it returns the original value. If they are,
151
- * it ensures that the value does not go below the minimum value or above
152
- * the maximum value.
153
- *
154
- * @param {bigint} [minValue=BigInt(-Number.MAX_VALUE)] - The minimum value.
155
- * Defaults to BigInt(-Number.MAX_VALUE).
156
- * @param {bigint} [maxValue=BigInt(Number.MAX_VALUE)] - The maximum value.
157
- * Defaults to BigInt(Number.MAX_VALUE).
158
- * @returns {bigint} - Returns the clamped value if all parameters are
159
- * big integers.
160
- *
161
- * @example
162
- * (10n).clamp(1n, 5n) // returns 5n
163
- * (-10n).clamp(1n, 5n) // returns 1n
164
- * (3n).clamp(1n, 5n) // returns 3n
165
- */
166
- clamp(minValue = BigInt(-Number.MAX_VALUE), maxValue = BigInt(Number.MAX_VALUE)) {
167
- if (typeof minValue !== 'bigint' || typeof maxValue !== 'bigint')
168
- throw new TypeError('All values must be big integers');
169
- return BigInt.max(minValue, BigInt.min(maxValue, this));
170
- },
171
- /**
172
- * A getter method that returns an object representation of the BigInt
173
- * instance.
174
- *
175
- * This method wraps the BigInt instance in an object, allowing it to be
176
- * treated as an object. The returned object is created using the `Object()`
177
- * constructor, which takes the BigInt instance as its argument.
178
- *
179
- * @type {Object}
180
- * @readonly
181
- *
182
- * @example
183
- * const bigInt = 1234567890123456789012345678901234567890n
184
- * console.log(typeof bigInt) // 'bigint'
185
- * console.log(typeof bigInt.instance) // 'object'
186
- */
187
- get instance() {
188
- return Object(this);
189
- },
190
- /**
191
- * A getter method that checks if the current instance is a BigInt.
192
- *
193
- * This method uses the `pIsBigInt` function from the `BigIntExtensions`
194
- * patch to determine if the current instance (`this`) is a BigInt.
195
- *
196
- * @type {boolean}
197
- * @readonly
198
- *
199
- * @example
200
- * const bigInt = 1234567890123456789012345678901234567890n
201
- * console.log(bigInt.isBigInt) // Output: true
202
- *
203
- * const notBigInt = 42
204
- * console.log(notBigInt.isBigInt) // Output: false
205
- */
206
- get isBigInt() {
207
- return pIsBigInt(this);
208
- },
209
- /**
210
- * Checks if the current object is a BigInt and returns the corresponding
211
- * value based on the result.
212
- *
213
- * This method uses the `pIfBigInt` function from the `BigIntExtensions`
214
- * patch to determine if the current object (`this`) is a BigInt. If it is
215
- * a BigInt, the `thenValue` is returned. Otherwise, the `elseValue` is
216
- * returned.
217
- *
218
- * @param {any} thenValue - The value to return if the current object
219
- * is a BigInt.
220
- * @param {any} elseValue - The value to return if the current object
221
- * is not a BigInt.
222
- * @returns {any} The `thenValue` if the current object is a BigInt, or
223
- * the `elseValue` if it is not a BigInt.
224
- *
225
- * @example
226
- * const bigInt = 1234567890123456789012345678901234567890n
227
- * // 'Is a BigInt'
228
- * console.log(bigInt.ifBigInt('Is a BigInt', 'Not a BigInt'))
229
- *
230
- * const notBigInt = 42
231
- * // 'Not a BigInt'
232
- * console.log(notBigInt.ifBigInt('Is a BigInt', 'Not a BigInt'))
233
- */
234
- ifBigInt(thenValue, elseValue) {
235
- return pIfBigInt(this, thenValue, elseValue);
236
- },
237
- /**
238
- * Provides a way when dealing with numbers to determine if
239
- * a given number is within a range of values. By default, if
240
- * no parameters are supplied, it always returns true since
241
- * the default range is -Infinity to +Infinity. Additionally,
242
- * by default, the number will always be less than the supplied
243
- * max unless inclusive is set to true.
244
- *
245
- * @param min the lower range value, defaults to -Infinity
246
- * @param max the upper range value, defaults to +Infinity
247
- * @param inclusive defaults to false, set to true if you
248
- * want the max value to less than and equals to
249
- * @returns {boolean} true if within the range, false otherwise
250
- */
251
- within(min = BigInt(-Infinity), max = BigInt(Infinity), inclusive = false) {
252
- return this >= min && (inclusive ? this <= max : this < max);
253
- }
254
- });
255
- // NOTE to self; this is repeated here otherwise a circular reference from
256
- // Object<->Function<->Global occurs. See original source in global.this.js
257
- // {@see globalThis.isThenElse}
258
- function isThenElse(bv, tv, ev) {
259
- function isFunction(value) { typeof value === 'function'; }
260
- if (arguments.length > 1) {
261
- var _then = isFunction(tv) ? tv(bv) : tv;
262
- if (arguments.length > 2) {
263
- var _else = isFunction(ev) ? tv(bv) : ev;
264
- return bv ? _then : _else;
265
- }
266
- return bv || _then;
267
- }
268
- return bv;
269
- }
270
- //# sourceMappingURL=big.int.extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"big.int.extension.js","sourceRoot":"","sources":["../../src/big.int.extension.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;IAChD,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;QACtB;;;;;;;;;;;;;;;;;WAiBG;QACH,UAAU,CAAC,KAAK,G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O,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;QACrE,CAAC;QAAC,OAAO,EAAE,IAAI,KAAK,CAAC;IACvB,CAAC;IAAC,OAAO,EAAE,CAAA;AACb,CAAC"}
@@ -1,126 +0,0 @@
1
- /**
2
- * The AsyncIterable class extends the concept of Iterable to asynchronous
3
- * operations. It allows creating iterable objects where each element can be
4
- * an asynchronous entity, like a Promise. This class is particularly useful
5
- * when dealing with asynchronous data sources, such as API responses, file
6
- * reading in chunks, or any other data that is not immediately available but
7
- * arrives over time.
8
- */
9
- export class AsyncIterable {
10
- /**
11
- * Checks if a given value is an async iterable. This method determines if
12
- * the provided value has a `Symbol.asyncIterator` property that is an async
13
- * generator function. It's a precise way to identify if the value conforms
14
- * to the async iterable protocol using an async generator function.
15
- *
16
- * Note: This method specifically checks for async generator functions. Some
17
- * async iterables might use regular async functions that return an async
18
- * iterator, which this method won't identify.
19
- *
20
- * @param {*} value - The value to be checked for async iterability.
21
- * @returns {boolean} - Returns true if the value is an async iterable
22
- * implemented using an async generator function, false otherwise.
23
- */
24
- static isAsyncIterable(value: any): boolean;
25
- /**
26
- * Constructs an instance of AsyncIterable. Similar to Iterable, it can be
27
- * initialized with either an iterable object, an async generator function,
28
- * or individual elements. The elements can be promises, direct values, or a
29
- * mix of both. If the first argument is an iterable or an async generator
30
- * function, the instance is initialized with the elements from the iterable
31
- * or the generated elements from the async generator function, followed by
32
- * any additional arguments. If the first argument is not an iterable or an
33
- * async generator function, all arguments are treated as individual elements.
34
- *
35
- * @param {Iterable|AsyncGeneratorFunction|Promise|*} elementsOrFirstElement -
36
- * An iterable object, an async generator function, a Promise, or the first
37
- * element.
38
- * @param {...Promise|*} moreElements - Additional elements if the first
39
- * argument is not an iterable or an async generator function.
40
- */
41
- constructor(elementsOrFirstElement: Iterable<any> | AsyncGeneratorFunction | Promise<any> | any, ...moreElements: (Promise<any> | any)[]);
42
- /**
43
- * Implements the async iterable protocol. When an instance of AsyncIterable
44
- * is used in a `for await...of` loop, this async generator function is
45
- * invoked. It yields each element as a Promise, allowing asynchronous
46
- * iteration. Elements that are not Promises are automatically wrapped in
47
- * a resolved Promise to ensure consistency.
48
- *
49
- * @returns {AsyncGenerator} An async generator that yields each element as
50
- * a Promise.
51
- */
52
- [Symbol.asyncIterator](): AsyncGenerator;
53
- /**
54
- * Ensures that the constructor of this object instance's name
55
- * is returned if the string tag for this instance is queried
56
- *
57
- * @returns {string} the name of the class
58
- */
59
- get [Symbol.toStringTag](): string;
60
- #private;
61
- }
62
- /**
63
- * Being able to create a compliant `AsyncIterator` around any type of
64
- * iterable object. This can be wrapped around any type of object that
65
- * has a `[Symbol.asyncIterator]` property assigned to a generator
66
- * function.
67
- */
68
- export class AsyncIterator {
69
- /**
70
- * Creates a new `AsyncIterator` object instance.
71
- *
72
- * @param {object|AsyncGeneratorFunction} asyncIterable any object that has a
73
- * `[Symbol.asyncIterable]` property assigned to a generator function or an
74
- * async generator function itself.
75
- */
76
- constructor(asyncIterable: object | AsyncGeneratorFunction);
77
- /**
78
- * Returns a new `Array` derived from the iterable this object
79
- * wraps.
80
- *
81
- * @returns {array} a new `Array` generated from the wrapped
82
- * iterable. The method is generated from using an async for of
83
- * loop.
84
- */
85
- asArray(): any[];
86
- /**
87
- * Returns the actual iterable object passed to the constructor that
88
- * created this instance.
89
- *
90
- * @returns {object} the object containing the `[Symbol.iterator]`
91
- */
92
- get asyncIterable(): object;
93
- /**
94
- * The function retrieves the next value in the iterator. If the
95
- * the iterator has run its course, `reset()` can be invoked to
96
- * reset the pointer to the beginning of the iteration.
97
- *
98
- * @returns {any} the next value
99
- */
100
- next(): any;
101
- /**
102
- * Resets the async iterator to the beginning allowing it to be
103
- * iterated over again.
104
- */
105
- reset(): Promise<void>;
106
- /**
107
- * The existence of this symbol on the object instances, indicates that
108
- * it can be used in `for(.. of ..)` loops and its values can be
109
- * extracted from calls to `Array.from()`
110
- *
111
- * @returns {AsyncIterable} this is returned since this object is already
112
- * conforming to the expected JavaScript AsyncIterator interface
113
- */
114
- [Symbol.asyncIterator](): AsyncIterable;
115
- /**
116
- * Ensures that the constructor of this object instance's name
117
- * is returned if the string tag for this instance is queried
118
- *
119
- * @returns {string} the name of the class
120
- */
121
- get [Symbol.toStringTag](): string;
122
- #private;
123
- }
124
- export const AsyncIterableExtensions: Extension;
125
- export const AsyncIteratorExtensions: Extension;
126
- import { Extension } from '@nejs/extension';
@@ -1,204 +0,0 @@
1
- import { Extension } from '@nejs/extension';
2
- /**
3
- * The AsyncIterable class extends the concept of Iterable to asynchronous
4
- * operations. It allows creating iterable objects where each element can be
5
- * an asynchronous entity, like a Promise. This class is particularly useful
6
- * when dealing with asynchronous data sources, such as API responses, file
7
- * reading in chunks, or any other data that is not immediately available but
8
- * arrives over time.
9
- */
10
- export class AsyncIterable {
11
- /**
12
- * Private field to store the elements of the async iterable.
13
- * @private
14
- */
15
- #elements = [];
16
- /**
17
- * Constructs an instance of AsyncIterable. Similar to Iterable, it can be
18
- * initialized with either an iterable object, an async generator function,
19
- * or individual elements. The elements can be promises, direct values, or a
20
- * mix of both. If the first argument is an iterable or an async generator
21
- * function, the instance is initialized with the elements from the iterable
22
- * or the generated elements from the async generator function, followed by
23
- * any additional arguments. If the first argument is not an iterable or an
24
- * async generator function, all arguments are treated as individual elements.
25
- *
26
- * @param {Iterable|AsyncGeneratorFunction|Promise|*} elementsOrFirstElement -
27
- * An iterable object, an async generator function, a Promise, or the first
28
- * element.
29
- * @param {...Promise|*} moreElements - Additional elements if the first
30
- * argument is not an iterable or an async generator function.
31
- */
32
- constructor(elementsOrFirstElement, ...moreElements) {
33
- if (elementsOrFirstElement != null &&
34
- (typeof elementsOrFirstElement[Symbol.iterator] === 'function' ||
35
- typeof elementsOrFirstElement[Symbol.asyncIterator] === 'function')) {
36
- this.#elements = [...elementsOrFirstElement, ...moreElements];
37
- }
38
- else if (typeof elementsOrFirstElement === 'function' &&
39
- elementsOrFirstElement.constructor.name === 'AsyncGeneratorFunction') {
40
- this.#elements = elementsOrFirstElement();
41
- }
42
- else {
43
- this.#elements = [elementsOrFirstElement, ...moreElements];
44
- }
45
- }
46
- /**
47
- * Implements the async iterable protocol. When an instance of AsyncIterable
48
- * is used in a `for await...of` loop, this async generator function is
49
- * invoked. It yields each element as a Promise, allowing asynchronous
50
- * iteration. Elements that are not Promises are automatically wrapped in
51
- * a resolved Promise to ensure consistency.
52
- *
53
- * @returns {AsyncGenerator} An async generator that yields each element as
54
- * a Promise.
55
- */
56
- async *[Symbol.asyncIterator]() {
57
- for await (const element of this.#elements) {
58
- // No need to wrap as a promise here since `for await...of` can handle
59
- // both Promises and non-Promise values.
60
- yield element;
61
- }
62
- }
63
- /**
64
- * Ensures that the constructor of this object instance's name
65
- * is returned if the string tag for this instance is queried
66
- *
67
- * @returns {string} the name of the class
68
- */
69
- get [Symbol.toStringTag]() {
70
- return this.constructor.name;
71
- }
72
- /**
73
- * Checks if a given value is an async iterable. This method determines if
74
- * the provided value has a `Symbol.asyncIterator` property that is an async
75
- * generator function. It's a precise way to identify if the value conforms
76
- * to the async iterable protocol using an async generator function.
77
- *
78
- * Note: This method specifically checks for async generator functions. Some
79
- * async iterables might use regular async functions that return an async
80
- * iterator, which this method won't identify.
81
- *
82
- * @param {*} value - The value to be checked for async iterability.
83
- * @returns {boolean} - Returns true if the value is an async iterable
84
- * implemented using an async generator function, false otherwise.
85
- */
86
- static isAsyncIterable(value) {
87
- const type = Object.prototype.toString.call(value?.[Symbol.asyncIterator]);
88
- return type === '[object AsyncGeneratorFunction]';
89
- }
90
- }
91
- /**
92
- * Being able to create a compliant `AsyncIterator` around any type of
93
- * iterable object. This can be wrapped around any type of object that
94
- * has a `[Symbol.asyncIterator]` property assigned to a generator
95
- * function.
96
- */
97
- export class AsyncIterator {
98
- /**
99
- * Creates a new `AsyncIterator` object instance.
100
- *
101
- * @param {object|AsyncGeneratorFunction} asyncIterable any object that has a
102
- * `[Symbol.asyncIterable]` property assigned to a generator function or an
103
- * async generator function itself.
104
- */
105
- constructor(asyncIterable) {
106
- if (typeof asyncIterable === 'function' &&
107
- asyncIterable.constructor.name === 'AsyncGeneratorFunction') {
108
- this.#asyncIterable = asyncIterable();
109
- }
110
- else if (!asyncIterable ||
111
- !Reflect.has(asyncIterable, Symbol.asyncIterator)) {
112
- throw new TypeError('Value used to instantiate AsyncIterator is not an async iterable');
113
- }
114
- else {
115
- this.#asyncIterable = asyncIterable;
116
- }
117
- this.#asyncIterator = this.#asyncIterable[Symbol.asyncIterator]();
118
- }
119
- /**
120
- * Returns a new `Array` derived from the iterable this object
121
- * wraps.
122
- *
123
- * @returns {array} a new `Array` generated from the wrapped
124
- * iterable. The method is generated from using an async for of
125
- * loop.
126
- */
127
- async asArray() {
128
- const array = [];
129
- for await (const value of this) {
130
- array.push(value);
131
- }
132
- return array;
133
- }
134
- /**
135
- * Returns the actual iterable object passed to the constructor that
136
- * created this instance.
137
- *
138
- * @returns {object} the object containing the `[Symbol.iterator]`
139
- */
140
- get asyncIterable() {
141
- return this.#asyncIterable;
142
- }
143
- /**
144
- * The function retrieves the next value in the iterator. If the
145
- * the iterator has run its course, `reset()` can be invoked to
146
- * reset the pointer to the beginning of the iteration.
147
- *
148
- * @returns {any} the next value
149
- */
150
- async next() {
151
- const result = await this.#asyncIterator.next();
152
- if (result.done) {
153
- return { value: undefined, done: true };
154
- }
155
- else {
156
- return { value: result.value, done: false };
157
- }
158
- }
159
- /**
160
- * Resets the async iterator to the beginning allowing it to be
161
- * iterated over again.
162
- */
163
- async reset() {
164
- this.#asyncIterator = this.#asyncIterable[Symbol.asyncIterator]();
165
- }
166
- /**
167
- * The existence of this symbol on the object instances, indicates that
168
- * it can be used in `for(.. of ..)` loops and its values can be
169
- * extracted from calls to `Array.from()`
170
- *
171
- * @returns {AsyncIterable} this is returned since this object is already
172
- * conforming to the expected JavaScript AsyncIterator interface
173
- */
174
- [Symbol.asyncIterator]() {
175
- return this;
176
- }
177
- /**
178
- * Ensures that the constructor of this object instance's name
179
- * is returned if the string tag for this instance is queried
180
- *
181
- * @returns {string} the name of the class
182
- */
183
- get [Symbol.toStringTag]() {
184
- return this.constructor.name;
185
- }
186
- /**
187
- * The object from which its iterator functionality is derived.
188
- *
189
- * @type {object}
190
- * @private
191
- */
192
- #asyncIterable = null;
193
- /**
194
- * The results of a call to the iterable's `[Symbol.asyncIterator]`
195
- * generator function.
196
- *
197
- * @type {object}
198
- * @private
199
- */
200
- #asyncIterator = null;
201
- }
202
- export const AsyncIterableExtensions = new Extension(AsyncIterable);
203
- export const AsyncIteratorExtensions = new Extension(AsyncIterator);
204
- //# sourceMappingURL=asyncIterable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"asyncIterable.js","sourceRoot":"","sources":["../../../src/classes/asyncIterable.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C;;;;;;;GAOG;AACH,MAAM,OAAO,aAAa;IACxB;;;OAGG;IACH,SAAS,GAAG,EAAE,CAAC;IAEf;;;;;;;;;;;;;;;OAeG;IACH,YAAY,sBAAsB,EAAE,GAAG,YAAY;QACjD,IACE,sBAAsB,IAAI,IAAI;YAC9B,CAAC,OAAO,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU;gBAC7D,OAAO,sBAAsB,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CAAC,EACpE,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,sBAAsB,EAAE,GAAG,YAAY,CAAC,CAAC;QAChE,CAAC;aAAM,IACL,OAAO,sBAAsB,KAAK,UAAU;YAC5C,sBAAsB,CAAC,WAAW,CAAC,IAAI,KAAK,wBAAwB,EACpE,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,sBAAsB,EAAE,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,CAAC,sBAAsB,EAAE,GAAG,YAAY,CAAC,CAAC;QAC7D,C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