@vnejs/plugins.feature.choose 0.1.0 → 0.1.1

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.
@@ -5,20 +5,18 @@ export class ChooseScenario extends Module {
5
5
 
6
6
  execName = "choose";
7
7
 
8
- init = () => this.emit(this.EVENTS.SCENARIO.EXEC_REG, { block: this.execName, handler: this.execHandler });
8
+ init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { block: this.execName, handler: this.execHandler });
9
9
 
10
10
  execHandler = async (line, args) => {
11
11
  const { curLine = 0, label } = this.globalState.scenario;
12
- const [lines] = await this.emit(this.EVENTS.SCENARIO.LINES_GET, { label });
12
+ const lines = await this.emitOne(this.EVENTS.SCENARIO.LINES_GET, { label });
13
13
  const optionsArr = [];
14
14
 
15
15
  let indexShift = 1;
16
16
  let curLineObj = lines[curLine + indexShift];
17
17
 
18
18
  while (curLineObj && curLineObj.indent >= lines[curLine].indent) {
19
- curLineObj.line.startsWith("% option") &&
20
- curLineObj.indent === lines[curLine].indent + 2 &&
21
- optionsArr.push(curLine + indexShift);
19
+ curLineObj.line.startsWith("% option") && curLineObj.indent === lines[curLine].indent + 2 && optionsArr.push(curLine + indexShift);
22
20
  indexShift++;
23
21
  curLineObj = lines[curLine + indexShift];
24
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.feature.choose",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",