@nejs/basic-extensions 2.21.0 → 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 (270) hide show
  1. package/.idea/markdown.xml +8 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/ne-basic-extensions.iml +8 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/CODE_STYLE.md +393 -0
  6. package/CODING_PHILOSOPHY.md +36 -0
  7. package/DOCUMENTATION_GUIDELINES.md +221 -0
  8. package/README.md +78 -4
  9. package/dist/@nejs/basic-extensions.bundle.2.22.6.js +25 -0
  10. package/dist/@nejs/basic-extensions.bundle.2.22.6.js.map +7 -0
  11. package/dist/cjs/classes/index.cjs +11129 -0
  12. package/dist/cjs/classes/index.cjs.map +7 -0
  13. package/dist/cjs/index.cjs +15191 -0
  14. package/dist/cjs/index.cjs.map +7 -0
  15. package/dist/cjs/utils/index.cjs +3954 -0
  16. package/dist/cjs/utils/index.cjs.map +7 -0
  17. package/dist/esm/basic-extensions.mjs +25 -0
  18. package/dist/esm/basic-extensions.mjs.map +7 -0
  19. package/package.json +16 -22
  20. package/repl.bootstrap.js +4 -7
  21. package/repl.history +30 -30
  22. package/src/big.int.extension.js +171 -45
  23. package/src/classes/enumeration.js +466 -0
  24. package/src/classes/index.js +5 -1
  25. package/src/index.js +5 -1
  26. package/src/math.extension.js +73 -0
  27. package/src/number.extension.js +18 -0
  28. package/src/regular.expression.extensions.js +0 -35
  29. package/src/utils/toolkit.js +699 -516
  30. package/tests/arrayextensions.test.js +3 -3
  31. package/tests/index.test.js +3 -1
  32. package/tests/newClasses/asyncIterable.test.js +3 -3
  33. package/tests/newClasses/deferred.test.js +3 -3
  34. package/tests/newClasses/descriptor.test.js +3 -3
  35. package/tests/newClasses/iterable.test.js +3 -3
  36. package/tests/newClasses/refmap.test.js +3 -3
  37. package/tests/newClasses/refset.test.js +3 -3
  38. package/tests/objectextensions.test.js +3 -3
  39. package/tests/setextensions.test.js +3 -3
  40. package/tests/stringextensions.test.js +3 -2
  41. package/tests/utils/descriptor.utils.test.js +1 -1
  42. package/tests/utils/toolkit.test.js +429 -163
  43. package/.esdoc.json +0 -9
  44. package/.vscode/settings.json +0 -5
  45. package/bin/build +0 -27
  46. package/bin/clean +0 -14
  47. package/bin/esbuild +0 -91
  48. package/bin/fixup +0 -13
  49. package/bin/repl.basics.js +0 -584
  50. package/bin/repl.signature.js +0 -63
  51. package/bin/version +0 -100
  52. package/dist/@nejs/basic-extensions.bundle.2.21.0.js +0 -25
  53. package/dist/@nejs/basic-extensions.bundle.2.21.0.js.map +0 -7
  54. package/dist/cjs/array.extensions.d.ts +0 -39
  55. package/dist/cjs/array.extensions.js +0 -477
  56. package/dist/cjs/array.extensions.js.map +0 -1
  57. package/dist/cjs/big.int.extension.d.ts +0 -31
  58. package/dist/cjs/big.int.extension.js +0 -165
  59. package/dist/cjs/big.int.extension.js.map +0 -1
  60. package/dist/cjs/classes/asyncIterable.d.ts +0 -126
  61. package/dist/cjs/classes/asyncIterable.js +0 -209
  62. package/dist/cjs/classes/asyncIterable.js.map +0 -1
  63. package/dist/cjs/classes/deferred.d.ts +0 -146
  64. package/dist/cjs/classes/deferred.js +0 -291
  65. package/dist/cjs/classes/deferred.js.map +0 -1
  66. package/dist/cjs/classes/descriptor.d.ts +0 -334
  67. package/dist/cjs/classes/descriptor.js +0 -537
  68. package/dist/cjs/classes/descriptor.js.map +0 -1
  69. package/dist/cjs/classes/enum.d.ts +0 -50
  70. package/dist/cjs/classes/enum.js +0 -405
  71. package/dist/cjs/classes/enum.js.map +0 -1
  72. package/dist/cjs/classes/index.d.ts +0 -15
  73. package/dist/cjs/classes/index.js +0 -63
  74. package/dist/cjs/classes/index.js.map +0 -1
  75. package/dist/cjs/classes/introspector.d.ts +0 -20
  76. package/dist/cjs/classes/introspector.js +0 -130
  77. package/dist/cjs/classes/introspector.js.map +0 -1
  78. package/dist/cjs/classes/iterable.d.ts +0 -169
  79. package/dist/cjs/classes/iterable.js +0 -268
  80. package/dist/cjs/classes/iterable.js.map +0 -1
  81. package/dist/cjs/classes/param.parser.d.ts +0 -221
  82. package/dist/cjs/classes/param.parser.js +0 -242
  83. package/dist/cjs/classes/param.parser.js.map +0 -1
  84. package/dist/cjs/classes/pluggable.proxy.d.ts +0 -153
  85. package/dist/cjs/classes/pluggable.proxy.js +0 -444
  86. package/dist/cjs/classes/pluggable.proxy.js.map +0 -1
  87. package/dist/cjs/classes/property.d.ts +0 -79
  88. package/dist/cjs/classes/property.js +0 -284
  89. package/dist/cjs/classes/property.js.map +0 -1
  90. package/dist/cjs/classes/refmap.d.ts +0 -238
  91. package/dist/cjs/classes/refmap.js +0 -421
  92. package/dist/cjs/classes/refmap.js.map +0 -1
  93. package/dist/cjs/classes/refset.d.ts +0 -186
  94. package/dist/cjs/classes/refset.js +0 -370
  95. package/dist/cjs/classes/refset.js.map +0 -1
  96. package/dist/cjs/classes/symkeys.d.ts +0 -349
  97. package/dist/cjs/classes/symkeys.js +0 -510
  98. package/dist/cjs/classes/symkeys.js.map +0 -1
  99. package/dist/cjs/classes/type.d.ts +0 -56
  100. package/dist/cjs/classes/type.js +0 -405
  101. package/dist/cjs/classes/type.js.map +0 -1
  102. package/dist/cjs/function.extensions.d.ts +0 -12
  103. package/dist/cjs/function.extensions.js +0 -758
  104. package/dist/cjs/function.extensions.js.map +0 -1
  105. package/dist/cjs/global.this.d.ts +0 -2
  106. package/dist/cjs/global.this.js +0 -300
  107. package/dist/cjs/global.this.js.map +0 -1
  108. package/dist/cjs/index.d.ts +0 -31
  109. package/dist/cjs/index.js +0 -226
  110. package/dist/cjs/index.js.map +0 -1
  111. package/dist/cjs/json.extensions.d.ts +0 -2
  112. package/dist/cjs/json.extensions.js +0 -109
  113. package/dist/cjs/json.extensions.js.map +0 -1
  114. package/dist/cjs/map.extensions.d.ts +0 -3
  115. package/dist/cjs/map.extensions.js +0 -143
  116. package/dist/cjs/map.extensions.js.map +0 -1
  117. package/dist/cjs/number.extension.d.ts +0 -44
  118. package/dist/cjs/number.extension.js +0 -261
  119. package/dist/cjs/number.extension.js.map +0 -1
  120. package/dist/cjs/object.extensions.d.ts +0 -33
  121. package/dist/cjs/object.extensions.js +0 -1091
  122. package/dist/cjs/object.extensions.js.map +0 -1
  123. package/dist/cjs/package.json +0 -3
  124. package/dist/cjs/proxy.extensions.d.ts +0 -2
  125. package/dist/cjs/proxy.extensions.js +0 -207
  126. package/dist/cjs/proxy.extensions.js.map +0 -1
  127. package/dist/cjs/reflect.extensions.d.ts +0 -14
  128. package/dist/cjs/reflect.extensions.js +0 -316
  129. package/dist/cjs/reflect.extensions.js.map +0 -1
  130. package/dist/cjs/regular.expression.extensions.d.ts +0 -2
  131. package/dist/cjs/regular.expression.extensions.js +0 -423
  132. package/dist/cjs/regular.expression.extensions.js.map +0 -1
  133. package/dist/cjs/set.extensions.d.ts +0 -40
  134. package/dist/cjs/set.extensions.js +0 -355
  135. package/dist/cjs/set.extensions.js.map +0 -1
  136. package/dist/cjs/string.extensions.d.ts +0 -23
  137. package/dist/cjs/string.extensions.js +0 -704
  138. package/dist/cjs/string.extensions.js.map +0 -1
  139. package/dist/cjs/symbol.extensions.d.ts +0 -11
  140. package/dist/cjs/symbol.extensions.js +0 -735
  141. package/dist/cjs/symbol.extensions.js.map +0 -1
  142. package/dist/cjs/utils/copy.object.d.ts +0 -408
  143. package/dist/cjs/utils/copy.object.js +0 -720
  144. package/dist/cjs/utils/copy.object.js.map +0 -1
  145. package/dist/cjs/utils/descriptor.utils.d.ts +0 -298
  146. package/dist/cjs/utils/descriptor.utils.js +0 -889
  147. package/dist/cjs/utils/descriptor.utils.js.map +0 -1
  148. package/dist/cjs/utils/index.d.ts +0 -75
  149. package/dist/cjs/utils/index.js +0 -61
  150. package/dist/cjs/utils/index.js.map +0 -1
  151. package/dist/cjs/utils/stdout.d.ts +0 -742
  152. package/dist/cjs/utils/stdout.js +0 -1042
  153. package/dist/cjs/utils/stdout.js.map +0 -1
  154. package/dist/cjs/utils/toolkit.d.ts +0 -1898
  155. package/dist/cjs/utils/toolkit.js +0 -1378
  156. package/dist/cjs/utils/toolkit.js.map +0 -1
  157. package/dist/cjs/weakref.extensions.d.ts +0 -2
  158. package/dist/cjs/weakref.extensions.js +0 -19
  159. package/dist/cjs/weakref.extensions.js.map +0 -1
  160. package/dist/mjs/array.extensions.d.ts +0 -39
  161. package/dist/mjs/array.extensions.js +0 -474
  162. package/dist/mjs/array.extensions.js.map +0 -1
  163. package/dist/mjs/big.int.extension.d.ts +0 -31
  164. package/dist/mjs/big.int.extension.js +0 -162
  165. package/dist/mjs/big.int.extension.js.map +0 -1
  166. package/dist/mjs/classes/asyncIterable.d.ts +0 -126
  167. package/dist/mjs/classes/asyncIterable.js +0 -204
  168. package/dist/mjs/classes/asyncIterable.js.map +0 -1
  169. package/dist/mjs/classes/deferred.d.ts +0 -146
  170. package/dist/mjs/classes/deferred.js +0 -287
  171. package/dist/mjs/classes/deferred.js.map +0 -1
  172. package/dist/mjs/classes/descriptor.d.ts +0 -334
  173. package/dist/mjs/classes/descriptor.js +0 -533
  174. package/dist/mjs/classes/descriptor.js.map +0 -1
  175. package/dist/mjs/classes/enum.d.ts +0 -50
  176. package/dist/mjs/classes/enum.js +0 -400
  177. package/dist/mjs/classes/enum.js.map +0 -1
  178. package/dist/mjs/classes/index.d.ts +0 -15
  179. package/dist/mjs/classes/index.js +0 -46
  180. package/dist/mjs/classes/index.js.map +0 -1
  181. package/dist/mjs/classes/introspector.d.ts +0 -20
  182. package/dist/mjs/classes/introspector.js +0 -126
  183. package/dist/mjs/classes/introspector.js.map +0 -1
  184. package/dist/mjs/classes/iterable.d.ts +0 -169
  185. package/dist/mjs/classes/iterable.js +0 -263
  186. package/dist/mjs/classes/iterable.js.map +0 -1
  187. package/dist/mjs/classes/param.parser.d.ts +0 -221
  188. package/dist/mjs/classes/param.parser.js +0 -238
  189. package/dist/mjs/classes/param.parser.js.map +0 -1
  190. package/dist/mjs/classes/pluggable.proxy.d.ts +0 -153
  191. package/dist/mjs/classes/pluggable.proxy.js +0 -438
  192. package/dist/mjs/classes/pluggable.proxy.js.map +0 -1
  193. package/dist/mjs/classes/property.d.ts +0 -79
  194. package/dist/mjs/classes/property.js +0 -280
  195. package/dist/mjs/classes/property.js.map +0 -1
  196. package/dist/mjs/classes/refmap.d.ts +0 -238
  197. package/dist/mjs/classes/refmap.js +0 -417
  198. package/dist/mjs/classes/refmap.js.map +0 -1
  199. package/dist/mjs/classes/refset.d.ts +0 -186
  200. package/dist/mjs/classes/refset.js +0 -366
  201. package/dist/mjs/classes/refset.js.map +0 -1
  202. package/dist/mjs/classes/symkeys.d.ts +0 -349
  203. package/dist/mjs/classes/symkeys.js +0 -506
  204. package/dist/mjs/classes/symkeys.js.map +0 -1
  205. package/dist/mjs/classes/type.d.ts +0 -56
  206. package/dist/mjs/classes/type.js +0 -401
  207. package/dist/mjs/classes/type.js.map +0 -1
  208. package/dist/mjs/function.extensions.d.ts +0 -12
  209. package/dist/mjs/function.extensions.js +0 -755
  210. package/dist/mjs/function.extensions.js.map +0 -1
  211. package/dist/mjs/global.this.d.ts +0 -2
  212. package/dist/mjs/global.this.js +0 -264
  213. package/dist/mjs/global.this.js.map +0 -1
  214. package/dist/mjs/index.d.ts +0 -31
  215. package/dist/mjs/index.js +0 -204
  216. package/dist/mjs/index.js.map +0 -1
  217. package/dist/mjs/json.extensions.d.ts +0 -2
  218. package/dist/mjs/json.extensions.js +0 -106
  219. package/dist/mjs/json.extensions.js.map +0 -1
  220. package/dist/mjs/map.extensions.d.ts +0 -3
  221. package/dist/mjs/map.extensions.js +0 -140
  222. package/dist/mjs/map.extensions.js.map +0 -1
  223. package/dist/mjs/number.extension.d.ts +0 -44
  224. package/dist/mjs/number.extension.js +0 -258
  225. package/dist/mjs/number.extension.js.map +0 -1
  226. package/dist/mjs/object.extensions.d.ts +0 -33
  227. package/dist/mjs/object.extensions.js +0 -1088
  228. package/dist/mjs/object.extensions.js.map +0 -1
  229. package/dist/mjs/package.json +0 -3
  230. package/dist/mjs/proxy.extensions.d.ts +0 -2
  231. package/dist/mjs/proxy.extensions.js +0 -204
  232. package/dist/mjs/proxy.extensions.js.map +0 -1
  233. package/dist/mjs/reflect.extensions.d.ts +0 -14
  234. package/dist/mjs/reflect.extensions.js +0 -313
  235. package/dist/mjs/reflect.extensions.js.map +0 -1
  236. package/dist/mjs/regular.expression.extensions.d.ts +0 -2
  237. package/dist/mjs/regular.expression.extensions.js +0 -420
  238. package/dist/mjs/regular.expression.extensions.js.map +0 -1
  239. package/dist/mjs/set.extensions.d.ts +0 -40
  240. package/dist/mjs/set.extensions.js +0 -352
  241. package/dist/mjs/set.extensions.js.map +0 -1
  242. package/dist/mjs/string.extensions.d.ts +0 -23
  243. package/dist/mjs/string.extensions.js +0 -701
  244. package/dist/mjs/string.extensions.js.map +0 -1
  245. package/dist/mjs/symbol.extensions.d.ts +0 -11
  246. package/dist/mjs/symbol.extensions.js +0 -732
  247. package/dist/mjs/symbol.extensions.js.map +0 -1
  248. package/dist/mjs/utils/copy.object.d.ts +0 -408
  249. package/dist/mjs/utils/copy.object.js +0 -702
  250. package/dist/mjs/utils/copy.object.js.map +0 -1
  251. package/dist/mjs/utils/descriptor.utils.d.ts +0 -298
  252. package/dist/mjs/utils/descriptor.utils.js +0 -875
  253. package/dist/mjs/utils/descriptor.utils.js.map +0 -1
  254. package/dist/mjs/utils/index.d.ts +0 -75
  255. package/dist/mjs/utils/index.js +0 -45
  256. package/dist/mjs/utils/index.js.map +0 -1
  257. package/dist/mjs/utils/stdout.d.ts +0 -742
  258. package/dist/mjs/utils/stdout.js +0 -1037
  259. package/dist/mjs/utils/stdout.js.map +0 -1
  260. package/dist/mjs/utils/toolkit.d.ts +0 -1898
  261. package/dist/mjs/utils/toolkit.js +0 -1373
  262. package/dist/mjs/utils/toolkit.js.map +0 -1
  263. package/dist/mjs/weakref.extensions.d.ts +0 -2
  264. package/dist/mjs/weakref.extensions.js +0 -16
  265. package/dist/mjs/weakref.extensions.js.map +0 -1
  266. package/jsdoc-config.json +0 -31
  267. package/tsconfig.base.json +0 -28
  268. package/tsconfig.cjs.json +0 -8
  269. package/tsconfig.esm.json +0 -8
  270. package/vitest.config.js +0 -7
