@vinicunca/eslint-config 2.0.0-beta.8 → 2.0.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.
package/dist/index.cjs CHANGED
@@ -94,7 +94,7 @@ module.exports = __toCommonJS(src_exports);
94
94
  var import_node_process2 = __toESM(require("process"), 1);
95
95
  var import_local_pkg = require("local-pkg");
96
96
 
97
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.4/node_modules/@vinicunca/perkakas/dist/es/function/purry.js
97
+ // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.10/node_modules/@vinicunca/perkakas/dist/index.js
98
98
  function purry(fn, args, lazy) {
99
99
  const diff = fn.length - args.length;
100
100
  const arrayArgs = Array.from(args);
@@ -111,13 +111,35 @@ function purry(fn, args, lazy) {
111
111
  }
112
112
  throw new Error("Wrong number of arguments");
113
113
  }
114
-
115
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.4/node_modules/@vinicunca/perkakas/dist/es/guard/is-boolean.js
116
114
  function isBoolean(data) {
117
115
  return typeof data === "boolean";
118
116
  }
119
-
120
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.4/node_modules/@vinicunca/perkakas/dist/es/utils/reduce-lazy.js
117
+ function isDefined(data) {
118
+ return typeof data !== "undefined" && data !== null;
119
+ }
120
+ ((isDefined2) => {
121
+ function strict(data) {
122
+ return data !== void 0;
123
+ }
124
+ isDefined2.strict = strict;
125
+ })(isDefined || (isDefined = {}));
126
+ function _countBy(indexed) {
127
+ return (array, fn) => {
128
+ return array.reduce((ret, item, index) => {
129
+ const value = indexed ? fn(item, index, array) : fn(item);
130
+ return ret + (value ? 1 : 0);
131
+ }, 0);
132
+ };
133
+ }
134
+ function countBy(...args) {
135
+ return purry(_countBy(false), args);
136
+ }
137
+ ((countBy2) => {
138
+ function indexed(...args) {
139
+ return purry(_countBy(true), args);
140
+ }
141
+ countBy2.indexed = indexed;
142
+ })(countBy || (countBy = {}));
121
143
  function _reduceLazy(array, lazy, indexed) {
122
144
  const newArray = [];
123
145
  for (let index = 0; index < array.length; index++) {
@@ -131,25 +153,815 @@ function _reduceLazy(array, lazy, indexed) {
131
153
  }
132
154
  return newArray;
133
155
  }
134
-
135
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.4/node_modules/@vinicunca/perkakas/dist/es/array/uniq.js
136
- function uniq() {
137
- return purry(_uniq, arguments, uniq.lazy);
156
+ function differenceWith(...args) {
157
+ return purry(_differenceWith, args, differenceWith.lazy);
158
+ }
159
+ function _differenceWith(array, other, isEquals) {
160
+ const lazy = differenceWith.lazy(other, isEquals);
161
+ return _reduceLazy(array, lazy);
162
+ }
163
+ ((differenceWith2) => {
164
+ function lazy(other, isEquals) {
165
+ return (value) => {
166
+ if (other.every((otherValue) => !isEquals(value, otherValue))) {
167
+ return {
168
+ done: false,
169
+ hasNext: true,
170
+ next: value
171
+ };
172
+ }
173
+ return {
174
+ done: false,
175
+ hasNext: false
176
+ };
177
+ };
178
+ }
179
+ differenceWith2.lazy = lazy;
180
+ })(differenceWith || (differenceWith = {}));
181
+ function difference(...args) {
182
+ return purry(_difference, args, difference.lazy);
183
+ }
184
+ function _difference(array, other) {
185
+ const lazy = difference.lazy(other);
186
+ return _reduceLazy(array, lazy);
187
+ }
188
+ ((difference2) => {
189
+ function lazy(other) {
190
+ const set2 = new Set(other);
191
+ return (value) => {
192
+ if (!set2.has(value)) {
193
+ return {
194
+ done: false,
195
+ hasNext: true,
196
+ next: value
197
+ };
198
+ }
199
+ return {
200
+ done: false,
201
+ hasNext: false
202
+ };
203
+ };
204
+ }
205
+ difference2.lazy = lazy;
206
+ })(difference || (difference = {}));
207
+ function drop(...args) {
208
+ return purry(_drop, args, drop.lazy);
209
+ }
210
+ function _drop(array, n) {
211
+ return _reduceLazy(array, drop.lazy(n));
212
+ }
213
+ ((drop2) => {
214
+ function lazy(n) {
215
+ let left = n;
216
+ return (value) => {
217
+ if (left > 0) {
218
+ left--;
219
+ return {
220
+ done: false,
221
+ hasNext: false
222
+ };
223
+ }
224
+ return {
225
+ done: false,
226
+ hasNext: true,
227
+ next: value
228
+ };
229
+ };
230
+ }
231
+ drop2.lazy = lazy;
232
+ })(drop || (drop = {}));
233
+ function toLazyIndexed(fn) {
234
+ fn.indexed = true;
235
+ return fn;
236
+ }
237
+ function filter(...args) {
238
+ return purry(_filter(false), args, filter.lazy);
239
+ }
240
+ function _filter(indexed) {
241
+ return (array, fn) => {
242
+ return _reduceLazy(
243
+ array,
244
+ indexed ? filter.lazyIndexed(fn) : filter.lazy(fn),
245
+ indexed
246
+ );
247
+ };
248
+ }
249
+ function _lazy(indexed) {
250
+ return (fn) => {
251
+ return (value, index, array) => {
252
+ const valid = indexed ? fn(value, index, array) : fn(value);
253
+ if (valid) {
254
+ return {
255
+ done: false,
256
+ hasNext: true,
257
+ next: value
258
+ };
259
+ }
260
+ return {
261
+ done: false,
262
+ hasNext: false
263
+ };
264
+ };
265
+ };
266
+ }
267
+ ((filter2) => {
268
+ function indexed(...args) {
269
+ return purry(_filter(true), args, filter2.lazyIndexed);
270
+ }
271
+ filter2.indexed = indexed;
272
+ filter2.lazy = _lazy(false);
273
+ filter2.lazyIndexed = toLazyIndexed(_lazy(true));
274
+ })(filter || (filter = {}));
275
+ function toSingle(fn) {
276
+ fn.single = true;
277
+ return fn;
278
+ }
279
+ function findIndex(...args) {
280
+ return purry(_findIndex(false), args, findIndex.lazy);
281
+ }
282
+ function _findIndex(indexed) {
283
+ return (array, fn) => {
284
+ if (indexed) {
285
+ return array.findIndex(fn);
286
+ }
287
+ return array.findIndex((x) => fn(x));
288
+ };
289
+ }
290
+ function _lazy2(indexed) {
291
+ return (fn) => {
292
+ let i = 0;
293
+ return (value, index, array) => {
294
+ const valid = indexed ? fn(value, index, array) : fn(value);
295
+ if (valid) {
296
+ return {
297
+ done: true,
298
+ hasNext: true,
299
+ next: i
300
+ };
301
+ }
302
+ i++;
303
+ return {
304
+ done: false,
305
+ hasNext: false
306
+ };
307
+ };
308
+ };
309
+ }
310
+ ((findIndex2) => {
311
+ function indexed(...args) {
312
+ return purry(_findIndex(true), args, findIndex2.lazyIndexed);
313
+ }
314
+ findIndex2.indexed = indexed;
315
+ findIndex2.lazy = toSingle(_lazy2(false));
316
+ findIndex2.lazyIndexed = toSingle(toLazyIndexed(_lazy2(true)));
317
+ })(findIndex || (findIndex = {}));
318
+ function findLastIndex(...args) {
319
+ return purry(_findLastIndex(false), args);
320
+ }
321
+ function _findLastIndex(indexed) {
322
+ return (array, fn) => {
323
+ for (let i = array.length - 1; i >= 0; i--) {
324
+ if (indexed ? fn(array[i], i, array) : fn(array[i])) {
325
+ return i;
326
+ }
327
+ }
328
+ return -1;
329
+ };
330
+ }
331
+ ((findLastIndex2) => {
332
+ function indexed(...args) {
333
+ return purry(_findLastIndex(true), args);
334
+ }
335
+ findLastIndex2.indexed = indexed;
336
+ })(findLastIndex || (findLastIndex = {}));
337
+ function findLast(...args) {
338
+ return purry(_findLast(false), args);
339
+ }
340
+ function _findLast(indexed) {
341
+ return (array, fn) => {
342
+ for (let i = array.length - 1; i >= 0; i--) {
343
+ if (indexed ? fn(array[i], i, array) : fn(array[i])) {
344
+ return array[i];
345
+ }
346
+ }
347
+ };
348
+ }
349
+ ((findLast2) => {
350
+ function indexed(...args) {
351
+ return purry(_findLast(true), args);
352
+ }
353
+ findLast2.indexed = indexed;
354
+ })(findLast || (findLast = {}));
355
+ function find(...args) {
356
+ return purry(_find(false), args, find.lazy);
357
+ }
358
+ function _find(indexed) {
359
+ return (array, fn) => {
360
+ if (indexed) {
361
+ return array.find(fn);
362
+ }
363
+ return array.find((x) => fn(x));
364
+ };
365
+ }
366
+ function _lazy3(indexed) {
367
+ return (fn) => {
368
+ return (value, index, array) => {
369
+ const valid = indexed ? fn(value, index, array) : fn(value);
370
+ return {
371
+ done: valid,
372
+ hasNext: valid,
373
+ next: value
374
+ };
375
+ };
376
+ };
377
+ }
378
+ ((find2) => {
379
+ function indexed(...args) {
380
+ return purry(_find(true), args, find2.lazyIndexed);
381
+ }
382
+ find2.indexed = indexed;
383
+ find2.lazy = toSingle(_lazy3(false));
384
+ find2.lazyIndexed = toSingle(toLazyIndexed(_lazy3(true)));
385
+ })(find || (find = {}));
386
+ function first(...args) {
387
+ return purry(_first, args, first.lazy);
388
+ }
389
+ function _first([first2]) {
390
+ return first2;
391
+ }
392
+ ((first2) => {
393
+ function lazy() {
394
+ return (value) => {
395
+ return {
396
+ done: true,
397
+ hasNext: true,
398
+ next: value
399
+ };
400
+ };
401
+ }
402
+ first2.lazy = lazy;
403
+ ((lazy2) => {
404
+ lazy2.single = true;
405
+ })(lazy = first2.lazy || (first2.lazy = {}));
406
+ })(first || (first = {}));
407
+ function flatMapToObj(...args) {
408
+ return purry(_flatMapToObj(false), args);
409
+ }
410
+ function _flatMapToObj(indexed) {
411
+ return (array, fn) => {
412
+ return array.reduce((result, element, index) => {
413
+ const items = indexed ? fn(element, index, array) : fn(element);
414
+ items.forEach(([key, value]) => {
415
+ result[key] = value;
416
+ });
417
+ return result;
418
+ }, {});
419
+ };
420
+ }
421
+ ((flatMapToObj2) => {
422
+ function indexed(...args) {
423
+ return purry(_flatMapToObj(true), args);
424
+ }
425
+ flatMapToObj2.indexed = indexed;
426
+ })(flatMapToObj || (flatMapToObj = {}));
427
+ function flatten(...args) {
428
+ return purry(_flatten, args, flatten.lazy);
429
+ }
430
+ function _flatten(items) {
431
+ return _reduceLazy(items, flatten.lazy());
432
+ }
433
+ ((flatten2) => {
434
+ function lazy() {
435
+ return (next) => {
436
+ if (Array.isArray(next)) {
437
+ return {
438
+ done: false,
439
+ hasNext: true,
440
+ hasMany: true,
441
+ next
442
+ };
443
+ }
444
+ return {
445
+ done: false,
446
+ hasNext: true,
447
+ next
448
+ };
449
+ };
450
+ }
451
+ flatten2.lazy = lazy;
452
+ })(flatten || (flatten = {}));
453
+ function flatMap(...args) {
454
+ return purry(_flatMap, args, flatMap.lazy);
455
+ }
456
+ function _flatMap(array, fn) {
457
+ return flatten(array.map((item) => fn(item)));
458
+ }
459
+ ((flatMap2) => {
460
+ function lazy(fn) {
461
+ return (value) => {
462
+ const next = fn(value);
463
+ if (Array.isArray(next)) {
464
+ return {
465
+ done: false,
466
+ hasNext: true,
467
+ hasMany: true,
468
+ next
469
+ };
470
+ }
471
+ return {
472
+ done: false,
473
+ hasNext: true,
474
+ next
475
+ };
476
+ };
477
+ }
478
+ flatMap2.lazy = lazy;
479
+ })(flatMap || (flatMap = {}));
480
+ function flattenDeep(...args) {
481
+ return purry(_flattenDeep, args, flattenDeep.lazy);
482
+ }
483
+ function _flattenDeep(items) {
484
+ return _reduceLazy(items, flattenDeep.lazy());
485
+ }
486
+ function _flattenDeepValue(value) {
487
+ if (!Array.isArray(value)) {
488
+ return value;
489
+ }
490
+ const ret = [];
491
+ value.forEach((item) => {
492
+ if (Array.isArray(item)) {
493
+ ret.push(...flattenDeep(item));
494
+ } else {
495
+ ret.push(item);
496
+ }
497
+ });
498
+ return ret;
499
+ }
500
+ ((flattenDeep2) => {
501
+ function lazy() {
502
+ return (value) => {
503
+ const next = _flattenDeepValue(value);
504
+ if (Array.isArray(next)) {
505
+ return {
506
+ done: false,
507
+ hasNext: true,
508
+ hasMany: true,
509
+ next
510
+ };
511
+ }
512
+ return {
513
+ done: false,
514
+ hasNext: true,
515
+ next
516
+ };
517
+ };
518
+ }
519
+ flattenDeep2.lazy = lazy;
520
+ })(flattenDeep || (flattenDeep = {}));
521
+ function forEach(...args) {
522
+ return purry(_forEach(false), args, forEach.lazy);
523
+ }
524
+ function _forEach(indexed) {
525
+ return (array, fn) => {
526
+ return _reduceLazy(
527
+ array,
528
+ indexed ? forEach.lazyIndexed(fn) : forEach.lazy(fn),
529
+ indexed
530
+ );
531
+ };
532
+ }
533
+ function _lazy4(indexed) {
534
+ return (fn) => {
535
+ return (value, index, array) => {
536
+ if (indexed) {
537
+ fn(value, index, array);
538
+ } else {
539
+ fn(value);
540
+ }
541
+ return {
542
+ done: false,
543
+ hasNext: true,
544
+ next: value
545
+ };
546
+ };
547
+ };
548
+ }
549
+ ((forEach2) => {
550
+ function indexed(...args) {
551
+ return purry(_forEach(true), args, forEach2.lazyIndexed);
552
+ }
553
+ forEach2.indexed = indexed;
554
+ forEach2.lazy = _lazy4(false);
555
+ forEach2.lazyIndexed = toLazyIndexed(_lazy4(true));
556
+ })(forEach || (forEach = {}));
557
+ function groupBy(...args) {
558
+ return purry(_groupBy(false), args);
559
+ }
560
+ function _groupBy(indexed) {
561
+ return (array, fn) => {
562
+ const ret = {};
563
+ array.forEach((item, index) => {
564
+ const key = indexed ? fn(item, index, array) : fn(item);
565
+ if (key !== void 0) {
566
+ const actualKey = String(key);
567
+ if (!ret[actualKey]) {
568
+ ret[actualKey] = [];
569
+ }
570
+ ret[actualKey].push(item);
571
+ }
572
+ });
573
+ return ret;
574
+ };
575
+ }
576
+ ((groupBy2) => {
577
+ function indexed(...args) {
578
+ return purry(_groupBy(true), args);
579
+ }
580
+ groupBy2.indexed = indexed;
581
+ groupBy2.strict = groupBy2;
582
+ })(groupBy || (groupBy = {}));
583
+ function indexBy(...args) {
584
+ return purry(_indexBy(false), args);
585
+ }
586
+ function _indexBy(indexed) {
587
+ return (array, fn) => {
588
+ return array.reduce((ret, item, index) => {
589
+ const value = indexed ? fn(item, index, array) : fn(item);
590
+ const key = String(value);
591
+ ret[key] = item;
592
+ return ret;
593
+ }, {});
594
+ };
595
+ }
596
+ ((indexBy2) => {
597
+ function indexed(...args) {
598
+ return purry(_indexBy(true), args);
599
+ }
600
+ indexBy2.indexed = indexed;
601
+ })(indexBy || (indexBy = {}));
602
+ function intersection(...args) {
603
+ return purry(_intersection, args, intersection.lazy);
604
+ }
605
+ function _intersection(array, other) {
606
+ const lazy = intersection.lazy(other);
607
+ return _reduceLazy(array, lazy);
608
+ }
609
+ ((intersection2) => {
610
+ function lazy(other) {
611
+ return (value) => {
612
+ const set2 = new Set(other);
613
+ if (set2.has(value)) {
614
+ return {
615
+ done: false,
616
+ hasNext: true,
617
+ next: value
618
+ };
619
+ }
620
+ return {
621
+ done: false,
622
+ hasNext: false
623
+ };
624
+ };
625
+ }
626
+ intersection2.lazy = lazy;
627
+ })(intersection || (intersection = {}));
628
+ function intersectionWith(...args) {
629
+ return purry(_intersectionWith, args, intersectionWith.lazy);
630
+ }
631
+ function _intersectionWith(array, other, comparator) {
632
+ const lazy = intersectionWith.lazy(other, comparator);
633
+ return _reduceLazy(array, lazy);
634
+ }
635
+ ((intersectionWith2) => {
636
+ function lazy(other, comparator) {
637
+ return (value) => {
638
+ if (other.some((otherValue) => comparator(value, otherValue))) {
639
+ return {
640
+ done: false,
641
+ hasNext: true,
642
+ next: value
643
+ };
644
+ }
645
+ return {
646
+ done: false,
647
+ hasNext: false
648
+ };
649
+ };
650
+ }
651
+ intersectionWith2.lazy = lazy;
652
+ })(intersectionWith || (intersectionWith = {}));
653
+ function map(...args) {
654
+ return purry(_map(false), args, map.lazy);
655
+ }
656
+ function _map(indexed) {
657
+ return (array, fn) => {
658
+ return _reduceLazy(
659
+ array,
660
+ indexed ? map.lazyIndexed(fn) : map.lazy(fn),
661
+ indexed
662
+ );
663
+ };
664
+ }
665
+ function _lazy5(indexed) {
666
+ return (fn) => {
667
+ return (value, index, array) => {
668
+ return {
669
+ done: false,
670
+ hasNext: true,
671
+ next: indexed ? fn(value, index, array) : fn(value)
672
+ };
673
+ };
674
+ };
675
+ }
676
+ ((map2) => {
677
+ function indexed(...args) {
678
+ return purry(_map(true), args, map2.lazyIndexed);
679
+ }
680
+ map2.indexed = indexed;
681
+ map2.lazy = _lazy5(false);
682
+ map2.lazyIndexed = toLazyIndexed(_lazy5(true));
683
+ map2.strict = map2;
684
+ })(map || (map = {}));
685
+ function mapToObj(...args) {
686
+ return purry(_mapToObj(false), args);
687
+ }
688
+ function _mapToObj(indexed) {
689
+ return (array, fn) => {
690
+ return array.reduce((result, element, index) => {
691
+ const [key, value] = indexed ? fn(element, index, array) : fn(element);
692
+ result[key] = value;
693
+ return result;
694
+ }, {});
695
+ };
696
+ }
697
+ ((mapToObj2) => {
698
+ function indexed(...args) {
699
+ return purry(_mapToObj(true), args);
700
+ }
701
+ mapToObj2.indexed = indexed;
702
+ })(mapToObj || (mapToObj = {}));
703
+ function _maxBy(indexed) {
704
+ return (array, fn) => {
705
+ let ret;
706
+ let retMax;
707
+ array.forEach((item, i) => {
708
+ const max = indexed ? fn(item, i, array) : fn(item);
709
+ if (retMax === void 0 || max > retMax) {
710
+ ret = item;
711
+ retMax = max;
712
+ }
713
+ });
714
+ return ret;
715
+ };
716
+ }
717
+ function maxBy(...args) {
718
+ return purry(_maxBy(false), args);
719
+ }
720
+ ((maxBy2) => {
721
+ function indexed(...args) {
722
+ return purry(_maxBy(true), args);
723
+ }
724
+ maxBy2.indexed = indexed;
725
+ })(maxBy || (maxBy = {}));
726
+ function _meanBy(indexed) {
727
+ return (array, fn) => {
728
+ if (array.length === 0) {
729
+ return Number.NaN;
730
+ }
731
+ let sum = 0;
732
+ array.forEach((item, i) => {
733
+ sum += indexed ? fn(item, i, array) : fn(item);
734
+ });
735
+ return sum / array.length;
736
+ };
737
+ }
738
+ function meanBy(...args) {
739
+ return purry(_meanBy(false), args);
740
+ }
741
+ ((meanBy2) => {
742
+ function indexed(...args) {
743
+ return purry(_meanBy(true), args);
744
+ }
745
+ meanBy2.indexed = indexed;
746
+ })(meanBy || (meanBy = {}));
747
+ function _minBy(indexed) {
748
+ return (array, fn) => {
749
+ let ret;
750
+ let retMin;
751
+ array.forEach((item, i) => {
752
+ const min = indexed ? fn(item, i, array) : fn(item);
753
+ if (retMin === void 0 || min < retMin) {
754
+ ret = item;
755
+ retMin = min;
756
+ }
757
+ });
758
+ return ret;
759
+ };
760
+ }
761
+ function minBy(...args) {
762
+ return purry(_minBy(false), args);
763
+ }
764
+ ((minBy2) => {
765
+ function indexed(...args) {
766
+ return purry(_minBy(true), args);
767
+ }
768
+ minBy2.indexed = indexed;
769
+ })(minBy || (minBy = {}));
770
+ function partition(...args) {
771
+ return purry(_partition(false), args);
772
+ }
773
+ function _partition(indexed) {
774
+ return (array, fn) => {
775
+ const ret = [[], []];
776
+ array.forEach((item, index) => {
777
+ const matches = indexed ? fn(item, index, array) : fn(item);
778
+ ret[matches ? 0 : 1].push(item);
779
+ });
780
+ return ret;
781
+ };
782
+ }
783
+ ((partition2) => {
784
+ function indexed(...args) {
785
+ return purry(_partition(true), args);
786
+ }
787
+ partition2.indexed = indexed;
788
+ })(partition || (partition = {}));
789
+ function reduce(...args) {
790
+ return purry(_reduce(false), args);
791
+ }
792
+ function _reduce(indexed) {
793
+ return (items, fn, initialValue) => {
794
+ return items.reduce(
795
+ (acc, item, index) => indexed ? fn(acc, item, index, items) : fn(acc, item),
796
+ initialValue
797
+ );
798
+ };
799
+ }
800
+ ((reduce2) => {
801
+ function indexed(...args) {
802
+ return purry(_reduce(true), args);
803
+ }
804
+ reduce2.indexed = indexed;
805
+ })(reduce || (reduce = {}));
806
+ function reject(...args) {
807
+ return purry(_reject(false), args, reject.lazy);
808
+ }
809
+ function _reject(indexed) {
810
+ return (array, fn) => {
811
+ return _reduceLazy(
812
+ array,
813
+ indexed ? reject.lazyIndexed(fn) : reject.lazy(fn),
814
+ indexed
815
+ );
816
+ };
817
+ }
818
+ function _lazy6(indexed) {
819
+ return (fn) => {
820
+ return (value, index, array) => {
821
+ const valid = indexed ? fn(value, index, array) : fn(value);
822
+ if (!valid) {
823
+ return {
824
+ done: false,
825
+ hasNext: true,
826
+ next: value
827
+ };
828
+ }
829
+ return {
830
+ done: false,
831
+ hasNext: false
832
+ };
833
+ };
834
+ };
835
+ }
836
+ ((reject2) => {
837
+ function indexed(...args) {
838
+ return purry(_reject(true), args, reject2.lazyIndexed);
839
+ }
840
+ reject2.indexed = indexed;
841
+ reject2.lazy = _lazy6(false);
842
+ reject2.lazyIndexed = toLazyIndexed(_lazy6(true));
843
+ })(reject || (reject = {}));
844
+ function sort(...args) {
845
+ return purry(_sort, args);
846
+ }
847
+ function _sort(items, cmp) {
848
+ const ret = [...items];
849
+ ret.sort(cmp);
850
+ return ret;
851
+ }
852
+ ((sort2) => {
853
+ sort2.strict = sort2;
854
+ })(sort || (sort = {}));
855
+ var ALL_DIRECTIONS = ["asc", "desc"];
856
+ var COMPARATOR = {
857
+ asc: (x, y) => x > y,
858
+ desc: (x, y) => x < y
859
+ };
860
+ function sortBy(arrayOrSortRule, ...sortRules) {
861
+ const args = isSortRule(arrayOrSortRule) ? [[arrayOrSortRule, ...sortRules]] : [arrayOrSortRule, sortRules];
862
+ return purry(_sortBy, args);
863
+ }
864
+ function isSortRule(x) {
865
+ if (typeof x === "function") {
866
+ return true;
867
+ }
868
+ const [maybeProjection, maybeDirection, ...rest] = x;
869
+ if (rest.length > 0) {
870
+ return false;
871
+ }
872
+ return typeof maybeProjection === "function" && ALL_DIRECTIONS.includes(maybeDirection);
873
+ }
874
+ function _sortBy(array, sorts) {
875
+ return [...array].sort(comparer(...sorts));
876
+ }
877
+ function comparer(primaryRule, secondaryRule, ...otherRules) {
878
+ const projector = typeof primaryRule === "function" ? primaryRule : primaryRule[0];
879
+ const direction = typeof primaryRule === "function" ? "asc" : primaryRule[1];
880
+ const comparator = COMPARATOR[direction];
881
+ const nextComparer = secondaryRule === void 0 ? void 0 : comparer(secondaryRule, ...otherRules);
882
+ return (a, b) => {
883
+ const projectedA = projector(a);
884
+ const projectedB = projector(b);
885
+ if (comparator(projectedA, projectedB)) {
886
+ return 1;
887
+ }
888
+ if (comparator(projectedB, projectedA)) {
889
+ return -1;
890
+ }
891
+ return nextComparer?.(a, b) ?? 0;
892
+ };
893
+ }
894
+ ((sortBy2) => {
895
+ sortBy2.strict = sortBy2;
896
+ })(sortBy || (sortBy = {}));
897
+ function _sumBy(indexed) {
898
+ return (array, fn) => {
899
+ let sum = 0;
900
+ array.forEach((item, i) => {
901
+ const summand = indexed ? fn(item, i, array) : fn(item);
902
+ sum += summand;
903
+ });
904
+ return sum;
905
+ };
906
+ }
907
+ function sumBy(...args) {
908
+ return purry(_sumBy(false), args);
909
+ }
910
+ ((sumBy2) => {
911
+ function indexed(...args) {
912
+ return purry(_sumBy(true), args);
913
+ }
914
+ sumBy2.indexed = indexed;
915
+ })(sumBy || (sumBy = {}));
916
+ function take(...args) {
917
+ return purry(_take, args, take.lazy);
918
+ }
919
+ function _take(array, n) {
920
+ return _reduceLazy(array, take.lazy(n));
921
+ }
922
+ ((take2) => {
923
+ function lazy(n) {
924
+ return (value) => {
925
+ if (n === 0) {
926
+ return {
927
+ done: true,
928
+ hasNext: false
929
+ };
930
+ }
931
+ n--;
932
+ if (n === 0) {
933
+ return {
934
+ done: true,
935
+ hasNext: true,
936
+ next: value
937
+ };
938
+ }
939
+ return {
940
+ done: false,
941
+ hasNext: true,
942
+ next: value
943
+ };
944
+ };
945
+ }
946
+ take2.lazy = lazy;
947
+ })(take || (take = {}));
948
+ function uniq(...args) {
949
+ return purry(_uniq, args, uniq.lazy);
138
950
  }
139
951
  function _uniq(array) {
140
952
  return _reduceLazy(array, uniq.lazy());
141
953
  }
142
- (function(uniq2) {
954
+ ((uniq2) => {
143
955
  function lazy() {
144
- const set = /* @__PURE__ */ new Set();
956
+ const set2 = /* @__PURE__ */ new Set();
145
957
  return (value) => {
146
- if (set.has(value)) {
958
+ if (set2.has(value)) {
147
959
  return {
148
960
  done: false,
149
961
  hasNext: false
150
962
  };
151
963
  }
152
- set.add(value);
964
+ set2.add(value);
153
965
  return {
154
966
  done: false,
155
967
  hasNext: true,
@@ -159,6 +971,81 @@ function _uniq(array) {
159
971
  }
160
972
  uniq2.lazy = lazy;
161
973
  })(uniq || (uniq = {}));
974
+ function uniqWith(...args) {
975
+ return purry(_uniqWith, args, uniqWith.lazy);
976
+ }
977
+ function _uniqWith(array, isEquals) {
978
+ const lazy = uniqWith.lazy(isEquals);
979
+ return _reduceLazy(array, lazy, true);
980
+ }
981
+ function _lazy7(isEquals) {
982
+ return (value, index, array) => {
983
+ if (array && array.findIndex((otherValue) => isEquals(value, otherValue)) === index) {
984
+ return {
985
+ done: false,
986
+ hasNext: true,
987
+ next: value
988
+ };
989
+ }
990
+ return {
991
+ done: false,
992
+ hasNext: false
993
+ };
994
+ };
995
+ }
996
+ ((uniqWith2) => {
997
+ uniqWith2.lazy = toLazyIndexed(_lazy7);
998
+ })(uniqWith || (uniqWith = {}));
999
+ var isArray2 = Array.isArray;
1000
+ function forEachObj(...args) {
1001
+ return purry(_forEachObj(false), args);
1002
+ }
1003
+ function _forEachObj(indexed) {
1004
+ return (object, fn) => {
1005
+ for (const key in object) {
1006
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
1007
+ const val = object[key];
1008
+ if (indexed) {
1009
+ fn(val, key, object);
1010
+ } else {
1011
+ fn(val);
1012
+ }
1013
+ }
1014
+ }
1015
+ return object;
1016
+ };
1017
+ }
1018
+ ((forEachObj2) => {
1019
+ function indexed(...args) {
1020
+ return purry(_forEachObj(true), args);
1021
+ }
1022
+ forEachObj2.indexed = indexed;
1023
+ })(forEachObj || (forEachObj = {}));
1024
+ function fromPairs(entries) {
1025
+ const out = {};
1026
+ for (const [key, value] of entries) {
1027
+ out[key] = value;
1028
+ }
1029
+ return out;
1030
+ }
1031
+ ((fromPairs2) => {
1032
+ fromPairs2.strict = fromPairs2;
1033
+ })(fromPairs || (fromPairs = {}));
1034
+ function keys(source) {
1035
+ return Object.keys(source);
1036
+ }
1037
+ ((keys2) => {
1038
+ keys2.strict = keys2;
1039
+ })(keys || (keys = {}));
1040
+ function toPairs(object) {
1041
+ return Object.entries(object);
1042
+ }
1043
+ ((toPairs2) => {
1044
+ function strict(object) {
1045
+ return Object.entries(object);
1046
+ }
1047
+ toPairs2.strict = strict;
1048
+ })(toPairs || (toPairs = {}));
162
1049
 
163
1050
  // src/flags.ts
164
1051
  var ERROR = "error";
@@ -586,6 +1473,7 @@ function javascript(options = {}) {
586
1473
  argsIgnorePattern: "^_",
587
1474
  ignoreRestSiblings: true
588
1475
  }],
1476
+ ...import_eslint_plugin_vinicunca.default.configs.recommended.rules,
589
1477
  ...overrides
590
1478
  }
591
1479
  },