@nestia/e2e 7.4.0 → 8.0.0-dev.20250829-2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TestValidator.js","sourceRoot":"","sources":["../src/TestValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAoD;AACpD,0DAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,IAAiB,aAAa,CAinB7B;AAjnBD,WAAiB,aAAa;;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACU,uBAAS,GACpB,UAAC,KAAa;QACd,OAAA,UACE,SAAY;YAEZ,IAAM,OAAO,GAAG;gBACd,OAAA,iBAAU,KAAK,2CAAwC;YAAvD,CAAuD,CAAC;YAE1D,SAAS;YACT,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE,CAAC;gBACnC,IAAI,SAAS,KAAK,IAAI;oBAAE,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBACnD,OAAO,SAAgB,CAAC;YAC1B,CAAC;YAED,UAAU;YACV,IAAM,MAAM,GAA+B,SAAS,EAAE,CAAC;YACvD,IAAI,OAAO,MAAM,KAAK,SAAS,EAAE,CAAC;gBAChC,IAAI,MAAM,KAAK,IAAI;oBAAE,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAChD,OAAO,SAAgB,CAAC;YAC1B,CAAC;YAED,eAAe;YACf,OAAO,IAAI,OAAO,CAAO,UAAC,OAAO,EAAE,MAAM;gBACvC,MAAM;qBACH,IAAI,CAAC,UAAC,IAAI;oBACT,IAAI,IAAI,KAAK,IAAI;wBAAE,OAAO,EAAE,CAAC;;wBACxB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;gBACzB,CAAC,CAAC;q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CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/lib/module.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./ArrayUtil";
2
+ export * from "./MapUtil";
3
+ export * from "./RandomGenerator";
2
4
  export * from "./DynamicExecutor";
3
5
  export * from "./GaffComparator";
4
- export * from "./RandomGenerator";
5
6
  export * from "./TestValidator";
package/lib/module.js CHANGED
@@ -15,8 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ArrayUtil"), exports);
18
+ __exportStar(require("./MapUtil"), exports);
19
+ __exportStar(require("./RandomGenerator"), exports);
18
20
  __exportStar(require("./DynamicExecutor"), exports);
19
21
  __exportStar(require("./GaffComparator"), exports);
20
- __exportStar(require("./RandomGenerator"), exports);
21
22
  __exportStar(require("./TestValidator"), exports);
22
23
  //# sourceMappingURL=module.js.map
package/lib/module.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,kDAAgC"}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,oDAAkC;AAElC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/e2e",
3
- "version": "7.4.0",
3
+ "version": "8.0.0-dev.20250829-2",
4
4
  "description": "E2E test utilify functions",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
package/src/ArrayUtil.ts CHANGED
@@ -3,15 +3,15 @@
3
3
  *
4
4
  * This namespace contains utility functions for array operations including
5
5
  * asynchronous processing, filtering, mapping, and repetition tasks implemented
6
- * in functional programming style. All functions are implemented using currying
7
- * to enhance reusability and composability.
6
+ * in functional programming style. Functions use direct parameter passing for
7
+ * simplicity while maintaining functional programming principles.
8
8
  *
9
9
  * @author Jeongho Nam - https://github.com/samchon
10
10
  * @example
11
11
  * ```typescript
12
12
  * // Asynchronous filtering example
13
13
  * const numbers = [1, 2, 3, 4, 5];
14
- * const evenNumbers = await ArrayUtil.asyncFilter(numbers)(
14
+ * const evenNumbers = await ArrayUtil.asyncFilter(numbers,
15
15
  * async (num) => num % 2 === 0
16
16
  * );
17
17
  * console.log(evenNumbers); // [2, 4]
@@ -22,9 +22,9 @@ export namespace ArrayUtil {
22
22
  * Filters an array by applying an asynchronous predicate function to each
23
23
  * element.
24
24
  *
25
- * This function is implemented in curried form, first taking an array and
26
- * then a predicate function. Elements are processed sequentially, ensuring
27
- * order is maintained.
25
+ * Elements are processed sequentially, ensuring order is maintained. The
26
+ * predicate function receives the element, index, and the full array as
27
+ * parameters.
28
28
  *
29
29
  * @example
30
30
  * ```typescript
@@ -34,7 +34,7 @@ export namespace ArrayUtil {
34
34
  * { id: 3, name: 'Charlie', active: true }
35
35
  * ];
36
36
  *
