@m2c2kit/build-helpers 0.3.15 → 0.3.16

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -10
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -19828,6 +19828,8 @@ var hasRequiredRange;
19828
19828
  function requireRange () {
19829
19829
  if (hasRequiredRange) return range;
19830
19830
  hasRequiredRange = 1;
19831
+ const SPACE_CHARACTERS = /\s+/g;
19832
+
19831
19833
  // hoisted class for cyclic dependency
19832
19834
  class Range {
19833
19835
  constructor (range, options) {
@@ -19848,7 +19850,7 @@ function requireRange () {
19848
19850
  // just put it in the set and return
19849
19851
  this.raw = range.value;
19850
19852
  this.set = [[range]];
19851
- this.format();
19853
+ this.formatted = undefined;
19852
19854
  return this
19853
19855
  }
19854
19856
 
@@ -19859,10 +19861,7 @@ function requireRange () {
19859
19861
  // First reduce all whitespace as much as possible so we do not have to rely
19860
19862
  // on potentially slow regexes like \s*. This is then stored and used for
19861
19863
  // future error messages as well.
19862
- this.raw = range
19863
- .trim()
19864
- .split(/\s+/)
19865
- .join(' ');
19864
+ this.raw = range.trim().replace(SPACE_CHARACTERS, ' ');
19866
19865
 
19867
19866
  // First, split on ||
19868
19867
  this.set = this.raw
@@ -19896,14 +19895,29 @@ function requireRange () {
19896
19895
  }
19897
19896
  }
19898
19897
 
19899
- this.format();
19898
+ this.formatted = undefined;
19899
+ }
19900
+
19901
+ get range () {
19902
+ if (this.formatted === undefined) {
19903
+ this.formatted = '';
19904
+ for (let i = 0; i < this.set.length; i++) {
19905
+ if (i > 0) {
19906
+ this.formatted += '||';
19907
+ }
19908
+ const comps = this.set[i];
19909
+ for (let k = 0; k < comps.length; k++) {
19910
+ if (k > 0) {
19911
+ this.formatted += ' ';
19912
+ }
19913
+ this.formatted += comps[k].toString().trim();
19914
+ }
19915
+ }
19916
+ }
19917
+ return this.formatted
19900
19918
  }
19901
19919
 
19902
19920
  format () {
19903
- this.range = this.set
19904
- .map((comps) => comps.join(' ').trim())
19905
- .join('||')
19906
- .trim();
19907
19921
  return this.range
19908
19922
  }
19909
19923
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m2c2kit/build-helpers",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Utility functions for building m2c2kit apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -24,13 +24,13 @@
24
24
  "cpy": "10.1.0",
25
25
  "findup-sync": "5.0.0",
26
26
  "magic-string": "0.30.10",
27
- "rimraf": "5.0.7",
28
- "rollup": "4.18.0",
27
+ "rimraf": "6.0.1",
28
+ "rollup": "4.18.1",
29
29
  "rollup-plugin-copy": "3.5.0",
30
30
  "rollup-plugin-dts": "6.1.1",
31
31
  "rollup-plugin-esbuild": "6.1.1",
32
- "semver": "7.6.2",
33
- "typescript": "5.4.5"
32
+ "semver": "7.6.3",
33
+ "typescript": "5.5.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "npm run clean && tsc && rollup -c",