1 | import { __assign } from "tslib";
|
2 | export function createOperation(starting, operation) {
|
3 | var context = __assign({}, starting);
|
4 | var setContext = function (next) {
|
5 | if (typeof next === "function") {
|
6 | context = __assign(__assign({}, context), next(context));
|
7 | }
|
8 | else {
|
9 | context = __assign(__assign({}, context), next);
|
10 | }
|
11 | };
|
12 | var getContext = function () { return (__assign({}, context)); };
|
13 | Object.defineProperty(operation, "setContext", {
|
14 | enumerable: false,
|
15 | value: setContext,
|
16 | });
|
17 | Object.defineProperty(operation, "getContext", {
|
18 | enumerable: false,
|
19 | value: getContext,
|
20 | });
|
21 | return operation;
|
22 | }
|
23 |
|
\ | No newline at end of file |