@nejs/basic-extensions 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.esdoc.json +9 -0
  2. package/README.md +2025 -11
  3. package/bin/clean +6 -0
  4. package/dist/@nejs/basic-extensions.bundle.1.6.1.js +4 -0
  5. package/dist/@nejs/basic-extensions.bundle.1.6.1.js.map +7 -0
  6. package/dist/cjs/arrayextensions.js +1 -0
  7. package/dist/cjs/arrayextensions.js.map +1 -0
  8. package/dist/cjs/functionextensions.js +1 -0
  9. package/dist/cjs/functionextensions.js.map +1 -0
  10. package/dist/cjs/globals.js +2 -1
  11. package/dist/cjs/globals.js.map +1 -0
  12. package/dist/cjs/index.d.ts +10 -19
  13. package/dist/cjs/index.js +69 -76
  14. package/dist/cjs/index.js.map +1 -0
  15. package/dist/cjs/mapextensions.d.ts +2 -0
  16. package/dist/cjs/mapextensions.js +30 -0
  17. package/dist/cjs/mapextensions.js.map +1 -0
  18. package/dist/cjs/newClasses/asyncIterable.d.ts +123 -0
  19. package/dist/cjs/{asyncIterable.js → newClasses/asyncIterable.js} +7 -4
  20. package/dist/cjs/newClasses/asyncIterable.js.map +1 -0
  21. package/dist/cjs/newClasses/descriptor.d.ts +401 -0
  22. package/dist/cjs/{descriptor.js → newClasses/descriptor.js} +150 -80
  23. package/dist/cjs/newClasses/descriptor.js.map +1 -0
  24. package/dist/cjs/newClasses/iterable.d.ts +125 -0
  25. package/dist/cjs/{iterable.js → newClasses/iterable.js} +36 -10
  26. package/dist/cjs/newClasses/iterable.js.map +1 -0
  27. package/dist/cjs/newClasses/refmap.d.ts +238 -0
  28. package/dist/cjs/newClasses/refmap.js +433 -0
  29. package/dist/cjs/newClasses/refmap.js.map +1 -0
  30. package/dist/cjs/newClasses/refset.d.ts +186 -0
  31. package/dist/cjs/{refset.js → newClasses/refset.js} +18 -3
  32. package/dist/cjs/newClasses/refset.js.map +1 -0
  33. package/dist/cjs/objectextensions.d.ts +7 -6
  34. package/dist/cjs/objectextensions.js +85 -43
  35. package/dist/cjs/objectextensions.js.map +1 -0
  36. package/dist/cjs/reflectextensions.js +16 -12
  37. package/dist/cjs/reflectextensions.js.map +1 -0
  38. package/dist/cjs/stringextensions.js +1 -0
  39. package/dist/cjs/stringextensions.js.map +1 -0
  40. package/dist/cjs/symbolextensions.js +3 -1
  41. package/dist/cjs/symbolextensions.js.map +1 -0
  42. package/dist/cjs/weakrefextensions.js +1 -0
  43. package/dist/cjs/weakrefextensions.js.map +1 -0
  44. package/dist/mjs/arrayextensions.js +1 -0
  45. package/dist/mjs/arrayextensions.js.map +1 -0
  46. package/dist/mjs/functionextensions.js +1 -0
  47. package/dist/mjs/functionextensions.js.map +1 -0
  48. package/dist/mjs/globals.js +2 -1
  49. package/dist/mjs/globals.js.map +1 -0
  50. package/dist/mjs/index.d.ts +10 -19
  51. package/dist/mjs/index.js +67 -60
  52. package/dist/mjs/index.js.map +1 -0
  53. package/dist/mjs/mapextensions.d.ts +2 -0
  54. package/dist/mjs/mapextensions.js +27 -0
  55. package/dist/mjs/mapextensions.js.map +1 -0
  56. package/dist/mjs/newClasses/asyncIterable.d.ts +123 -0
  57. package/dist/mjs/{asyncIterable.js → newClasses/asyncIterable.js} +106 -105
  58. package/dist/mjs/newClasses/asyncIterable.js.map +1 -0
  59. package/dist/mjs/newClasses/descriptor.d.ts +401 -0
  60. package/dist/mjs/{descriptor.js → newClasses/descriptor.js} +129 -67
  61. package/dist/mjs/newClasses/descriptor.js.map +1 -0
  62. package/dist/mjs/newClasses/iterable.d.ts +125 -0
  63. package/dist/mjs/newClasses/iterable.js +199 -0
  64. package/dist/mjs/newClasses/iterable.js.map +1 -0
  65. package/dist/mjs/newClasses/refmap.d.ts +238 -0
  66. package/dist/mjs/newClasses/refmap.js +417 -0
  67. package/dist/mjs/newClasses/refmap.js.map +1 -0
  68. package/dist/mjs/newClasses/refset.d.ts +186 -0
  69. package/dist/mjs/{refset.js → newClasses/refset.js} +17 -3
  70. package/dist/mjs/newClasses/refset.js.map +1 -0
  71. package/dist/mjs/objectextensions.d.ts +7 -6
  72. package/dist/mjs/objectextensions.js +84 -42
  73. package/dist/mjs/objectextensions.js.map +1 -0
  74. package/dist/mjs/reflectextensions.js +16 -12
  75. package/dist/mjs/reflectextensions.js.map +1 -0
  76. package/dist/mjs/stringextensions.js +1 -0
  77. package/dist/mjs/stringextensions.js.map +1 -0
  78. package/dist/mjs/symbolextensions.js +3 -1
  79. package/dist/mjs/symbolextensions.js.map +1 -0
  80. package/dist/mjs/weakrefextensions.js +1 -0
  81. package/dist/mjs/weakrefextensions.js.map +1 -0
  82. package/docs/assets/anchor.js +350 -0
  83. package/docs/assets/bass-addons.css +12 -0
  84. package/docs/assets/bass.css +544 -0
  85. package/docs/assets/fonts/EOT/SourceCodePro-Bold.eot +0 -0
  86. package/docs/assets/fonts/EOT/SourceCodePro-Regular.eot +0 -0
  87. package/docs/assets/fonts/LICENSE.txt +93 -0
  88. package/docs/assets/fonts/OTF/SourceCodePro-Bold.otf +0 -0
  89. package/docs/assets/fonts/OTF/SourceCodePro-Regular.otf +0 -0
  90. package/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf +0 -0
  91. package/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf +0 -0
  92. package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff +0 -0
  93. package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff +0 -0
  94. package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff +0 -0
  95. package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff +0 -0
  96. package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 +0 -0
  97. package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 +0 -0
  98. package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 +0 -0
  99. package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 +0 -0
  100. package/docs/assets/fonts/source-code-pro.css +23 -0
  101. package/docs/assets/github.css +123 -0
  102. package/docs/assets/site.js +168 -0
  103. package/docs/assets/split.css +15 -0
  104. package/docs/assets/split.js +782 -0
  105. package/docs/assets/style.css +147 -0
  106. package/docs/index.html +13060 -0
  107. package/jsdoc-config.json +31 -0
  108. package/package.json +12 -3
  109. package/src/globals.js +1 -1
  110. package/src/index.js +75 -82
  111. package/src/mapextensions.js +30 -0
  112. package/src/{asyncIterable.js → newClasses/asyncIterable.js} +117 -117
  113. package/src/{descriptor.js → newClasses/descriptor.js} +137 -74
  114. package/src/newClasses/iterable.js +221 -0
  115. package/src/newClasses/refmap.js +483 -0
  116. package/src/{refset.js → newClasses/refset.js} +29 -16
  117. package/src/objectextensions.js +97 -46
  118. package/src/reflectextensions.js +16 -14
  119. package/src/symbolextensions.js +2 -1
  120. package/tests/index.test.js +1 -1
  121. package/tests/{asyncIterable.test.js → newClasses/asyncIterable.test.js} +3 -4
  122. package/tests/newClasses/descriptor.test.js +252 -0
  123. package/tests/{iterable.test.js → newClasses/iterable.test.js} +2 -4
  124. package/tests/newClasses/refmap.test.js +69 -0
  125. package/tests/{refset.test.js → newClasses/refset.test.js} +2 -4
  126. package/tests/objectextensions.test.js +128 -0
  127. package/tsconfig.base.json +2 -1
  128. package/dist/@nejs/basic-extensions.bundle.1.5.1.js +0 -2
  129. package/dist/@nejs/basic-extensions.bundle.1.5.1.js.map +0 -7
  130. package/dist/cjs/asyncIterable.d.ts +0 -3
  131. package/dist/cjs/descriptor.d.ts +0 -2
  132. package/dist/cjs/iterable.d.ts +0 -3
  133. package/dist/cjs/refset.d.ts +0 -2
  134. package/dist/mjs/asyncIterable.d.ts +0 -3
  135. package/dist/mjs/descriptor.d.ts +0 -2
  136. package/dist/mjs/iterable.d.ts +0 -3
  137. package/dist/mjs/iterable.js +0 -184
  138. package/dist/mjs/refset.d.ts +0 -2
  139. package/src/iterable.js +0 -203
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refmap.js","sourceRoot":"","sources":["../../../src/newClasses/refmap.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2C;AAC3C,gEAAyD;AACzD,gEAAyD;AACzD,kEAA2D;AAC3D,+CAAkD;AAElD,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,sCAAgB,CAAC,OAAO,CAAA;AACxE,MAAM,EAAE,YAAY,EAAE,GAAG,sCAAgB,CAAC,OAAO,CAAA;AACjD,MAAM,EAAE,gBAAgB,EAAE,GAAG,wCAAiB,CAAC,OAAO,CAAA;AAEtD;;;;;;;;;;;GAWG;AACH,MAAa,MAAO,SAAQ,GAAG;IAS7B,YAAY,GAAG,IAAI;QACjB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QAThB;;;;;WAKG;QACH,kCAAmB,KAAK,EAAA;IAIxB,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CAAC,kBAAkB,GAAG,IAAI;QACpC,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAAA;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,QAAQ;QACN,MAAM,MAAM,GAAG,EAAE,CAAA;QAEjB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAClD,MAAM,QAAQ,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,KAAK,CAAA;YAE1C,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAA;QAC3B,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,eAAe;QACjB,OAAO,uBAAA,IAAI,+BAAiB,CAAA;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AED,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;;OAKG;IACH,CAAC,2CAAC,MAAM,CAAC,QAAQ,EAAC;QAChB,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;IAC9B,CAAC;CACF;AA1cD,wBA0cC;AAEY,QAAA,gBAAgB,GAAG,IAAI,qBAAS,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * RefSet class extends the standard Set object to manage a collection of
3
+ * WeakRef objects. It provides additional functionality such as objectification
4
+ * of values and various utility methods.
5
+ *
6
+ * Unlike standard Sets or Arrays, RefSet stores weak references to objects,
7
+ * allowing them to be garbage-collected if there are no other references to
8
+ * them. This behavior is different from Arrays and standard Sets, which
9
+ * maintain strong references to their elements.
10
+ *
11
+ * @extends Set
12
+ */
13
+ export class RefSet extends Set<any> {
14
+ constructor(values?: readonly any[] | null | undefined);
15
+ constructor(iterable?: Iterable<any> | null | undefined);
16
+ /**
17
+ * Method to control whether the RefSet should objectify its values. When
18
+ * objectifying, primitive values (number, string, boolean, bigint) are
19
+ * converted to their respective object types, which allows them to be used as
20
+ * WeakRef targets.
21
+ *
22
+ * @param {boolean} setObjectification - Flag to enable or disable
23
+ * objectification.
24
+ * @returns {RefSet} - The current RefSet instance to allow method chaining.
25
+ */
26
+ objectifying(setObjectification?: boolean): RefSet;
27
+ /**
28
+ * Setting this value to true, will cause all added values to the Set to
29
+ * be analyzed for validity as a candidate to be wrapped in a `WeakRef`
30
+ * object. If true, and if possible, the object will be turned into an
31
+ * `Object` variant first. This will also enable less rigid variable
32
+ * comparison in the `.has()` method (i.e. `==` instead of `===`).
33
+ *
34
+ * @param {boolean} value - The new state to set for objectifyValues.
35
+ */
36
+ set objectifyValues(value: boolean);
37
+ /**
38
+ * Returns the state indicating whether or not `RefSet` will attempt to
39
+ * convert non-valid primitives into targets that are valid input for
40
+ * new `WeakRef` object instances. If this value is `false` then no
41
+ * *objectification* will occur.
42
+ *
43
+ * @returns {boolean} The current state of objectifyValues.
44
+ */
45
+ get objectifyValues(): boolean;
46
+ /**
47
+ * Overrides the add method of Set. Adds a value to the RefSet, converting it
48
+ * to a WeakRef. Throws an error if the value is not a valid WeakRef target
49
+ * (e.g., null, undefined, or a registered symbol). If `objectifyValues` is
50
+ * enabled, an attempt to convert primitives to their object variants will be
51
+ * made. These are numbers, strings, boolean values and big integers.
52
+ *
53
+ * @param {*} value - The value to be added to the RefSet.
54
+ * @throws {TypeError} If the value is not a valid WeakRef target.
55
+ */
56
+ add(value: any): void;
57
+ /**
58
+ * Adds multiple values to the RefSet. The supplied `values` should be
59
+ * iterable and truthy. This function defers to `.add()` for its logic so
60
+ * each value from the supplied collection of values will also be subject
61
+ * to the criteria of that function.
62
+ *
63
+ * @param {Iterable} values - An iterable of values to add to the RefSet.
64
+ * @throws {TypeError} If the supplied values are falsey or non-iterable.
65
+ */
66
+ addAll(values: Iterable<any>): void;
67
+ /**
68
+ * Removes all elements from the RefSet that have been garbage collected
69
+ * (i.e., their WeakRef no longer points to an object).
70
+ *
71
+ * @returns {RefSet} - The current RefSet instance to allow method chaining.
72
+ */
73
+ clean(): RefSet;
74
+ /**
75
+ * Executes a provided function once for each value in the RefSet. The callback
76
+ * function receives the dereferenced value, the value again (as RefSet doesn't
77
+ * use keys), and the RefSet itself. This method provides a way to iterate over
78
+ * and apply operations to the values stored in the RefSet, taking into account
79
+ * that they are weak references and may have been garbage-collected.
80
+ *
81
+ * @param {Function} forEachFn - Function to execute for each element. It
82
+ * takes three arguments: element, element (again, as RefSet has no key), and
83
+ * the RefSet itself.
84
+ * @param {*} thisArg - Value to use as `this` when executing `forEachFn`.
85
+ */
86
+ entries(): any[][];
87
+ /**
88
+ * Iterate over the items in the set and pass them to the supplied
89
+ * function ala `Array.prototype.forEach`. Note however, there are no
90
+ * indexes on Sets and as such, the index parameter of the callback
91
+ * will always be `NaN`. Subsequently the `array` or third parameter
92
+ * will receive the set instance rather than an array.
93
+ *
94
+ * @param {function} forEachFn the function to use for each element in
95
+ * the set.
96
+ * @param {object} thisArg the `this` argument to be applied to each
97
+ * invocation of the `forEachFn` callback. Note, this value is unable
98
+ * to be applied if the `forEachFn` is a big arrow function
99
+ */
100
+ forEach(forEachFn: Function, thisArg: object): void;
101
+ /**
102
+ * Returns an iterator for the values in the RefSet. Each value is
103
+ * dereferenced from its WeakRef before being returned. This method allows
104
+ * iterating over he set's values, similar to how one would iterate over
105
+ * values in a standard Set or Array, but with the understanding that the
106
+ * values are weakly referenced and may no longer exist (in which case
107
+ * they are skipped).
108
+ *
109
+ * @returns {Iterator} An iterator for the values.
110
+ */
111
+ values(): Iterator<any, any, undefined>;
112
+ /**
113
+ * Returns an iterator for the keys of the RefSet. In RefSet, keys and
114
+ * values are identical, so this method behaves the same as `values()`. It
115
+ * provides compatibility with the standard Set interface and allows use in
116
+ * contexts where keys are expected, despite RefSet not differentiating
117
+ * between keys and values.
118
+ *
119
+ * @returns {Iterator} An iterator for the keys.
120
+ */
121
+ keys(): Iterator<any, any, undefined>;
122
+ /**
123
+ * Checks if the RefSet contains a value that is equal to the specified
124
+ * value. This method is used primarily in objectified RefSets to determine
125
+ * the presence of a value, taking into account objectification. It differs
126
+ * from the `has` method in that it's tailored for sets that have
127
+ * transformed their primitive values into objects, whereas `has` is more
128
+ * general-purpose.
129
+ *
130
+ * @param {*} value - The value to search for in the RefSet.
131
+ * @returns {boolean} - True if the RefSet contains the value, false otherwise.
132
+ */
133
+ contains(value: any): boolean;
134
+ /**
135
+ * Creates a new array with all elements that pass the test implemented by
136
+ * the provided function. This method iterates over each element,
137
+ * dereferences it, and applies the filter function. Unlike Array `filter`,
138
+ * the callback receives the dereferenced value and not an index or array,
139
+ * reflecting the non-indexed nature of RefSet. Useful for selectively
140
+ * creating arrays from the set based on certain conditions, especially when
141
+ * dealing with weak references.
142
+ *
143
+ * @param {Function} filterFn - Function to test each element of the RefSet.
144
+ * The function receives the dereferenced value.
145
+ * @param {*} thisArg - Value to use as `this` when executing `filterFn`.
146
+ * @returns {Array} - A new array with the elements that pass the test.
147
+ */
148
+ filter(filterFn: Function, thisArg: any): any[];
149
+ /**
150
+ * Returns the value of the first element in the RefSet that satisfies the
151
+ * provided testing function. Similar to Array `find`, this method iterates
152
+ * over the RefSet, dereferencing each value and applying the testing
153
+ * function. The non-indexed nature of RefSet is considered, as the
154
+ * callback does not receive an index. This method is useful for finding a
155
+ * specific element based on a condition.
156
+ *
157
+ * @param {*} thisArg - Value to use as this when executing findFn.
158
+ * @returns {*} - The value of the first element in the RefSet that satisfies
159
+ * the testing function, or undefined if none found.
160
+ * @returns {any} the dereferenced value if found, or undefined otherwise
161
+ */
162
+ find(findFn: any, thisArg: any): any;
163
+ /**
164
+ * Creates a new array or `RefSet` with the results of calling a provided
165
+ * function on every element in the calling `RefSet`. This method dereferences
166
+ * each value, applies the `mapFn`, and collects the results. If `toRefSet` is
167
+ * `true`, a new `RefSet` is returned; otherwise, an array. This method
168
+ * differs from `Array.map` in handling weak references and the potential to
169
+ * return a new `RefSet` instead of an array.
170
+ *
171
+ * @param {Function} mapFn - Function that produces an element of the new
172
+ * array or `RefSet`, taking three arguments.
173
+ * @param {*} thisArg - Value to use as this when executing mapFn.
174
+ * @param {boolean} toRefSet - Determines if the output should be a new
175
+ * `RefSet` (`true`) or an array (`false`).
176
+ * @param {boolean} mirrorObjectification - If `true` and `toRefSet` is
177
+ * `true`, the new `RefSet` mirrors the objectification setting of the
178
+ * original.
179
+ * @returns {Array|RefSet} - A new array or `RefSet` with each element being
180
+ * the result of the `mapFn`.
181
+ */
182
+ map(mapFn: Function, thisArg: any, toRefSet: boolean, mirrorObjectification: boolean): any[] | RefSet;
183
+ #private;
184
+ }
185
+ export const RefSetExtensions: Extension;
186
+ import { Extension } from '@nejs/extension';
@@ -12,7 +12,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
12
12
  };
