UNPKG

veffect

Version:

powerful TypeScript validation library built on the robust foundation of Effect combining exceptional type safety, high performance, and developer experience. Taking inspiration from Effect's functional principles, VEffect delivers a balanced approach tha

54 lines (53 loc) 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sequential = exports.parallelN = exports.parallel = exports.match = exports.isSequential = exports.isParallelN = exports.isParallel = exports.OP_SEQUENTIAL = exports.OP_PARALLEL_N = exports.OP_PARALLEL = void 0; var _Function = /*#__PURE__*/require("../Function.js"); /** @internal */ const OP_SEQUENTIAL = exports.OP_SEQUENTIAL = "Sequential"; /** @internal */ const OP_PARALLEL = exports.OP_PARALLEL = "Parallel"; /** @internal */ const OP_PARALLEL_N = exports.OP_PARALLEL_N = "ParallelN"; /** @internal */ const sequential = exports.sequential = { _tag: OP_SEQUENTIAL }; /** @internal */ const parallel = exports.parallel = { _tag: OP_PARALLEL }; /** @internal */ const parallelN = parallelism => ({ _tag: OP_PARALLEL_N, parallelism }); /** @internal */ exports.parallelN = parallelN; const isSequential = self => self._tag === OP_SEQUENTIAL; /** @internal */ exports.isSequential = isSequential; const isParallel = self => self._tag === OP_PARALLEL; /** @internal */ exports.isParallel = isParallel; const isParallelN = self => self._tag === OP_PARALLEL_N; /** @internal */ exports.isParallelN = isParallelN; const match = exports.match = /*#__PURE__*/(0, _Function.dual)(4, (self, onSequential, onParallel, onParallelN) => { switch (self._tag) { case OP_SEQUENTIAL: { return onSequential(); } case OP_PARALLEL: { return onParallel(); } case OP_PARALLEL_N: { return onParallelN(self.parallelism); } } }); //# sourceMappingURL=executionStrategy.js.map