@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.
package/lib/ArrayUtil.js CHANGED
@@ -53,15 +53,15 @@ exports.ArrayUtil = void 0;
53
53
  *
54
54
  * This namespace contains utility functions for array operations including
55
55
  * asynchronous processing, filtering, mapping, and repetition tasks implemented
56
- * in functional programming style. All functions are implemented using currying
57
- * to enhance reusability and composability.
56
+ * in functional programming style. Functions use direct parameter passing for
57
+ * simplicity while maintaining functional programming principles.
58
58
  *
59
59
  * @author Jeongho Nam - https://github.com/samchon
60
60
  * @example
61
61
  * ```typescript
62
62
  * // Asynchronous filtering example
63
63
  * const numbers = [1, 2, 3, 4, 5];
64
- * const evenNumbers = await ArrayUtil.asyncFilter(numbers)(
64
+ * const evenNumbers = await ArrayUtil.asyncFilter(numbers,
65
65
  * async (num) => num % 2 === 0
66
66
  * );
67
67
  * console.log(evenNumbers); // [2, 4]
@@ -74,9 +74,9 @@ var ArrayUtil;
74
74
  * Filters an array by applying an asynchronous predicate function to each
75
75
  * element.
76
76
  *
77
- * This function is implemented in curried form, first taking an array and
78
- * then a predicate function. Elements are processed sequentially, ensuring
79
- * order is maintained.
77
+ * Elements are processed sequentially, ensuring order is maintained. The
78
+ * predicate function receives the element, index, and the full array as
79
+ * parameters.
80
80
  *
81
81
  * @example
82
82
  * ```typescript
@@ -86,7 +86,7 @@ var ArrayUtil;
86
86
  * { id: 3, name: 'Charlie', active: true }
87
87
  * ];
88
88
  *
89
- * const activeUsers = await ArrayUtil.asyncFilter(users)(
89
+ * const activeUsers = await ArrayUtil.asyncFilter(users,
90
90
  * async (user) => {
91
91
  * // Async validation logic (e.g., API call)
92
92
  * await new Promise(resolve => setTimeout(resolve, 100));
@@ -98,37 +98,35 @@ var ArrayUtil;
98
98
  *
99
99
  * @template Input - The type of elements in the input array
100
100
  * @param elements - The readonly array to filter
101
- * @returns A function that takes a predicate and returns a Promise resolving
102
- * to the filtered array
101
+ * @param pred - The asynchronous predicate function to test each element
102
+ * @returns A Promise resolving to the filtered array
103
103
  */
104
- ArrayUtil.asyncFilter = function (elements) {
105
- return function (pred) { return __awaiter(_this, void 0, void 0, function () {
106
- var ret;
107
- var _this = this;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0:
111
- ret = [];
112
- return [4 /*yield*/, ArrayUtil.asyncForEach(elements)(function (elem, index, array) { return __awaiter(_this, void 0, void 0, function () {
113
- var flag;
114
- return __generator(this, function (_a) {
115
- switch (_a.label) {
116
- case 0: return [4 /*yield*/, pred(elem, index, array)];
117
- case 1:
118
- flag = _a.sent();
119
- if (flag === true)
120
- ret.push(elem);
121
- return [2 /*return*/];
122
- }
123
- });
124
- }); })];
125
- case 1:
126
- _a.sent();
127
- return [2 /*return*/, ret];
128
- }
129
- });
130
- }); };
131
- };
104
+ ArrayUtil.asyncFilter = function (elements, pred) { return __awaiter(_this, void 0, void 0, function () {
105
+ var ret;
106
+ var _this = this;
107
+ return __generator(this, function (_a) {
108
+ switch (_a.label) {
109
+ case 0:
110
+ ret = [];
111
+ return [4 /*yield*/, ArrayUtil.asyncForEach(elements, function (elem, index, array) { return __awaiter(_this, void 0, void 0, function () {
112
+ var flag;
113
+ return __generator(this, function (_a) {
114
+ switch (_a.label) {
115
+ case 0: return [4 /*yield*/, pred(elem, index, array)];
116
+ case 1:
117
+ flag = _a.sent();
118
+ if (flag === true)
119
+ ret.push(elem);
120
+ return [2 /*return*/];
121
+ }
122
+ });
123
+ }); })];
124
+ case 1:
125
+ _a.sent();
126
+ return [2 /*return*/, ret];
127
+ }
128
+ });
129
+ }); };
132
130
  /**
133
131
  * Executes an asynchronous function for each element in an array
134
132
  * sequentially.
@@ -142,7 +140,7 @@ var ArrayUtil;
142
140
  * ```typescript
143
141
  * const urls = ['url1', 'url2', 'url3'];
144
142
  *
145
- * await ArrayUtil.asyncForEach(urls)(async (url, index) => {
143
+ * await ArrayUtil.asyncForEach(urls, async (url, index) => {
146
144
  * console.log(`Processing ${index}: ${url}`);
147
145
  * const data = await fetch(url);
148
146
  * await processData(data);
@@ -153,29 +151,29 @@ var ArrayUtil;
153
151
  *
154
152
  * @template Input - The type of elements in the input array
155
153
  * @param elements - The readonly array to process
156
- * @returns A function that takes an async closure and returns a Promise<void>
154
+ * @param closure - The asynchronous function to execute for each element
155
+ * @returns A Promise<void> that resolves when all operations complete
157
156
  */