13
13
  var _RefSet_instances, _RefSet_objectifyValues, _RefSet_validWeakRefTarget;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.RefSetExtensions = void 0;
15
+ exports.RefSetExtensions = exports.RefSet = void 0;
16
16
  const extension_1 = require("@nejs/extension");
17
17
  /**
18
18
  * RefSet class extends the standard Set object to manage a collection of
@@ -163,11 +163,24 @@ class RefSet extends Set {
163
163
  * @param {*} thisArg - Value to use as `this` when executing `forEachFn`.
164
164
  */
165
165
  entries() {
166
- const refEntries = super.entries();
166
+ const refEntries = Array.from(super.entries());
167
167
  return refEntries
168
168
  .map(([_, ref]) => [ref.deref(), ref.deref()])
169
169
  .filter(([_, value]) => !!value);
170
170
  }
171
+ /**
172
+ * Iterate over the items in the set and pass them to the supplied
173
+ * function ala `Array.prototype.forEach`. Note however, there are no
174
+ * indexes on Sets and as such, the index parameter of the callback
175
+ * will always be `NaN`. Subsequently the `array` or third parameter
176
+ * will receive the set instance rather than an array.
177
+ *
178
+ * @param {function} forEachFn the function to use for each element in
179
+ * the set.
180
+ * @param {object} thisArg the `this` argument to be applied to each
181
+ * invocation of the `forEachFn` callback. Note, this value is unable
182
+ * to be applied if the `forEachFn` is a big arrow function
183
+ */
171
184
  forEach(forEachFn, thisArg) {
172
185
  const set = this;
173
186
  super.forEach(function (ref) {
@@ -290,7 +303,7 @@ class RefSet extends Set {
290
303
  * @param {*} thisArg - Value to use as this when executing findFn.
291
304
  * @returns {*} - The value of the first element in the RefSet that satisfies
292
305
  * the testing function, or undefined if none found.
293
- * @returns
306
+ * @returns {any} the dereferenced value if found, or undefined otherwise
294
307
  */
295
308
  find(findFn, thisArg) {
296
309
  for (const value of this) {
@@ -366,9 +379,11 @@ class RefSet extends Set {
366
379
  return this.constructor.name;
367
380
  }
368
381
  }
382
+ exports.RefSet = RefSet;
369
383
  _RefSet_validWeakRefTarget = function _RefSet_validWeakRefTarget(value) {
370
384
  return !((typeof value === 'symbol' && Symbol.keyFor(value) === undefined) ||
371
385
  (typeof value !== 'object' && typeof value !== 'symbol') ||
372
386
  (value === null || value === undefined));
373
387
  };
374
388
  exports.RefSetExtensions = new extension_1.Extension(RefSet);
389
+ //# sourceMappingURL=refset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refset.js","sourceRoot":"","sources":["../../../src/newClasses/refset.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C;;;;;;;;;;;GAWG;AACH,MAAa,MAAO,SAAQ,GAAG;IAA/B;;;QACE;;;;;WAKG;QACH,kCAAmB,KAAK;QAExB;;;;;;;;;WASG;UAXqB;IAmZ1B,CAAC;IAjZC;;;;;;;;;OASG;IACH,YAAY,CAAC,kBAAkB,GAAG,IAAI;QACpC,IAAI,CAAC,eAAe,GAAG,kBAAkB,CAAA;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,eAAe;QACjB,OAAO,uBAAA,IAAI,+BAAiB,CAAA;IAC9B,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,eAAe,CAAC,KAAK;QACvB,uBAAA,IAAI,2BAAoB,CAAC,CAAC,KAAK,MAAA,CAAA;IACjC,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAC,KAAK;QACP,gCAAgC;QAChC,IAAI,uBAAA,IAAI,+BAAiB,IAAI,CAC3B,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,SAAS;YAC1B,OAAO,KAAK,KAAK,QAAQ,CAC1B,EAAE,CAAC;YACF,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;QAED,oFAAoF;QACpF,IAAI,OAAO,KAAK,KAAK,QAAQ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E,CAAC;gBACnC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnC,OAAO,uBAAA,IAAI,qDAAoB,MAAxB,IAAI,EAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAChE,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAA;YACpB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;;;OAKG;IACH,IAAI,8EAAC,MAAM,CAAC,WAAW,EAAC;QACtB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;IAC9B,CAAC;CAiBF;AA1ZD,wBA0ZC;iEAPqB,KAAK;IACvB,OAAO,CAAC,CACN,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;QACjE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;QACxD,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CACxC,CAAA;AACH,CAAC;AAGU,QAAA,gBAAgB,GAAG,IAAI,qBAAS,CAAC,MAAM,CAAC,CAAA"}
@@ -1,10 +1,11 @@
1
1
  /**
2
- * `ObjectExtensions` is a patch for the JavaScript built-in `Object` class. It
3
- * adds utility methods to the `Object` class without modifying the global namespace
4
- * directly. This patch includes methods for key validation, object type checking,
5
- * and retrieving the string tag of an object. These methods are useful for
6
- * enhancing the capabilities of the standard `Object` class with additional
7
- * utility functions.
2
+ * `ObjectExtensions` is a patch for the JavaScript built-in `Object` class.
3
+ * It adds utility methods to the `Object` class without modifying the global
4
+ * namespace directly. This patch includes methods for key validation, object
5
+ * type checking, and retrieving the string tag of an object. These methods
6
+ * are useful for enhancing the capabilities of the standard `Object` class
7
+ * with additional utility functions.
8
8
  */
9
9
  export const ObjectExtensions: Patch;
10
+ export const ObjectPrototypeExtensions: Patch;
10
11
  import { Patch } from '@nejs/extension';
@@ -1,16 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ObjectExtensions = void 0;
3
+ exports.ObjectPrototypeExtensions = exports.ObjectExtensions = void 0;
4
4
  const extension_1 = require("@nejs/extension");
5
5
  /**
6
- * `ObjectExtensions` is a patch for the JavaScript built-in `Object` class. It
7
- * adds utility methods to the `Object` class without modifying the global namespace
8
- * directly. This patch includes methods for key validation, object type checking,
9
- * and retrieving the string tag of an object. These methods are useful for
10
- * enhancing the capabilities of the standard `Object` class with additional
11
- * utility functions.
6
+ * `ObjectExtensions` is a patch for the JavaScript built-in `Object` class.
7
+ * It adds utility methods to the `Object` class without modifying the global
8
+ * namespace directly. This patch includes methods for key validation, object
9
+ * type checking, and retrieving the string tag of an object. These methods
10
+ * are useful for enhancing the capabilities of the standard `Object` class
11
+ * with additional utility functions.
12
12
  */
13
13
  exports.ObjectExtensions = new extension_1.Patch(Object, {
14
+ /**
15
+ * The function checks if a value is either `undefined` or `null`.
16
+ *
17
+ * @param {any} value - The parameter "value" is a variable that can hold
18
+ * any value.
19
+ * @returns {boolean} `true` if the value is either `undefined` or `null`,
20
+ * and `false` otherwise.
21
+ */
22
+ isNullDefined(value) {
23
+ return value === undefined || value === null;
24
+ },
14
25
  /**
15
26
  * Checks to see if the supplied `value` is both an object, and has the
16
27
  * appropriate symbol defined.
@@ -23,18 +34,25 @@ exports.ObjectExtensions = new extension_1.Patch(Object, {
23
34
  return Object.isObject(value) && Reflect.has(value, Symbol.toStringTag);
24
35
  },
25
36
  /**
26
- * Retrieves the string tag of an object. The string tag is a representation of
27
- * the object's type, as defined by its `Object.prototype.toString` method. This
28
- * utility method is helpful for getting a more descriptive type of an object than
29
- * what is returned by the `typeof` operator, especially for custom objects.
37
+ * Retrieves the string tag of an object. The string tag is a representation
38
+ * of the object's type, as defined by its `Object.prototype.toString`
39
+ * method. This utility method is helpful for getting a more descriptive
40
+ * type of an object than what is returned by the `typeof` operator,
41
+ * especially for custom objects.
30
42
  *
31
43
  * @param {*} value - The object whose string tag is to be retrieved.
44
+ * @param {boolean} strict - if this is set to true, undefined will be
45
+ * returned whenever a supplied object does not have a
46
+ * `Symbol.toStringTag` defined, period. if false, the default,
32
47
  * @returns {string} - The string tag of the object, indicating its type.
33
48
  */
34
- getStringTag(value) {
49
+ getStringTag(value, strict = false) {
35
50
  if (Object.hasStringTag(value)) {
36
51
  return value[Symbol.toStringTag];
37
52
  }
53
+ if (strict) {
54
+ return undefined;
55
+ }
38
56
  if (value && (typeof value === 'function')) {
39
57
  return value.name;
40
58
  }
@@ -52,13 +70,13 @@ exports.ObjectExtensions = new extension_1.Patch(Object, {
52
70
  *
53
71
  * @param {any} value - The value whose type is to be determined.
54
72
  * @param {object} [owner=globalThis] - The object in which to look up the
55
- * constructor corresponding to the string tag. Defaults to `globalThis`, which
56
- * covers global constructors like `Array`, `Object`, etc.
57
- * @returns {Function|object|null|undefined} - Returns the constructor or type
58
- * of the value based on its string tag. For 'Null' and 'Undefined', it returns
59
- * `null` and `undefined`, respectively. For other types, it returns the
60
- * corresponding constructor (e.g., `Array` for arrays) if available in the
61
- * `owner` object.
73
+ * constructor corresponding to the string tag. Defaults to `globalThis`,
74
+ * which covers global constructors like `Array`, `Object`, etc.
75
+ * @returns {Function|object|null|undefined} - Returns the constructor or
76
+ * type of the value based on its string tag. For 'Null' and 'Undefined',
77
+ * it returns `null` and `undefined`, respectively. For other types, it
78
+ * returns the corresponding constructor (e.g., `Array` for arrays) if
79
+ * available in the `owner` object.
62
80
  */
63
81
  getType(value, owner = globalThis) {
64
82
  const stringTag = Object.getStringTag(value);
@@ -70,13 +88,14 @@ exports.ObjectExtensions = new extension_1.Patch(Object, {
70
88
  }
71
89
  },
72
90
  /**
73
- * Determines if the provided value is an object. This method checks whether the
74
- * value is an instance of `Object` or if its type is 'object'. It's a utility
75
- * method for type-checking, ensuring that a value is an object before performing
76
- * operations that are specific to objects.
91
+ * Determines if the provided value is an object. This method checks whether
92
+ * the value is an instance of `Object` or if its type is 'object'. It's a
93
+ * utility method for type-checking, ensuring that a value is an object
94
+ * before performing operations that are specific to objects.
77
95
  *
78
96
  * @param {*} value - The value to be checked.
79
- * @returns {boolean} - Returns `true` if the value is an object, otherwise `false`.
97
+ * @returns {boolean} - Returns `true` if the value is an object,
98
+ * otherwise `false`.
80
99
  */
81
100
  isObject(value) {
82
101
  return value && (value instanceof Object || typeof value === 'object');
@@ -108,13 +127,14 @@ exports.ObjectExtensions = new extension_1.Patch(Object, {
108
127
  }
109
128
  },
110
129
  /**
111
- * Checks if the given value is a valid key for an object. In JavaScript, a valid
112
- * key can be either a string or a symbol. This method is useful for validating
113
- * object keys before using them in operations like setting or getting object properties.
130
+ * Checks if the given value is a valid key for an object. In JavaScript, a
131
+ * valid key can be either a string or a symbol. This method is useful for
132
+ * validating object keys before using them in operations like setting or
133
+ * getting object properties.
114
134
  *
115
135
  * @param {*} value - The value to be checked.
116
- * @returns {boolean} - Returns `true` if the value is a valid object key (string or symbol),
117
- * otherwise `false`.
136
+ * @returns {boolean} - Returns `true` if the value is a valid object key
137
+ * (string or symbol), otherwise `false`.
118
138
  */
119
139
  isValidKey(value) {
120
140
  return (typeof value === 'string' || typeof value === 'symbol');
@@ -126,33 +146,55 @@ exports.ObjectExtensions = new extension_1.Patch(Object, {
126
146
  * @param {object} object the object to pare down
127
147
  * @param {Array<string|symbol>} keys the keys that should appear in the
128
148
  * final reduced object
129
- * @param {boolean} [bindAccessors = true] if this value is true
130
- * then any accessors from the source object will continue to have their
131
- * `this` value bound to the source. If the getter or setter on that object
132
- * is defined using an arrow function, this will not work as intended.
133
- * @returns {object} an object containing only the keys and symbols specified
134
- * in the `keys` parameter.
149
+ * @param {boolean} [bindAccessors = true] if this value is true then any
150
+ * accessors from the source object will continue to have their `this`
151
+ * value bound to the source. If the getter or setter on that object is
152
+ * defined using an arrow function, this will not work as intended.
153
+ * @returns {object} an object containing only the keys and symbols
154
+ * specified in the `keys` parameter.
135
155
  */
136
156
  stripTo(object, keys, bindAccessors = true) {
157
+ if (!object || typeof object !== 'object') {
158
+ throw new TypeError('Object.stripTo requires an object to strip. Received', object);
159
+ }
137
160
  const result = {};
138
161
  if (!Array.isArray(keys)) {
139
162
  return result;
140
163
  }
141
164
  for (let key of keys) {
142
165
  if (Reflect.has(object, key)) {
143
- const descriptor = Object.getOwnPropertyDescriptor(object, key);
144
- if (Reflect.has(descriptor, 'get') || Reflect.has(descriptor, 'set')) {
166
+ const originalDescriptor = Object.getOwnPropertyDescriptor(object, key);
167
+ const descriptor = { ...originalDescriptor };
168
+ if (typeof descriptor.get === 'function' ||
169
+ typeof descriptor.set === 'function') {
145
170
  if (bindAccessors) {
146
- descriptor.get = descriptor?.get?.bind(object);
147
- descriptor.set = descriptor?.set?.bind(object);
171
+ descriptor.get = descriptor.get?.bind(object);
172
+ descriptor.set = descriptor.set?.bind(object);
148
173
  }
149
- Object.defineProperty(result, descriptor);
150
- }
151
- else {
152
- Object.defineProperty(result, descriptor);
153
174
  }
175
+ Object.defineProperty(result, key, descriptor);
154
176
  }
155
177
  }
156
178
  return result;
157
179
  },
158
180
  });
181
+ exports.ObjectPrototypeExtensions = new extension_1.Patch(Object.prototype, {
182
+ /**
183
+ * Strips an object down to only the keys specified. Optionally, any
184
+ * accessors can be made to retain their context on the source object.
185
+ * This is a passthrough to the static {@link Object.stripTo} function
186
+ *
187
+ * @param {Array<string|symbol>} keys the keys that should appear in the
188
+ * final reduced object
189
+ * @param {boolean} [bindAccessors = true] if this value is true then any
190
+ * accessors from the source object will continue to have their `this`
191
+ * value bound to the source. If the getter or setter on that object is
192
+ * defined using an arrow function, this will not work as intended.
193
+ * @returns {object} an object containing only the keys and symbols
194
+ * specified in the `keys` parameter.
195
+ */
196
+ stripTo(keys, bindAccessors = true) {
197
+ return Object.stripTo(this, keys, bindAccessors);
198
+ }
199
+ });
200
+ //# sourceMappingURL=objectextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectextensions.js","sourceRoot":"","sources":["../../src/objectextensions.js"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC;;;;;;;GAOG;AACU,QAAA,gBAAgB,GAAG,IAAI,iBAAK,CAAC,MAAM,EAAE;IAChD;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK;QACjB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAA;IAC9C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,KAAK;QAChB,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IACzE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK;QAChC,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QAClC,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC,IAAI,CAAA;QACnB,CAAC;QAED,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU;QAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAE5C,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,MAAM,CAAC,CAAC,OA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,CAAC;YACrB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;gBAC7B,MAAM,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBACxE,MAAM,UAAU,GAAG,EAAE,GAAG,kBAAkB,EAAE,CAAC;gBAE7C,IACE,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU;oBACpC,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU,EACpC,CAAC;oBACD,IAAI,aAAa,EAAE,CAAC;wBAClB,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;wBAC9C,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;oBAChD,CAAC;gBACH,CAAC;gBAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAI,iBAAK,CAAC,MAAM,CAAC,SAAS,EAAE;IACnE;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;QAChC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;IAClD,CAAC;CACF,CAAC,CAAA"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReflectExtensions = void 0;
4
4
  const extension_1 = require("@nejs/extension");
5
5
  const objectextensions_js_1 = require("./objectextensions.js");
6
+ const { isObject } = objectextensions_js_1.ObjectExtensions.patches;
6
7
  /**
7
8
  * The `ReflectExtensions` class is a patch applied to the built-in JavaScript
8
9
  * `Reflect` object. It extends `Reflect` with additional utility methods that
@@ -31,23 +32,25 @@ exports.ReflectExtensions = new extension_1.Patch(Reflect, {
31
32
  .map(key => Reflect.has(object, key))
32
33
  .every(has => has));
33
34
  },
35
+ /**
36
+ * Fetches all descriptors of an object, including those mapped to a
37
+ * symbol descriptor value.
38
+ *
39
+ * @param {object} object the object from whose descriptors need to be
40
+ * retrieved.
41
+ * @returns {object} with keys mapped to object descriptors
42
+ * @throws {TypeError} if the supplied `object` is null or not an object
43
+ * a TypeError exception will be thrown
44
+ */
34
45
  ownDescriptors(object) {
35
- const result = {};
36
- const revertOnDone = () => revertOnDone.doIt ? objectextensions_js_1.ObjectExtensions.revert() : '';
37
- revertOnDone.doIt = false;
38
- if (!Object.isObject) {
39
- revertOnDone.doIt = true;
40
- objectextensions_js_1.ObjectExtensions.apply();
41
- }
42
- if (!Object.isObject(object)) {
43
- revertOnDone();
44
- return {};
46
+ if (!isObject(object)) {
47
+ throw new TypeError('The supplied object must be non-null and an object');
45
48
  }
49
+ const result = {};
46
50
  const keys = Reflect.ownKeys(object);
47
51
  for (const key of keys) {
48
52
  result[key] = Object.getOwnPropertyDescriptor(key);
49
53
  }
50
- revertOnDone();
51
54
  return result;
52
55
  },
53
56
  /**
@@ -62,7 +65,7 @@ exports.ReflectExtensions = new extension_1.Patch(Reflect, {
62
65
  * at least one of the keys provided as arguments exists in the given object.
63
66
  */
64
67
  hasSome(object, ...keys) {
65
- return Object.isObject(object) && (keys.flat(Infinity)
68
+ return isObject(object) && (keys.flat(Infinity)
66
69
  .map(key => Reflect.has(object, key))
67
70
  .some(has => has));
68
71
  },
@@ -105,3 +108,4 @@ exports.ReflectExtensions = new extension_1.Patch(Reflect, {
105
108
  return Reflect.entries.map(([, value]) => value);
106
109
  }
107
110
  });
111
+ //# sourceMappingURL=reflectextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflectextensions.js","sourceRoot":"","sources":["../../src/reflectextensions.js"],"names":[],"mappings":";;;AAAA,+CAAuC;AACvC,+DAAwD;AAExD,MAAM,EAA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;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM;QACZ,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAAC,OAAO,EAAE,CAAA;QAAC,CAAC;QAExD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,GAAG,EAAE,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC;SAClD,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC;CACF,CAAC,CAAA"}
@@ -25,3 +25,4 @@ exports.StringExtensions = new extension_1.Patch(String, {
25
25
  return false;
26
26
  },
27
27
  });
28
+ //# sourceMappingURL=stringextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringextensions.js","sourceRoot":"","sources":["../../src/stringextensions.js"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC;;;;;;;GAOG;AACU,QAAA,gBAAgB,GAAG,IAAI,iBAAK,CAAC,MAAM,EAAE;IAChD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK;QACZ,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACzB,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAC,CAAC"}
@@ -59,9 +59,11 @@ exports.SymbolExtensions = new extension_1.Patch(Symbol, {
59
59
  * spec static symbols (`toStringTag`, `iterator`, etc...), and any symbols
60
60
  * created by passing a value directly to the `Symbol` function, such as
61
61
  * `Symbol('name')`
62
- * @returns
62
+ * @returns true if the `value` in question is both a `symbol` and has
63
+ * returns `undefined` if passed to `Symbol.keyFor`
63
64
  */
64
65
  isNonRegistered(value, allowOnlySymbols = false) {
65
66
  return !Symbol.isRegistered(value, allowOnlySymbols);
66
67
  },
67
68
  });
69
+ //# sourceMappingURL=symbolextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbolextensions.js","sourceRoot":"","sources":["../../src/symbolextensions.js"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC;;;;;;;GAOG;AACU,QAAA,gBAAgB,GAAG,IAAI,iBAAK,CAAC,MAAM,EAAE;IAChD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK;QACZ,OAAO,KAAK,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK;QAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,IAAI,gBAAgB,EAAE,CAAC;gBACrB,MAAM,IAAI,SAAS,CAAC,mDAAmD,CAAC,CAAA;YAC1E,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAAA;IAC3C,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK;QAC7C,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;IACtD,CAAC;CACF,CAAC,CAAC"}
@@ -16,3 +16,4 @@ exports.WeakRefExtensions = new extension_1.Patch(WeakRef, {
16
16
  (value === null || value === undefined));
17
17
  },
18
18
  });
19
+ //# sourceMappingURL=weakrefextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weakrefextensions.js","sourceRoot":"","sources":["../../src/weakrefextensions.js"],"names":[],"mappings":";;;AAAA,+CAAuC;AAE1B,QAAA,iBAAiB,GAAG,IAAI,iBAAK,CAAC,OAAO,EAAE;IAClD;;;;;;OAMG;IACH,gBAAgB,CAAC,KAAK;QACpB,OAAO,CAAC,CACN,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;YACjE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;YACxD,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CACxC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -65,3 +65,4 @@ export const ArrayPrototypeExtensions = new Patch(Array.prototype, {
65
65
  return this[this.length - 1];
66
66
  },
67
67
  });
68
+ //# sourceMappingURL=arrayextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayextensions.js","sourceRoot":"","sources":["../../src/arrayextensions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE;IACjE;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;IAC9C,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;QAC9B,MAAM,KAAK,GAAG,CAAC,CAAA;QAEf,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBACzB,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;CAEF,CAAC,CAAA"}
@@ -84,3 +84,4 @@ export const FunctionExtensions = new Patch(Function, {
84
84
  !Reflect.has(value, 'prototype'));
85
85
  },
86
86
  });
87
+ //# sourceMappingURL=functionextensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionextensions.js","sourceRoot":"","sources":["../../src/functionextensions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE;IACpD;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAK;QACX,OAAO,KAAK,YAAY,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACtE,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU,CAAC,KAAK;QACd,OAAO,KAAK,YAAY,QAAQ,CAAC;IACnC,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,KAAK;QACX,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1E,OAAO,CACL,KAAK,YAAY,QAAQ;YACzB,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAC5B,CAAA;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CAAC,KAAK;QACd,OAAO,CACL,KAAK,YAAY,QAAQ;YACzB,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;YAClC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CACjC,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,KAAK;QACX,OAAO,CACL,KAAK,YAAY,QAAQ;YACzB,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;YACjC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CACjC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Patch } from '@nejs/extension';
2
2
  import { FunctionExtensions } from './functionextensions.js';
3
- const { isClass, isFunction } = FunctionExtensions.patchEntries.isClass.computed;
3
+ const { isClass, isFunction } = FunctionExtensions.patches;
4
4
  const CustomInspect = Symbol.for('nodejs.util.inspect.custom');
5
5
  export const GlobalFunctionsAndProps = new Patch(globalThis, {
6
6
  /**
@@ -160,3 +160,4 @@ export const GlobalFunctionsAndProps = new Patch(globalThis, {
160
160
  return options;
161
161
  },
162
162
  });
163
+ //# sourceMappingURL=globals.js.map