@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,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JSONExtensions = void 0;
4
- const extension_1 = require("@nejs/extension");
5
- exports.JSONExtensions = new extension_1.Patch(JSON, {
6
- [extension_1.Patch.kMutablyHidden]: {
7
- extractAllFrom(string) {
8
- const pattern = this.JSONStartPattern;
9
- const notJSON = Symbol("Value is not valid JSON");
10
- const decoder = part => {
11
- try {
12
- return JSON.parse(part);
13
- }
14
- catch (_) {
15
- return notJSON;
16
- }
17
- };
18
- const parts = [];
19
- let part = undefined;
20
- while ((part = pattern.exec(string))) {
21
- parts.push(decoder(part?.[0]));
22
- }
23
- return parts.filter(isJSON => isJSON !== notJSON);
24
- },
25
- /**
26
- * The `extractFrom` method attempts to extract a JSON object from a string.
27
- * It uses a regular expression to identify potential JSON objects in the
28
- * string and attempts to parse them. If a valid JSON object is found, it is
29
- * returned. If no valid JSON object is found, the method returns undefined.
30
- *
31
- * NOTE: This method will only find JSON from an iterated upon start spot
32
- * until the end of the string. So `'JSON follows {"count": 0}'` will
33
- * return `{count: 0}` but `'JSON follows {"count": 0} and more'` will
34
- * fail to locate any JSON in the String. You've been warned.
35
- *
36
- * @param {string} string - The string from which to extract a JSON object.
37
- * @returns {Object|undefined} - The first valid JSON object found in the
38
- * string, or undefined if no valid JSON object is found.
39
- *
40
- * @example
41
- * // Suppose we have a string with embedded JSON
42
- * const str1 = 'Hello {"name":"John", "age":30} World'
43
- * const str2 = 'Hello {"name": "John", "age": 30}'
44
- *
45
- * // Using `extractFrom`
46
- * console.log(JSON.extractFrom(str1)) // Output: undefined
47
- * console.log(JSON.extractFrom(str2)) // Output: {name: 'John', age: 30}
48
- */
49
- extractFrom(string) {
50
- this.extractAllFrom(string)?.[0];
51
- },
52
- /**
53
- * The `mightContain` method checks if a string might contain a JSON object.
54
- * It uses the `JSONStartPattern` regular expression to search for potential
55
- * JSON objects in the string. If a potential JSON object is found, the method
56
- * returns true. If no potential JSON object is found, the method returns false.
57
- *
58
- * @param {string} string - The string to check for potential JSON objects.
59
- * @returns {boolean} - Returns true if the string might contain a JSON object,
60
- * false otherwise.
61
- *
62
- * @example
63
- * // Suppose we have a string with embedded JSON
64
- * const str = 'Hello {"name":"John", "age":30} World'
65
- *
66
- * // Using `mightContain`
67
- * console.log(JSON.mightContain(str)) // Output: true
68
- */
69
- mightContain(string, detail = false) {
70
- const results = this.JSONStartPattern.exec(string);
71
- return detail ? [!!results, results?.index ?? -1, results] : !!results;
72
- },
73
- /**
74
- * Getter method for the JSONStartPattern.
75
- *
76
- * This method constructs a regular expression pattern that is used to
77
- * identify potential JSON objects in a string. The pattern is designed
78
- * to match various JSON data types including null, boolean, number,
79
- * string, object, and array.
80
- *
81
- * The pattern is constructed using an array of strings, each representing
82
- * a part of the pattern. The array is then joined into a single string
83
- * and passed to the RegExp constructor to create the pattern.
84
- *
85
- * @returns {RegExp} - The constructed regular expression pattern.
86
- *
87
- * @example
88
- * // Using `JSONStartPattern`
89
- * const pattern = JSONStartPattern;
90
- * const str = 'Hello {"name":"John", "age":30} World';
91
- * const match = pattern.exec(str);
92
- * console.log(match[0]); // Output: '{"name":"John", "age":30}'
93
- */
94
- get JSONStartPattern() {
95
- const pattern = new RegExp([
96
- '(?:', // Start with a non-capturing group and match
97
- '(null)|', // ...a null
98
- '(true|false)|', // ...a bool
99
- '(\\d+\\.?\\d*)|', // ...a number (including floats)
100
- '("[^\\"]*(?:[^:])")|', // ...a double quote (start of string)
101
- '((?:\\{.*\\})+)|', // ...an open curly brace (object)
102
- '((?:\\[.*\\]+))', // ...an open square bracket (array)
103
- ')+', // End of the groups
104
- ].join(''), 'gm');
105
- return pattern;
106
- },
107
- }
108
- });
109
- //# sourceMappingURL=json.extensions.js.map
@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AM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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,143 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MapPrototypeExtensions = exports.MapExtensions = void 0;
4
- const extension_1 = require("@nejs/extension");
5
- exports.MapExtensions = new extension_1.Patch(Map, {
6
- [extension_1.Patch.kMutablyHidden]: {
7
- /**
8
- * Determines if the supplied `value` is a `Map` object. This check
9
- * is performed by first looking for the `Symbol.toStringTag` on the
10
- * `value` and checking to see if it is equal to the string "Map".
11
- * If that check fails, `instanceof` is used as a fallback to check
12
- * the prototype chain.
13
- *
14
- * @param {any} value the value that needs to be checked to determine
15
- * if it is a `Map` object or not
16
- * @returns {boolean} `true` if the supplied `value` is a `Map`
17
- * object, `false` otherwise
18
- *
19
- * @example
20
- * const map = new Map()
21
- * isMap(map) // true
22
- * isMap(new Set()) // false
23
- * isMap([]) // false
24
- * isMap({}) // false
25
- */
26
- isMap(value) {
27
- return value?.[Symbol.toStringTag] === Map.name && value instanceof Map;
28
- },
29
- /**
30
- * Conditionally returns a value based on whether the supplied
31
- * `value` is a `Map` object or not. If the `value` is a `Map`
32
- * object, the `thenValue` will be returned. If it is not a `Map`
33
- * object, the `elseValue` will be returned instead.
34
- *
35
- * @param {any} value the value to check to determine if it is a
36
- * `Map` object
37
- * @param {any} thenValue the value to return if the supplied
38
- * `value` is a `Map` object
39
- * @param {any} elseValue the value to return if the supplied
40
- * `value` is not a `Map` object
41
- * @returns {any} either the `thenValue` or `elseValue` depending
42
- * on if the supplied `value` is a `Map` object
43
- *
44
- * @example
45
- * const map = new Map()
46
- * const set = new Set()
47
- * ifMap(map, 'is a map', 'not a map') // 'is a map'
48
- * ifMap(set, 'is a map', 'not a map') // 'not a map'
49
- */
50
- ifMap(value, thenValue, elseValue) {
51
- return isThenElse(this.isMap(value), thenValue, elseValue);
52
- },
53
- }
54
- });
55
- const { isMap: pIsMap, ifMap: pIfMap } = exports.MapExtensions.patches;
56
- exports.MapPrototypeExtensions = new extension_1.Patch(Map.prototype, {
57
- [extension_1.Patch.kMutablyHidden]: {
58
- /**
59
- * Determines if the current object is a `Map` object
60
- *
61
- * This is a getter that uses the `isMap` function from the
62
- * `MapExtensions` patch to check if the current object (`this`) is
63
- * a `Map` object
64
- *
65
- * @type {boolean}
66
- * @readonly
67
- *
68
- * @example
69
- * const map = new Map()
70
- * console.log(map.isMap) // Output: true
71
- *
72
- * const notMap = {}
73
- * console.log(notMap.isMap) // Output: false
74
- */
75
- get isMap() {
76
- return pIsMap(this);
77
- },
78
- /**
79
- * Conditionally returns a value based on whether the current
80
- * object is a `Map` object or not
81
- *
82
- * If the current object is a `Map` object, the `thenValue` will
83
- * be returned. If it is not a `Map` object, the `elseValue` will
84
- * be returned instead.
85
- *
86
- * @param {any} thenValue the value to return if the current
87
- * object is a `Map` object
88
- * @param {any} elseValue the value to return if the current
89
- * object is not a `Map` object
90
- * @returns {any} either the `thenValue` or `elseValue` depending
91
- * on if the current object is a `Map` object
92
- *
93
- * @example
94
- * const map = new Map()
95
- * map.ifMap('is a map', 'not a map') // 'is a map'
96
- *
97
- * const notMap = {}
98
- * notMap.ifMap('is a map', 'not a map') // 'not a map'
99
- */
100
- ifMap(thenValue, elseValue) {
101
- return pIfMap(this, thenValue, elseValue);
102
- },
103
- /**
104
- * The function `getKey` returns the key associated with a given value
105
- * in a map.
106
- *
107
- * @param {any} value - The value parameter is the value that you want to
108
- * find the corresponding key for in the map.
109
- * @param [strict=true] - The "strict" parameter is a boolean value that
110
- * determines whether strict equality (===) or loose equality (==) should
111
- * be used when comparing the "value" parameter with the values in the
112
- * entries of the object. If "strict" is set to true, strict equality will
113
- * be used.
114
- * @returns the key associated with the given value. If a matching key is
115
- * found, it is returned. If no matching key is found, null is returned.
116
- */
117
- getKey(value, strict = true) {
118
- for (const [key, entryValue] of this) {
119
- if ((strict && value === entryValue) &&
120
- (!strict && value == entryValue)) {
121
- return key;
122
- }
123
- return null;
124
- }
125
- },
126
- },
127
- });
128
- // NOTE to self; this is repeated here otherwise a circular reference from
129
- // Object<->Function<->Global occurs. See original source in global.this.js
130
- // {@see globalThis.isThenElse}
131
- function isThenElse(bv, tv, ev) {
132
- function isFunction(value) { typeof value === 'function'; }
133
- if (arguments.length > 1) {
134
- var _then = isFunction(tv) ? tv(bv) : tv;
135
- if (arguments.length > 2) {
136
- var _else = isFunction(ev) ? tv(bv) : ev;
137
- return bv ? _then : _else;
138
- }
139
- return bv || _then;
140
- }
141
- return bv;
142
- }
143
- //# sourceMappingURL=map.extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map.extensions.js","sourceRoot":"","sources":["../../src/map.extensions.js"],"names":[],"mappings":";;;AAAA,+CAAuC;AAE1B,QAAA,aAAa,GAAG,IAAI,iBAAK,CAAC,GAAG,EAAE;IAC1C,CAAC,iBAAK,CAAC,cAAc,CAAC,EAAE;QACtB;;;;;;;;;;;;;;;;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AC3E,+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,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,261 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NumberPrototypeExtensions = exports.NumberExtensions = void 0;
4
- const extension_1 = require("@nejs/extension");
5
- /**
6
- * A patch for the JavaScript built-in `Number` class that adds utility
7
- * methods without modifying the global namespace directly
8
- *
9
- * This patch includes methods for checking if a value is a number and
10
- * conditionally returning a value based on whether the supplied value is
11
- * a number or not.
12
- *
13
- * @type {Patch}
14
- * @property {Object} [Patch.kMutablyHidden] An object containing methods
15
- * that are hidden from enumeration and mutation
16
- *
17
- * @example
18
- * import { NumberExtensions } from 'number.extension.js'
19
- *
20
- * NumberExtensions.apply()
21
- * // Now the `Number` class has additional methods available
22
- */
23
- exports.NumberExtensions = new extension_1.Patch(Number, {
24
- [extension_1.Patch.kMutablyHidden]: {
25
- /**
26
- * Determines if the supplied `value` is a `Number`. This check is
27
- * performed by first converting the `value` to a `Number` using the
28
- * `Number()` constructor and checking to see if the result is not
29
- * `NaN`. If that check passes, `typeof` is used to ensure that the
30
- * original `value` is of type "number".
31
- *
32
- * @param {*} value The value that needs to be checked to determine if it
33
- * is a `Number` or not
34
- * @returns {boolean} `true` if the supplied `value` is a `Number`,
35
- * `false` otherwise
36
- *
37
- * @example
38
- * const num = 42
39
- * isNumber(num) // true
40
- * isNumber('42') // false
41
- * isNumber(NaN) // false
42
- * isNumber(Infinity) // true
43
- */
44
- isNumber(value) {
45
- return !isNaN(value) && typeof value === 'number';
46
- },
47
- /**
48
- * Checks if all or some of the supplied values are numbers.
49
- *
50
- * This method uses the `Array.prototype.every` or `Array.prototype.some`
51
- * method to check if all or some of the supplied values are numbers,
52
- * respectively. The method to use is determined by the `which` parameter.
53
- *
54
- * @param {string} [which='every'] - Determines the method to use for the
55
- * check. Can be either 'every' or 'some'. Defaults to 'every'.
56
- * @param {...*} values - The values to check.
57
- * @returns {boolean} - Returns `true` if all or some of the values are
58
- * numbers (based on the `which` parameter), `false` otherwise.
59
- *
60
- * @example
61
- * areNumbers('every', 1, 2, 3) // true
62
- * areNumbers('some', 1, '2', 3) // true
63
- * areNumbers('every', 1, '2', 3) // false
64
- */
65
- areNumbers(which = ['every', 'some'][0], ...values) {
66
- if (which !== 'every' && which !== 'some') {
67
- return false;
68
- }
69
- return values[which](num => this.isNumber(num));
70
- },
71
- /**
72
- * Conditionally returns a value based on whether the supplied `value` is
73
- * a `Number` or not. If the `value` is a `Number`, the `thenValue` will
74
- * be returned. If it is not a `Number`, the `elseValue` will be
75
- * returned instead.
76
- *
77
- * @param {*} value The value to check to determine if it is a `Number`
78
- * @param {*} thenValue The value to return if the supplied `value` is
79
- * a `Number`
80
- * @param {*} elseValue The value to return if the supplied `value` is
81
- * not a `Number`
82
- * @returns {*} Either the `thenValue` or `elseValue` depending on if the
83
- * supplied `value` is a `Number`
84
- *
85
- * @example
86
- * const num = 42
87
- * const str = 'hello'
88
- * ifNumber(num, 'is a number', 'not a number') // 'is a number'
89
- * ifNumber(str, 'is a number', 'not a number') // 'not a number'
90
- */
91
- ifNumber(value, thenValue, elseValue) {
92
- return isThenElse(this.isNumber(value), thenValue, elseValue);
93
- },
94
- /**
95
- * Conditionally returns a value based on whether all or some of the
96
- * supplied values are numbers.
97
- *
98
- * This method uses the `areNumbers` method to check if all or some of
99
- * the supplied values are numbers, based on the `which` parameter.
100
- * If the condition is met, the `thenValue` is returned, otherwise
101
- * the `elseValue` is returned.
102
- *
103
- * @param {*} thenValue - The value to return if the condition is met.
104
- * @param {*} elseValue - The value to return if the condition is not met.
105
- * @param {string} [which='every'] - Determines the method to use for the
106
- * check. Can be either 'every' or 'some'. Defaults to 'every'.
107
- * @param {...*} numbers - The values to check.
108
- * @returns {*} Either the `thenValue` or `elseValue` depending on if all
109
- * or some of the supplied values are numbers.
110
- *
111
- * @example
112
- * ifNumbers('All are numbers', 'Not all are numbers', 'every', 1, 2, 3)
113
- * // returns 'All are numbers'
114
- * ifNumbers('At least one is a number', 'None are numbers', 'some', 1, '2', 3)
115
- * // returns 'At least one is a number'
116
- * ifNumbers('All are numbers', 'Not all are numbers', 'every', 1, '2', 3)
117
- * // returns 'Not all are numbers'
118
- */
119
- ifNumbers(thenValue, elseValue, which = ['every', 'some'][0], ...numbers) {
120
- return isThenElse(this.areNumbers(which, ...numbers), thenValue, elseValue);
121
- },
122
- /**
123
- * Clamps a value between a minimum and maximum value.
124
- *
125
- * This method checks if the provided value and the min and max bounds are
126
- * numbers. If they are not, it returns the original value. If they are,
127
- * it ensures that the value does not go below the minimum value or above
128
- * the maximum value.
129
- *
130
- * @param {*} value - The value to clamp.
131
- * @param {number} [minValue=-Infinity] - The minimum value. Defaults
132
- * to -Infinity.
133
- * @param {number} [maxValue=Infinity] - The maximum value. Defaults
134
- * to Infinity.
135
- * @returns {*} - Returns the clamped value if all parameters are numbers,
136
- * otherwise returns the original value.
137
- *
138
- * @example
139
- * clamp(10, 1, 5) // returns 5
140
- * clamp(-10, 1, 5) // returns 1
141
- * clamp(3, 1, 5) // returns 3
142
- * clamp('10', 1, 5) // returns '10'
143
- */
144
- clamp(value, minValue = -Infinity, maxValue = Infinity) {
145
- if (!this.areNumbers('every', value, minValue, maxValue)) {
146
- return value;
147
- }
148
- return Math.max(minValue, Math.min(maxValue, value));
149
- },
150
- }
151
- });
152
- const { isNumber: pIsNumber, ifNumber: pIfNumber } = exports.NumberExtensions.patches;
153
- /**
154
- * `NumberPrototypeExtensions` provides a set of utility methods that
155
- * are added to the `Number` prototype. This allows all number instances
156
- * to access new functionality directly, enhancing their capabilities
157
- * beyond the standard `Number` class methods.
158
- *
159
- * These extensions are applied using the `Patch` class from
160
- * '@nejs/extension', ensuring that they do not interfere with the
161
- * global namespace or existing properties.
162
- *
163
- * The extensions include methods for checking if a value is a number,
164
- * conditionally returning values based on whether a value is a number,
165
- * and more, making number-related tasks more convenient and expressive.
166
- *
167
- * @example
168
- * const num = 42
169
- * console.log(num.isNumber) // Output: true
170
- *
171
- * const notNum = "123"
172
- * console.log(notNum.isNumber) // Output: false
173
- *
174
- * @type {Patch}
175
- */
176
- exports.NumberPrototypeExtensions = new extension_1.Patch(Number.prototype, {
177
- [extension_1.Patch.kMutablyHidden]: {
178
- /**
179
- * Returns an object representation of the number instance.
180
- *
181
- * This getter method creates and returns an object that wraps the number
182
- * instance, allowing it to be treated as an object. The returned object
183
- * is created using the `Object()` constructor, which takes the number
184
- * instance as its argument.
185
- *
186
- * @type {Object}
187
- * @readonly
188
- *
189
- * @example
190
- * const num = 42
191
- * console.log(typeof num) // 'number'
192
- * console.log(typeof num.instance) // 'object'
193
- */
194
- get instance() {
195
- return Object(this);
196
- },
197
- /**
198
- * Determines if the current object is a number
199
- *
200
- * This getter uses the `pIsNumber` function from the `NumberExtensions`
201
- * patch to check if the current object (`this`) is a number.
202
- *
203
- * @type {boolean}
204
- * @readonly
205
- *
206
- * @example
207
- * const num = 42
208
- * console.log(num.isNumber) // Output: true
209
- *
210
- * const notNum = "123"
211
- * console.log(notNum.isNumber) // Output: false
212
- */
213
- get isNumber() {
214
- return pIsNumber(this);
215
- },
216
- /**
217
- * Checks if the current object is a number and returns the corresponding
218
- * value based on the result.
219
- *
220
- * This method uses the `pIfNumber` function from the `NumberExtensions`
221
- * patch to determine if the current object (`this`) is a number. If it is
222
- * a number, the `thenValue` is returned. Otherwise, the `elseValue` is
223
- * returned.
224
- *
225
- * @param {any} thenValue The value to return if the current object is
226
- * a number
227
- * @param {any} elseValue The value to return if the current object is not
228
- * a number
229
- * @returns {any} The `thenValue` if the current object is a number, or
230
- * the `elseValue` if it is not a number
231
- *
232
- * @example
233
- * const num = 42
234
- * console.log(num.ifNumber('Is a number', 'Not a number'))
235
- * // Output: 'Is a number'
236
- *
237
- * const notNum = '123'
238
- * console.log(notNum.ifNumber('Is a number', 'Not a number'))
239
- * // Output: 'Not a number'
240
- */
241
- ifNumber(thenValue, elseValue) {
242
- return pIfNumber(this, thenValue, elseValue);
243
- },
244
- }
245
- });
246
- // NOTE to self; this is repeated here otherwise a circular reference from
247
- // Object<->Function<->Global occurs. See original source in global.this.js
248
- // {@see globalThis.isThenElse}
249
- function isThenElse(bv, tv, ev) {
250
- function isFunction(value) { typeof value === 'function'; }
251
- if (arguments.length > 1) {
252
- var _then = isFunction(tv) ? tv(bv) : tv;
253
- if (arguments.length > 2) {
254
- var _else = isFunction(ev) ? tv(bv) : ev;
255
- return bv ? _then : _else;
256
- }
257
- return bv || _then;
258
- }
259
- return bv;
260
- }
261
- //# sourceMappingURL=number.extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.extension.js","sourceRoot":"","sources":["../../src/number.extension.js"],"names":[],"mappings":";;;AAAA,+CAAuC;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,gBAAgB,GAAG,IAAI,iBAAK,CAAC,MAAM,EAAE;IAChD,CAAC,iBAAK,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,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;YACV,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC;QAED;;;;;;;;;;;;;;;WAeG;QACH,IAAI,QAAQ;YACV,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;QAED;;;;;;;;;;;;;;;;;;;;;;;;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';