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.
@@ -572,8 +572,14 @@ var Action = /*#__PURE__*/function () {
572
572
  parentContext.currentIndex = value;
573
573
  },
574
574
 
575
- eventbus: parentContext.eventbus,
576
- operations: parentContext.operations,
575
+ get eventbus() {
576
+ return parentContext.eventbus;
577
+ },
578
+
579
+ get operations() {
580
+ return parentContext.operations;
581
+ },
582
+
577
583
  parent: parentContext
578
584
  };
579
585
 
@@ -586,7 +592,7 @@ var Action = /*#__PURE__*/function () {
586
592
  this._contextStack.pop();
587
593
  };
588
594
 
589
- _proto.executeOperation = function executeOperation(operations, idx, resolve, reject, previousOperationData) {
595
+ _proto.executeOperation = function executeOperation(operations, operationIndex, resolve, reject, previousOperationData) {
590
596
  var _this2 = this;
591
597
 
592
598
  if (previousOperationData === void 0) {
@@ -596,16 +602,16 @@ var Action = /*#__PURE__*/function () {
596
602
  var context = this._contextStack[this._contextStack.length - 1];
597
603
 
598
604
  if (context.newIndex !== undefined) {
599
- idx = context.newIndex;
605
+ operationIndex = context.newIndex;
600
606
  delete context.newIndex;
601
607
  }
602
608
 
603
- context.currentIndex = idx;
609
+ context.currentIndex = operationIndex;
604
610
 
605
- if (idx < operations.length) {
611
+ if (operationIndex < operations.length) {
606
612
  var _operationInfo$operat;
607
613
 
608
- var operationInfo = operations[idx];
614
+ var operationInfo = operations[operationIndex];
609
615
  var copy = deepCopy((_operationInfo$operat = operationInfo.operationData) != null ? _operationInfo$operat : {});
610
616
  var mergedOperationData = Object.assign(previousOperationData, copy);
611
617
 
@@ -631,12 +637,12 @@ var Action = /*#__PURE__*/function () {
631
637
 
632
638
  if (isPromise(operationResult)) {
633
639
  operationResult.then(function (promisedOperationResult) {
634
- return _this2.executeOperation(operations, ++idx, resolve, reject, promisedOperationResult);
640
+ return _this2.executeOperation(operations, ++operationIndex, resolve, reject, promisedOperationResult);
635
641
  })["catch"](function (error) {
636
642
  reject(error);
637
643
  });
638
644
  } else {
639
- this.executeOperation(operations, ++idx, resolve, reject, operationResult);
645
+ this.executeOperation(operations, ++operationIndex, resolve, reject, operationResult);
640
646
  }
641
647
  } else {
642
648
  resolve(previousOperationData);
@@ -1321,9 +1327,12 @@ var createElement$1 = function createElement(operationData) {
1321
1327
  elementName = _operationData.elementName,
1322
1328
  attributes = _operationData.attributes,
1323
1329
  text = _operationData.text;
1324
- var serializedAttrs = attributes ? " " + Object.entries(attributes).map(function (_ref) {
1325
- var key = _ref[0],
1326
- value = _ref[1];
1330
+ var serializedAttrs = attributes ? " " + Object.entries(attributes).filter(function (_ref) {
1331
+ var value = _ref[1];
1332
+ return Boolean(value);
1333
+ }).map(function (_ref2) {
1334
+ var key = _ref2[0],
1335
+ value = _ref2[1];
1327
1336
  return key + "=\"" + value + "\"";
1328
1337
  }).join(' ') : '';
1329
1338
  var template = text ? $("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $("<" + elementName + serializedAttrs + "/>");
@@ -1923,13 +1932,14 @@ var otherwise$1 = function otherwise(operationData) {
1923
1932
  };
1924
1933
 
1925
1934
  function findEndWhenIndex(context) {
1926
- var list = context.operations.slice(context.currentIndex);
1935
+ var currentIndex = context.currentIndex + 1;
1936
+ var list = context.operations.slice(currentIndex);
1927
1937
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
1928
1938
  counter: 0,
1929
1939
  self: 'when',
1930
1940
  matchingName: 'endWhen'
1931
1941
  }));
1932
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
1942
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
1933
1943
  }
1934
1944
 
1935
1945
  /**
@@ -2278,13 +2288,14 @@ var startLoop$1 = function startLoop(operationData) {
2278
2288
  };
2279
2289
 
2280
2290
  function findLoopEndIndex(context) {
2281
- var list = context.operations.slice(context.currentIndex + 1);
2291
+ var currentIndex = context.currentIndex + 1;
2292
+ var list = context.operations.slice(currentIndex);
2282
2293
  var index = list.findIndex(findMatchingOperationIndex.bind({
2283
2294
  counter: 0,
2284
2295
  self: 'startLoop',
2285
2296
  matchingName: 'endLoop'
2286
2297
  }));
2287
- var endLoopIndex = index > -1 ? index + (context.currentIndex + 1) : context.operations.length;
2298
+ var endLoopIndex = index > -1 ? index + currentIndex : context.operations.length;
2288
2299
  return endLoopIndex;
2289
2300
  }
2290
2301
 
@@ -2386,7 +2397,8 @@ var evaluations = {
2386
2397
  };
2387
2398
 
2388
2399
  function findNextFlowControlIndex(context) {
2389
- var list = context.operations.slice(context.currentIndex + 1);
2400
+ var currentIndex = context.currentIndex + 1;
2401
+ var list = context.operations.slice(currentIndex);
2390
2402
  var otherWiseIndex = list.findIndex(findMatchingOperationIndex.bind({
2391
2403
  counter: 0,
2392
2404
  self: 'when',
@@ -2394,7 +2406,7 @@ function findNextFlowControlIndex(context) {
2394
2406
  }));
2395
2407
 
2396
2408
  if (otherWiseIndex > -1) {
2397
- return otherWiseIndex + context.currentIndex + 1;
2409
+ return otherWiseIndex + currentIndex;
2398
2410
  }
2399
2411
 
2400
2412
  var endWhenIndex = list.findIndex(findMatchingOperationIndex.bind({
@@ -2402,7 +2414,7 @@ function findNextFlowControlIndex(context) {
2402
2414
  self: 'when',
2403
2415
  matchingName: 'endWhen'
2404
2416
  }));
2405
- return endWhenIndex > -1 ? endWhenIndex + (context.currentIndex + 1) : context.operations.length;
2417
+ return endWhenIndex > -1 ? endWhenIndex + currentIndex : context.operations.length;
2406
2418
  }
2407
2419
 
2408
2420
  var ops = {