37
- * const activeUsers = await ArrayUtil.asyncFilter(users)(
37
+ * const activeUsers = await ArrayUtil.asyncFilter(users,
38
38
  * async (user) => {
39
39
  * // Async validation logic (e.g., API call)
40
40
  * await new Promise(resolve => setTimeout(resolve, 100));
@@ -46,25 +46,24 @@ export namespace ArrayUtil {
46
46
  *
47
47
  * @template Input - The type of elements in the input array
48
48
  * @param elements - The readonly array to filter
49
- * @returns A function that takes a predicate and returns a Promise resolving
50
- * to the filtered array
49
+ * @param pred - The asynchronous predicate function to test each element
50
+ * @returns A Promise resolving to the filtered array
51
51
  */
52
- export const asyncFilter =
53
- <Input>(elements: readonly Input[]) =>
54
- async (
55
- pred: (
56
- elem: Input,
57
- index: number,
58
- array: readonly Input[],
59
- ) => Promise<boolean>,
60
- ): Promise<Input[]> => {
61
- const ret: Input[] = [];
62
- await asyncForEach(elements)(async (elem, index, array) => {
63
- const flag: boolean = await pred(elem, index, array);
64
- if (flag === true) ret.push(elem);
65
- });
66
- return ret;
67
- };
52
+ export const asyncFilter = async <Input>(
53
+ elements: readonly Input[],
54
+ pred: (
55
+ elem: Input,
56
+ index: number,
57
+ array: readonly Input[],
58
+ ) => Promise<boolean>,
59
+ ): Promise<Input[]> => {
60
+ const ret: Input[] = [];
61
+ await asyncForEach(elements, async (elem, index, array) => {
62
+ const flag: boolean = await pred(elem, index, array);
63
+ if (flag === true) ret.push(elem);
64
+ });
65
+ return ret;
66
+ };
68
67
 
69
68
  /**
70
69
  * Executes an asynchronous function for each element in an array
@@ -79,7 +78,7 @@ export namespace ArrayUtil {
79
78
  * ```typescript
80
79
  * const urls = ['url1', 'url2', 'url3'];
81
80
  *
82
- * await ArrayUtil.asyncForEach(urls)(async (url, index) => {
81
+ * await ArrayUtil.asyncForEach(urls, async (url, index) => {
83
82
  * console.log(`Processing ${index}: ${url}`);
84
83
  * const data = await fetch(url);
85
84
  * await processData(data);
@@ -90,21 +89,21 @@ export namespace ArrayUtil {
90
89
  *
91
90
  * @template Input - The type of elements in the input array
92
91
  * @param elements - The readonly array to process
93
- * @returns A function that takes an async closure and returns a Promise<void>
92
+ * @param closure - The asynchronous function to execute for each element
93
+ * @returns A Promise<void> that resolves when all operations complete
94
94
  */
95
- export const asyncForEach =
96
- <Input>(elements: readonly Input[]) =>
97
- async (
98
- closure: (
99
- elem: Input,
100
- index: number,
101
- array: readonly Input[],
102
- ) => Promise<any>,
103
- ): Promise<void> => {
104
- await asyncRepeat(elements.length)((index) =>
105
- closure(elements[index], index, elements),
106
- );
107
- };
95
+ export const asyncForEach = async <Input>(
96
+ elements: readonly Input[],
97
+ closure: (
98
+ elem: Input,
99
+ index: number,
100
+ array: readonly Input[],
101
+ ) => Promise<any>,
102
+ ): Promise<void> => {
103
+ await asyncRepeat(elements.length, (index) =>
104
+ closure(elements[index], index, elements),
105
+ );
106
+ };
108
107
 
109
108
  /**
110
109
  * Transforms each element of an array using an asynchronous function to
@@ -112,7 +111,8 @@ export namespace ArrayUtil {
112
111
  *
113
112
  * Similar to JavaScript's native map but processes asynchronous functions
114
113
  * sequentially. Each element's transformation is completed before proceeding
115
- * to the next element, ensuring order is maintained.
114
+ * to the next element, ensuring order is maintained. This function still
115
+ * maintains the currying pattern for composition.
116
116
  *
117
117
  * @example
118
118
  * ```typescript
@@ -129,27 +129,25 @@ export namespace ArrayUtil {
129
129
  * ```
130
130
  *
131
131
  * @template Input - The type of elements in the input array
132
- * @template Output - The type of elements in the output array
133
132
  * @param elements - The readonly array to transform
134
133
  * @returns A function that takes a transformation function and returns a
135
134
  * Promise resolving to the transformed array
136
135
  */
137
- export const asyncMap =
138
- <Input>(elements: readonly Input[]) =>
139
- async <Output>(
140
- closure: (
141
- elem: Input,
142
- index: number,
143
- array: readonly Input[],
144
- ) => Promise<Output>,
145
- ): Promise<Output[]> => {
146
- const ret: Output[] = [];
147
- await asyncForEach(elements)(async (elem, index, array) => {
148
- const output: Output = await closure(elem, index, array);
149
- ret.push(output);
150
- });
151
- return ret;
152
- };
136
+ export const asyncMap = async <Input, Output>(
137
+ elements: readonly Input[],
138
+ closure: (
139
+ elem: Input,
140
+ index: number,
141
+ array: readonly Input[],
142
+ ) => Promise<Output>,
143
+ ): Promise<Output[]> => {
144
+ const ret: Output[] = [];
145
+ await asyncForEach(elements, async (elem, index, array) => {
146
+ const output: Output = await closure(elem, index, array);
147
+ ret.push(output);
148
+ });
149
+ return ret;
150
+ };
153
151
 
154
152
  /**
155
153
  * Executes an asynchronous function a specified number of times sequentially.
@@ -161,7 +159,7 @@ export namespace ArrayUtil {
161
159
  * @example
162
160
  * ```typescript
163
161
  * // Generate random data 5 times
164
- * const randomData = await ArrayUtil.asyncRepeat(5)(async (index) => {
162
+ * const randomData = await ArrayUtil.asyncRepeat(5, async (index) => {
165
163
  * await new Promise(resolve => setTimeout(resolve, 100)); // Wait 0.1 seconds
166
164
  * return {
167
165
  * id: index,
@@ -172,29 +170,26 @@ export namespace ArrayUtil {
172
170
  * console.log('Generated data:', randomData);
173
171
  * ```;
174
172
  *
173
+ * @template T - The type of the result from each execution
175
174
  * @param count - The number of times to repeat (non-negative integer)
176
- * @returns A function that takes an async closure and returns a Promise
177
- * resolving to an array of results
175
+ * @param closure - The asynchronous function to execute repeatedly
176
+ * @returns A Promise resolving to an array of results
178
177
  */
179
- export const asyncRepeat =
180
- (count: number) =>
181
- async <T>(closure: (index: number) => Promise<T>): Promise<T[]> => {
182
- const indexes: number[] = new Array(count)
183
- .fill(1)
184
- .map((_, index) => index);
185
-
186
- const output: T[] = [];
187
- for (const index of indexes) output.push(await closure(index));
188
-
189
- return output;
190
- };
178
+ export const asyncRepeat = async <T>(
179
+ count: number,
180
+ closure: (index: number) => Promise<T>,
181
+ ): Promise<T[]> => {
182
+ const indexes: number[] = new Array(count).fill(1).map((_, index) => index);
183
+ const output: T[] = [];
184
+ for (const index of indexes) output.push(await closure(index));
185
+ return output;
186
+ };
191
187
 
192
188
  /**
193
189
  * Checks if at least one element in the array satisfies the given condition.
194
190
  *
195
- * Similar to JavaScript's native some() method but implemented in curried
196
- * form for better compatibility with functional programming style. Returns
197
- * true immediately when the first element satisfying the condition is found.
191
+ * Similar to JavaScript's native some() method. Returns true immediately when
192
+ * the first element satisfying the condition is found.
198
193
  *
199
194
  * @example
200
195
  * ```typescript
@@ -205,24 +200,25 @@ export namespace ArrayUtil {
205
200
  * { name: 'Orange', price: 80, inStock: true }
206
201
  * ];
207
202
  *
208
- * const hasEvenNumber = ArrayUtil.has(numbers)(num => num % 2 === 0);
203
+ * const hasEvenNumber = ArrayUtil.has(numbers, num => num % 2 === 0);
209
204
  * console.log(hasEvenNumber); // true (8 exists)
210
205
  *
211
- * const hasExpensiveItem = ArrayUtil.has(products)(product => product.price > 90);
206
+ * const hasExpensiveItem = ArrayUtil.has(products, product => product.price > 90);
212
207
  * console.log(hasExpensiveItem); // true (Apple costs 100)
213
208
  *
214
- * const hasOutOfStock = ArrayUtil.has(products)(product => !product.inStock);
209
+ * const hasOutOfStock = ArrayUtil.has(products, product => !product.inStock);
215
210
  * console.log(hasOutOfStock); // true (Banana is out of stock)
216
211
  * ```;
217
212
  *
218
213
  * @template T - The type of elements in the array
219
214
  * @param elements - The readonly array to check
220
- * @returns A function that takes a predicate and returns a boolean
215
+ * @param pred - The predicate function to test elements
216
+ * @returns Boolean indicating if any element satisfies the condition
221
217
  */
222
- export const has =
223
- <T>(elements: readonly T[]) =>
224
- (pred: (elem: T) => boolean): boolean =>
225
- elements.find(pred) !== undefined;
218
+ export const has = <T>(
219
+ elements: readonly T[],
220
+ pred: (elem: T) => boolean,
221
+ ): boolean => elements.find(pred) !== undefined;
226
222
 
227
223
  /**
228
224
  * Executes a function a specified number of times and collects the results
@@ -234,11 +230,11 @@ export namespace ArrayUtil {
234
230
  * @example
235
231
  * ```typescript
236
232
  * // Generate an array of squares from 1 to 5
237
- * const squares = ArrayUtil.repeat(5)(index => (index + 1) ** 2);
233
+ * const squares = ArrayUtil.repeat(5, index => (index + 1) ** 2);
238
234
  * console.log(squares); // [1, 4, 9, 16, 25]
239
235
  *
240
236
  * // Generate an array of default user objects
241
- * const users = ArrayUtil.repeat(3)(index => ({
237
+ * const users = ArrayUtil.repeat(3, index => ({
242
238
  * id: index + 1,
243
239
  * name: `User${index + 1}`,
244
240
  * email: `user${index + 1}@example.com`
@@ -251,13 +247,15 @@ export namespace ArrayUtil {
251
247
  * // ]
252
248
  * ```
253
249
  *
250
+ * @template T - The type of the result from each execution
254
251
  * @param count - The number of times to repeat (non-negative integer)
255
- * @returns A function that takes a closure and returns an array of results
252
+ * @param closure - The function to execute repeatedly
253
+ * @returns An array of results
256
254
  */
257
- export const repeat =
258
- (count: number) =>
259
- <T>(closure: (index: number) => T): T[] =>
260
- new Array(count).fill("").map((_, index) => closure(index));
255
+ export const repeat = <T>(
256
+ count: number,
257
+ closure: (index: number) => T,
258
+ ): T[] => new Array(count).fill("").map((_, index) => closure(index));
261
259
 
262
260
  /**
263
261
  * Generates all possible subsets of a given array.
@@ -34,12 +34,14 @@
34
34
  * users.sort(GaffComparator.strings(user => [user.lastName, user.firstName]));
35
35
  * events.sort(GaffComparator.dates(event => [event.startDate, event.endDate]));
36
36
  *
37
- * // Integration with TestValidator
38
- * await TestValidator.sort("user sorting")(
37
+ * // Integration with TestValidator's currying pattern
38
+ * const validator = TestValidator.sort("user sorting",
39
39
  * (sortable) => api.getUsers({ sort: sortable })
40
40
  * )("name", "email")(
41
41
  * GaffComparator.strings(user => [user.name, user.email])
42
- * )("+");
42
+ * );
43
+ * await validator("+"); // ascending
44
+ * await validator("-"); // descending
43
45
  * ```;
44
46
  */
45
47
  export namespace GaffComparator {
@@ -87,12 +89,14 @@ export namespace GaffComparator {
87
89
  * // Complex multi-field: status, then last name, then first name
88
90
  * users.sort(GaffComparator.strings(user => [user.status, user.lastName, user.firstName]));
89
91
  *
90
- * // Integration with API sorting validation
91
- * await TestValidator.sort("user name sorting")(
92
+ * // Integration with TestValidator sorting validation
93
+ * const sortValidator = TestValidator.sort("user name sorting",
92
94
  * (sortFields) => userApi.getUsers({ sort: sortFields })
93
95
  * )("lastName", "firstName")(
94
96
  * GaffComparator.strings(user => [user.lastName, user.firstName])
95
- * )("+");
97
+ * );
98
+ * await sortValidator("+"); // test ascending order
99
+ * await sortValidator("-"); // test descending order
96
100
  * ```;
97
101
  *
98
102
  * @template T - The type of objects being compared
@@ -165,12 +169,13 @@ export namespace GaffComparator {
165
169
  * // Sort by modification history: created date, then updated date
166
170
  * events.sort(GaffComparator.dates(event => [event.createdAt, event.updatedAt]));
167
171
  *
168
- * // Validate API date sorting
169
- * await TestValidator.sort("event chronological sorting")(
172
+ * // Validate API date sorting with TestValidator
173
+ * const dateValidator = TestValidator.sort("event chronological sorting",
170
174
  * (sortFields) => eventApi.getEvents({ sort: sortFields })
171
175
  * )("startDate")(
172
176
  * GaffComparator.dates(event => event.startDate)
173
- * )("+");
177
+ * );
178
+ * await dateValidator("+", true); // ascending with trace logging
174
179
  *
175
180
  * // Test complex date-based sorting
176
181
  * const sortByEventSchedule = GaffComparator.dates(event => [
@@ -245,12 +250,14 @@ export namespace GaffComparator {
245
250
  * // Sort by inventory priority: low stock first, then by sales
246
251
  * products.sort(GaffComparator.numbers(product => [product.stock, -product.salesCount]));
247
252
  *
248
- * // Validate API numerical sorting
249
- * await TestValidator.sort("product price sorting")(
253
+ * // Validate API numerical sorting with TestValidator
254
+ * const priceValidator = TestValidator.sort("product price sorting",
250
255
  * (sortFields) => productApi.getProducts({ sort: sortFields })
251
256
  * )("price")(
252
257
  * GaffComparator.numbers(product => product.price)
253
- * )("+");
258
+ * );
259
+ * await priceValidator("+"); // test ascending order
260
+ * await priceValidator("-"); // test descending order
254
261
  *
255
262
  * // Test multi-criteria sorting
256
263
  * const sortByBusinessValue = GaffComparator.numbers(product => [
package/src/MapUtil.ts ADDED
@@ -0,0 +1,86 @@
1
+ /**
2
+ * A namespace providing utility functions for Map manipulation.
3
+ *
4
+ * This namespace contains helper functions for working with JavaScript Map
5
+ * objects, providing convenient methods for common Map operations like
6
+ * retrieving values with lazy initialization.
7
+ *
8
+ * @author Jeongho Nam - https://github.com/samchon
9
+ * @example
10
+ * ```typescript
11
+ * // Create a cache with lazy initialization
12
+ * const cache = new Map<string, ExpensiveObject>();
13
+ *
14
+ * const obj = MapUtil.take(cache, "key1", () => {
15
+ * console.log("Creating expensive object...");
16
+ * return new ExpensiveObject();
17
+ * });
18
+ *
19
+ * // Subsequent calls return cached value without re-creating
20
+ * const sameObj = MapUtil.take(cache, "key1", () => new ExpensiveObject());
21
+ * console.log(obj === sameObj); // true
22
+ * ```;
23
+ */
24
+ export namespace MapUtil {
25
+ /**
26
+ * Retrieves a value from a Map or creates it using a lazy initialization
27
+ * function.
28
+ *
29
+ * This function implements the "get or create" pattern for Maps. If the key
30
+ * exists in the Map, it returns the existing value. Otherwise, it calls the
31
+ * provided factory function to create a new value, stores it in the Map, and
32
+ * returns it. The factory function is only called when the key doesn't exist,
33
+ * enabling lazy initialization and caching patterns.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * // Simple caching example
38
+ * const userCache = new Map<number, User>();
39
+ *
40
+ * const user = MapUtil.take(userCache, userId, () => {
41
+ * // This expensive operation only runs if userId is not cached
42
+ * return fetchUserFromDatabase(userId);
43
+ * });
44
+ *
45
+ * // Configuration object caching
46
+ * const configs = new Map<string, Config>();
47
+ *
48
+ * const dbConfig = MapUtil.take(configs, "database", () => ({
49
+ * host: "localhost",
50
+ * port: 5432,
51
+ * database: "myapp"
52
+ * }));
53
+ *
54
+ * // Lazy computation results
55
+ * const computationCache = new Map<string, number>();
56
+ *
57
+ * const result = MapUtil.take(computationCache, "fibonacci-40", () => {
58
+ * console.log("Computing fibonacci(40)...");
59
+ * return fibonacci(40); // Only computed once
60
+ * });
61
+ *
62
+ * // Using with complex keys
63
+ * const cache = new Map<[number, number], Matrix>();
64
+ * const key: [number, number] = [rows, cols];
65
+ *
66
+ * const matrix = MapUtil.take(cache, key, () =>
67
+ * generateIdentityMatrix(rows, cols)
68
+ * );
69
+ * ```;
70
+ *
71
+ * @template K - The type of keys in the Map
72
+ * @template V - The type of values in the Map
73
+ * @param map - The Map to retrieve from or update
74
+ * @param key - The key to look up in the Map
75
+ * @param value - A factory function that creates the value if key doesn't exist
76
+ * @returns The existing value if found, or the newly created value
77
+ */
78
+ export function take<K, V>(map: Map<K, V>, key: K, value: () => V): V {
79
+ if (map.has(key)) {
80
+ return map.get(key) as V;
81
+ }
82
+ const newValue = value();
83
+ map.set(key, newValue);
84
+ return newValue;
85
+ }
86
+ }