158
- ArrayUtil.asyncForEach = function (elements) {
159
- return function (closure) { return __awaiter(_this, void 0, void 0, function () {
160
- return __generator(this, function (_a) {
161
- switch (_a.label) {
162
- case 0: return [4 /*yield*/, ArrayUtil.asyncRepeat(elements.length)(function (index) {
163
- return closure(elements[index], index, elements);
164
- })];
165
- case 1:
166
- _a.sent();
167
- return [2 /*return*/];
168
- }
169
- });
170
- }); };
171
- };
157
+ ArrayUtil.asyncForEach = function (elements, closure) { return __awaiter(_this, void 0, void 0, function () {
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0: return [4 /*yield*/, ArrayUtil.asyncRepeat(elements.length, function (index) {
161
+ return closure(elements[index], index, elements);
162
+ })];
163
+ case 1:
164
+ _a.sent();
165
+ return [2 /*return*/];
166
+ }
167
+ });
168
+ }); };
172
169
  /**
173
170
  * Transforms each element of an array using an asynchronous function to
174
171
  * create a new array.
175
172
  *
176
173
  * Similar to JavaScript's native map but processes asynchronous functions
177
174
  * sequentially. Each element's transformation is completed before proceeding
178
- * to the next element, ensuring order is maintained.
175
+ * to the next element, ensuring order is maintained. This function still
176
+ * maintains the currying pattern for composition.
179
177
  *
180
178
  * @example
181
179
  * ```typescript
@@ -192,38 +190,35 @@ var ArrayUtil;
192
190
  * ```
193
191
  *
194
192
  * @template Input - The type of elements in the input array
195
- * @template Output - The type of elements in the output array
196
193
  * @param elements - The readonly array to transform
197
194
  * @returns A function that takes a transformation function and returns a
198
195
  * Promise resolving to the transformed array
199
196
  */
