@@ -2613,6 +2613,8 @@ const Range = __nccwpck_require__(9828)
2613
2613
/***/ 9828:
2614
2614
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2615
2615
2616
+ const SPACE_CHARACTERS = /\s+/g
2617
+
2616
2618
// hoisted class for cyclic dependency
2617
2619
class Range {
2618
2620
constructor (range, options) {
@@ -2633,7 +2635,7 @@ class Range {
2633
2635
// just put it in the set and return
2634
2636
this.raw = range.value
2635
2637
this.set = [[range]]
2636
- this.format()
2638
+ this.formatted = undefined
2637
2639
return this
2638
2640
}
2639
2641
@@ -2644,10 +2646,7 @@ class Range {
2644
2646
// First reduce all whitespace as much as possible so we do not have to rely
2645
2647
// on potentially slow regexes like \s*. This is then stored and used for
2646
2648
// future error messages as well.
2647
- this.raw = range
2648
- .trim()
2649
- .split(/\s+/)
2650
- .join(' ')
2649
+ this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
2651
2650
2652
2651
// First, split on ||
2653
2652
this.set = this.raw
@@ -2681,14 +2680,29 @@ class Range {
2681
2680
}
2682
2681
}
2683
2682
2684
- this.format()
2683
+ this.formatted = undefined
2684
+ }
2685
+
2686
+ get range () {
2687
+ if (this.formatted === undefined) {
2688
+ this.formatted = ''
2689
+ for (let i = 0; i < this.set.length; i++) {
2690
+ if (i > 0) {
2691
+ this.formatted += '||'
2692
+ }
2693
+ const comps = this.set[i]
2694
+ for (let k = 0; k < comps.length; k++) {
2695
+ if (k > 0) {
2696
+ this.formatted += ' '
2697
+ }
2698
+ this.formatted += comps[k].toString().trim()
2699
+ }
2700
+ }
2701
+ }
2702
+ return this.formatted
2685
2703
}
2686
2704
2687
2705
format () {
2688
- this.range = this.set
2689
- .map((comps) => comps.join(' ').trim())
2690
- .join('||')
2691
- .trim()
2692
2706
return this.range
2693
2707
}
2694
2708
0 commit comments