@forsakringskassan/prettier-config-svelte 3.3.0 → 3.3.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.
@@ -30,6 +30,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
+ // ../../node_modules/sort-package-json/node_modules/semver/internal/debug.js
34
+ var require_debug = __commonJS({
35
+ "../../node_modules/sort-package-json/node_modules/semver/internal/debug.js"(exports2, module2) {
36
+ "use strict";
37
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
38
+ };
39
+ module2.exports = debug;
40
+ }
41
+ });
42
+
33
43
  // ../../node_modules/sort-package-json/node_modules/semver/internal/constants.js
34
44
  var require_constants = __commonJS({
35
45
  "../../node_modules/sort-package-json/node_modules/semver/internal/constants.js"(exports2, module2) {
@@ -62,16 +72,6 @@ var require_constants = __commonJS({
62
72
  }
63
73
  });
64
74
 
65
- // ../../node_modules/sort-package-json/node_modules/semver/internal/debug.js
66
- var require_debug = __commonJS({
67
- "../../node_modules/sort-package-json/node_modules/semver/internal/debug.js"(exports2, module2) {
68
- "use strict";
69
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
70
- };
71
- module2.exports = debug;
72
- }
73
- });
74
-
75
75
  // ../../node_modules/sort-package-json/node_modules/semver/internal/re.js
76
76
  var require_re = __commonJS({
77
77
  "../../node_modules/sort-package-json/node_modules/semver/internal/re.js"(exports2, module2) {
@@ -483,246 +483,51 @@ var require_semver = __commonJS({
483
483
  }
484
484
  });
485
485
 
486
- // ../../node_modules/sort-package-json/node_modules/semver/functions/parse.js
487
- var require_parse = __commonJS({
488
- "../../node_modules/sort-package-json/node_modules/semver/functions/parse.js"(exports2, module2) {
486
+ // ../../node_modules/sort-package-json/node_modules/semver/functions/compare.js
487
+ var require_compare = __commonJS({
488
+ "../../node_modules/sort-package-json/node_modules/semver/functions/compare.js"(exports2, module2) {
489
489
  "use strict";
490
490
  var SemVer = require_semver();
491
- var parse = (version, options, throwErrors = false) => {
492
- if (version instanceof SemVer) {
493
- return version;
494
- }
495
- try {
496
- return new SemVer(version, options);
497
- } catch (er) {
498
- if (!throwErrors) {
499
- return null;
500
- }
501
- throw er;
502
- }
503
- };
504
- module2.exports = parse;
505
- }
506
- });
507
-
508
- // ../../node_modules/sort-package-json/node_modules/semver/functions/valid.js
509
- var require_valid = __commonJS({
510
- "../../node_modules/sort-package-json/node_modules/semver/functions/valid.js"(exports2, module2) {
511
- "use strict";
512
- var parse = require_parse();
513
- var valid = (version, options) => {
514
- const v = parse(version, options);
515
- return v ? v.version : null;
516
- };
517
- module2.exports = valid;
518
- }
519
- });
520
-
521
- // ../../node_modules/sort-package-json/node_modules/semver/functions/clean.js
522
- var require_clean = __commonJS({
523
- "../../node_modules/sort-package-json/node_modules/semver/functions/clean.js"(exports2, module2) {
524
- "use strict";
525
- var parse = require_parse();
526
- var clean = (version, options) => {
527
- const s = parse(version.trim().replace(/^[=v]+/, ""), options);
528
- return s ? s.version : null;
529
- };
530
- module2.exports = clean;
491
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
492
+ module2.exports = compare;
531
493
  }
532
494
  });
533
495
 
534
- // ../../node_modules/sort-package-json/node_modules/semver/functions/inc.js
535
- var require_inc = __commonJS({
536
- "../../node_modules/sort-package-json/node_modules/semver/functions/inc.js"(exports2, module2) {
496
+ // ../../node_modules/sort-package-json/node_modules/semver/internal/lrucache.js
497
+ var require_lrucache = __commonJS({
498
+ "../../node_modules/sort-package-json/node_modules/semver/internal/lrucache.js"(exports2, module2) {
537
499
  "use strict";
538
- var SemVer = require_semver();
539
- var inc = (version, release, options, identifier, identifierBase) => {
540
- if (typeof options === "string") {
541
- identifierBase = identifier;
542
- identifier = options;
543
- options = void 0;
500
+ var LRUCache = class {
501
+ constructor() {
502
+ this.max = 1e3;
503
+ this.map = /* @__PURE__ */ new Map();
544
504
  }
545
- try {
546
- return new SemVer(
547
- version instanceof SemVer ? version.version : version,
548
- options
549
- ).inc(release, identifier, identifierBase).version;
550
- } catch (er) {
551
- return null;
505
+ get(key) {
506
+ const value = this.map.get(key);
507
+ if (value === void 0) {
508
+ return void 0;
509
+ } else {
510
+ this.map.delete(key);
511
+ this.map.set(key, value);
512
+ return value;
513
+ }
552
514
  }
553
- };
554
- module2.exports = inc;
555
- }
556
- });
557
-
558
- // ../../node_modules/sort-package-json/node_modules/semver/functions/diff.js
559
- var require_diff = __commonJS({
560
- "../../node_modules/sort-package-json/node_modules/semver/functions/diff.js"(exports2, module2) {
561
- "use strict";
562
- var parse = require_parse();
563
- var diff = (version1, version2) => {
564
- const v1 = parse(version1, null, true);
565
- const v2 = parse(version2, null, true);
566
- const comparison = v1.compare(v2);
567
- if (comparison === 0) {
568
- return null;
515
+ delete(key) {
516
+ return this.map.delete(key);
569
517
  }
570
- const v1Higher = comparison > 0;
571
- const highVersion = v1Higher ? v1 : v2;
572
- const lowVersion = v1Higher ? v2 : v1;
573
- const highHasPre = !!highVersion.prerelease.length;
574
- const lowHasPre = !!lowVersion.prerelease.length;
575
- if (lowHasPre && !highHasPre) {
576
- if (!lowVersion.patch && !lowVersion.minor) {
577
- return "major";
578
- }
579
- if (lowVersion.compareMain(highVersion) === 0) {
580
- if (lowVersion.minor && !lowVersion.patch) {
581
- return "minor";
518
+ set(key, value) {
519
+ const deleted = this.delete(key);
520
+ if (!deleted && value !== void 0) {
521
+ if (this.map.size >= this.max) {
522
+ const firstKey = this.map.keys().next().value;
523
+ this.delete(firstKey);
582
524
  }
583
- return "patch";
525
+ this.map.set(key, value);
584
526
  }
527
+ return this;
585
528
  }
586
- const prefix = highHasPre ? "pre" : "";
587
- if (v1.major !== v2.major) {
588
- return prefix + "major";
589
- }
590
- if (v1.minor !== v2.minor) {
591
- return prefix + "minor";
592
- }
593
- if (v1.patch !== v2.patch) {
594
- return prefix + "patch";
595
- }
596
- return "prerelease";
597
- };
598
- module2.exports = diff;
599
- }
600
- });
601
-
602
- // ../../node_modules/sort-package-json/node_modules/semver/functions/major.js
603
- var require_major = __commonJS({
604
- "../../node_modules/sort-package-json/node_modules/semver/functions/major.js"(exports2, module2) {
605
- "use strict";
606
- var SemVer = require_semver();
607
- var major = (a, loose) => new SemVer(a, loose).major;
608
- module2.exports = major;
609
- }
610
- });
611
-
612
- // ../../node_modules/sort-package-json/node_modules/semver/functions/minor.js
613
- var require_minor = __commonJS({
614
- "../../node_modules/sort-package-json/node_modules/semver/functions/minor.js"(exports2, module2) {
615
- "use strict";
616
- var SemVer = require_semver();
617
- var minor = (a, loose) => new SemVer(a, loose).minor;
618
- module2.exports = minor;
619
- }
620
- });
621
-
622
- // ../../node_modules/sort-package-json/node_modules/semver/functions/patch.js
623
- var require_patch = __commonJS({
624
- "../../node_modules/sort-package-json/node_modules/semver/functions/patch.js"(exports2, module2) {
625
- "use strict";
626
- var SemVer = require_semver();
627
- var patch = (a, loose) => new SemVer(a, loose).patch;
628
- module2.exports = patch;
629
- }
630
- });
631
-
632
- // ../../node_modules/sort-package-json/node_modules/semver/functions/prerelease.js
633
- var require_prerelease = __commonJS({
634
- "../../node_modules/sort-package-json/node_modules/semver/functions/prerelease.js"(exports2, module2) {
635
- "use strict";
636
- var parse = require_parse();
637
- var prerelease = (version, options) => {
638
- const parsed = parse(version, options);
639
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
640
- };
641
- module2.exports = prerelease;
642
- }
643
- });
644
-
645
- // ../../node_modules/sort-package-json/node_modules/semver/functions/compare.js
646
- var require_compare = __commonJS({
647
- "../../node_modules/sort-package-json/node_modules/semver/functions/compare.js"(exports2, module2) {
648
- "use strict";
649
- var SemVer = require_semver();
650
- var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
651
- module2.exports = compare;
652
- }
653
- });
654
-
655
- // ../../node_modules/sort-package-json/node_modules/semver/functions/rcompare.js
656
- var require_rcompare = __commonJS({
657
- "../../node_modules/sort-package-json/node_modules/semver/functions/rcompare.js"(exports2, module2) {
658
- "use strict";
659
- var compare = require_compare();
660
- var rcompare = (a, b, loose) => compare(b, a, loose);
661
- module2.exports = rcompare;
662
- }
663
- });
664
-
665
- // ../../node_modules/sort-package-json/node_modules/semver/functions/compare-loose.js
666
- var require_compare_loose = __commonJS({
667
- "../../node_modules/sort-package-json/node_modules/semver/functions/compare-loose.js"(exports2, module2) {
668
- "use strict";
669
- var compare = require_compare();
670
- var compareLoose = (a, b) => compare(a, b, true);
671
- module2.exports = compareLoose;
672
- }
673
- });
674
-
675
- // ../../node_modules/sort-package-json/node_modules/semver/functions/compare-build.js
676
- var require_compare_build = __commonJS({
677
- "../../node_modules/sort-package-json/node_modules/semver/functions/compare-build.js"(exports2, module2) {
678
- "use strict";
679
- var SemVer = require_semver();
680
- var compareBuild = (a, b, loose) => {
681
- const versionA = new SemVer(a, loose);
682
- const versionB = new SemVer(b, loose);
683
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
684
529
  };
685
- module2.exports = compareBuild;
686
- }
687
- });
688
-
689
- // ../../node_modules/sort-package-json/node_modules/semver/functions/sort.js
690
- var require_sort = __commonJS({
691
- "../../node_modules/sort-package-json/node_modules/semver/functions/sort.js"(exports2, module2) {
692
- "use strict";
693
- var compareBuild = require_compare_build();
694
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
695
- module2.exports = sort;
696
- }
697
- });
698
-
699
- // ../../node_modules/sort-package-json/node_modules/semver/functions/rsort.js
700
- var require_rsort = __commonJS({
701
- "../../node_modules/sort-package-json/node_modules/semver/functions/rsort.js"(exports2, module2) {
702
- "use strict";
703
- var compareBuild = require_compare_build();
704
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
705
- module2.exports = rsort;
706
- }
707
- });
708
-
709
- // ../../node_modules/sort-package-json/node_modules/semver/functions/gt.js
710
- var require_gt = __commonJS({
711
- "../../node_modules/sort-package-json/node_modules/semver/functions/gt.js"(exports2, module2) {
712
- "use strict";
713
- var compare = require_compare();
714
- var gt = (a, b, loose) => compare(a, b, loose) > 0;
715
- module2.exports = gt;
716
- }
717
- });
718
-
719
- // ../../node_modules/sort-package-json/node_modules/semver/functions/lt.js
720
- var require_lt = __commonJS({
721
- "../../node_modules/sort-package-json/node_modules/semver/functions/lt.js"(exports2, module2) {
722
- "use strict";
723
- var compare = require_compare();
724
- var lt = (a, b, loose) => compare(a, b, loose) < 0;
725
- module2.exports = lt;
530
+ module2.exports = LRUCache;
726
531
  }
727
532
  });
728
533
 
@@ -746,6 +551,16 @@ var require_neq = __commonJS({
746
551
  }
747
552
  });
748
553
 
554
+ // ../../node_modules/sort-package-json/node_modules/semver/functions/gt.js
555
+ var require_gt = __commonJS({
556
+ "../../node_modules/sort-package-json/node_modules/semver/functions/gt.js"(exports2, module2) {
557
+ "use strict";
558
+ var compare = require_compare();
559
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
560
+ module2.exports = gt;
561
+ }
562
+ });
563
+
749
564
  // ../../node_modules/sort-package-json/node_modules/semver/functions/gte.js
750
565
  var require_gte = __commonJS({
751
566
  "../../node_modules/sort-package-json/node_modules/semver/functions/gte.js"(exports2, module2) {
@@ -756,6 +571,16 @@ var require_gte = __commonJS({
756
571
  }
757
572
  });
758
573
 
574
+ // ../../node_modules/sort-package-json/node_modules/semver/functions/lt.js
575
+ var require_lt = __commonJS({
576
+ "../../node_modules/sort-package-json/node_modules/semver/functions/lt.js"(exports2, module2) {
577
+ "use strict";
578
+ var compare = require_compare();
579
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
580
+ module2.exports = lt;
581
+ }
582
+ });
583
+
759
584
  // ../../node_modules/sort-package-json/node_modules/semver/functions/lte.js
760
585
  var require_lte = __commonJS({
761
586
  "../../node_modules/sort-package-json/node_modules/semver/functions/lte.js"(exports2, module2) {
@@ -816,87 +641,116 @@ var require_cmp = __commonJS({
816
641
  }
817
642
  });
818
643
 
819
- // ../../node_modules/sort-package-json/node_modules/semver/functions/coerce.js
820
- var require_coerce = __commonJS({
821
- "../../node_modules/sort-package-json/node_modules/semver/functions/coerce.js"(exports2, module2) {
644
+ // ../../node_modules/sort-package-json/node_modules/semver/classes/comparator.js
645
+ var require_comparator = __commonJS({
646
+ "../../node_modules/sort-package-json/node_modules/semver/classes/comparator.js"(exports2, module2) {
822
647
  "use strict";
823
- var SemVer = require_semver();
824
- var parse = require_parse();
825
- var { safeRe: re, t } = require_re();
826
- var coerce = (version, options) => {
827
- if (version instanceof SemVer) {
828
- return version;
829
- }
830
- if (typeof version === "number") {
831
- version = String(version);
832
- }
833
- if (typeof version !== "string") {
834
- return null;
648
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
649
+ var Comparator = class _Comparator {
650
+ static get ANY() {
651
+ return ANY;
835
652
  }
836
- options = options || {};
837
- let match = null;
838
- if (!options.rtl) {
839
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
840
- } else {
841
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
842
- let next;
843
- while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
844
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
845
- match = next;
653
+ constructor(comp, options) {
654
+ options = parseOptions(options);
655
+ if (comp instanceof _Comparator) {
656
+ if (comp.loose === !!options.loose) {
657
+ return comp;
658
+ } else {
659
+ comp = comp.value;
846
660
  }
847
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
848
661
  }
849
- coerceRtlRegex.lastIndex = -1;
850
- }
851
- if (match === null) {
852
- return null;
853
- }
854
- const major = match[2];
855
- const minor = match[3] || "0";
856
- const patch = match[4] || "0";
857
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
858
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
859
- return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
860
- };
861
- module2.exports = coerce;
862
- }
863
- });
864
-
865
- // ../../node_modules/sort-package-json/node_modules/semver/internal/lrucache.js
866
- var require_lrucache = __commonJS({
867
- "../../node_modules/sort-package-json/node_modules/semver/internal/lrucache.js"(exports2, module2) {
868
- "use strict";
869
- var LRUCache = class {
870
- constructor() {
871
- this.max = 1e3;
872
- this.map = /* @__PURE__ */ new Map();
662
+ comp = comp.trim().split(/\s+/).join(" ");
663
+ debug("comparator", comp, options);
664
+ this.options = options;
665
+ this.loose = !!options.loose;
666
+ this.parse(comp);
667
+ if (this.semver === ANY) {
668
+ this.value = "";
669
+ } else {
670
+ this.value = this.operator + this.semver.version;
671
+ }
672
+ debug("comp", this);
873
673
  }
874
- get(key) {
875
- const value = this.map.get(key);
876
- if (value === void 0) {
877
- return void 0;
674
+ parse(comp) {
675
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
676
+ const m = comp.match(r);
677
+ if (!m) {
678
+ throw new TypeError(`Invalid comparator: ${comp}`);
679
+ }
680
+ this.operator = m[1] !== void 0 ? m[1] : "";
681
+ if (this.operator === "=") {
682
+ this.operator = "";
683
+ }
684
+ if (!m[2]) {
685
+ this.semver = ANY;
878
686
  } else {
879
- this.map.delete(key);
880
- this.map.set(key, value);
881
- return value;
687
+ this.semver = new SemVer(m[2], this.options.loose);
882
688
  }
883
689
  }
884
- delete(key) {
885
- return this.map.delete(key);
690
+ toString() {
691
+ return this.value;
886
692
  }
887
- set(key, value) {
888
- const deleted = this.delete(key);
889
- if (!deleted && value !== void 0) {
890
- if (this.map.size >= this.max) {
891
- const firstKey = this.map.keys().next().value;
892
- this.delete(firstKey);
693
+ test(version) {
694
+ debug("Comparator.test", version, this.options.loose);
695
+ if (this.semver === ANY || version === ANY) {
696
+ return true;
697
+ }
698
+ if (typeof version === "string") {
699
+ try {
700
+ version = new SemVer(version, this.options);
701
+ } catch (er) {
702
+ return false;
893
703
  }
894
- this.map.set(key, value);
895
704
  }
896
- return this;
705
+ return cmp(version, this.operator, this.semver, this.options);
706
+ }
707
+ intersects(comp, options) {
708
+ if (!(comp instanceof _Comparator)) {
709
+ throw new TypeError("a Comparator is required");
710
+ }
711
+ if (this.operator === "") {
712
+ if (this.value === "") {
713
+ return true;
714
+ }
715
+ return new Range(comp.value, options).test(this.value);
716
+ } else if (comp.operator === "") {
717
+ if (comp.value === "") {
718
+ return true;
719
+ }
720
+ return new Range(this.value, options).test(comp.semver);
721
+ }
722
+ options = parseOptions(options);
723
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
724
+ return false;
725
+ }
726
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
727
+ return false;
728
+ }
729
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
730
+ return true;
731
+ }
732
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
733
+ return true;
734
+ }
735
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
736
+ return true;
737
+ }
738
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
739
+ return true;
740
+ }
741
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
742
+ return true;
743
+ }
744
+ return false;
897
745
  }
898
746
  };
899
- module2.exports = LRUCache;
747
+ module2.exports = Comparator;
748
+ var parseOptions = require_parse_options();
749
+ var { safeRe: re, t } = require_re();
750
+ var cmp = require_cmp();
751
+ var debug = require_debug();
752
+ var SemVer = require_semver();
753
+ var Range = require_range();
900
754
  }
901
755
  });
902
756
 
@@ -972,7 +826,7 @@ var require_range = __commonJS({
972
826
  parseRange(range) {
973
827
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
974
828
  const memoKey = memoOpts + ":" + range;
975
- const cached = cache.get(memoKey);
829
+ const cached = cache2.get(memoKey);
976
830
  if (cached) {
977
831
  return cached;
978
832
  }
@@ -1006,7 +860,7 @@ var require_range = __commonJS({
1006
860
  rangeMap.delete("");
1007
861
  }
1008
862
  const result = [...rangeMap.values()];
1009
- cache.set(memoKey, result);
863
+ cache2.set(memoKey, result);
1010
864
  return result;
1011
865
  }
1012
866
  intersects(range, options) {
@@ -1045,7 +899,7 @@ var require_range = __commonJS({
1045
899
  };
1046
900
  module2.exports = Range;
1047
901
  var LRU = require_lrucache();
1048
- var cache = new LRU();
902
+ var cache2 = new LRU();
1049
903
  var parseOptions = require_parse_options();
1050
904
  var Comparator = require_comparator();
1051
905
  var debug = require_debug();
@@ -1197,281 +1051,83 @@ var require_range = __commonJS({
1197
1051
  }
1198
1052
  } else if (gtlt === "<=") {
1199
1053
  gtlt = "<";
1200
- if (xm) {
1201
- M = +M + 1;
1202
- } else {
1203
- m = +m + 1;
1204
- }
1205
- }
1206
- if (gtlt === "<") {
1207
- pr = "-0";
1208
- }
1209
- ret = `${gtlt + M}.${m}.${p}${pr}`;
1210
- } else if (xm) {
1211
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1212
- } else if (xp) {
1213
- ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1214
- }
1215
- debug("xRange return", ret);
1216
- return ret;
1217
- });
1218
- };
1219
- var replaceStars = (comp, options) => {
1220
- debug("replaceStars", comp, options);
1221
- return comp.trim().replace(re[t.STAR], "");
1222
- };
1223
- var replaceGTE0 = (comp, options) => {
1224
- debug("replaceGTE0", comp, options);
1225
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1226
- };
1227
- var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1228
- if (isX(fM)) {
1229
- from = "";
1230
- } else if (isX(fm)) {
1231
- from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1232
- } else if (isX(fp)) {
1233
- from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1234
- } else if (fpr) {
1235
- from = `>=${from}`;
1236
- } else {
1237
- from = `>=${from}${incPr ? "-0" : ""}`;
1238
- }
1239
- if (isX(tM)) {
1240
- to = "";
1241
- } else if (isX(tm)) {
1242
- to = `<${+tM + 1}.0.0-0`;
1243
- } else if (isX(tp)) {
1244
- to = `<${tM}.${+tm + 1}.0-0`;
1245
- } else if (tpr) {
1246
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
1247
- } else if (incPr) {
1248
- to = `<${tM}.${tm}.${+tp + 1}-0`;
1249
- } else {
1250
- to = `<=${to}`;
1251
- }
1252
- return `${from} ${to}`.trim();
1253
- };
1254
- var testSet = (set, version, options) => {
1255
- for (let i = 0; i < set.length; i++) {
1256
- if (!set[i].test(version)) {
1257
- return false;
1258
- }
1259
- }
1260
- if (version.prerelease.length && !options.includePrerelease) {
1261
- for (let i = 0; i < set.length; i++) {
1262
- debug(set[i].semver);
1263
- if (set[i].semver === Comparator.ANY) {
1264
- continue;
1265
- }
1266
- if (set[i].semver.prerelease.length > 0) {
1267
- const allowed = set[i].semver;
1268
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1269
- return true;
1270
- }
1271
- }
1272
- }
1273
- return false;
1274
- }
1275
- return true;
1276
- };
1277
- }
1278
- });
1279
-
1280
- // ../../node_modules/sort-package-json/node_modules/semver/classes/comparator.js
1281
- var require_comparator = __commonJS({
1282
- "../../node_modules/sort-package-json/node_modules/semver/classes/comparator.js"(exports2, module2) {
1283
- "use strict";
1284
- var ANY = Symbol("SemVer ANY");
1285
- var Comparator = class _Comparator {
1286
- static get ANY() {
1287
- return ANY;
1288
- }
1289
- constructor(comp, options) {
1290
- options = parseOptions(options);
1291
- if (comp instanceof _Comparator) {
1292
- if (comp.loose === !!options.loose) {
1293
- return comp;
1294
- } else {
1295
- comp = comp.value;
1296
- }
1297
- }
1298
- comp = comp.trim().split(/\s+/).join(" ");
1299
- debug("comparator", comp, options);
1300
- this.options = options;
1301
- this.loose = !!options.loose;
1302
- this.parse(comp);
1303
- if (this.semver === ANY) {
1304
- this.value = "";
1305
- } else {
1306
- this.value = this.operator + this.semver.version;
1307
- }
1308
- debug("comp", this);
1309
- }
1310
- parse(comp) {
1311
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1312
- const m = comp.match(r);
1313
- if (!m) {
1314
- throw new TypeError(`Invalid comparator: ${comp}`);
1315
- }
1316
- this.operator = m[1] !== void 0 ? m[1] : "";
1317
- if (this.operator === "=") {
1318
- this.operator = "";
1319
- }
1320
- if (!m[2]) {
1321
- this.semver = ANY;
1322
- } else {
1323
- this.semver = new SemVer(m[2], this.options.loose);
1324
- }
1325
- }
1326
- toString() {
1327
- return this.value;
1328
- }
1329
- test(version) {
1330
- debug("Comparator.test", version, this.options.loose);
1331
- if (this.semver === ANY || version === ANY) {
1332
- return true;
1333
- }
1334
- if (typeof version === "string") {
1335
- try {
1336
- version = new SemVer(version, this.options);
1337
- } catch (er) {
1338
- return false;
1339
- }
1340
- }
1341
- return cmp(version, this.operator, this.semver, this.options);
1342
- }
1343
- intersects(comp, options) {
1344
- if (!(comp instanceof _Comparator)) {
1345
- throw new TypeError("a Comparator is required");
1346
- }
1347
- if (this.operator === "") {
1348
- if (this.value === "") {
1349
- return true;
1350
- }
1351
- return new Range(comp.value, options).test(this.value);
1352
- } else if (comp.operator === "") {
1353
- if (comp.value === "") {
1354
- return true;
1355
- }
1356
- return new Range(this.value, options).test(comp.semver);
1357
- }
1358
- options = parseOptions(options);
1359
- if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1360
- return false;
1361
- }
1362
- if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1363
- return false;
1364
- }
1365
- if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1366
- return true;
1367
- }
1368
- if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1369
- return true;
1370
- }
1371
- if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1372
- return true;
1373
- }
1374
- if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1375
- return true;
1376
- }
1377
- if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1378
- return true;
1379
- }
1380
- return false;
1381
- }
1382
- };
1383
- module2.exports = Comparator;
1384
- var parseOptions = require_parse_options();
1385
- var { safeRe: re, t } = require_re();
1386
- var cmp = require_cmp();
1387
- var debug = require_debug();
1388
- var SemVer = require_semver();
1389
- var Range = require_range();
1390
- }
1391
- });
1392
-
1393
- // ../../node_modules/sort-package-json/node_modules/semver/functions/satisfies.js
1394
- var require_satisfies = __commonJS({
1395
- "../../node_modules/sort-package-json/node_modules/semver/functions/satisfies.js"(exports2, module2) {
1396
- "use strict";
1397
- var Range = require_range();
1398
- var satisfies = (version, range, options) => {
1399
- try {
1400
- range = new Range(range, options);
1401
- } catch (er) {
1402
- return false;
1403
- }
1404
- return range.test(version);
1405
- };
1406
- module2.exports = satisfies;
1407
- }
1408
- });
1409
-
1410
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/to-comparators.js
1411
- var require_to_comparators = __commonJS({
1412
- "../../node_modules/sort-package-json/node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
1413
- "use strict";
1414
- var Range = require_range();
1415
- var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1416
- module2.exports = toComparators;
1417
- }
1418
- });
1419
-
1420
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/max-satisfying.js
1421
- var require_max_satisfying = __commonJS({
1422
- "../../node_modules/sort-package-json/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
1423
- "use strict";
1424
- var SemVer = require_semver();
1425
- var Range = require_range();
1426
- var maxSatisfying = (versions, range, options) => {
1427
- let max = null;
1428
- let maxSV = null;
1429
- let rangeObj = null;
1430
- try {
1431
- rangeObj = new Range(range, options);
1432
- } catch (er) {
1433
- return null;
1434
- }
1435
- versions.forEach((v) => {
1436
- if (rangeObj.test(v)) {
1437
- if (!max || maxSV.compare(v) === -1) {
1438
- max = v;
1439
- maxSV = new SemVer(max, options);
1054
+ if (xm) {
1055
+ M = +M + 1;
1056
+ } else {
1057
+ m = +m + 1;
1058
+ }
1059
+ }
1060
+ if (gtlt === "<") {
1061
+ pr = "-0";
1440
1062
  }
1063
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1064
+ } else if (xm) {
1065
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1066
+ } else if (xp) {
1067
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1441
1068
  }
1069
+ debug("xRange return", ret);
1070
+ return ret;
1442
1071
  });
1443
- return max;
1444
1072
  };
1445
- module2.exports = maxSatisfying;
1446
- }
1447
- });
1448
-
1449
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/min-satisfying.js
1450
- var require_min_satisfying = __commonJS({
1451
- "../../node_modules/sort-package-json/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
1452
- "use strict";
1453
- var SemVer = require_semver();
1454
- var Range = require_range();
1455
- var minSatisfying = (versions, range, options) => {
1456
- let min = null;
1457
- let minSV = null;
1458
- let rangeObj = null;
1459
- try {
1460
- rangeObj = new Range(range, options);
1461
- } catch (er) {
1462
- return null;
1073
+ var replaceStars = (comp, options) => {
1074
+ debug("replaceStars", comp, options);
1075
+ return comp.trim().replace(re[t.STAR], "");
1076
+ };
1077
+ var replaceGTE0 = (comp, options) => {
1078
+ debug("replaceGTE0", comp, options);
1079
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1080
+ };
1081
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1082
+ if (isX(fM)) {
1083
+ from = "";
1084
+ } else if (isX(fm)) {
1085
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1086
+ } else if (isX(fp)) {
1087
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1088
+ } else if (fpr) {
1089
+ from = `>=${from}`;
1090
+ } else {
1091
+ from = `>=${from}${incPr ? "-0" : ""}`;
1092
+ }
1093
+ if (isX(tM)) {
1094
+ to = "";
1095
+ } else if (isX(tm)) {
1096
+ to = `<${+tM + 1}.0.0-0`;
1097
+ } else if (isX(tp)) {
1098
+ to = `<${tM}.${+tm + 1}.0-0`;
1099
+ } else if (tpr) {
1100
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1101
+ } else if (incPr) {
1102
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1103
+ } else {
1104
+ to = `<=${to}`;
1105
+ }
1106
+ return `${from} ${to}`.trim();
1107
+ };
1108
+ var testSet = (set, version, options) => {
1109
+ for (let i = 0; i < set.length; i++) {
1110
+ if (!set[i].test(version)) {
1111
+ return false;
1112
+ }
1463
1113
  }
1464
- versions.forEach((v) => {
1465
- if (rangeObj.test(v)) {
1466
- if (!min || minSV.compare(v) === 1) {
1467
- min = v;
1468
- minSV = new SemVer(min, options);
1114
+ if (version.prerelease.length && !options.includePrerelease) {
1115
+ for (let i = 0; i < set.length; i++) {
1116
+ debug(set[i].semver);
1117
+ if (set[i].semver === Comparator.ANY) {
1118
+ continue;
1119
+ }
1120
+ if (set[i].semver.prerelease.length > 0) {
1121
+ const allowed = set[i].semver;
1122
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1123
+ return true;
1124
+ }
1469
1125
  }
1470
1126
  }
1471
- });
1472
- return min;
1127
+ return false;
1128
+ }
1129
+ return true;
1473
1130
  };
1474
- module2.exports = minSatisfying;
1475
1131
  }
1476
1132
  });
1477
1133
 
@@ -1534,432 +1190,6 @@ var require_min_version = __commonJS({
1534
1190
  }
1535
1191
  });
1536
1192
 
1537
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/valid.js
1538
- var require_valid2 = __commonJS({
1539
- "../../node_modules/sort-package-json/node_modules/semver/ranges/valid.js"(exports2, module2) {
1540
- "use strict";
1541
- var Range = require_range();
1542
- var validRange = (range, options) => {
1543
- try {
1544
- return new Range(range, options).range || "*";
1545
- } catch (er) {
1546
- return null;
1547
- }
1548
- };
1549
- module2.exports = validRange;
1550
- }
1551
- });
1552
-
1553
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/outside.js
1554
- var require_outside = __commonJS({
1555
- "../../node_modules/sort-package-json/node_modules/semver/ranges/outside.js"(exports2, module2) {
1556
- "use strict";
1557
- var SemVer = require_semver();
1558
- var Comparator = require_comparator();
1559
- var { ANY } = Comparator;
1560
- var Range = require_range();
1561
- var satisfies = require_satisfies();
1562
- var gt = require_gt();
1563
- var lt = require_lt();
1564
- var lte = require_lte();
1565
- var gte = require_gte();
1566
- var outside = (version, range, hilo, options) => {
1567
- version = new SemVer(version, options);
1568
- range = new Range(range, options);
1569
- let gtfn, ltefn, ltfn, comp, ecomp;
1570
- switch (hilo) {
1571
- case ">":
1572
- gtfn = gt;
1573
- ltefn = lte;
1574
- ltfn = lt;
1575
- comp = ">";
1576
- ecomp = ">=";
1577
- break;
1578
- case "<":
1579
- gtfn = lt;
1580
- ltefn = gte;
1581
- ltfn = gt;
1582
- comp = "<";
1583
- ecomp = "<=";
1584
- break;
1585
- default:
1586
- throw new TypeError('Must provide a hilo val of "<" or ">"');
1587
- }
1588
- if (satisfies(version, range, options)) {
1589
- return false;
1590
- }
1591
- for (let i = 0; i < range.set.length; ++i) {
1592
- const comparators = range.set[i];
1593
- let high = null;
1594
- let low = null;
1595
- comparators.forEach((comparator) => {
1596
- if (comparator.semver === ANY) {
1597
- comparator = new Comparator(">=0.0.0");
1598
- }
1599
- high = high || comparator;
1600
- low = low || comparator;
1601
- if (gtfn(comparator.semver, high.semver, options)) {
1602
- high = comparator;
1603
- } else if (ltfn(comparator.semver, low.semver, options)) {
1604
- low = comparator;
1605
- }
1606
- });
1607
- if (high.operator === comp || high.operator === ecomp) {
1608
- return false;
1609
- }
1610
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1611
- return false;
1612
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1613
- return false;
1614
- }
1615
- }
1616
- return true;
1617
- };
1618
- module2.exports = outside;
1619
- }
1620
- });
1621
-
1622
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/gtr.js
1623
- var require_gtr = __commonJS({
1624
- "../../node_modules/sort-package-json/node_modules/semver/ranges/gtr.js"(exports2, module2) {
1625
- "use strict";
1626
- var outside = require_outside();
1627
- var gtr = (version, range, options) => outside(version, range, ">", options);
1628
- module2.exports = gtr;
1629
- }
1630
- });
1631
-
1632
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/ltr.js
1633
- var require_ltr = __commonJS({
1634
- "../../node_modules/sort-package-json/node_modules/semver/ranges/ltr.js"(exports2, module2) {
1635
- "use strict";
1636
- var outside = require_outside();
1637
- var ltr = (version, range, options) => outside(version, range, "<", options);
1638
- module2.exports = ltr;
1639
- }
1640
- });
1641
-
1642
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/intersects.js
1643
- var require_intersects = __commonJS({
1644
- "../../node_modules/sort-package-json/node_modules/semver/ranges/intersects.js"(exports2, module2) {
1645
- "use strict";
1646
- var Range = require_range();
1647
- var intersects = (r1, r2, options) => {
1648
- r1 = new Range(r1, options);
1649
- r2 = new Range(r2, options);
1650
- return r1.intersects(r2, options);
1651
- };
1652
- module2.exports = intersects;
1653
- }
1654
- });
1655
-
1656
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/simplify.js
1657
- var require_simplify = __commonJS({
1658
- "../../node_modules/sort-package-json/node_modules/semver/ranges/simplify.js"(exports2, module2) {
1659
- "use strict";
1660
- var satisfies = require_satisfies();
1661
- var compare = require_compare();
1662
- module2.exports = (versions, range, options) => {
1663
- const set = [];
1664
- let first = null;
1665
- let prev = null;
1666
- const v = versions.sort((a, b) => compare(a, b, options));
1667
- for (const version of v) {
1668
- const included = satisfies(version, range, options);
1669
- if (included) {
1670
- prev = version;
1671
- if (!first) {
1672
- first = version;
1673
- }
1674
- } else {
1675
- if (prev) {
1676
- set.push([first, prev]);
1677
- }
1678
- prev = null;
1679
- first = null;
1680
- }
1681
- }
1682
- if (first) {
1683
- set.push([first, null]);
1684
- }
1685
- const ranges = [];
1686
- for (const [min, max] of set) {
1687
- if (min === max) {
1688
- ranges.push(min);
1689
- } else if (!max && min === v[0]) {
1690
- ranges.push("*");
1691
- } else if (!max) {
1692
- ranges.push(`>=${min}`);
1693
- } else if (min === v[0]) {
1694
- ranges.push(`<=${max}`);
1695
- } else {
1696
- ranges.push(`${min} - ${max}`);
1697
- }
1698
- }
1699
- const simplified = ranges.join(" || ");
1700
- const original = typeof range.raw === "string" ? range.raw : String(range);
1701
- return simplified.length < original.length ? simplified : range;
1702
- };
1703
- }
1704
- });
1705
-
1706
- // ../../node_modules/sort-package-json/node_modules/semver/ranges/subset.js
1707
- var require_subset = __commonJS({
1708
- "../../node_modules/sort-package-json/node_modules/semver/ranges/subset.js"(exports2, module2) {
1709
- "use strict";
1710
- var Range = require_range();
1711
- var Comparator = require_comparator();
1712
- var { ANY } = Comparator;
1713
- var satisfies = require_satisfies();
1714
- var compare = require_compare();
1715
- var subset = (sub, dom, options = {}) => {
1716
- if (sub === dom) {
1717
- return true;
1718
- }
1719
- sub = new Range(sub, options);
1720
- dom = new Range(dom, options);
1721
- let sawNonNull = false;
1722
- OUTER: for (const simpleSub of sub.set) {
1723
- for (const simpleDom of dom.set) {
1724
- const isSub = simpleSubset(simpleSub, simpleDom, options);
1725
- sawNonNull = sawNonNull || isSub !== null;
1726
- if (isSub) {
1727
- continue OUTER;
1728
- }
1729
- }
1730
- if (sawNonNull) {
1731
- return false;
1732
- }
1733
- }
1734
- return true;
1735
- };
1736
- var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1737
- var minimumVersion = [new Comparator(">=0.0.0")];
1738
- var simpleSubset = (sub, dom, options) => {
1739
- if (sub === dom) {
1740
- return true;
1741
- }
1742
- if (sub.length === 1 && sub[0].semver === ANY) {
1743
- if (dom.length === 1 && dom[0].semver === ANY) {
1744
- return true;
1745
- } else if (options.includePrerelease) {
1746
- sub = minimumVersionWithPreRelease;
1747
- } else {
1748
- sub = minimumVersion;
1749
- }
1750
- }
1751
- if (dom.length === 1 && dom[0].semver === ANY) {
1752
- if (options.includePrerelease) {
1753
- return true;
1754
- } else {
1755
- dom = minimumVersion;
1756
- }
1757
- }
1758
- const eqSet = /* @__PURE__ */ new Set();
1759
- let gt, lt;
1760
- for (const c of sub) {
1761
- if (c.operator === ">" || c.operator === ">=") {
1762
- gt = higherGT(gt, c, options);
1763
- } else if (c.operator === "<" || c.operator === "<=") {
1764
- lt = lowerLT(lt, c, options);
1765
- } else {
1766
- eqSet.add(c.semver);
1767
- }
1768
- }
1769
- if (eqSet.size > 1) {
1770
- return null;
1771
- }
1772
- let gtltComp;
1773
- if (gt && lt) {
1774
- gtltComp = compare(gt.semver, lt.semver, options);
1775
- if (gtltComp > 0) {
1776
- return null;
1777
- } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1778
- return null;
1779
- }
1780
- }
1781
- for (const eq of eqSet) {
1782
- if (gt && !satisfies(eq, String(gt), options)) {
1783
- return null;
1784
- }
1785
- if (lt && !satisfies(eq, String(lt), options)) {
1786
- return null;
1787
- }
1788
- for (const c of dom) {
1789
- if (!satisfies(eq, String(c), options)) {
1790
- return false;
1791
- }
1792
- }
1793
- return true;
1794
- }
1795
- let higher, lower;
1796
- let hasDomLT, hasDomGT;
1797
- let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1798
- let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1799
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1800
- needDomLTPre = false;
1801
- }
1802
- for (const c of dom) {
1803
- hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1804
- hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1805
- if (gt) {
1806
- if (needDomGTPre) {
1807
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1808
- needDomGTPre = false;
1809
- }
1810
- }
1811
- if (c.operator === ">" || c.operator === ">=") {
1812
- higher = higherGT(gt, c, options);
1813
- if (higher === c && higher !== gt) {
1814
- return false;
1815
- }
1816
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
1817
- return false;
1818
- }
1819
- }
1820
- if (lt) {
1821
- if (needDomLTPre) {
1822
- if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1823
- needDomLTPre = false;
1824
- }
1825
- }
1826
- if (c.operator === "<" || c.operator === "<=") {
1827
- lower = lowerLT(lt, c, options);
1828
- if (lower === c && lower !== lt) {
1829
- return false;
1830
- }
1831
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
1832
- return false;
1833
- }
1834
- }
1835
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
1836
- return false;
1837
- }
1838
- }
1839
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
1840
- return false;
1841
- }
1842
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
1843
- return false;
1844
- }
1845
- if (needDomGTPre || needDomLTPre) {
1846
- return false;
1847
- }
1848
- return true;
1849
- };
1850
- var higherGT = (a, b, options) => {
1851
- if (!a) {
1852
- return b;
1853
- }
1854
- const comp = compare(a.semver, b.semver, options);
1855
- return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1856
- };
1857
- var lowerLT = (a, b, options) => {
1858
- if (!a) {
1859
- return b;
1860
- }
1861
- const comp = compare(a.semver, b.semver, options);
1862
- return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1863
- };
1864
- module2.exports = subset;
1865
- }
1866
- });
1867
-
1868
- // ../../node_modules/sort-package-json/node_modules/semver/index.js
1869
- var require_semver2 = __commonJS({
1870
- "../../node_modules/sort-package-json/node_modules/semver/index.js"(exports2, module2) {
1871
- "use strict";
1872
- var internalRe = require_re();
1873
- var constants = require_constants();
1874
- var SemVer = require_semver();
1875
- var identifiers = require_identifiers();
1876
- var parse = require_parse();
1877
- var valid = require_valid();
1878
- var clean = require_clean();
1879
- var inc = require_inc();
1880
- var diff = require_diff();
1881
- var major = require_major();
1882
- var minor = require_minor();
1883
- var patch = require_patch();
1884
- var prerelease = require_prerelease();
1885
- var compare = require_compare();
1886
- var rcompare = require_rcompare();
1887
- var compareLoose = require_compare_loose();
1888
- var compareBuild = require_compare_build();
1889
- var sort = require_sort();
1890
- var rsort = require_rsort();
1891
- var gt = require_gt();
1892
- var lt = require_lt();
1893
- var eq = require_eq();
1894
- var neq = require_neq();
1895
- var gte = require_gte();
1896
- var lte = require_lte();
1897
- var cmp = require_cmp();
1898
- var coerce = require_coerce();
1899
- var Comparator = require_comparator();
1900
- var Range = require_range();
1901
- var satisfies = require_satisfies();
1902
- var toComparators = require_to_comparators();
1903
- var maxSatisfying = require_max_satisfying();
1904
- var minSatisfying = require_min_satisfying();
1905
- var minVersion = require_min_version();
1906
- var validRange = require_valid2();
1907
- var outside = require_outside();
1908
- var gtr = require_gtr();
1909
- var ltr = require_ltr();
1910
- var intersects = require_intersects();
1911
- var simplifyRange = require_simplify();
1912
- var subset = require_subset();
1913
- module2.exports = {
1914
- parse,
1915
- valid,
1916
- clean,
1917
- inc,
1918
- diff,
1919
- major,
1920
- minor,
1921
- patch,
1922
- prerelease,
1923
- compare,
1924
- rcompare,
1925
- compareLoose,
1926
- compareBuild,
1927
- sort,
1928
- rsort,
1929
- gt,
1930
- lt,
1931
- eq,
1932
- neq,
1933
- gte,
1934
- lte,
1935
- cmp,
1936
- coerce,
1937
- Comparator,
1938
- Range,
1939
- satisfies,
1940
- toComparators,
1941
- maxSatisfying,
1942
- minSatisfying,
1943
- minVersion,
1944
- validRange,
1945
- outside,
1946
- gtr,
1947
- ltr,
1948
- intersects,
1949
- simplifyRange,
1950
- subset,
1951
- SemVer,
1952
- re: internalRe.re,
1953
- src: internalRe.src,
1954
- tokens: internalRe.t,
1955
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1956
- RELEASE_TYPES: constants.RELEASE_TYPES,
1957
- compareIdentifiers: identifiers.compareIdentifiers,
1958
- rcompareIdentifiers: identifiers.rcompareIdentifiers
1959
- };
1960
- }
1961
- });
1962
-
1963
1193
  // ../prettier-config/src/sort-package-json.ts
1964
1194
  var sort_package_json_exports = {};
1965
1195
  __export(sort_package_json_exports, {
@@ -1968,6 +1198,9 @@ __export(sort_package_json_exports, {
1968
1198
  module.exports = __toCommonJS(sort_package_json_exports);
1969
1199
  var import_parser_babel = require("prettier/esm/parser-babel.mjs");
1970
1200
 
1201
+ // ../../node_modules/sort-package-json/index.js
1202
+ var import_node_fs = __toESM(require("node:fs"), 1);
1203
+
1971
1204
  // ../../node_modules/sort-object-keys/index.js
1972
1205
  var has = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
1973
1206
  function sortObjectByKeyNameList(object, sortWith) {
@@ -2146,7 +1379,8 @@ function isPlainObject(value) {
2146
1379
  }
2147
1380
 
2148
1381
  // ../../node_modules/sort-package-json/index.js
2149
- var import_semver = __toESM(require_semver2(), 1);
1382
+ var import_compare = __toESM(require_compare(), 1);
1383
+ var import_min_version = __toESM(require_min_version(), 1);
2150
1384
  var pipe = (fns) => (x, ...args) => fns.reduce((result, fn) => fn(result, ...args), x);
2151
1385
  var onArray = (fn) => (x) => Array.isArray(x) ? fn(x) : x;
2152
1386
  var onStringArray = (fn) => (x) => Array.isArray(x) && x.every((item) => typeof item === "string") ? fn(x) : x;
@@ -2192,7 +1426,9 @@ var sortDirectories = sortObjectBy([
2192
1426
  "example",
2193
1427
  "test"
2194
1428
  ]);
2195
- var overProperty = (property, over) => (object, ...args) => Object.hasOwn(object, property) ? { ...object, [property]: over(object[property], ...args) } : object;
1429
+ var overProperty = (property, over) => onObject(
1430
+ (object, ...args) => Object.hasOwn(object, property) ? { ...object, [property]: over(object[property], ...args) } : object
1431
+ );
2196
1432
  var sortGitHooks = sortObjectBy(git_hooks_list_default);
2197
1433
  var parseNameAndVersionRange = (specifier) => {
2198
1434
  const [nameAndVersion] = specifier.split(">");
@@ -2218,7 +1454,7 @@ var sortObjectBySemver = sortObjectBy((a, b) => {
2218
1454
  if (!bRange) {
2219
1455
  return 1;
2220
1456
  }
2221
- return import_semver.default.compare(import_semver.default.minVersion(aRange), import_semver.default.minVersion(bRange));
1457
+ return (0, import_compare.default)((0, import_min_version.default)(aRange), (0, import_min_version.default)(bRange));
2222
1458
  });
2223
1459
  var getPackageName = (ident) => {
2224
1460
  const index = ident.indexOf("@", ident.startsWith("@") ? 1 : 0);
@@ -2231,25 +1467,49 @@ var sortObjectByIdent = (a, b) => {
2231
1467
  if (packageNameA > packageNameB) return 1;
2232
1468
  return 0;
2233
1469
  };
2234
- var sortDependenciesLikeNpm = sortObjectBy((a, b) => a.localeCompare(b, "en"));
2235
- var sortWorkspaces = (workspaces) => {
2236
- if (!isPlainObject(workspaces)) {
2237
- return workspaces;
1470
+ var cache = /* @__PURE__ */ new Map();
1471
+ var hasYarnOrPnpmFiles = () => {
1472
+ const cwd = process.cwd();
1473
+ if (!cache.has(cwd)) {
1474
+ cache.set(
1475
+ cwd,
1476
+ import_node_fs.default.existsSync("yarn.lock") || import_node_fs.default.existsSync(".yarn/") || import_node_fs.default.existsSync(".yarnrc.yml") || import_node_fs.default.existsSync("pnpm-lock.yaml") || import_node_fs.default.existsSync("pnpm-workspace.yaml")
1477
+ );
1478
+ }
1479
+ return cache.get(cwd);
1480
+ };
1481
+ function shouldSortDependenciesLikeNpm(packageJson) {
1482
+ if (typeof packageJson.packageManager === "string") {
1483
+ return packageJson.packageManager.startsWith("npm@");
2238
1484
  }
2239
- const sortedWorkspaces = {};
2240
- if (workspaces.packages) {
2241
- sortedWorkspaces.packages = uniqAndSortArray(workspaces.packages);
1485
+ if (packageJson.devEngines?.packageManager?.name) {
1486
+ return packageJson.devEngines.packageManager.name === "npm";
2242
1487
  }
2243
- if (workspaces.catalog) {
2244
- sortedWorkspaces.catalog = sortDependenciesLikeNpm(workspaces.catalog);
1488
+ if (packageJson.pnpm) {
1489
+ return false;
2245
1490
  }
2246
- const knownKeys = ["packages", "catalog"];
2247
- const otherKeys = Object.keys(workspaces).filter((key) => !knownKeys.includes(key)).sort();
2248
- for (const key of otherKeys) {
2249
- sortedWorkspaces[key] = workspaces[key];
1491
+ if (packageJson.engines?.npm) {
1492
+ return true;
2250
1493
  }
2251
- return sortedWorkspaces;
2252
- };
1494
+ if (hasYarnOrPnpmFiles()) {
1495
+ return false;
1496
+ }
1497
+ return true;
1498
+ }
1499
+ var sortDependencies = onObject((dependencies, packageJson) => {
1500
+ if (Object.keys(dependencies).length < 2) {
1501
+ return dependencies;
1502
+ }
1503
+ if (shouldSortDependenciesLikeNpm(packageJson)) {
1504
+ return sortObjectByKeyNameList(dependencies, (a, b) => a.localeCompare(b, "en"));
1505
+ }
1506
+ return sortObjectByKeyNameList(dependencies);
1507
+ });
1508
+ var sortWorkspaces = pipe([
1509
+ sortObjectBy(["packages", "catalog"]),
1510
+ overProperty("packages", uniqAndSortArray),
1511
+ overProperty("catalog", sortDependencies)
1512
+ ]);
2253
1513
  var eslintBaseConfigProperties = [
2254
1514
  // `files` and `excludedFiles` are only on `overrides[]`
2255
1515
  // for easier sort `overrides[]`,
@@ -2270,51 +1530,53 @@ var eslintBaseConfigProperties = [
2270
1530
  "noInlineConfig",
2271
1531
  "reportUnusedDisableDirectives"
2272
1532
  ];
2273
- var sortEslintConfig = onObject(
2274
- pipe([
2275
- sortObjectBy(eslintBaseConfigProperties),
2276
- overProperty("env", sortObject),
2277
- overProperty("globals", sortObject),
2278
- overProperty(
2279
- "overrides",
2280
- onArray((overrides) => overrides.map(sortEslintConfig))
2281
- ),
2282
- overProperty("parserOptions", sortObject),
2283
- overProperty(
2284
- "rules",
2285
- sortObjectBy(
2286
- (rule1, rule2) => rule1.split("/").length - rule2.split("/").length || rule1.localeCompare(rule2)
2287
- )
2288
- ),
2289
- overProperty("settings", sortObject)
2290
- ])
2291
- );
1533
+ var sortEslintConfig = pipe([
1534
+ sortObjectBy(eslintBaseConfigProperties),
1535
+ overProperty("env", sortObject),
1536
+ overProperty("globals", sortObject),
1537
+ overProperty(
1538
+ "overrides",
1539
+ onArray((overrides) => overrides.map(sortEslintConfig))
1540
+ ),
1541
+ overProperty("parserOptions", sortObject),
1542
+ overProperty(
1543
+ "rules",
1544
+ sortObjectBy(
1545
+ (rule1, rule2) => rule1.split("/").length - rule2.split("/").length || rule1.localeCompare(rule2)
1546
+ )
1547
+ ),
1548
+ overProperty("settings", sortObject)
1549
+ ]);
2292
1550
  var sortVSCodeBadgeObject = sortObjectBy(["description", "url", "href"]);
2293
- var sortPrettierConfig = onObject(
2294
- pipe([
2295
- // sort keys alphabetically, but put `overrides` at bottom
1551
+ var sortPrettierConfig = pipe([
1552
+ // sort keys alphabetically, but put `overrides` at bottom
1553
+ onObject(
2296
1554
  (config) => sortObjectByKeyNameList(config, [
2297
1555
  ...Object.keys(config).filter((key) => key !== "overrides").sort(),
2298
1556
  "overrides"
2299
- ]),
2300
- // if `config.overrides` exists
2301
- overProperty(
2302
- "overrides",
2303
- // and `config.overrides` is an array
2304
- onArray(
2305
- (overrides) => overrides.map(
2306
- pipe([
2307
- // sort `config.overrides[]` alphabetically
2308
- sortObject,
2309
- // sort `config.overrides[].options` alphabetically
2310
- overProperty("options", sortObject)
2311
- ])
2312
- )
1557
+ ])
1558
+ ),
1559
+ // if `config.overrides` exists
1560
+ overProperty(
1561
+ "overrides",
1562
+ // and `config.overrides` is an array
1563
+ onArray(
1564
+ (overrides) => overrides.map(
1565
+ pipe([
1566
+ // sort `config.overrides[]` alphabetically
1567
+ sortObject,
1568
+ // sort `config.overrides[].options` alphabetically
1569
+ overProperty("options", sortObject)
1570
+ ])
2313
1571
  )
2314
1572
  )
2315
- ])
2316
- );
1573
+ )
1574
+ ]);
2317
1575
  var sortVolta = sortObjectBy(["node", "npm", "yarn"]);
1576
+ var sortDevEngines = overProperty(
1577
+ "packageManager",
1578
+ sortObjectBy(["name", "version", "onFail"])
1579
+ );
2318
1580
  var pnpmBaseConfigProperties = [
2319
1581
  "peerDependencyRules",
2320
1582
  "neverBuiltDependencies",
@@ -2330,12 +1592,10 @@ var pnpmBaseConfigProperties = [
2330
1592
  "patchedDependencies",
2331
1593
  "packageExtensions"
2332
1594
  ];
2333
- var sortPnpmConfig = onObject(
2334
- pipe([
2335
- sortObjectBy(pnpmBaseConfigProperties, true),
2336
- overProperty("overrides", sortObjectBySemver)
2337
- ])
2338
- );
1595
+ var sortPnpmConfig = pipe([
1596
+ sortObjectBy(pnpmBaseConfigProperties, true),
1597
+ overProperty("overrides", sortObjectBySemver)
1598
+ ]);
2339
1599
  var defaultNpmScripts = /* @__PURE__ */ new Set([
2340
1600
  "install",
2341
1601
  "pack",
@@ -2363,10 +1623,34 @@ var hasSequentialScript = (packageJson) => {
2363
1623
  );
2364
1624
  return scripts.some((script) => isSequentialScript(script));
2365
1625
  };
1626
+ function sortScriptNames(keys, prefix = "") {
1627
+ const groupMap = /* @__PURE__ */ new Map();
1628
+ for (const key of keys) {
1629
+ const rest = prefix ? key.slice(prefix.length + 1) : key;
1630
+ const idx = rest.indexOf(":");
1631
+ if (idx > 0) {
1632
+ const base = key.slice(0, (prefix ? prefix.length + 1 : 0) + idx);
1633
+ if (!groupMap.has(base)) groupMap.set(base, []);
1634
+ groupMap.get(base).push(key);
1635
+ } else {
1636
+ if (!groupMap.has(key)) groupMap.set(key, []);
1637
+ groupMap.get(key).push(key);
1638
+ }
1639
+ }
1640
+ return Array.from(groupMap.keys()).sort().flatMap((groupKey) => {
1641
+ const children = groupMap.get(groupKey);
1642
+ if (children.length > 1 && children.some((k) => k !== groupKey && k.startsWith(groupKey + ":"))) {
1643
+ const direct = children.filter((k) => k === groupKey || !k.startsWith(groupKey + ":")).sort();
1644
+ const nested = children.filter((k) => k.startsWith(groupKey + ":"));
1645
+ return [...direct, ...sortScriptNames(nested, groupKey)];
1646
+ }
1647
+ return children.sort();
1648
+ });
1649
+ }
2366
1650
  var sortScripts = onObject((scripts, packageJson) => {
2367
- const names = Object.keys(scripts);
1651
+ let names = Object.keys(scripts);
2368
1652
  const prefixable = /* @__PURE__ */ new Set();
2369
- const keys = names.map((name) => {
1653
+ names = names.map((name) => {
2370
1654
  const omitted = name.replace(/^(?:pre|post)/, "");
2371
1655
  if (defaultNpmScripts.has(omitted) || names.includes(omitted)) {
2372
1656
  prefixable.add(omitted);
@@ -2375,12 +1659,12 @@ var sortScripts = onObject((scripts, packageJson) => {
2375
1659
  return name;
2376
1660
  });
2377
1661
  if (!hasSequentialScript(packageJson)) {
2378
- keys.sort();
1662
+ names = sortScriptNames(names);
2379
1663
  }
2380
- const order = keys.flatMap(
1664
+ names = names.flatMap(
2381
1665
  (key) => prefixable.has(key) ? [`pre${key}`, key, `post${key}`] : [key]
2382
1666
  );
2383
- return sortObjectByKeyNameList(scripts, order);
1667
+ return sortObjectByKeyNameList(scripts, names);
2384
1668
  });
2385
1669
  var sortConditions = (conditions) => {
2386
1670
  const {
@@ -2517,14 +1801,14 @@ var fields = [
2517
1801
  { key: "tap", over: sortObject },
2518
1802
  { key: "oclif", over: sortObjectBy(void 0, true) },
2519
1803
  { key: "resolutions", over: sortObject },
2520
- { key: "overrides", over: sortDependenciesLikeNpm },
2521
- { key: "dependencies", over: sortDependenciesLikeNpm },
2522
- { key: "devDependencies", over: sortDependenciesLikeNpm },
1804
+ { key: "overrides", over: sortDependencies },
1805
+ { key: "dependencies", over: sortDependencies },
1806
+ { key: "devDependencies", over: sortDependencies },
2523
1807
  { key: "dependenciesMeta", over: sortObjectBy(sortObjectByIdent, true) },
2524
- { key: "peerDependencies", over: sortDependenciesLikeNpm },
1808
+ { key: "peerDependencies", over: sortDependencies },
2525
1809
  // TODO: only sort depth = 2
2526
1810
  { key: "peerDependenciesMeta", over: sortObjectBy(void 0, true) },
2527
- { key: "optionalDependencies", over: sortDependenciesLikeNpm },
1811
+ { key: "optionalDependencies", over: sortDependencies },
2528
1812
  { key: "bundledDependencies", over: uniqAndSortArray },
2529
1813
  { key: "bundleDependencies", over: uniqAndSortArray },
2530
1814
  /* vscode */
@@ -2535,6 +1819,7 @@ var fields = [
2535
1819
  { key: "packageManager" },
2536
1820
  { key: "engines", over: sortObject },
2537
1821
  { key: "engineStrict", over: sortObject },
1822
+ { key: "devEngines", over: sortDevEngines },
2538
1823
  { key: "volta", over: sortVolta },
2539
1824
  { key: "languageName" },
2540
1825
  { key: "os" },
@@ -2574,14 +1859,6 @@ function editStringJSON(json, over) {
2574
1859
  }
2575
1860
  return over(json);
2576
1861
  }
2577
- var isPrivateKey = (key) => key[0] === "_";
2578
- var partition = (array, predicate) => array.reduce(
2579
- (result, value) => {
2580
- result[predicate(value) ? 0 : 1].push(value);
2581
- return result;
2582
- },
2583
- [[], []]
2584
- );
2585
1862
  function sortPackageJson(jsonIsh, options = {}) {
2586
1863
  return editStringJSON(
2587
1864
  jsonIsh,
@@ -2589,7 +1866,10 @@ function sortPackageJson(jsonIsh, options = {}) {
2589
1866
  let sortOrder = options.sortOrder || defaultSortOrder;
2590
1867
  if (Array.isArray(sortOrder)) {
2591
1868
  const keys = Object.keys(json);
2592
- const [privateKeys, publicKeys] = partition(keys, isPrivateKey);
1869
+ const { privateKeys = [], publicKeys = [] } = objectGroupBy(
1870
+ keys,
1871
+ (key) => key[0] === "_" ? "privateKeys" : "publicKeys"
1872
+ );
2593
1873
  sortOrder = [
2594
1874
  ...sortOrder,
2595
1875
  ...defaultSortOrder,