Skip to content

Commit 7161a76

Browse files
cq-botgithub-actions[bot]
authored andcommitted
chore: Prepare dist
1 parent c22d13b commit 7161a76

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

dist/index.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,6 +2613,8 @@ const Range = __nccwpck_require__(9828)
26132613
/***/ 9828:
26142614
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
26152615

2616+
const SPACE_CHARACTERS = /\s+/g
2617+
26162618
// hoisted class for cyclic dependency
26172619
class Range {
26182620
constructor (range, options) {
@@ -2633,7 +2635,7 @@ class Range {
26332635
// just put it in the set and return
26342636
this.raw = range.value
26352637
this.set = [[range]]
2636-
this.format()
2638+
this.formatted = undefined
26372639
return this
26382640
}
26392641

@@ -2644,10 +2646,7 @@ class Range {
26442646
// First reduce all whitespace as much as possible so we do not have to rely
26452647
// on potentially slow regexes like \s*. This is then stored and used for
26462648
// future error messages as well.
2647-
this.raw = range
2648-
.trim()
2649-
.split(/\s+/)
2650-
.join(' ')
2649+
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
26512650

26522651
// First, split on ||
26532652
this.set = this.raw
@@ -2681,14 +2680,29 @@ class Range {
26812680
}
26822681
}
26832682

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
26852703
}
26862704

26872705
format () {
2688-
this.range = this.set
2689-
.map((comps) => comps.join(' ').trim())
2690-
.join('||')
2691-
.trim()
26922706
return this.range
26932707
}
26942708

0 commit comments

Comments
 (0)