@@ -18235,6 +18235,8 @@ const Range = __nccwpck_require__(9828)
18235
18235
/***/ 9828:
18236
18236
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
18237
18237
18238
+ const SPACE_CHARACTERS = /\s+/g
18239
+
18238
18240
// hoisted class for cyclic dependency
18239
18241
class Range {
18240
18242
constructor (range, options) {
@@ -18255,7 +18257,7 @@ class Range {
18255
18257
// just put it in the set and return
18256
18258
this.raw = range.value
18257
18259
this.set = [[range]]
18258
- this.format()
18260
+ this.formatted = undefined
18259
18261
return this
18260
18262
}
18261
18263
@@ -18266,10 +18268,7 @@ class Range {
18266
18268
// First reduce all whitespace as much as possible so we do not have to rely
18267
18269
// on potentially slow regexes like \s*. This is then stored and used for
18268
18270
// future error messages as well.
18269
- this.raw = range
18270
- .trim()
18271
- .split(/\s+/)
18272
- .join(' ')
18271
+ this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
18273
18272
18274
18273
// First, split on ||
18275
18274
this.set = this.raw
@@ -18303,14 +18302,29 @@ class Range {
18303
18302
}
18304
18303
}
18305
18304
18306
- this.format()
18305
+ this.formatted = undefined
18306
+ }
18307
+
18308
+ get range () {
18309
+ if (this.formatted === undefined) {
18310
+ this.formatted = ''
18311
+ for (let i = 0; i < this.set.length; i++) {
18312
+ if (i > 0) {
18313
+ this.formatted += '||'
18314
+ }
18315
+ const comps = this.set[i]
18316
+ for (let k = 0; k < comps.length; k++) {
18317
+ if (k > 0) {
18318
+ this.formatted += ' '
18319
+ }
18320
+ this.formatted += comps[k].toString().trim()
18321
+ }
18322
+ }
18323
+ }
18324
+ return this.formatted
18307
18325
}
18308
18326
18309
18327
format () {
18310
- this.range = this.set
18311
- .map((comps) => comps.join(' ').trim())
18312
- .join('||')
18313
- .trim()
18314
18328
return this.range
18315
18329
}
18316
18330
0 commit comments