webpipe-js 2.0.51 → 2.0.52

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.
package/dist/index.cjs CHANGED
@@ -127,21 +127,27 @@ var Parser = class {
127
127
  const originalPos = this.pos;
128
128
  this.pos++;
129
129
  const restOfLine = this.consumeWhile((ch) => ch !== "\n");
130
+ const end = this.pos;
130
131
  return {
131
132
  type: "standalone",
132
133
  text: restOfLine,
133
134
  style: "#",
134
- lineNumber: this.getLineNumber(start)
135
+ lineNumber: this.getLineNumber(start),
136
+ start,
137
+ end
135
138
  };
136
139
  }
137
140
  if (this.text.startsWith("//", this.pos)) {
138
141
  this.pos += 2;
139
142
  const text = this.consumeWhile((ch) => ch !== "\n");
143
+ const end = this.pos;
140
144
  return {
141
145
  type: "standalone",
142
146
  text,
143
147
  style: "//",
144
- lineNumber: this.getLineNumber(start)
148
+ lineNumber: this.getLineNumber(start),
149
+ start,
150
+ end
145
151
  };
146
152
  }
147
153
  return null;
@@ -1614,7 +1620,9 @@ function printPipeline(pipeline) {
1614
1620
  items.push({ type: "step", item: step, position: step.start });
1615
1621
  });
1616
1622
  pipeline.pipeline.comments.forEach((comment) => {
1617
- items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1623
+ if (comment.start !== void 0) {
1624
+ items.push({ type: "comment", item: comment, position: comment.start });
1625
+ }
1618
1626
  });
1619
1627
  items.sort((a, b) => a.position - b.position);
1620
1628
  items.forEach((entry) => {
@@ -2026,7 +2034,9 @@ function formatPipelineRef(ref) {
2026
2034
  items.push({ type: "step", item: step, position: step.start });
2027
2035
  });
2028
2036
  ref.pipeline.comments.forEach((comment) => {
2029
- items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
2037
+ if (comment.start !== void 0) {
2038
+ items.push({ type: "comment", item: comment, position: comment.start });
2039
+ }
2030
2040
  });
2031
2041
  items.sort((a, b) => a.position - b.position);
2032
2042
  items.forEach((entry) => {
package/dist/index.d.cts CHANGED
@@ -16,6 +16,8 @@ interface Comment {
16
16
  text: string;
17
17
  style: '#' | '//';
18
18
  lineNumber?: number;
19
+ start?: number;
20
+ end?: number;
19
21
  }
20
22
  interface Config {
21
23
  name: string;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,8 @@ interface Comment {
16
16
  text: string;
17
17
  style: '#' | '//';
18
18
  lineNumber?: number;
19
+ start?: number;
20
+ end?: number;
19
21
  }
20
22
  interface Config {
21
23
  name: string;
package/dist/index.mjs CHANGED
@@ -74,21 +74,27 @@ var Parser = class {
74
74
  const originalPos = this.pos;
75
75
  this.pos++;
76
76
  const restOfLine = this.consumeWhile((ch) => ch !== "\n");
77
+ const end = this.pos;
77
78
  return {
78
79
  type: "standalone",
79
80
  text: restOfLine,
80
81
  style: "#",
81
- lineNumber: this.getLineNumber(start)
82
+ lineNumber: this.getLineNumber(start),
83
+ start,
84
+ end
82
85
  };
83
86
  }
84
87
  if (this.text.startsWith("//", this.pos)) {
85
88
  this.pos += 2;
86
89
  const text = this.consumeWhile((ch) => ch !== "\n");
90
+ const end = this.pos;
87
91
  return {
88
92
  type: "standalone",
89
93
  text,
90
94
  style: "//",
91
- lineNumber: this.getLineNumber(start)
95
+ lineNumber: this.getLineNumber(start),
96
+ start,
97
+ end
92
98
  };
93
99
  }
94
100
  return null;
@@ -1561,7 +1567,9 @@ function printPipeline(pipeline) {
1561
1567
  items.push({ type: "step", item: step, position: step.start });
1562
1568
  });
1563
1569
  pipeline.pipeline.comments.forEach((comment) => {
1564
- items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1570
+ if (comment.start !== void 0) {
1571
+ items.push({ type: "comment", item: comment, position: comment.start });
1572
+ }
1565
1573
  });
1566
1574
  items.sort((a, b) => a.position - b.position);
1567
1575
  items.forEach((entry) => {
@@ -1973,7 +1981,9 @@ function formatPipelineRef(ref) {
1973
1981
  items.push({ type: "step", item: step, position: step.start });
1974
1982
  });
1975
1983
  ref.pipeline.comments.forEach((comment) => {
1976
- items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1984
+ if (comment.start !== void 0) {
1985
+ items.push({ type: "comment", item: comment, position: comment.start });
1986
+ }
1977
1987
  });
1978
1988
  items.sort((a, b) => a.position - b.position);
1979
1989
  items.forEach((entry) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.51",
3
+ "version": "2.0.52",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",