200
- ArrayUtil.asyncMap = function (elements) {
201
- return function (closure) { return __awaiter(_this, void 0, void 0, function () {
202
- var ret;
203
- var _this = this;
204
- return __generator(this, function (_a) {
205
- switch (_a.label) {
206
- case 0:
207
- ret = [];
208
- return [4 /*yield*/, ArrayUtil.asyncForEach(elements)(function (elem, index, array) { return __awaiter(_this, void 0, void 0, function () {
209
- var output;
210
- return __generator(this, function (_a) {
211
- switch (_a.label) {
212
- case 0: return [4 /*yield*/, closure(elem, index, array)];
213
- case 1:
214
- output = _a.sent();
215
- ret.push(output);
216
- return [2 /*return*/];
217
- }
218
- });
219
- }); })];
220
- case 1:
221
- _a.sent();
222
- return [2 /*return*/, ret];
223
- }
224
- });
225
- }); };
226
- };
197
+ ArrayUtil.asyncMap = function (elements, closure) { return __awaiter(_this, void 0, void 0, function () {
198
+ var ret;
199
+ var _this = this;
200
+ return __generator(this, function (_a) {
201
+ switch (_a.label) {
202
+ case 0:
203
+ ret = [];
204
+ return [4 /*yield*/, ArrayUtil.asyncForEach(elements, function (elem, index, array) { return __awaiter(_this, void 0, void 0, function () {
205
+ var output;
206
+ return __generator(this, function (_a) {
207
+ switch (_a.label) {
208
+ case 0: return [4 /*yield*/, closure(elem, index, array)];
209
+ case 1:
210
+ output = _a.sent();
211
+ ret.push(output);
212
+ return [2 /*return*/];
213
+ }
214
+ });
215
+ }); })];
216
+ case 1:
217
+ _a.sent();
218
+ return [2 /*return*/, ret];
219
+ }
220
+ });
221
+ }); };
227
222
  /**
228
223
  * Executes an asynchronous function a specified number of times sequentially.
229
224
  *
@@ -234,7 +229,7 @@ var ArrayUtil;
234
229
  * @example
235
230
  * ```typescript
236
231
  * // Generate random data 5 times
237
- * const randomData = await ArrayUtil.asyncRepeat(5)(async (index) => {
232
+ * const randomData = await ArrayUtil.asyncRepeat(5, async (index) => {
238
233
  * await new Promise(resolve => setTimeout(resolve, 100)); // Wait 0.1 seconds
239
234
  * return {
240
235
  * id: index,
@@ -245,59 +240,55 @@ var ArrayUtil;
245
240
  * console.log('Generated data:', randomData);
246
241
  * ```;
247
242
  *
243
+ * @template T - The type of the result from each execution
248
244
  * @param count - The number of times to repeat (non-negative integer)
249
- * @returns A function that takes an async closure and returns a Promise
250
- * resolving to an array of results
245
+ * @param closure - The asynchronous function to execute repeatedly
246
+ * @returns A Promise resolving to an array of results
251
247
  */
