export function createOperation(starting, operation) {
    let context = { ...starting };
    const setContext = (next) => {
        if (typeof next === "function") {
            context = { ...context, ...next(context) };
        }
        else {
            context = { ...context, ...next };
        }
    };
    const getContext = () => ({ ...context });
    Object.defineProperty(operation, "setContext", {
        enumerable: false,
        value: setContext,
    });
    Object.defineProperty(operation, "getContext", {
        enumerable: false,
        value: getContext,
    });
    return operation;
}
//# sourceMappingURL=createOperation.js.map
