@@ -8109,6 +8109,8 @@ const Range = __nccwpck_require__(9828)
8109
8109
/***/ 9828:
8110
8110
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
8111
8111
8112
+ const SPACE_CHARACTERS = /\s+/g
8113
+
8112
8114
// hoisted class for cyclic dependency
8113
8115
class Range {
8114
8116
constructor (range, options) {
@@ -8129,7 +8131,7 @@ class Range {
8129
8131
// just put it in the set and return
8130
8132
this.raw = range.value
8131
8133
this.set = [[range]]
8132
- this.format()
8134
+ this.formatted = undefined
8133
8135
return this
8134
8136
}
8135
8137
@@ -8140,10 +8142,7 @@ class Range {
8140
8142
// First reduce all whitespace as much as possible so we do not have to rely
8141
8143
// on potentially slow regexes like \s*. This is then stored and used for
8142
8144
// future error messages as well.
8143
- this.raw = range
8144
- .trim()
8145
- .split(/\s+/)
8146
- .join(' ')
8145
+ this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
8147
8146
8148
8147
// First, split on ||
8149
8148
this.set = this.raw
@@ -8177,14 +8176,29 @@ class Range {
8177
8176
}
8178
8177
}
8179
8178
8180
- this.format()
8179
+ this.formatted = undefined
8180
+ }
8181
+
8182
+ get range () {
8183
+ if (this.formatted === undefined) {
8184
+ this.formatted = ''
8185
+ for (let i = 0; i < this.set.length; i++) {
8186
+ if (i > 0) {
8187
+ this.formatted += '||'
8188
+ }
8189
+ const comps = this.set[i]
8190
+ for (let k = 0; k < comps.length; k++) {
8191
+ if (k > 0) {
8192
+ this.formatted += ' '
8193
+ }
8194
+ this.formatted += comps[k].toString().trim()
8195
+ }
8196
+ }
8197
+ }
8198
+ return this.formatted
8181
8199
}
8182
8200
8183
8201
format () {
8184
- this.range = this.set
8185
- .map((comps) => comps.join(' ').trim())
8186
- .join('||')
8187
- .trim()
8188
8202
return this.range
8189
8203
}
8190
8204
0 commit comments