252
- ArrayUtil.asyncRepeat = function (count) {
253
- return function (closure) { return __awaiter(_this, void 0, void 0, function () {
254
- var indexes, output, indexes_1, indexes_1_1, index, _a, _b, e_1_1;
255
- var e_1, _c;
256
- return __generator(this, function (_d) {
257
- switch (_d.label) {
258
- case 0:
259
- indexes = new Array(count)
260
- .fill(1)
261
- .map(function (_, index) { return index; });
262
- output = [];
263
- _d.label = 1;
264
- case 1:
265
- _d.trys.push([1, 6, 7, 8]);
266
- indexes_1 = __values(indexes), indexes_1_1 = indexes_1.next();
267
- _d.label = 2;
268
- case 2:
269
- if (!!indexes_1_1.done) return [3 /*break*/, 5];
270
- index = indexes_1_1.value;
271
- _b = (_a = output).push;
272
- return [4 /*yield*/, closure(index)];
273
- case 3:
274
- _b.apply(_a, [_d.sent()]);
275
- _d.label = 4;
276
- case 4:
277
- indexes_1_1 = indexes_1.next();
278
- return [3 /*break*/, 2];
279
- case 5: return [3 /*break*/, 8];
280
- case 6:
281
- e_1_1 = _d.sent();
282
- e_1 = { error: e_1_1 };
283
- return [3 /*break*/, 8];
284
- case 7:
285
- try {
286
- if (indexes_1_1 && !indexes_1_1.done && (_c = indexes_1.return)) _c.call(indexes_1);
287
- }
288
- finally { if (e_1) throw e_1.error; }
289
- return [7 /*endfinally*/];
290
- case 8: return [2 /*return*/, output];
291
- }
292
- });
293
- }); };
294
- };
248
+ ArrayUtil.asyncRepeat = function (count, closure) { return __awaiter(_this, void 0, void 0, function () {
249
+ var indexes, output, indexes_1, indexes_1_1, index, _a, _b, e_1_1;
250
+ var e_1, _c;
251
+ return __generator(this, function (_d) {
252
+ switch (_d.label) {
253
+ case 0:
254
+ indexes = new Array(count).fill(1).map(function (_, index) { return index; });
255
+ output = [];
256
+ _d.label = 1;
257
+ case 1:
258
+ _d.trys.push([1, 6, 7, 8]);
259
+ indexes_1 = __values(indexes), indexes_1_1 = indexes_1.next();
260
+ _d.label = 2;
261
+ case 2:
262
+ if (!!indexes_1_1.done) return [3 /*break*/, 5];
263
+ index = indexes_1_1.value;
264
+ _b = (_a = output).push;
265
+ return [4 /*yield*/, closure(index)];
266
+ case 3:
267
+ _b.apply(_a, [_d.sent()]);
268
+ _d.label = 4;
269
+ case 4:
270
+ indexes_1_1 = indexes_1.next();
271
+ return [3 /*break*/, 2];
272
+ case 5: return [3 /*break*/, 8];
273
+ case 6:
274
+ e_1_1 = _d.sent();
275
+ e_1 = { error: e_1_1 };
276
+ return [3 /*break*/, 8];
277
+ case 7:
278
+ try {
279
+ if (indexes_1_1 && !indexes_1_1.done && (_c = indexes_1.return)) _c.call(indexes_1);
280
+ }
281
+ finally { if (e_1) throw e_1.error; }
282
+ return [7 /*endfinally*/];
283
+ case 8: return [2 /*return*/, output];
284
+ }
285
+ });
286
+ }); };
295
287
  /**
296
288
  * Checks if at least one element in the array satisfies the given condition.
297
289
  *
298
- * Similar to JavaScript's native some() method but implemented in curried
299
- * form for better compatibility with functional programming style. Returns
300
- * true immediately when the first element satisfying the condition is found.
290
+ * Similar to JavaScript's native some() method. Returns true immediately when
291
+ * the first element satisfying the condition is found.
301
292
  *
302
293
  * @example
303
294
  * ```typescript
@@ -308,25 +299,22 @@ var ArrayUtil;
308
299
  * { name: 'Orange', price: 80, inStock: true }
309
300
  * ];
310
301
  *
311
- * const hasEvenNumber = ArrayUtil.has(numbers)(num => num % 2 === 0);
302
+ * const hasEvenNumber = ArrayUtil.has(numbers, num => num % 2 === 0);
312
303
  * console.log(hasEvenNumber); // true (8 exists)
313
304
  *
314
- * const hasExpensiveItem = ArrayUtil.has(products)(product => product.price > 90);
305
+ * const hasExpensiveItem = ArrayUtil.has(products, product => product.price > 90);
315
306
  * console.log(hasExpensiveItem); // true (Apple costs 100)
316
307
  *
317
- * const hasOutOfStock = ArrayUtil.has(products)(product => !product.inStock);
308
+ * const hasOutOfStock = ArrayUtil.has(products, product => !product.inStock);
318
309
  * console.log(hasOutOfStock); // true (Banana is out of stock)
319
310
  * ```;
320
311
  *
321
312
  * @template T - The type of elements in the array
322
313
  * @param elements - The readonly array to check
323
- * @returns A function that takes a predicate and returns a boolean
314
+ * @param pred - The predicate function to test elements
315
+ * @returns Boolean indicating if any element satisfies the condition
324
316
  */
