webpipe-js 2.0.64 → 2.0.66

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
@@ -778,13 +778,13 @@ var Parser = class {
778
778
  this.expect("then:");
779
779
  this.skipWhitespaceOnly();
780
780
  const thenBranch = this.parseIfPipeline("else:", "end");
781
- this.skipSpaces();
781
+ this.skipWhitespaceOnly();
782
782
  const elseBranch = this.tryParse(() => {
783
783
  this.expect("else:");
784
784
  this.skipWhitespaceOnly();
785
785
  return this.parseIfPipeline("end");
786
786
  });
787
- this.skipSpaces();
787
+ this.skipWhitespaceOnly();
788
788
  this.tryParse(() => {
789
789
  this.expect("end");
790
790
  return true;
@@ -2083,16 +2083,10 @@ function formatPipelineStep(step, indent = " ", isLastStep = false) {
2083
2083
  } else if (step.kind === "Dispatch") {
2084
2084
  const lines = [`${indent}|> dispatch`];
2085
2085
  step.branches.forEach((branch) => {
2086
- if (branch.pipeline.steps.length === 1) {
2087
- const inlineStep = formatPipelineStep(branch.pipeline.steps[0], indent + " ");
2088
- const stepContent = inlineStep.substring((indent + " ").length);
2089
- lines.push(`${indent} case ${formatTagExpr(branch.condition)}: ${stepContent}`);
2090
- } else {
2091
- lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
2092
- branch.pipeline.steps.forEach((branchStep) => {
2093
- lines.push(formatPipelineStep(branchStep, indent + " "));
2094
- });
2095
- }
2086
+ lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
2087
+ branch.pipeline.steps.forEach((branchStep) => {
2088
+ lines.push(formatPipelineStep(branchStep, indent + " "));
2089
+ });
2096
2090
  });
2097
2091
  if (step.default) {
2098
2092
  lines.push(`${indent} default:`);
package/dist/index.mjs CHANGED
@@ -724,13 +724,13 @@ var Parser = class {
724
724
  this.expect("then:");
725
725
  this.skipWhitespaceOnly();
726
726
  const thenBranch = this.parseIfPipeline("else:", "end");
727
- this.skipSpaces();
727
+ this.skipWhitespaceOnly();
728
728
  const elseBranch = this.tryParse(() => {
729
729
  this.expect("else:");
730
730
  this.skipWhitespaceOnly();
731
731
  return this.parseIfPipeline("end");
732
732
  });
733
- this.skipSpaces();
733
+ this.skipWhitespaceOnly();
734
734
  this.tryParse(() => {
735
735
  this.expect("end");
736
736
  return true;
@@ -2029,16 +2029,10 @@ function formatPipelineStep(step, indent = " ", isLastStep = false) {
2029
2029
  } else if (step.kind === "Dispatch") {
2030
2030
  const lines = [`${indent}|> dispatch`];
2031
2031
  step.branches.forEach((branch) => {
2032
- if (branch.pipeline.steps.length === 1) {
2033
- const inlineStep = formatPipelineStep(branch.pipeline.steps[0], indent + " ");
2034
- const stepContent = inlineStep.substring((indent + " ").length);
2035
- lines.push(`${indent} case ${formatTagExpr(branch.condition)}: ${stepContent}`);
2036
- } else {
2037
- lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
2038
- branch.pipeline.steps.forEach((branchStep) => {
2039
- lines.push(formatPipelineStep(branchStep, indent + " "));
2040
- });
2041
- }
2032
+ lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
2033
+ branch.pipeline.steps.forEach((branchStep) => {
2034
+ lines.push(formatPipelineStep(branchStep, indent + " "));
2035
+ });
2042
2036
  });
2043
2037
  if (step.default) {
2044
2038
  lines.push(`${indent} default:`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.64",
3
+ "version": "2.0.66",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",