@envelop/core 2.0.0 → 2.0.1-alpha-ea62296.0
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/index.js +10 -12
- package/index.mjs +10 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -626,14 +626,12 @@ function createEnvelopOrchestrator(plugins) {
|
|
|
626
626
|
const afterCalls = [];
|
|
627
627
|
let context = args.contextValue || {};
|
|
628
628
|
for (const onExecute of beforeCallbacks.execute) {
|
|
629
|
-
let stopCalled = false;
|
|
630
629
|
const after = await onExecute({
|
|
631
630
|
executeFn,
|
|
632
631
|
setExecuteFn: newExecuteFn => {
|
|
633
632
|
executeFn = newExecuteFn;
|
|
634
633
|
},
|
|
635
634
|
setResultAndStopExecution: stopResult => {
|
|
636
|
-
stopCalled = true;
|
|
637
635
|
result = stopResult;
|
|
638
636
|
},
|
|
639
637
|
extendContext: extension => {
|
|
@@ -649,22 +647,22 @@ function createEnvelopOrchestrator(plugins) {
|
|
|
649
647
|
},
|
|
650
648
|
args: args,
|
|
651
649
|
});
|
|
652
|
-
if (
|
|
653
|
-
|
|
650
|
+
if (after === null || after === void 0 ? void 0 : after.onExecuteDone) {
|
|
651
|
+
afterCalls.push(after.onExecuteDone);
|
|
654
652
|
}
|
|
655
|
-
if (
|
|
656
|
-
|
|
657
|
-
afterCalls.push(after.onExecuteDone);
|
|
658
|
-
}
|
|
653
|
+
if (result !== undefined) {
|
|
654
|
+
break;
|
|
659
655
|
}
|
|
660
656
|
}
|
|
661
657
|
if (onResolversHandlers.length) {
|
|
662
658
|
context[resolversHooksSymbol] = onResolversHandlers;
|
|
663
659
|
}
|
|
664
|
-
result
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
660
|
+
if (result === undefined) {
|
|
661
|
+
result = (await executeFn({
|
|
662
|
+
...args,
|
|
663
|
+
contextValue: context,
|
|
664
|
+
}));
|
|
665
|
+
}
|
|
668
666
|
const onNextHandler = [];
|
|
669
667
|
const onEndHandler = [];
|
|
670
668
|
for (const afterCb of afterCalls) {
|
package/index.mjs
CHANGED
|
@@ -622,14 +622,12 @@ function createEnvelopOrchestrator(plugins) {
|
|
|
622
622
|
const afterCalls = [];
|
|
623
623
|
let context = args.contextValue || {};
|
|
624
624
|
for (const onExecute of beforeCallbacks.execute) {
|
|
625
|
-
let stopCalled = false;
|
|
626
625
|
const after = await onExecute({
|
|
627
626
|
executeFn,
|
|
628
627
|
setExecuteFn: newExecuteFn => {
|
|
629
628
|
executeFn = newExecuteFn;
|
|
630
629
|
},
|
|
631
630
|
setResultAndStopExecution: stopResult => {
|
|
632
|
-
stopCalled = true;
|
|
633
631
|
result = stopResult;
|
|
634
632
|
},
|
|
635
633
|
extendContext: extension => {
|
|
@@ -645,22 +643,22 @@ function createEnvelopOrchestrator(plugins) {
|
|
|
645
643
|
},
|
|
646
644
|
args: args,
|
|
647
645
|
});
|
|
648
|
-
if (
|
|
649
|
-
|
|
646
|
+
if (after === null || after === void 0 ? void 0 : after.onExecuteDone) {
|
|
647
|
+
afterCalls.push(after.onExecuteDone);
|
|
650
648
|
}
|
|
651
|
-
if (
|
|
652
|
-
|
|
653
|
-
afterCalls.push(after.onExecuteDone);
|
|
654
|
-
}
|
|
649
|
+
if (result !== undefined) {
|
|
650
|
+
break;
|
|
655
651
|
}
|
|
656
652
|
}
|
|
657
653
|
if (onResolversHandlers.length) {
|
|
658
654
|
context[resolversHooksSymbol] = onResolversHandlers;
|
|
659
655
|
}
|
|
660
|
-
result
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
656
|
+
if (result === undefined) {
|
|
657
|
+
result = (await executeFn({
|
|
658
|
+
...args,
|
|
659
|
+
contextValue: context,
|
|
660
|
+
}));
|
|
661
|
+
}
|
|
664
662
|
const onNextHandler = [];
|
|
665
663
|
const onEndHandler = [];
|
|
666
664
|
for (const afterCb of afterCalls) {
|