325
- ArrayUtil.has = function (elements) {
326
- return function (pred) {
327
- return elements.find(pred) !== undefined;
328
- };
329
- };
317
+ ArrayUtil.has = function (elements, pred) { return elements.find(pred) !== undefined; };
330
318
  /**
331
319
  * Executes a function a specified number of times and collects the results
332
320
  * into an array.
@@ -337,11 +325,11 @@ var ArrayUtil;
337
325
  * @example
338
326
  * ```typescript
339
327
  * // Generate an array of squares from 1 to 5
340
- * const squares = ArrayUtil.repeat(5)(index => (index + 1) ** 2);
328
+ * const squares = ArrayUtil.repeat(5, index => (index + 1) ** 2);
341
329
  * console.log(squares); // [1, 4, 9, 16, 25]
342
330
  *
343
331
  * // Generate an array of default user objects
344
- * const users = ArrayUtil.repeat(3)(index => ({
332
+ * const users = ArrayUtil.repeat(3, index => ({
345
333
  * id: index + 1,
346
334
  * name: `User${index + 1}`,
347
335
  * email: `user${index + 1}@example.com`
@@ -354,14 +342,12 @@ var ArrayUtil;
354
342
  * // ]
355
343
  * ```
356
344
  *
345
+ * @template T - The type of the result from each execution
357
346
  * @param count - The number of times to repeat (non-negative integer)
358
- * @returns A function that takes a closure and returns an array of results
347
+ * @param closure - The function to execute repeatedly
348
+ * @returns An array of results
359
349
  */
360
- ArrayUtil.repeat = function (count) {
361
- return function (closure) {
362
- return new Array(count).fill("").map(function (_, index) { return closure(index); });
363
- };
364
- };
350
+ ArrayUtil.repeat = function (count, closure) { return new Array(count).fill("").map(function (_, index) { return closure(index); }); };
365
351
  /**
366
352
  * Generates all possible subsets of a given array.
367
353
  *
@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KAAK,CAAC,MAAM;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAC,EAAE,EAAE,GAAG,IAAK,OAAA,KAAK,CAAC,GAAG,CAAC,EAAV,CAAU,CAAC,CAAC,CAAC;iBAChD,CAAC;gBACJ,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;gBACpB,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAEf,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;gBACrB,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC;QACF,GAAG,CAAC,CAAC,CAAC,CAAC;QACP,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,EA5SgB,SAAS,yBAAT,SAAS,QA4SzB"}
@@ -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 declare namespace GaffComparator {
@@ -87,12 +89,14 @@ export declare 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
@@ -156,12 +160,13 @@ export declare namespace GaffComparator {
156
160
  * // Sort by modification history: created date, then updated date
157
161
  * events.sort(GaffComparator.dates(event => [event.createdAt, event.updatedAt]));
158
162
  *
159
- * // Validate API date sorting
160
- * await TestValidator.sort("event chronological sorting")(
163
+ * // Validate API date sorting with TestValidator
164
+ * const dateValidator = TestValidator.sort("event chronological sorting",
161
165
  * (sortFields) => eventApi.getEvents({ sort: sortFields })
162
166
  * )("startDate")(
163
167
  * GaffComparator.dates(event => event.startDate)
164
- * )("+");
168
+ * );
169
+ * await dateValidator("+", true); // ascending with trace logging
165
170
  *
166
171
  * // Test complex date-based sorting
167
172
  * const sortByEventSchedule = GaffComparator.dates(event => [
@@ -225,12 +230,14 @@ export declare namespace GaffComparator {
225
230
  * // Sort by inventory priority: low stock first, then by sales
226
231
  * products.sort(GaffComparator.numbers(product => [product.stock, -product.salesCount]));
227
232
  *
228
- * // Validate API numerical sorting
229
- * await TestValidator.sort("product price sorting")(
233
+ * // Validate API numerical sorting with TestValidator
234
+ * const priceValidator = TestValidator.sort("product price sorting",
230
235
  * (sortFields) => productApi.getProducts({ sort: sortFields })
231
236
  * )("price")(
232
237
  * GaffComparator.numbers(product => product.price)
233
- * )("+");
238
+ * );
239
+ * await priceValidator("+"); // test ascending order
240
+ * await priceValidator("-"); // test descending order
234
241
  *
235
242
  * // Test multi-criteria sorting
236
243
  * const sortByBusinessValue = GaffComparator.numbers(product => [
@@ -37,12 +37,14 @@ exports.GaffComparator = void 0;
37
37
  * users.sort(GaffComparator.strings(user => [user.lastName, user.firstName]));
38
38
  * events.sort(GaffComparator.dates(event => [event.startDate, event.endDate]));
39
39
  *
40
- * // Integration with TestValidator
41
- * await TestValidator.sort("user sorting")(
40
+ * // Integration with TestValidator's currying pattern
41
+ * const validator = TestValidator.sort("user sorting",
42
42
  * (sortable) => api.getUsers({ sort: sortable })
43
43
  * )("name", "email")(
44
44
  * GaffComparator.strings(user => [user.name, user.email])
45
- * )("+");
45
+ * );
46
+ * await validator("+"); // ascending
47
+ * await validator("-"); // descending
46
48
  * ```;
47
49
  */
