UNPKG

@decaf-ts/core

Version:

Core persistence module for the decaf framework

10 lines 543 B
import { OperationKeys } from "@decaf-ts/db-decorators"; import { Metadata } from "@decaf-ts/decoration"; export function promiseSequence(tasks) { return tasks.reduce((chain, task) => chain.then(async (results) => [...results, await task()]), Promise.resolve([])); } export function isOperationBlocked(ModelConstructor, op) { const { handler, args } = (Metadata.get(ModelConstructor, OperationKeys.REFLECT + OperationKeys.BLOCK) || {}); return !handler ? false : (handler(...args, op) ?? false); } //# sourceMappingURL=utils.js.map