@html-validate/prettier-config 3.1.9 → 3.1.11

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.
@@ -24,6 +24,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
+ // node_modules/sort-package-json/node_modules/semver/internal/debug.js
28
+ var require_debug = __commonJS({
29
+ "node_modules/sort-package-json/node_modules/semver/internal/debug.js"(exports, module) {
30
+ "use strict";
31
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
32
+ };
33
+ module.exports = debug;
34
+ }
35
+ });
36
+
27
37
  // node_modules/sort-package-json/node_modules/semver/internal/constants.js
28
38
  var require_constants = __commonJS({
29
39
  "node_modules/sort-package-json/node_modules/semver/internal/constants.js"(exports, module) {
@@ -56,16 +66,6 @@ var require_constants = __commonJS({
56
66
  }
57
67
  });
58
68
 
59
- // node_modules/sort-package-json/node_modules/semver/internal/debug.js
60
- var require_debug = __commonJS({
61
- "node_modules/sort-package-json/node_modules/semver/internal/debug.js"(exports, module) {
62
- "use strict";
63
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
64
- };
65
- module.exports = debug;
66
- }
67
- });
68
-
69
69
  // node_modules/sort-package-json/node_modules/semver/internal/re.js
70
70
  var require_re = __commonJS({
71
71
  "node_modules/sort-package-json/node_modules/semver/internal/re.js"(exports, module) {
@@ -477,246 +477,51 @@ var require_semver = __commonJS({
477
477
  }
478
478
  });
479
479
 
480
- // node_modules/sort-package-json/node_modules/semver/functions/parse.js
481
- var require_parse = __commonJS({
482
- "node_modules/sort-package-json/node_modules/semver/functions/parse.js"(exports, module) {
480
+ // node_modules/sort-package-json/node_modules/semver/functions/compare.js
481
+ var require_compare = __commonJS({
482
+ "node_modules/sort-package-json/node_modules/semver/functions/compare.js"(exports, module) {
483
483
  "use strict";
484
484
  var SemVer = require_semver();
485
- var parse = (version, options, throwErrors = false) => {
486
- if (version instanceof SemVer) {
487
- return version;
488
- }
489
- try {
490
- return new SemVer(version, options);
491
- } catch (er) {
492
- if (!throwErrors) {
493
- return null;
494
- }
495
- throw er;
496
- }
497
- };
498
- module.exports = parse;
499
- }
500
- });
501
-
502
- // node_modules/sort-package-json/node_modules/semver/functions/valid.js
503
- var require_valid = __commonJS({
504
- "node_modules/sort-package-json/node_modules/semver/functions/valid.js"(exports, module) {
505
- "use strict";
506
- var parse = require_parse();
507
- var valid = (version, options) => {
508
- const v = parse(version, options);
509
- return v ? v.version : null;
510
- };
511
- module.exports = valid;
512
- }
513
- });
514
-
515
- // node_modules/sort-package-json/node_modules/semver/functions/clean.js
516
- var require_clean = __commonJS({
517
- "node_modules/sort-package-json/node_modules/semver/functions/clean.js"(exports, module) {
518
- "use strict";
519
- var parse = require_parse();
520
- var clean = (version, options) => {
521
- const s = parse(version.trim().replace(/^[=v]+/, ""), options);
522
- return s ? s.version : null;
523
- };
524
- module.exports = clean;
485
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
486
+ module.exports = compare;
525
487
  }
526
488
  });
527
489
 
528
- // node_modules/sort-package-json/node_modules/semver/functions/inc.js
529
- var require_inc = __commonJS({
530
- "node_modules/sort-package-json/node_modules/semver/functions/inc.js"(exports, module) {
490
+ // node_modules/sort-package-json/node_modules/semver/internal/lrucache.js
491
+ var require_lrucache = __commonJS({
492
+ "node_modules/sort-package-json/node_modules/semver/internal/lrucache.js"(exports, module) {
531
493
  "use strict";
532
- var SemVer = require_semver();
533
- var inc = (version, release, options, identifier, identifierBase) => {
534
- if (typeof options === "string") {
535
- identifierBase = identifier;
536
- identifier = options;
537
- options = void 0;
494
+ var LRUCache = class {
495
+ constructor() {
496
+ this.max = 1e3;
497
+ this.map = /* @__PURE__ */ new Map();
538
498
  }
539
- try {
540
- return new SemVer(
541
- version instanceof SemVer ? version.version : version,
542
- options
543
- ).inc(release, identifier, identifierBase).version;
544
- } catch (er) {
545
- return null;
499
+ get(key) {
500
+ const value = this.map.get(key);
501
+ if (value === void 0) {
502
+ return void 0;
503
+ } else {
504
+ this.map.delete(key);
505
+ this.map.set(key, value);
506
+ return value;
507
+ }
546
508
  }
547
- };
548
- module.exports = inc;
549
- }
550
- });
551
-
552
- // node_modules/sort-package-json/node_modules/semver/functions/diff.js
553
- var require_diff = __commonJS({
554
- "node_modules/sort-package-json/node_modules/semver/functions/diff.js"(exports, module) {
555
- "use strict";
556
- var parse = require_parse();
557
- var diff = (version1, version2) => {
558
- const v1 = parse(version1, null, true);
559
- const v2 = parse(version2, null, true);
560
- const comparison = v1.compare(v2);
561
- if (comparison === 0) {
562
- return null;
509
+ delete(key) {
510
+ return this.map.delete(key);
563
511
  }
564
- const v1Higher = comparison > 0;
565
- const highVersion = v1Higher ? v1 : v2;
566
- const lowVersion = v1Higher ? v2 : v1;
567
- const highHasPre = !!highVersion.prerelease.length;
568
- const lowHasPre = !!lowVersion.prerelease.length;
569
- if (lowHasPre && !highHasPre) {
570
- if (!lowVersion.patch && !lowVersion.minor) {
571
- return "major";
572
- }
573
- if (lowVersion.compareMain(highVersion) === 0) {
574
- if (lowVersion.minor && !lowVersion.patch) {
575
- return "minor";
512
+ set(key, value) {
513
+ const deleted = this.delete(key);
514
+ if (!deleted && value !== void 0) {
515
+ if (this.map.size >= this.max) {
516
+ const firstKey = this.map.keys().next().value;
517
+ this.delete(firstKey);
576
518
  }
577
- return "patch";
519
+ this.map.set(key, value);
578
520
  }
521
+ return this;
579
522
  }
580
- const prefix = highHasPre ? "pre" : "";
581
- if (v1.major !== v2.major) {
582
- return prefix + "major";
583
- }
584
- if (v1.minor !== v2.minor) {
585
- return prefix + "minor";
586
- }
587
- if (v1.patch !== v2.patch) {
588
- return prefix + "patch";
589
- }
590
- return "prerelease";
591
- };
592
- module.exports = diff;
593
- }
594
- });
595
-
596
- // node_modules/sort-package-json/node_modules/semver/functions/major.js
597
- var require_major = __commonJS({
598
- "node_modules/sort-package-json/node_modules/semver/functions/major.js"(exports, module) {
599
- "use strict";
600
- var SemVer = require_semver();
601
- var major = (a, loose) => new SemVer(a, loose).major;
602
- module.exports = major;
603
- }
604
- });
605
-
606
- // node_modules/sort-package-json/node_modules/semver/functions/minor.js
607
- var require_minor = __commonJS({
608
- "node_modules/sort-package-json/node_modules/semver/functions/minor.js"(exports, module) {
609
- "use strict";
610
- var SemVer = require_semver();
611
- var minor = (a, loose) => new SemVer(a, loose).minor;
612
- module.exports = minor;
613
- }
614
- });
615
-
616
- // node_modules/sort-package-json/node_modules/semver/functions/patch.js
617
- var require_patch = __commonJS({
618
- "node_modules/sort-package-json/node_modules/semver/functions/patch.js"(exports, module) {
619
- "use strict";
620
- var SemVer = require_semver();
621
- var patch = (a, loose) => new SemVer(a, loose).patch;
622
- module.exports = patch;
623
- }
624
- });
625
-
626
- // node_modules/sort-package-json/node_modules/semver/functions/prerelease.js
627
- var require_prerelease = __commonJS({
628
- "node_modules/sort-package-json/node_modules/semver/functions/prerelease.js"(exports, module) {
629
- "use strict";
630
- var parse = require_parse();
631
- var prerelease = (version, options) => {
632
- const parsed = parse(version, options);
633
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
634
- };
635
- module.exports = prerelease;
636
- }
637
- });
638
-
639
- // node_modules/sort-package-json/node_modules/semver/functions/compare.js
640
- var require_compare = __commonJS({
641
- "node_modules/sort-package-json/node_modules/semver/functions/compare.js"(exports, module) {
642
- "use strict";
643
- var SemVer = require_semver();
644
- var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
645
- module.exports = compare;
646
- }
647
- });
648
-
649
- // node_modules/sort-package-json/node_modules/semver/functions/rcompare.js
650
- var require_rcompare = __commonJS({
651
- "node_modules/sort-package-json/node_modules/semver/functions/rcompare.js"(exports, module) {
652
- "use strict";
653
- var compare = require_compare();
654
- var rcompare = (a, b, loose) => compare(b, a, loose);
655
- module.exports = rcompare;
656
- }
657
- });
658
-
659
- // node_modules/sort-package-json/node_modules/semver/functions/compare-loose.js
660
- var require_compare_loose = __commonJS({
661
- "node_modules/sort-package-json/node_modules/semver/functions/compare-loose.js"(exports, module) {
662
- "use strict";
663
- var compare = require_compare();
664
- var compareLoose = (a, b) => compare(a, b, true);
665
- module.exports = compareLoose;
666
- }
667
- });
668
-
669
- // node_modules/sort-package-json/node_modules/semver/functions/compare-build.js
670
- var require_compare_build = __commonJS({
671
- "node_modules/sort-package-json/node_modules/semver/functions/compare-build.js"(exports, module) {
672
- "use strict";
673
- var SemVer = require_semver();
674
- var compareBuild = (a, b, loose) => {
675
- const versionA = new SemVer(a, loose);
676
- const versionB = new SemVer(b, loose);
677
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
678
523
  };
679
- module.exports = compareBuild;
680
- }
681
- });
682
-
683
- // node_modules/sort-package-json/node_modules/semver/functions/sort.js
684
- var require_sort = __commonJS({
685
- "node_modules/sort-package-json/node_modules/semver/functions/sort.js"(exports, module) {
686
- "use strict";
687
- var compareBuild = require_compare_build();
688
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
689
- module.exports = sort;
690
- }
691
- });
692
-
693
- // node_modules/sort-package-json/node_modules/semver/functions/rsort.js
694
- var require_rsort = __commonJS({
695
- "node_modules/sort-package-json/node_modules/semver/functions/rsort.js"(exports, module) {
696
- "use strict";
697
- var compareBuild = require_compare_build();
698
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
699
- module.exports = rsort;
700
- }
701
- });
702
-
703
- // node_modules/sort-package-json/node_modules/semver/functions/gt.js
704
- var require_gt = __commonJS({
705
- "node_modules/sort-package-json/node_modules/semver/functions/gt.js"(exports, module) {
706
- "use strict";
707
- var compare = require_compare();
708
- var gt = (a, b, loose) => compare(a, b, loose) > 0;
709
- module.exports = gt;
710
- }
711
- });
712
-
713
- // node_modules/sort-package-json/node_modules/semver/functions/lt.js
714
- var require_lt = __commonJS({
715
- "node_modules/sort-package-json/node_modules/semver/functions/lt.js"(exports, module) {
716
- "use strict";
717
- var compare = require_compare();
718
- var lt = (a, b, loose) => compare(a, b, loose) < 0;
719
- module.exports = lt;
524
+ module.exports = LRUCache;
720
525
  }
721
526
  });
722
527
 
@@ -740,6 +545,16 @@ var require_neq = __commonJS({
740
545
  }
741
546
  });
742
547
 
548
+ // node_modules/sort-package-json/node_modules/semver/functions/gt.js
549
+ var require_gt = __commonJS({
550
+ "node_modules/sort-package-json/node_modules/semver/functions/gt.js"(exports, module) {
551
+ "use strict";
552
+ var compare = require_compare();
553
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
554
+ module.exports = gt;
555
+ }
556
+ });
557
+
743
558
  // node_modules/sort-package-json/node_modules/semver/functions/gte.js
744
559
  var require_gte = __commonJS({
745
560
  "node_modules/sort-package-json/node_modules/semver/functions/gte.js"(exports, module) {
@@ -750,6 +565,16 @@ var require_gte = __commonJS({
750
565
  }
751
566
  });
752
567
 
568
+ // node_modules/sort-package-json/node_modules/semver/functions/lt.js
569
+ var require_lt = __commonJS({
570
+ "node_modules/sort-package-json/node_modules/semver/functions/lt.js"(exports, module) {
571
+ "use strict";
572
+ var compare = require_compare();
573
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
574
+ module.exports = lt;
575
+ }
576
+ });
577
+
753
578
  // node_modules/sort-package-json/node_modules/semver/functions/lte.js
754
579
  var require_lte = __commonJS({
755
580
  "node_modules/sort-package-json/node_modules/semver/functions/lte.js"(exports, module) {
@@ -810,87 +635,116 @@ var require_cmp = __commonJS({
810
635
  }
811
636
  });
812
637
 
813
- // node_modules/sort-package-json/node_modules/semver/functions/coerce.js
814
- var require_coerce = __commonJS({
815
- "node_modules/sort-package-json/node_modules/semver/functions/coerce.js"(exports, module) {
638
+ // node_modules/sort-package-json/node_modules/semver/classes/comparator.js
639
+ var require_comparator = __commonJS({
640
+ "node_modules/sort-package-json/node_modules/semver/classes/comparator.js"(exports, module) {
816
641
  "use strict";
817
- var SemVer = require_semver();
818
- var parse = require_parse();
819
- var { safeRe: re, t } = require_re();
820
- var coerce = (version, options) => {
821
- if (version instanceof SemVer) {
822
- return version;
823
- }
824
- if (typeof version === "number") {
825
- version = String(version);
826
- }
827
- if (typeof version !== "string") {
828
- return null;
642
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
643
+ var Comparator = class _Comparator {
644
+ static get ANY() {
645
+ return ANY;
829
646
  }
830
- options = options || {};
831
- let match = null;
832
- if (!options.rtl) {
833
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
834
- } else {
835
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
836
- let next;
837
- while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
838
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
839
- match = next;
647
+ constructor(comp, options) {
648
+ options = parseOptions(options);
649
+ if (comp instanceof _Comparator) {
650
+ if (comp.loose === !!options.loose) {
651
+ return comp;
652
+ } else {
653
+ comp = comp.value;
840
654
  }
841
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
842
655
  }
843
- coerceRtlRegex.lastIndex = -1;
844
- }
845
- if (match === null) {
846
- return null;
847
- }
848
- const major = match[2];
849
- const minor = match[3] || "0";
850
- const patch = match[4] || "0";
851
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
852
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
853
- return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
854
- };
855
- module.exports = coerce;
856
- }
857
- });
858
-
859
- // node_modules/sort-package-json/node_modules/semver/internal/lrucache.js
860
- var require_lrucache = __commonJS({
861
- "node_modules/sort-package-json/node_modules/semver/internal/lrucache.js"(exports, module) {
862
- "use strict";
863
- var LRUCache = class {
864
- constructor() {
865
- this.max = 1e3;
866
- this.map = /* @__PURE__ */ new Map();
656
+ comp = comp.trim().split(/\s+/).join(" ");
657
+ debug("comparator", comp, options);
658
+ this.options = options;
659
+ this.loose = !!options.loose;
660
+ this.parse(comp);
661
+ if (this.semver === ANY) {
662
+ this.value = "";
663
+ } else {
664
+ this.value = this.operator + this.semver.version;
665
+ }
666
+ debug("comp", this);
867
667
  }
868
- get(key) {
869
- const value = this.map.get(key);
870
- if (value === void 0) {
871
- return void 0;
668
+ parse(comp) {
669
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
670
+ const m = comp.match(r);
671
+ if (!m) {
672
+ throw new TypeError(`Invalid comparator: ${comp}`);
673
+ }
674
+ this.operator = m[1] !== void 0 ? m[1] : "";
675
+ if (this.operator === "=") {
676
+ this.operator = "";
677
+ }
678
+ if (!m[2]) {
679
+ this.semver = ANY;
872
680
  } else {
873
- this.map.delete(key);
874
- this.map.set(key, value);
875
- return value;
681
+ this.semver = new SemVer(m[2], this.options.loose);
876
682
  }
877
683
  }
878
- delete(key) {
879
- return this.map.delete(key);
684
+ toString() {
685
+ return this.value;
880
686
  }
881
- set(key, value) {
882
- const deleted = this.delete(key);
883
- if (!deleted && value !== void 0) {
884
- if (this.map.size >= this.max) {
885
- const firstKey = this.map.keys().next().value;
886
- this.delete(firstKey);
687
+ test(version) {
688
+ debug("Comparator.test", version, this.options.loose);
689
+ if (this.semver === ANY || version === ANY) {
690
+ return true;
691
+ }
692
+ if (typeof version === "string") {
693
+ try {
694
+ version = new SemVer(version, this.options);
695
+ } catch (er) {
696
+ return false;
887
697
  }
888
- this.map.set(key, value);
889
698
  }
890
- return this;
699
+ return cmp(version, this.operator, this.semver, this.options);
700
+ }
701
+ intersects(comp, options) {
702
+ if (!(comp instanceof _Comparator)) {
703
+ throw new TypeError("a Comparator is required");
704
+ }
705
+ if (this.operator === "") {
706
+ if (this.value === "") {
707
+ return true;
708
+ }
709
+ return new Range(comp.value, options).test(this.value);
710
+ } else if (comp.operator === "") {
711
+ if (comp.value === "") {
712
+ return true;
713
+ }
714
+ return new Range(this.value, options).test(comp.semver);
715
+ }
716
+ options = parseOptions(options);
717
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
718
+ return false;
719
+ }
720
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
721
+ return false;
722
+ }
723
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
724
+ return true;
725
+ }
726
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
727
+ return true;
728
+ }
729
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
730
+ return true;
731
+ }
732
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
733
+ return true;
734
+ }
735
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
736
+ return true;
737
+ }
738
+ return false;
891
739
  }
892
740
  };
893
- module.exports = LRUCache;
741
+ module.exports = Comparator;
742
+ var parseOptions = require_parse_options();
743
+ var { safeRe: re, t } = require_re();
744
+ var cmp = require_cmp();
745
+ var debug = require_debug();
746
+ var SemVer = require_semver();
747
+ var Range = require_range();
894
748
  }
895
749
  });
896
750
 
@@ -1206,266 +1060,68 @@ var require_range = __commonJS({
1206
1060
  } else if (xp) {
1207
1061
  ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1208
1062
  }
1209
- debug("xRange return", ret);
1210
- return ret;
1211
- });
1212
- };
1213
- var replaceStars = (comp, options) => {
1214
- debug("replaceStars", comp, options);
1215
- return comp.trim().replace(re[t.STAR], "");
1216
- };
1217
- var replaceGTE0 = (comp, options) => {
1218
- debug("replaceGTE0", comp, options);
1219
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1220
- };
1221
- var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1222
- if (isX(fM)) {
1223
- from = "";
1224
- } else if (isX(fm)) {
1225
- from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1226
- } else if (isX(fp)) {
1227
- from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1228
- } else if (fpr) {
1229
- from = `>=${from}`;
1230
- } else {
1231
- from = `>=${from}${incPr ? "-0" : ""}`;
1232
- }
1233
- if (isX(tM)) {
1234
- to = "";
1235
- } else if (isX(tm)) {
1236
- to = `<${+tM + 1}.0.0-0`;
1237
- } else if (isX(tp)) {
1238
- to = `<${tM}.${+tm + 1}.0-0`;
1239
- } else if (tpr) {
1240
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
1241
- } else if (incPr) {
1242
- to = `<${tM}.${tm}.${+tp + 1}-0`;
1243
- } else {
1244
- to = `<=${to}`;
1245
- }
1246
- return `${from} ${to}`.trim();
1247
- };
1248
- var testSet = (set, version, options) => {
1249
- for (let i = 0; i < set.length; i++) {
1250
- if (!set[i].test(version)) {
1251
- return false;
1252
- }
1253
- }
1254
- if (version.prerelease.length && !options.includePrerelease) {
1255
- for (let i = 0; i < set.length; i++) {
1256
- debug(set[i].semver);
1257
- if (set[i].semver === Comparator.ANY) {
1258
- continue;
1259
- }
1260
- if (set[i].semver.prerelease.length > 0) {
1261
- const allowed = set[i].semver;
1262
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1263
- return true;
1264
- }
1265
- }
1266
- }
1267
- return false;
1268
- }
1269
- return true;
1270
- };
1271
- }
1272
- });
1273
-
1274
- // node_modules/sort-package-json/node_modules/semver/classes/comparator.js
1275
- var require_comparator = __commonJS({
1276
- "node_modules/sort-package-json/node_modules/semver/classes/comparator.js"(exports, module) {
1277
- "use strict";
1278
- var ANY = Symbol("SemVer ANY");
1279
- var Comparator = class _Comparator {
1280
- static get ANY() {
1281
- return ANY;
1282
- }
1283
- constructor(comp, options) {
1284
- options = parseOptions(options);
1285
- if (comp instanceof _Comparator) {
1286
- if (comp.loose === !!options.loose) {
1287
- return comp;
1288
- } else {
1289
- comp = comp.value;
1290
- }
1291
- }
1292
- comp = comp.trim().split(/\s+/).join(" ");
1293
- debug("comparator", comp, options);
1294
- this.options = options;
1295
- this.loose = !!options.loose;
1296
- this.parse(comp);
1297
- if (this.semver === ANY) {
1298
- this.value = "";
1299
- } else {
1300
- this.value = this.operator + this.semver.version;
1301
- }
1302
- debug("comp", this);
1303
- }
1304
- parse(comp) {
1305
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1306
- const m = comp.match(r);
1307
- if (!m) {
1308
- throw new TypeError(`Invalid comparator: ${comp}`);
1309
- }
1310
- this.operator = m[1] !== void 0 ? m[1] : "";
1311
- if (this.operator === "=") {
1312
- this.operator = "";
1313
- }
1314
- if (!m[2]) {
1315
- this.semver = ANY;
1316
- } else {
1317
- this.semver = new SemVer(m[2], this.options.loose);
1318
- }
1319
- }
1320
- toString() {
1321
- return this.value;
1322
- }
1323
- test(version) {
1324
- debug("Comparator.test", version, this.options.loose);
1325
- if (this.semver === ANY || version === ANY) {
1326
- return true;
1327
- }
1328
- if (typeof version === "string") {
1329
- try {
1330
- version = new SemVer(version, this.options);
1331
- } catch (er) {
1332
- return false;
1333
- }
1334
- }
1335
- return cmp(version, this.operator, this.semver, this.options);
1336
- }
1337
- intersects(comp, options) {
1338
- if (!(comp instanceof _Comparator)) {
1339
- throw new TypeError("a Comparator is required");
1340
- }
1341
- if (this.operator === "") {
1342
- if (this.value === "") {
1343
- return true;
1344
- }
1345
- return new Range(comp.value, options).test(this.value);
1346
- } else if (comp.operator === "") {
1347
- if (comp.value === "") {
1348
- return true;
1349
- }
1350
- return new Range(this.value, options).test(comp.semver);
1351
- }
1352
- options = parseOptions(options);
1353
- if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1354
- return false;
1355
- }
1356
- if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1357
- return false;
1358
- }
1359
- if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1360
- return true;
1361
- }
1362
- if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1363
- return true;
1364
- }
1365
- if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1366
- return true;
1367
- }
1368
- if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1369
- return true;
1370
- }
1371
- if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1372
- return true;
1373
- }
1374
- return false;
1375
- }
1063
+ debug("xRange return", ret);
1064
+ return ret;
1065
+ });
1376
1066
  };
1377
- module.exports = Comparator;
1378
- var parseOptions = require_parse_options();
1379
- var { safeRe: re, t } = require_re();
1380
- var cmp = require_cmp();
1381
- var debug = require_debug();
1382
- var SemVer = require_semver();
1383
- var Range = require_range();
1384
- }
1385
- });
1386
-
1387
- // node_modules/sort-package-json/node_modules/semver/functions/satisfies.js
1388
- var require_satisfies = __commonJS({
1389
- "node_modules/sort-package-json/node_modules/semver/functions/satisfies.js"(exports, module) {
1390
- "use strict";
1391
- var Range = require_range();
1392
- var satisfies = (version, range, options) => {
1393
- try {
1394
- range = new Range(range, options);
1395
- } catch (er) {
1396
- return false;
1397
- }
1398
- return range.test(version);
1067
+ var replaceStars = (comp, options) => {
1068
+ debug("replaceStars", comp, options);
1069
+ return comp.trim().replace(re[t.STAR], "");
1399
1070
  };
1400
- module.exports = satisfies;
1401
- }
1402
- });
1403
-
1404
- // node_modules/sort-package-json/node_modules/semver/ranges/to-comparators.js
1405
- var require_to_comparators = __commonJS({
1406
- "node_modules/sort-package-json/node_modules/semver/ranges/to-comparators.js"(exports, module) {
1407
- "use strict";
1408
- var Range = require_range();
1409
- var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1410
- module.exports = toComparators;
1411
- }
1412
- });
1413
-
1414
- // node_modules/sort-package-json/node_modules/semver/ranges/max-satisfying.js
1415
- var require_max_satisfying = __commonJS({
1416
- "node_modules/sort-package-json/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1417
- "use strict";
1418
- var SemVer = require_semver();
1419
- var Range = require_range();
1420
- var maxSatisfying = (versions, range, options) => {
1421
- let max = null;
1422
- let maxSV = null;
1423
- let rangeObj = null;
1424
- try {
1425
- rangeObj = new Range(range, options);
1426
- } catch (er) {
1427
- return null;
1071
+ var replaceGTE0 = (comp, options) => {
1072
+ debug("replaceGTE0", comp, options);
1073
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1074
+ };
1075
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1076
+ if (isX(fM)) {
1077
+ from = "";
1078
+ } else if (isX(fm)) {
1079
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1080
+ } else if (isX(fp)) {
1081
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1082
+ } else if (fpr) {
1083
+ from = `>=${from}`;
1084
+ } else {
1085
+ from = `>=${from}${incPr ? "-0" : ""}`;
1428
1086
  }
1429
- versions.forEach((v) => {
1430
- if (rangeObj.test(v)) {
1431
- if (!max || maxSV.compare(v) === -1) {
1432
- max = v;
1433
- maxSV = new SemVer(max, options);
1434
- }
1435
- }
1436
- });
1437
- return max;
1087
+ if (isX(tM)) {
1088
+ to = "";
1089
+ } else if (isX(tm)) {
1090
+ to = `<${+tM + 1}.0.0-0`;
1091
+ } else if (isX(tp)) {
1092
+ to = `<${tM}.${+tm + 1}.0-0`;
1093
+ } else if (tpr) {
1094
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1095
+ } else if (incPr) {
1096
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1097
+ } else {
1098
+ to = `<=${to}`;
1099
+ }
1100
+ return `${from} ${to}`.trim();
1438
1101
  };
1439
- module.exports = maxSatisfying;
1440
- }
1441
- });
1442
-
1443
- // node_modules/sort-package-json/node_modules/semver/ranges/min-satisfying.js
1444
- var require_min_satisfying = __commonJS({
1445
- "node_modules/sort-package-json/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1446
- "use strict";
1447
- var SemVer = require_semver();
1448
- var Range = require_range();
1449
- var minSatisfying = (versions, range, options) => {
1450
- let min = null;
1451
- let minSV = null;
1452
- let rangeObj = null;
1453
- try {
1454
- rangeObj = new Range(range, options);
1455
- } catch (er) {
1456
- return null;
1102
+ var testSet = (set, version, options) => {
1103
+ for (let i = 0; i < set.length; i++) {
1104
+ if (!set[i].test(version)) {
1105
+ return false;
1106
+ }
1457
1107
  }
1458
- versions.forEach((v) => {
1459
- if (rangeObj.test(v)) {
1460
- if (!min || minSV.compare(v) === 1) {
1461
- min = v;
1462
- minSV = new SemVer(min, options);
1108
+ if (version.prerelease.length && !options.includePrerelease) {
1109
+ for (let i = 0; i < set.length; i++) {
1110
+ debug(set[i].semver);
1111
+ if (set[i].semver === Comparator.ANY) {
1112
+ continue;
1113
+ }
1114
+ if (set[i].semver.prerelease.length > 0) {
1115
+ const allowed = set[i].semver;
1116
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1117
+ return true;
1118
+ }
1463
1119
  }
1464
1120
  }
1465
- });
1466
- return min;
1121
+ return false;
1122
+ }
1123
+ return true;
1467
1124
  };
1468
- module.exports = minSatisfying;
1469
1125
  }
1470
1126
  });
1471
1127
 
@@ -1528,432 +1184,6 @@ var require_min_version = __commonJS({
1528
1184
  }
1529
1185
  });
1530
1186
 
1531
- // node_modules/sort-package-json/node_modules/semver/ranges/valid.js
1532
- var require_valid2 = __commonJS({
1533
- "node_modules/sort-package-json/node_modules/semver/ranges/valid.js"(exports, module) {
1534
- "use strict";
1535
- var Range = require_range();
1536
- var validRange = (range, options) => {
1537
- try {
1538
- return new Range(range, options).range || "*";
1539
- } catch (er) {
1540
- return null;
1541
- }
1542
- };
1543
- module.exports = validRange;
1544
- }
1545
- });
1546
-
1547
- // node_modules/sort-package-json/node_modules/semver/ranges/outside.js
1548
- var require_outside = __commonJS({
1549
- "node_modules/sort-package-json/node_modules/semver/ranges/outside.js"(exports, module) {
1550
- "use strict";
1551
- var SemVer = require_semver();
1552
- var Comparator = require_comparator();
1553
- var { ANY } = Comparator;
1554
- var Range = require_range();
1555
- var satisfies = require_satisfies();
1556
- var gt = require_gt();
1557
- var lt = require_lt();
1558
- var lte = require_lte();
1559
- var gte = require_gte();
1560
- var outside = (version, range, hilo, options) => {
1561
- version = new SemVer(version, options);
1562
- range = new Range(range, options);
1563
- let gtfn, ltefn, ltfn, comp, ecomp;
1564
- switch (hilo) {
1565
- case ">":
1566
- gtfn = gt;
1567
- ltefn = lte;
1568
- ltfn = lt;
1569
- comp = ">";
1570
- ecomp = ">=";
1571
- break;
1572
- case "<":
1573
- gtfn = lt;
1574
- ltefn = gte;
1575
- ltfn = gt;
1576
- comp = "<";
1577
- ecomp = "<=";
1578
- break;
1579
- default:
1580
- throw new TypeError('Must provide a hilo val of "<" or ">"');
1581
- }
1582
- if (satisfies(version, range, options)) {
1583
- return false;
1584
- }
1585
- for (let i = 0; i < range.set.length; ++i) {
1586
- const comparators = range.set[i];
1587
- let high = null;
1588
- let low = null;
1589
- comparators.forEach((comparator) => {
1590
- if (comparator.semver === ANY) {
1591
- comparator = new Comparator(">=0.0.0");
1592
- }
1593
- high = high || comparator;
1594
- low = low || comparator;
1595
- if (gtfn(comparator.semver, high.semver, options)) {
1596
- high = comparator;
1597
- } else if (ltfn(comparator.semver, low.semver, options)) {
1598
- low = comparator;
1599
- }
1600
- });
1601
- if (high.operator === comp || high.operator === ecomp) {
1602
- return false;
1603
- }
1604
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1605
- return false;
1606
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1607
- return false;
1608
- }
1609
- }
1610
- return true;
1611
- };
1612
- module.exports = outside;
1613
- }
1614
- });
1615
-
1616
- // node_modules/sort-package-json/node_modules/semver/ranges/gtr.js
1617
- var require_gtr = __commonJS({
1618
- "node_modules/sort-package-json/node_modules/semver/ranges/gtr.js"(exports, module) {
1619
- "use strict";
1620
- var outside = require_outside();
1621
- var gtr = (version, range, options) => outside(version, range, ">", options);
1622
- module.exports = gtr;
1623
- }
1624
- });
1625
-
1626
- // node_modules/sort-package-json/node_modules/semver/ranges/ltr.js
1627
- var require_ltr = __commonJS({
1628
- "node_modules/sort-package-json/node_modules/semver/ranges/ltr.js"(exports, module) {
1629
- "use strict";
1630
- var outside = require_outside();
1631
- var ltr = (version, range, options) => outside(version, range, "<", options);
1632
- module.exports = ltr;
1633
- }
1634
- });
1635
-
1636
- // node_modules/sort-package-json/node_modules/semver/ranges/intersects.js
1637
- var require_intersects = __commonJS({
1638
- "node_modules/sort-package-json/node_modules/semver/ranges/intersects.js"(exports, module) {
1639
- "use strict";
1640
- var Range = require_range();
1641
- var intersects = (r1, r2, options) => {
1642
- r1 = new Range(r1, options);
1643
- r2 = new Range(r2, options);
1644
- return r1.intersects(r2, options);
1645
- };
1646
- module.exports = intersects;
1647
- }
1648
- });
1649
-
1650
- // node_modules/sort-package-json/node_modules/semver/ranges/simplify.js
1651
- var require_simplify = __commonJS({
1652
- "node_modules/sort-package-json/node_modules/semver/ranges/simplify.js"(exports, module) {
1653
- "use strict";
1654
- var satisfies = require_satisfies();
1655
- var compare = require_compare();
1656
- module.exports = (versions, range, options) => {
1657
- const set = [];
1658
- let first = null;
1659
- let prev = null;
1660
- const v = versions.sort((a, b) => compare(a, b, options));
1661
- for (const version of v) {
1662
- const included = satisfies(version, range, options);
1663
- if (included) {
1664
- prev = version;
1665
- if (!first) {
1666
- first = version;
1667
- }
1668
- } else {
1669
- if (prev) {
1670
- set.push([first, prev]);
1671
- }
1672
- prev = null;
1673
- first = null;
1674
- }
1675
- }
1676
- if (first) {
1677
- set.push([first, null]);
1678
- }
1679
- const ranges = [];
1680
- for (const [min, max] of set) {
1681
- if (min === max) {
1682
- ranges.push(min);
1683
- } else if (!max && min === v[0]) {
1684
- ranges.push("*");
1685
- } else if (!max) {
1686
- ranges.push(`>=${min}`);
1687
- } else if (min === v[0]) {
1688
- ranges.push(`<=${max}`);
1689
- } else {
1690
- ranges.push(`${min} - ${max}`);
1691
- }
1692
- }
1693
- const simplified = ranges.join(" || ");
1694
- const original = typeof range.raw === "string" ? range.raw : String(range);
1695
- return simplified.length < original.length ? simplified : range;
1696
- };
1697
- }
1698
- });
1699
-
1700
- // node_modules/sort-package-json/node_modules/semver/ranges/subset.js
1701
- var require_subset = __commonJS({
1702
- "node_modules/sort-package-json/node_modules/semver/ranges/subset.js"(exports, module) {
1703
- "use strict";
1704
- var Range = require_range();
1705
- var Comparator = require_comparator();
1706
- var { ANY } = Comparator;
1707
- var satisfies = require_satisfies();
1708
- var compare = require_compare();
1709
- var subset = (sub, dom, options = {}) => {
1710
- if (sub === dom) {
1711
- return true;
1712
- }
1713
- sub = new Range(sub, options);
1714
- dom = new Range(dom, options);
1715
- let sawNonNull = false;
1716
- OUTER: for (const simpleSub of sub.set) {
1717
- for (const simpleDom of dom.set) {
1718
- const isSub = simpleSubset(simpleSub, simpleDom, options);
1719
- sawNonNull = sawNonNull || isSub !== null;
1720
- if (isSub) {
1721
- continue OUTER;
1722
- }
1723
- }
1724
- if (sawNonNull) {
1725
- return false;
1726
- }
1727
- }
1728
- return true;
1729
- };
1730
- var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1731
- var minimumVersion = [new Comparator(">=0.0.0")];
1732
- var simpleSubset = (sub, dom, options) => {
1733
- if (sub === dom) {
1734
- return true;
1735
- }
1736
- if (sub.length === 1 && sub[0].semver === ANY) {
1737
- if (dom.length === 1 && dom[0].semver === ANY) {
1738
- return true;
1739
- } else if (options.includePrerelease) {
1740
- sub = minimumVersionWithPreRelease;
1741
- } else {
1742
- sub = minimumVersion;
1743
- }
1744
- }
1745
- if (dom.length === 1 && dom[0].semver === ANY) {
1746
- if (options.includePrerelease) {
1747
- return true;
1748
- } else {
1749
- dom = minimumVersion;
1750
- }
1751
- }
1752
- const eqSet = /* @__PURE__ */ new Set();
1753
- let gt, lt;
1754
- for (const c of sub) {
1755
- if (c.operator === ">" || c.operator === ">=") {
1756
- gt = higherGT(gt, c, options);
1757
- } else if (c.operator === "<" || c.operator === "<=") {
1758
- lt = lowerLT(lt, c, options);
1759
- } else {
1760
- eqSet.add(c.semver);
1761
- }
1762
- }
1763
- if (eqSet.size > 1) {
1764
- return null;
1765
- }
1766
- let gtltComp;
1767
- if (gt && lt) {
1768
- gtltComp = compare(gt.semver, lt.semver, options);
1769
- if (gtltComp > 0) {
1770
- return null;
1771
- } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1772
- return null;
1773
- }
1774
- }
1775
- for (const eq of eqSet) {
1776
- if (gt && !satisfies(eq, String(gt), options)) {
1777
- return null;
1778
- }
1779
- if (lt && !satisfies(eq, String(lt), options)) {
1780
- return null;
1781
- }
1782
- for (const c of dom) {
1783
- if (!satisfies(eq, String(c), options)) {
1784
- return false;
1785
- }
1786
- }
1787
- return true;
1788
- }
1789
- let higher, lower;
1790
- let hasDomLT, hasDomGT;
1791
- let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1792
- let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1793
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1794
- needDomLTPre = false;
1795
- }
1796
- for (const c of dom) {
1797
- hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1798
- hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1799
- if (gt) {
1800
- if (needDomGTPre) {
1801
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1802
- needDomGTPre = false;
1803
- }
1804
- }
1805
- if (c.operator === ">" || c.operator === ">=") {
1806
- higher = higherGT(gt, c, options);
1807
- if (higher === c && higher !== gt) {
1808
- return false;
1809
- }
1810
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
1811
- return false;
1812
- }
1813
- }
1814
- if (lt) {
1815
- if (needDomLTPre) {
1816
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1817
- needDomLTPre = false;
1818
- }
1819
- }
1820
- if (c.operator === "<" || c.operator === "<=") {
1821
- lower = lowerLT(lt, c, options);
1822
- if (lower === c && lower !== lt) {
1823
- return false;
1824
- }
1825
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
1826
- return false;
1827
- }
1828
- }
1829
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
1830
- return false;
1831
- }
1832
- }
1833
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
1834
- return false;
1835
- }
1836
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
1837
- return false;
1838
- }
1839
- if (needDomGTPre || needDomLTPre) {
1840
- return false;
1841
- }
1842
- return true;
1843
- };
1844
- var higherGT = (a, b, options) => {
1845
- if (!a) {
1846
- return b;
1847
- }
1848
- const comp = compare(a.semver, b.semver, options);
1849
- return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1850
- };
1851
- var lowerLT = (a, b, options) => {
1852
- if (!a) {
1853
- return b;
1854
- }
1855
- const comp = compare(a.semver, b.semver, options);
1856
- return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1857
- };
1858
- module.exports = subset;
1859
- }
1860
- });
1861
-
1862
- // node_modules/sort-package-json/node_modules/semver/index.js
1863
- var require_semver2 = __commonJS({
1864
- "node_modules/sort-package-json/node_modules/semver/index.js"(exports, module) {
1865
- "use strict";
1866
- var internalRe = require_re();
1867
- var constants = require_constants();
1868
- var SemVer = require_semver();
1869
- var identifiers = require_identifiers();
1870
- var parse = require_parse();
1871
- var valid = require_valid();
1872
- var clean = require_clean();
1873
- var inc = require_inc();
1874
- var diff = require_diff();
1875
- var major = require_major();
1876
- var minor = require_minor();
1877
- var patch = require_patch();
1878
- var prerelease = require_prerelease();
1879
- var compare = require_compare();
1880
- var rcompare = require_rcompare();
1881
- var compareLoose = require_compare_loose();
1882
- var compareBuild = require_compare_build();
1883
- var sort = require_sort();
1884
- var rsort = require_rsort();
1885
- var gt = require_gt();
1886
- var lt = require_lt();
1887
- var eq = require_eq();
1888
- var neq = require_neq();
1889
- var gte = require_gte();
1890
- var lte = require_lte();
1891
- var cmp = require_cmp();
1892
- var coerce = require_coerce();
1893
- var Comparator = require_comparator();
1894
- var Range = require_range();
1895
- var satisfies = require_satisfies();
1896
- var toComparators = require_to_comparators();
1897
- var maxSatisfying = require_max_satisfying();
1898
- var minSatisfying = require_min_satisfying();
1899
- var minVersion = require_min_version();
1900
- var validRange = require_valid2();
1901
- var outside = require_outside();
1902
- var gtr = require_gtr();
1903
- var ltr = require_ltr();
1904
- var intersects = require_intersects();
1905
- var simplifyRange = require_simplify();
1906
- var subset = require_subset();
1907
- module.exports = {
1908
- parse,
1909
- valid,
1910
- clean,
1911
- inc,
1912
- diff,
1913
- major,
1914
- minor,
1915
- patch,
1916
- prerelease,
1917
- compare,
1918
- rcompare,
1919
- compareLoose,
1920
- compareBuild,
1921
- sort,
1922
- rsort,
1923
- gt,
1924
- lt,
1925
- eq,
1926
- neq,
1927
- gte,
1928
- lte,
1929
- cmp,
1930
- coerce,
1931
- Comparator,
1932
- Range,
1933
- satisfies,
1934
- toComparators,
1935
- maxSatisfying,
1936
- minSatisfying,
1937
- minVersion,
1938
- validRange,
1939
- outside,
1940
- gtr,
1941
- ltr,
1942
- intersects,
1943
- simplifyRange,
1944
- subset,
1945
- SemVer,
1946
- re: internalRe.re,
1947
- src: internalRe.src,
1948
- tokens: internalRe.t,
1949
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1950
- RELEASE_TYPES: constants.RELEASE_TYPES,
1951
- compareIdentifiers: identifiers.compareIdentifiers,
1952
- rcompareIdentifiers: identifiers.rcompareIdentifiers
1953
- };
1954
- }
1955
- });
1956
-
1957
1187
  // src/sort-package-json.ts
1958
1188
  import { parsers } from "prettier/esm/parser-babel.mjs";
1959
1189
 
@@ -2135,7 +1365,8 @@ function isPlainObject(value) {
2135
1365
  }
2136
1366
 
2137
1367
  // node_modules/sort-package-json/index.js
2138
- var import_semver = __toESM(require_semver2(), 1);
1368
+ var import_compare = __toESM(require_compare(), 1);
1369
+ var import_min_version = __toESM(require_min_version(), 1);
2139
1370
  var pipe = (fns) => (x, ...args) => fns.reduce((result, fn) => fn(result, ...args), x);
2140
1371
  var onArray = (fn) => (x) => Array.isArray(x) ? fn(x) : x;
2141
1372
  var onStringArray = (fn) => (x) => Array.isArray(x) && x.every((item) => typeof item === "string") ? fn(x) : x;
@@ -2207,7 +1438,7 @@ var sortObjectBySemver = sortObjectBy((a, b) => {
2207
1438
  if (!bRange) {
2208
1439
  return 1;
2209
1440
  }
2210
- return import_semver.default.compare(import_semver.default.minVersion(aRange), import_semver.default.minVersion(bRange));
1441
+ return (0, import_compare.default)((0, import_min_version.default)(aRange), (0, import_min_version.default)(bRange));
2211
1442
  });
2212
1443
  var getPackageName = (ident) => {
2213
1444
  const index = ident.indexOf("@", ident.startsWith("@") ? 1 : 0);
@@ -2221,24 +1452,13 @@ var sortObjectByIdent = (a, b) => {
2221
1452
  return 0;
2222
1453
  };
2223
1454
  var sortDependenciesLikeNpm = sortObjectBy((a, b) => a.localeCompare(b, "en"));
2224
- var sortWorkspaces = (workspaces) => {
2225
- if (!isPlainObject(workspaces)) {
2226
- return workspaces;
2227
- }
2228
- const sortedWorkspaces = {};
2229
- if (workspaces.packages) {
2230
- sortedWorkspaces.packages = uniqAndSortArray(workspaces.packages);
2231
- }
2232
- if (workspaces.catalog) {
2233
- sortedWorkspaces.catalog = sortDependenciesLikeNpm(workspaces.catalog);
2234
- }
2235
- const knownKeys = ["packages", "catalog"];
2236
- const otherKeys = Object.keys(workspaces).filter((key) => !knownKeys.includes(key)).sort();
2237
- for (const key of otherKeys) {
2238
- sortedWorkspaces[key] = workspaces[key];
2239
- }
2240
- return sortedWorkspaces;
2241
- };
1455
+ var sortWorkspaces = onObject(
1456
+ pipe([
1457
+ sortObjectBy(["packages", "catalog"]),
1458
+ overProperty("packages", uniqAndSortArray),
1459
+ overProperty("catalog", sortDependenciesLikeNpm)
1460
+ ])
1461
+ );
2242
1462
  var eslintBaseConfigProperties = [
2243
1463
  // `files` and `excludedFiles` are only on `overrides[]`
2244
1464
  // for easier sort `overrides[]`,
@@ -2352,10 +1572,34 @@ var hasSequentialScript = (packageJson) => {
2352
1572
  );
2353
1573
  return scripts.some((script) => isSequentialScript(script));
2354
1574
  };
1575
+ function sortScriptNames(keys, prefix = "") {
1576
+ const groupMap = /* @__PURE__ */ new Map();
1577
+ for (const key of keys) {
1578
+ const rest = prefix ? key.slice(prefix.length + 1) : key;
1579
+ const idx = rest.indexOf(":");
1580
+ if (idx !== -1) {
1581
+ const base = key.slice(0, (prefix ? prefix.length + 1 : 0) + idx);
1582
+ if (!groupMap.has(base)) groupMap.set(base, []);
1583
+ groupMap.get(base).push(key);
1584
+ } else {
1585
+ if (!groupMap.has(key)) groupMap.set(key, []);
1586
+ groupMap.get(key).push(key);
1587
+ }
1588
+ }
1589
+ return Array.from(groupMap.keys()).sort().flatMap((groupKey) => {
1590
+ const children = groupMap.get(groupKey);
1591
+ if (children.length > 1 && children.some((k) => k !== groupKey && k.startsWith(groupKey + ":"))) {
1592
+ const direct = children.filter((k) => k === groupKey || !k.startsWith(groupKey + ":")).sort();
1593
+ const nested = children.filter((k) => k.startsWith(groupKey + ":"));
1594
+ return [...direct, ...sortScriptNames(nested, groupKey)];
1595
+ }
1596
+ return children.sort();
1597
+ });
1598
+ }
2355
1599
  var sortScripts = onObject((scripts, packageJson) => {
2356
- const names = Object.keys(scripts);
1600
+ let names = Object.keys(scripts);
2357
1601
  const prefixable = /* @__PURE__ */ new Set();
2358
- const keys = names.map((name) => {
1602
+ names = names.map((name) => {
2359
1603
  const omitted = name.replace(/^(?:pre|post)/, "");
2360
1604
  if (defaultNpmScripts.has(omitted) || names.includes(omitted)) {
2361
1605
  prefixable.add(omitted);
@@ -2364,12 +1608,12 @@ var sortScripts = onObject((scripts, packageJson) => {
2364
1608
  return name;
2365
1609
  });
2366
1610
  if (!hasSequentialScript(packageJson)) {
2367
- keys.sort();
1611
+ names = sortScriptNames(names);
2368
1612
  }
2369
- const order = keys.flatMap(
1613
+ names = names.flatMap(
2370
1614
  (key) => prefixable.has(key) ? [`pre${key}`, key, `post${key}`] : [key]
2371
1615
  );
2372
- return sortObjectByKeyNameList(scripts, order);
1616
+ return sortObjectByKeyNameList(scripts, names);
2373
1617
  });
2374
1618
  var sortConditions = (conditions) => {
2375
1619
  const {
@@ -2563,14 +1807,6 @@ function editStringJSON(json, over) {
2563
1807
  }
2564
1808
  return over(json);
2565
1809
  }
2566
- var isPrivateKey = (key) => key[0] === "_";
2567
- var partition = (array, predicate) => array.reduce(
2568
- (result, value) => {
2569
- result[predicate(value) ? 0 : 1].push(value);
2570
- return result;
2571
- },
2572
- [[], []]
2573
- );
2574
1810
  function sortPackageJson(jsonIsh, options = {}) {
2575
1811
  return editStringJSON(
2576
1812
  jsonIsh,
@@ -2578,7 +1814,10 @@ function sortPackageJson(jsonIsh, options = {}) {
2578
1814
  let sortOrder = options.sortOrder || defaultSortOrder;
2579
1815
  if (Array.isArray(sortOrder)) {
2580
1816
  const keys = Object.keys(json);
2581
- const [privateKeys, publicKeys] = partition(keys, isPrivateKey);
1817
+ const { privateKeys = [], publicKeys = [] } = objectGroupBy(
1818
+ keys,
1819
+ (key) => key[0] === "_" ? "privateKeys" : "publicKeys"
1820
+ );
2582
1821
  sortOrder = [
2583
1822
  ...sortOrder,
2584
1823
  ...defaultSortOrder,