48
50
  var GaffComparator;
@@ -91,12 +93,14 @@ var GaffComparator;
91
93
  * // Complex multi-field: status, then last name, then first name
92
94
  * users.sort(GaffComparator.strings(user => [user.status, user.lastName, user.firstName]));
93
95
  *
94
- * // Integration with API sorting validation
95
- * await TestValidator.sort("user name sorting")(
96
+ * // Integration with TestValidator sorting validation
97
+ * const sortValidator = TestValidator.sort("user name sorting",
96
98
  * (sortFields) => userApi.getUsers({ sort: sortFields })
97
99
  * )("lastName", "firstName")(
98
100
  * GaffComparator.strings(user => [user.lastName, user.firstName])
99
- * )("+");
101
+ * );
102
+ * await sortValidator("+"); // test ascending order
103
+ * await sortValidator("-"); // test descending order
100
104
  * ```;
101
105
  *
102
106
  * @template T - The type of objects being compared
@@ -167,12 +171,13 @@ var GaffComparator;
167
171
  * // Sort by modification history: created date, then updated date
168
172
  * events.sort(GaffComparator.dates(event => [event.createdAt, event.updatedAt]));
169
173
  *
170
- * // Validate API date sorting
171
- * await TestValidator.sort("event chronological sorting")(
174
+ * // Validate API date sorting with TestValidator
175
+ * const dateValidator = TestValidator.sort("event chronological sorting",
172
176
  * (sortFields) => eventApi.getEvents({ sort: sortFields })
173
177
  * )("startDate")(
174
178
  * GaffComparator.dates(event => event.startDate)
175
- * )("+");
179
+ * );
180
+ * await dateValidator("+", true); // ascending with trace logging
176
181
  *
177
182
  * // Test complex date-based sorting
178
183
  * const sortByEventSchedule = GaffComparator.dates(event => [
@@ -246,12 +251,14 @@ var GaffComparator;
246
251
  * // Sort by inventory priority: low stock first, then by sales
247
252
  * products.sort(GaffComparator.numbers(product => [product.stock, -product.salesCount]));
248
253
  *
249
- * // Validate API numerical sorting
250
- * await TestValidator.sort("product price sorting")(
254
+ * // Validate API numerical sorting with TestValidator
255
+ * const priceValidator = TestValidator.sort("product price sorting",
251
256
  * (sortFields) => productApi.getProducts({ sort: sortFields })
252
257
  * )("price")(
253
258
  * GaffComparator.numbers(product => product.price)
254
- * )("+");
259
+ * );
260
+ * await priceValidator("+"); // test ascending order
261
+ * await priceValidator("-"); // test descending order
255
262
  *
256
263
  * // Test multi-criteria sorting
257
264
  * const sortByBusinessValue = GaffComparator.numbers(product => [
@@ -1 +1 @@
1
- {"version":3,"file":"GaffComparator.js","sourceRoot":"","sources":["../src/GaffComparator.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,IAAiB,cAAc,CA2O9B;AA3OD,WAAiB,cAAc;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACU,sBAAO,GAClB,UAAI,MAAuC;QAC3C,OAAA,UAAC,CAAI,EAAE,CAAI;YACT,IAAM,CAAC,GAAa,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,IAAM,CAAC,GAAa,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAEpC,IAAM,GAAG,GAAW,CAAC,CAAC,SAAS,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAV,CAAU,CAAC,CAAC;YACtD,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;IAND,CAMC,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyEG;IACU,oB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