eligius 1.0.19 → 1.0.20

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.
@@ -13,5 +13,5 @@ export declare class Action implements IAction {
13
13
  protected _initializeContextStack(): void;
14
14
  private _pushContext;
15
15
  private _popContext;
16
- executeOperation(operations: IResolvedOperation[], idx: number, resolve: (value?: any | PromiseLike<any>) => void, reject: (reason?: any) => void, previousOperationData?: TOperationData | undefined): void;
16
+ executeOperation(operations: IResolvedOperation[], operationIndex: number, resolve: (value?: any | PromiseLike<any>) => void, reject: (reason?: any) => void, previousOperationData?: TOperationData | undefined): void;
17
17
  }
@@ -584,8 +584,14 @@ var Action = /*#__PURE__*/function () {
584
584
  parentContext.currentIndex = value;
585
585
  },
586
586
 
587
- eventbus: parentContext.eventbus,
588
- operations: parentContext.operations,
587
+ get eventbus() {
588
+ return parentContext.eventbus;
589
+ },
590
+
591
+ get operations() {
592
+ return parentContext.operations;
593
+ },
594
+
589
595
  parent: parentContext
590
596
  };
591
597
 
@@ -598,7 +604,7 @@ var Action = /*#__PURE__*/function () {
598
604
  this._contextStack.pop();
599
605
  };
600
606
 
601
- _proto.executeOperation = function executeOperation(operations, idx, resolve, reject, previousOperationData) {
607
+ _proto.executeOperation = function executeOperation(operations, operationIndex, resolve, reject, previousOperationData) {
602
608
  var _this2 = this;
603
609
 
604
610
  if (previousOperationData === void 0) {
@@ -608,16 +614,16 @@ var Action = /*#__PURE__*/function () {
608
614
  var context = this._contextStack[this._contextStack.length - 1];
609
615
 
610
616
  if (context.newIndex !== undefined) {
611
- idx = context.newIndex;
617
+ operationIndex = context.newIndex;
612
618
  delete context.newIndex;
613
619
  }
614
620
 
615
- context.currentIndex = idx;
621
+ context.currentIndex = operationIndex;
616
622
 
617
- if (idx < operations.length) {
623
+ if (operationIndex < operations.length) {
618
624
  var _operationInfo$operat;
619
625
 
620
- var operationInfo = operations[idx];
626
+ var operationInfo = operations[operationIndex];
621
627
  var copy = deepCopy((_operationInfo$operat = operationInfo.operationData) != null ? _operationInfo$operat : {});
622
628
  var mergedOperationData = Object.assign(previousOperationData, copy);
623
629
 
@@ -643,12 +649,12 @@ var Action = /*#__PURE__*/function () {
643
649
 
644
650
  if (isPromise(operationResult)) {
645
651
  operationResult.then(function (promisedOperationResult) {
646
- return _this2.executeOperation(operations, ++idx, resolve, reject, promisedOperationResult);
652
+ return _this2.executeOperation(operations, ++operationIndex, resolve, reject, promisedOperationResult);
647
653
  })["catch"](function (error) {
648
654
  reject(error);
649
655
  });
650
656
  } else {
651
- this.executeOperation(operations, ++idx, resolve, reject, operationResult);
657
+ this.executeOperation(operations, ++operationIndex, resolve, reject, operationResult);
652
658
  }
653
659
  } else {
654
660
  resolve(previousOperationData);
@@ -1333,9 +1339,12 @@ var createElement$1 = function createElement(operationData) {
1333
1339
  elementName = _operationData.elementName,
1334
1340
  attributes = _operationData.attributes,
1335
1341
  text = _operationData.text;
1336
- var serializedAttrs = attributes ? " " + Object.entries(attributes).map(function (_ref) {
1337
- var key = _ref[0],
1338
- value = _ref[1];
1342
+ var serializedAttrs = attributes ? " " + Object.entries(attributes).filter(function (_ref) {
1343
+ var value = _ref[1];
1344
+ return Boolean(value);
1345
+ }).map(function (_ref2) {
1346
+ var key = _ref2[0],
1347
+ value = _ref2[1];
1339
1348
  return key + "=\"" + value + "\"";
1340
1349
  }).join(' ') : '';
1341
1350
  var template = text ? $__default["default"]("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $__default["default"]("<" + elementName + serializedAttrs + "/>");
@@ -1935,13 +1944,14 @@ var otherwise$1 = function otherwise(operationData) {
1935
1944
  };
1936
1945
 
1937
1946
  function findEndWhenIndex(context) {
1938
- var list = context.operations.slice(context.currentIndex);
1947
+ var currentIndex = context.currentIndex + 1;
1948
+ var list = context.operations.slice(currentIndex);
1939
1949
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
1940
1950
  counter: 0,
1941
1951
  self: 'when',
1942
1952
  matchingName: 'endWhen'
1943
1953
  }));
1944
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
1954
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
1945
1955
  }
1946
1956
 
1947
1957
  /**
@@ -2290,13 +2300,14 @@ var startLoop$1 = function startLoop(operationData) {
2290
2300
  };
2291
2301
 
2292
2302
  function findLoopEndIndex(context) {
2293
- var list = context.operations.slice(context.currentIndex + 1);
2303
+ var currentIndex = context.currentIndex + 1;
2304
+ var list = context.operations.slice(currentIndex);
2294
2305
  var index = list.findIndex(findMatchingOperationIndex.bind({
2295
2306
  counter: 0,
2296
2307
  self: 'startLoop',
2297
2308
  matchingName: 'endLoop'
2298
2309
  }));
2299
- var endLoopIndex = index > -1 ? index + (context.currentIndex + 1) : context.operations.length;
2310
+ var endLoopIndex = index > -1 ? index + currentIndex : context.operations.length;
2300
2311
  return endLoopIndex;
2301
2312
  }
2302
2313
 
@@ -2398,7 +2409,8 @@ var evaluations = {
2398
2409
  };
2399
2410
 
2400
2411
  function findNextFlowControlIndex(context) {
2401
- var list = context.operations.slice(context.currentIndex + 1);
2412
+ var currentIndex = context.currentIndex + 1;
2413
+ var list = context.operations.slice(currentIndex);
2402
2414
  var otherWiseIndex = list.findIndex(findMatchingOperationIndex.bind({
2403
2415
  counter: 0,
2404
2416
  self: 'when',
@@ -2406,7 +2418,7 @@ function findNextFlowControlIndex(context) {
2406
2418
  }));
2407
2419
 
2408
2420
  if (otherWiseIndex > -1) {
2409
- return otherWiseIndex + context.currentIndex + 1;
2421
+ return otherWiseIndex + currentIndex;
2410
2422
  }
2411
2423
 
2412
2424
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
@@ -2414,7 +2426,7 @@ function findNextFlowControlIndex(context) {
2414
2426
  self: 'when',
2415
2427
  matchingName: 'endWhen'
2416
2428
  }));
2417
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
2429
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
2418
2430
  }
2419
2431
 
2420
2432
  var ops = {