UNPKG

752 BJavaScriptView Raw
1import { __assign } from "tslib";
2export 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//# sourceMappingURL=createOperation.js.map
\No newline at end of file