@@ -1,106 +0,0 @@
1
- import { Patch } from '@nejs/extension';
2
- export const JSONExtensions = new Patch(JSON, {
3
- [Patch.kMutablyHidden]: {
4
- extractAllFrom(string) {
5
- const pattern = this.JSONStartPattern;
6
- const notJSON = Symbol("Value is not valid JSON");
7
- const decoder = part => {
8
- try {
9
- return JSON.parse(part);
10
- }
11
- catch (_) {
12
- return notJSON;
13
- }
14
- };
15
- const parts = [];
16
- let part = undefined;
17
- while ((part = pattern.exec(string))) {
18
- parts.push(decoder(part?.[0]));
19
- }
20
- return parts.filter(isJSON => isJSON !== notJSON);
21
- },
22
- /**
23
- * The `extractFrom` method attempts to extract a JSON object from a string.
24
- * It uses a regular expression to identify potential JSON objects in the
25
- * string and attempts to parse them. If a valid JSON object is found, it is
26
- * returned. If no valid JSON object is found, the method returns undefined.
27
- *
28
- * NOTE: This method will only find JSON from an iterated upon start spot
29
- * until the end of the string. So `'JSON follows {"count": 0}'` will
30
- * return `{count: 0}` but `'JSON follows {"count": 0} and more'` will
31
- * fail to locate any JSON in the String. You've been warned.
32
- *
33
- * @param {string} string - The string from which to extract a JSON object.
34
- * @returns {Object|undefined} - The first valid JSON object found in the
35
- * string, or undefined if no valid JSON object is found.
36
- *
37
- * @example
38
- * // Suppose we have a string with embedded JSON
39
- * const str1 = 'Hello {"name":"John", "age":30} World'
40
- * const str2 = 'Hello {"name": "John", "age": 30}'
41
- *
42
- * // Using `extractFrom`
43
- * console.log(JSON.extractFrom(str1)) // Output: undefined
44
- * console.log(JSON.extractFrom(str2)) // Output: {name: 'John', age: 30}
45
- */
46
- extractFrom(string) {
47
- this.extractAllFrom(string)?.[0];
48
- },
49
- /**
50
- * The `mightContain` method checks if a string might contain a JSON object.
51
- * It uses the `JSONStartPattern` regular expression to search for potential
52
- * JSON objects in the string. If a potential JSON object is found, the method
53
- * returns true. If no potential JSON object is found, the method returns false.
54
- *
55
- * @param {string} string - The string to check for potential JSON objects.
56
- * @returns {boolean} - Returns true if the string might contain a JSON object,
57
- * false otherwise.
58
- *
59
- * @example
60
- * // Suppose we have a string with embedded JSON
61
- * const str = 'Hello {"name":"John", "age":30} World'
62
- *
63
- * // Using `mightContain`
64
- * console.log(JSON.mightContain(str)) // Output: true
65
- */
66
- mightContain(string, detail = false) {
67
- const results = this.JSONStartPattern.exec(string);
68
- return detail ? [!!results, results?.index ?? -1, results] : !!results;
69
- },
70
- /**
71
- * Getter method for the JSONStartPattern.
72
- *
73
- * This method constructs a regular expression pattern that is used to
74
- * identify potential JSON objects in a string. The pattern is designed
75
- * to match various JSON data types including null, boolean, number,
76
- * string, object, and array.
77
- *
78
- * The pattern is constructed using an array of strings, each representing
79
- * a part of the pattern. The array is then joined into a single string
80
- * and passed to the RegExp constructor to create the pattern.
81
- *
82
- * @returns {RegExp} - The constructed regular expression pattern.
83
- *
84
- * @example
85
- * // Using `JSONStartPattern`
86
- * const pattern = JSONStartPattern;
87
- * const str = 'Hello {"name":"John", "age":30} World';
88
- * const match = pattern.exec(str);
89
- * console.log(match[0]); // Output: '{"name":"John", "age":30}'
90
- */
91
- get JSONStartPattern() {
92
- const pattern = new RegExp([
93
- '(?:', // Start with a non-capturing group and match
94
- '(null)|', // ...a null
95
- '(true|false)|', // ...a bool
96
- '(\\d+\\.?\\d*)|', // ...a number (including floats)
97
- '("[^\\"]*(?:[^:])")|', // ...a double quote (start of string)
98
- '((?:\\{.*\\})+)|', // ...an open curly brace (object)
99
- '((?:\\[.*\\]+))', // ...an open square bracket (array)
100
- ')+', // End of the groups
101
- ].join(''), 'gm');
102
- return pattern;
103
- },
104
- }
105
- });
106
- //# sourceMappingURL=json.extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.extensions.js","sourceRoot":"","sources":["../../src/json.extensions.js"],"names":[],"m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C,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACxE,CAAC;QAED;;;;;;;;;;;;;;;;;;;;WAoBG;QACH,IAAI,gBAAgB;YAClB,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC;gBACzB,KAAK,EAAqB,6CAA6C;gBACrE,SAAS,EAAe,YAAY;gBACpC,eAAe,EAAS,YAAY;gBACpC,iBAAiB,EAAO,iCAAiC;gBACzD,sBAAsB,EAAE,sCAAsC;gBAC9D,kBAAkB,EAAM,kCAAkC;gBAC1D,iBAAiB,EAAO,oCAAoC;gBAC9D,IAAI,EAAsB,oBAAoB;aAC/C,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;YAEjB,OAAO,OAAO,CAAA;QAChB,CAAC;KACF;CACF,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export const MapExtensions: Patch;
2
- export const MapPrototypeExtensions: Patch;
3
- import { Patch } from '@nejs/extension';
@@ -1,140 +0,0 @@
1
- import { Patch } from '@nejs/extension';
2
- export const MapExtensions = new Patch(Map, {
3
- [Patch.kMutablyHidden]: {
4
- /**
5
- * Determines if the supplied `value` is a `Map` object. This check
6
- * is performed by first looking for the `Symbol.toStringTag` on the
7
- * `value` and checking to see if it is equal to the string "Map".
8
- * If that check fails, `instanceof` is used as a fallback to check
9
- * the prototype chain.
10
- *
11
- * @param {any} value the value that needs to be checked to determine
12
- * if it is a `Map` object or not
13
- * @returns {boolean} `true` if the supplied `value` is a `Map`
14
- * object, `false` otherwise
15
- *
16
- * @example
17
- * const map = new Map()
18
- * isMap(map) // true
19
- * isMap(new Set()) // false
20
- * isMap([]) // false
21
- * isMap({}) // false
22
- */
23
- isMap(value) {
24
- return value?.[Symbol.toStringTag] === Map.name && value instanceof Map;
25
- },
26
- /**
27
- * Conditionally returns a value based on whether the supplied
28
- * `value` is a `Map` object or not. If the `value` is a `Map`
29
- * object, the `thenValue` will be returned. If it is not a `Map`
30
- * object, the `elseValue` will be returned instead.
31
- *
32
- * @param {any} value the value to check to determine if it is a
33
- * `Map` object
34
- * @param {any} thenValue the value to return if the supplied
35
- * `value` is a `Map` object
36
- * @param {any} elseValue the value to return if the supplied
37
- * `value` is not a `Map` object
38
- * @returns {any} either the `thenValue` or `elseValue` depending
39
- * on if the supplied `value` is a `Map` object
40
- *
41
- * @example
42
- * const map = new Map()
43
- * const set = new Set()
44
- * ifMap(map, 'is a map', 'not a map') // 'is a map'
45
- * ifMap(set, 'is a map', 'not a map') // 'not a map'
46
- */
47
- ifMap(value, thenValue, elseValue) {
48
- return isThenElse(this.isMap(value), thenValue, elseValue);
49
- },
50
- }
51
- });
52
- const { isMap: pIsMap, ifMap: pIfMap } = MapExtensions.patches;
53
- export const MapPrototypeExtensions = new Patch(Map.prototype, {
54
- [Patch.kMutablyHidden]: {
55
- /**
56
- * Determines if the current object is a `Map` object
57
- *
58
- * This is a getter that uses the `isMap` function from the
59
- * `MapExtensions` patch to check if the current object (`this`) is
60
- * a `Map` object
61
- *
62
- * @type {boolean}
63
- * @readonly
64
- *
65
- * @example
66
- * const map = new Map()
67
- * console.log(map.isMap) // Output: true
68
- *
69
- * const notMap = {}
70
- * console.log(notMap.isMap) // Output: false
71
- */
72
- get isMap() {
73
- return pIsMap(this);
74
- },
75
- /**
76
- * Conditionally returns a value based on whether the current
77
- * object is a `Map` object or not
78
- *
79
- * If the current object is a `Map` object, the `thenValue` will
80
- * be returned. If it is not a `Map` object, the `elseValue` will
81
- * be returned instead.
82
- *
83
- * @param {any} thenValue the value to return if the current
84
- * object is a `Map` object
85
- * @param {any} elseValue the value to return if the current
86
- * object is not a `Map` object
87
- * @returns {any} either the `thenValue` or `elseValue` depending
88
- * on if the current object is a `Map` object
89
- *
90
- * @example
91
- * const map = new Map()
92
- * map.ifMap('is a map', 'not a map') // 'is a map'
93
- *
94
- * const notMap = {}
95
- * notMap.ifMap('is a map', 'not a map') // 'not a map'
96
- */
97
- ifMap(thenValue, elseValue) {
98
- return pIfMap(this, thenValue, elseValue);
99
- },
100
- /**
101
- * The function `getKey` returns the key associated with a given value
102
- * in a map.
103
- *
104
- * @param {any} value - The value parameter is the value that you want to
105
- * find the corresponding key for in the map.
106
- * @param [strict=true] - The "strict" parameter is a boolean value that
107
- * determines whether strict equality (===) or loose equality (==) should
108
- * be used when comparing the "value" parameter with the values in the
109
- * entries of the object. If "strict" is set to true, strict equality will
110
- * be used.
111
- * @returns the key associated with the given value. If a matching key is
112
- * found, it is returned. If no matching key is found, null is returned.
113
- */
114
- getKey(value, strict = true) {
115
- for (const [key, entryValue] of this) {
116
- if ((strict && value === entryValue) &&
117
- (!strict && value == entryValue)) {
118
- return key;
119
- }
120
- return null;
121
- }
122
- },
123
- },
124
- });
125
- // NOTE to self; this is repeated here otherwise a circular reference from
126
- // Object<->Function<->Global occurs. See original source in global.this.js
127
- // {@see globalThis.isThenElse}
128
- function isThenElse(bv, tv, ev) {
129
- function isFunction(value) { typeof value === 'function'; }
130
- if (arguments.length > 1) {
131
- var _then = isFunction(tv) ? tv(bv) : tv;
132
- if (arguments.length > 2) {
133
- var _else = isFunction(ev) ? tv(bv) : ev;
134
- return bv ? _then : _else;
135
- }
136
- return bv || _then;
137
- }
138
- return bv;
139
- }
140
- //# sourceMappingURL=map.extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map.extensions.js","sourceRoot":"","sources":["../../src/map.extensions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE;IAC1C,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;QACtB;;;;;;;;;;;;;;;;;;WAkBG;QACH,KAAK,CAAC,KAAK;YACT,OAAO,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,IAAI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,IAAI,OAAO,KAAK,KAAK,UAAU,CAAA,CAAC,CAAC;IAE1D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnE,IAAI,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAAC,OAAO,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,44 +0,0 @@
1
- /**
2
- * A patch for the JavaScript built-in `Number` class that adds utility
3
- * methods without modifying the global namespace directly
4
- *
5
- * This patch includes methods for checking if a value is a number and
6
- * conditionally returning a value based on whether the supplied value is
7
- * a number or not.
8
- *
9
- * @type {Patch}
10
- * @property {Object} [Patch.kMutablyHidden] An object containing methods
11
- * that are hidden from enumeration and mutation
12
- *
13
- * @example
14
- * import { NumberExtensions } from 'number.extension.js'
15
- *
16
- * NumberExtensions.apply()
17
- * // Now the `Number` class has additional methods available
18
- */
19
- export const NumberExtensions: Patch;
20
- /**
21
- * `NumberPrototypeExtensions` provides a set of utility methods that
22
- * are added to the `Number` prototype. This allows all number instances
23
- * to access new functionality directly, enhancing their capabilities
24
- * beyond the standard `Number` class methods.
25
- *
26
- * These extensions are applied using the `Patch` class from
27
- * '@nejs/extension', ensuring that they do not interfere with the
28
- * global namespace or existing properties.
29
- *
30
- * The extensions include methods for checking if a value is a number,
31
- * conditionally returning values based on whether a value is a number,
32
- * and more, making number-related tasks more convenient and expressive.
33
- *
34
- * @example
35
- * const num = 42
36
- * console.log(num.isNumber) // Output: true
37
- *
38
- * const notNum = "123"
39
- * console.log(notNum.isNumber) // Output: false
40
- *
41
- * @type {Patch}
42
- */
43
- export const NumberPrototypeExtensions: Patch;
44
- import { Patch } from '@nejs/extension';
@@ -1,258 +0,0 @@
1
- import { Patch } from '@nejs/extension';
2
- /**
3
- * A patch for the JavaScript built-in `Number` class that adds utility
4
- * methods without modifying the global namespace directly
5
- *
6
- * This patch includes methods for checking if a value is a number and
7
- * conditionally returning a value based on whether the supplied value is
8
- * a number or not.
9
- *
10
- * @type {Patch}
11
- * @property {Object} [Patch.kMutablyHidden] An object containing methods
12
- * that are hidden from enumeration and mutation
13
- *
14
- * @example
15
- * import { NumberExtensions } from 'number.extension.js'
16
- *
17
- * NumberExtensions.apply()
18
- * // Now the `Number` class has additional methods available
19
- */
20
- export const NumberExtensions = new Patch(Number, {
21
- [Patch.kMutablyHidden]: {
22
- /**
23
- * Determines if the supplied `value` is a `Number`. This check is
24
- * performed by first converting the `value` to a `Number` using the
25
- * `Number()` constructor and checking to see if the result is not
26
- * `NaN`. If that check passes, `typeof` is used to ensure that the
27
- * original `value` is of type "number".
28
- *
29
- * @param {*} value The value that needs to be checked to determine if it
30
- * is a `Number` or not
31
- * @returns {boolean} `true` if the supplied `value` is a `Number`,
32
- * `false` otherwise
33
- *
34
- * @example
35
- * const num = 42
36
- * isNumber(num) // true
37
- * isNumber('42') // false
38
- * isNumber(NaN) // false
39
- * isNumber(Infinity) // true
40
- */
41
- isNumber(value) {
42
- return !isNaN(value) && typeof value === 'number';
43
- },
44
- /**
45
- * Checks if all or some of the supplied values are numbers.
46
- *
47
- * This method uses the `Array.prototype.every` or `Array.prototype.some`
48
- * method to check if all or some of the supplied values are numbers,
49
- * respectively. The method to use is determined by the `which` parameter.
50
- *
51
- * @param {string} [which='every'] - Determines the method to use for the
52
- * check. Can be either 'every' or 'some'. Defaults to 'every'.
53
- * @param {...*} values - The values to check.
54
- * @returns {boolean} - Returns `true` if all or some of the values are
55
- * numbers (based on the `which` parameter), `false` otherwise.
56
- *
57
- * @example
58
- * areNumbers('every', 1, 2, 3) // true
59
- * areNumbers('some', 1, '2', 3) // true
60
- * areNumbers('every', 1, '2', 3) // false
61
- */
62
- areNumbers(which = ['every', 'some'][0], ...values) {
63
- if (which !== 'every' && which !== 'some') {
64
- return false;
65
- }
66
- return values[which](num => this.isNumber(num));
67
- },
68
- /**
69
- * Conditionally returns a value based on whether the supplied `value` is
70
- * a `Number` or not. If the `value` is a `Number`, the `thenValue` will
71
- * be returned. If it is not a `Number`, the `elseValue` will be
72
- * returned instead.
73
- *
74
- * @param {*} value The value to check to determine if it is a `Number`
75
- * @param {*} thenValue The value to return if the supplied `value` is
76
- * a `Number`
77
- * @param {*} elseValue The value to return if the supplied `value` is
78
- * not a `Number`
79
- * @returns {*} Either the `thenValue` or `elseValue` depending on if the
80
- * supplied `value` is a `Number`
81
- *
82
- * @example
83
- * const num = 42
84
- * const str = 'hello'
85
- * ifNumber(num, 'is a number', 'not a number') // 'is a number'
86
- * ifNumber(str, 'is a number', 'not a number') // 'not a number'
87
- */
88
- ifNumber(value, thenValue, elseValue) {
89
- return isThenElse(this.isNumber(value), thenValue, elseValue);
90
- },
91
- /**
92
- * Conditionally returns a value based on whether all or some of the
93
- * supplied values are numbers.
94
- *
95
- * This method uses the `areNumbers` method to check if all or some of
96
- * the supplied values are numbers, based on the `which` parameter.
97
- * If the condition is met, the `thenValue` is returned, otherwise
98
- * the `elseValue` is returned.
99
- *
100
- * @param {*} thenValue - The value to return if the condition is met.
101
- * @param {*} elseValue - The value to return if the condition is not met.
102
- * @param {string} [which='every'] - Determines the method to use for the
103
- * check. Can be either 'every' or 'some'. Defaults to 'every'.
104
- * @param {...*} numbers - The values to check.
105
- * @returns {*} Either the `thenValue` or `elseValue` depending on if all
106
- * or some of the supplied values are numbers.
107
- *
108
- * @example
109
- * ifNumbers('All are numbers', 'Not all are numbers', 'every', 1, 2, 3)
110
- * // returns 'All are numbers'
111
- * ifNumbers('At least one is a number', 'None are numbers', 'some', 1, '2', 3)
112
- * // returns 'At least one is a number'
113
- * ifNumbers('All are numbers', 'Not all are numbers', 'every', 1, '2', 3)
114
- * // returns 'Not all are numbers'
115
- */
116
- ifNumbers(thenValue, elseValue, which = ['every', 'some'][0], ...numbers) {
117
- return isThenElse(this.areNumbers(which, ...numbers), thenValue, elseValue);
118
- },
119
- /**
120
- * Clamps a value between a minimum and maximum value.
121
- *
122
- * This method checks if the provided value and the min and max bounds are
123
- * numbers. If they are not, it returns the original value. If they are,
124
- * it ensures that the value does not go below the minimum value or above
125
- * the maximum value.
126
- *
127
- * @param {*} value - The value to clamp.
128
- * @param {number} [minValue=-Infinity] - The minimum value. Defaults
129
- * to -Infinity.
130
- * @param {number} [maxValue=Infinity] - The maximum value. Defaults
131
- * to Infinity.
132
- * @returns {*} - Returns the clamped value if all parameters are numbers,
133
- * otherwise returns the original value.
134
- *
135
- * @example
136
- * clamp(10, 1, 5) // returns 5
137
- * clamp(-10, 1, 5) // returns 1
138
- * clamp(3, 1, 5) // returns 3
139
- * clamp('10', 1, 5) // returns '10'
140
- */
141
- clamp(value, minValue = -Infinity, maxValue = Infinity) {
142
- if (!this.areNumbers('every', value, minValue, maxValue)) {
143
- return value;
144
- }
145
- return Math.max(minValue, Math.min(maxValue, value));
146
- },
147
- }
148
- });
149
- const { isNumber: pIsNumber, ifNumber: pIfNumber } = NumberExtensions.patches;
150
- /**
151
- * `NumberPrototypeExtensions` provides a set of utility methods that
152
- * are added to the `Number` prototype. This allows all number instances
153
- * to access new functionality directly, enhancing their capabilities
154
- * beyond the standard `Number` class methods.
155
- *
156
- * These extensions are applied using the `Patch` class from
157
- * '@nejs/extension', ensuring that they do not interfere with the
158
- * global namespace or existing properties.
159
- *
160
- * The extensions include methods for checking if a value is a number,
161
- * conditionally returning values based on whether a value is a number,
162
- * and more, making number-related tasks more convenient and expressive.
163
- *
164
- * @example
165
- * const num = 42
166
- * console.log(num.isNumber) // Output: true
167
- *
168
- * const notNum = "123"
169
- * console.log(notNum.isNumber) // Output: false
170
- *
171
- * @type {Patch}
172
- */
173
- export const NumberPrototypeExtensions = new Patch(Number.prototype, {
174
- [Patch.kMutablyHidden]: {
175
- /**
176
- * Returns an object representation of the number instance.
177
- *
178
- * This getter method creates and returns an object that wraps the number
179
- * instance, allowing it to be treated as an object. The returned object
180
- * is created using the `Object()` constructor, which takes the number
181
- * instance as its argument.
182
- *
183
- * @type {Object}
184
- * @readonly
185
- *
186
- * @example
187
- * const num = 42
188
- * console.log(typeof num) // 'number'
189
- * console.log(typeof num.instance) // 'object'
190
- */
191
- get instance() {
192
- return Object(this);
193
- },
194
- /**
195
- * Determines if the current object is a number
196
- *
197
- * This getter uses the `pIsNumber` function from the `NumberExtensions`
198
- * patch to check if the current object (`this`) is a number.
199
- *
200
- * @type {boolean}
201
- * @readonly
202
- *
203
- * @example
204
- * const num = 42
205
- * console.log(num.isNumber) // Output: true
206
- *
207
- * const notNum = "123"
208
- * console.log(notNum.isNumber) // Output: false
209
- */
210
- get isNumber() {
211
- return pIsNumber(this);
212
- },
213
- /**
214
- * Checks if the current object is a number and returns the corresponding
215
- * value based on the result.
216
- *
217
- * This method uses the `pIfNumber` function from the `NumberExtensions`
218
- * patch to determine if the current object (`this`) is a number. If it is
219
- * a number, the `thenValue` is returned. Otherwise, the `elseValue` is
220
- * returned.
221
- *
222
- * @param {any} thenValue The value to return if the current object is
223
- * a number
224
- * @param {any} elseValue The value to return if the current object is not
225
- * a number
226
- * @returns {any} The `thenValue` if the current object is a number, or
227
- * the `elseValue` if it is not a number
228
- *
229
- * @example
230
- * const num = 42
231
- * console.log(num.ifNumber('Is a number', 'Not a number'))
232
- * // Output: 'Is a number'
233
- *
234
- * const notNum = '123'
235
- * console.log(notNum.ifNumber('Is a number', 'Not a number'))
236
- * // Output: 'Not a number'
237
- */
238
- ifNumber(thenValue, elseValue) {
239
- return pIfNumber(this, thenValue, elseValue);
240
- },
241
- }
242
- });
243
- // NOTE to self; this is repeated here otherwise a circular reference from
244
- // Object<->Function<->Global occurs. See original source in global.this.js
245
- // {@see globalThis.isThenElse}
246
- function isThenElse(bv, tv, ev) {
247
- function isFunction(value) { typeof value === 'function'; }
248
- if (arguments.length > 1) {
249
- var _then = isFunction(tv) ? tv(bv) : tv;
250
- if (arguments.length > 2) {
251
- var _else = isFunction(ev) ? tv(bv) : ev;
252
- return bv ? _then : _else;
253
- }
254
- return bv || _then;
255
- }
256
- return bv;
257
- }
258
- //# sourceMappingURL=number.extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.extension.js","sourceRoot":"","sources":["../../src/number.extension.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;IAChD,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;QACtB;;;;;;;;;;;;;;;;;;WAkBG;QACH,QAAQ,CAAC,KAAK;YACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAA;QACnD,CAAC;QAED;;;;;;;;;;;;;;;;;WAiBG;QACH,UAAU,CAAC,KAAK,GAAG,CAAC,OAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM;YAC/C,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;gBAC1C,OAAO,KAAK,CAAA;YACd,CAAC;YAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;QACjD,CAAC;QAED;;;;;;;;;;;;;;;;;;;WAmBG;QACH,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS;YAClC,OAAO,UAAU,CAAC,IAAI,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;;;;;;;;;;;;;;;;;;WAwBG;QACH,QAAQ,CAAC,SAAS,EAAE,SAAS;YAC3B,OAAO,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;QAC9C,CAAC;KACF;CACF,CAAC,CAAA;AAEF,0EAA0E;AAC1E,2EAA2E;AAC3E,+BAA+B;AAC/B,SAAS,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IAC5B,SAAS,UAAU,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,UAAU,CAAA,CAAC,CAAC;IAE1D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnE,IAAI,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAAC,OAAO,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,33 +0,0 @@
1
- /**
2
- * `ObjectExtensions` is a constant that applies a patch to the global
3
- * `Object` constructor. This patch extends the `Object` with additional
4
- * methods and properties, enhancing its functionality.
5
- *
6
- * The `Patch` function takes two arguments: the target object to be patched
7
- * (in this case, `Object`), and an object containing the methods and
8
- * properties to be added to the target object.
9
- *
10
- * @type {Patch}
11
- * @memberof module:object.extensions
12
- */
13
- export const ObjectExtensions: Patch;
14
- /**
15
- * `ObjectPrototypeExtensions` is a constant that applies a patch to the
16
- * Object prototype. This patch extends the Object prototype with additional
17
- * methods and properties, enhancing its functionality.
18
- *
19
- * The `Patch` function takes two arguments: the target object to be patched
20
- * (in this case, `Object.prototype`), and an object containing the methods
21
- * and properties to be added to the target object.
22
- *
23
- * @example
24
- * // Using a method added by ObjectPrototypeExtensions
25
- * const obj = {};
26
- * console.log(obj.isObject()); // Output: true
27
- *
28
- * @const
29
- * @type {Patch}
30
- * @memberof module:object.extensions
31
- */
32
- export const ObjectPrototypeExtensions: Patch;
33
- import { Patch } from '@nejs/extension';