import { TypedResponseError } from './classes.typedresponseerror.js'; import * as plugins from './plugins.js'; export class TypedTools { public async passGuards(guardsArg: plugins.smartguard.Guard[], dataArg: T) { const guardSet = new plugins.smartguard.GuardSet(guardsArg); const guardResult = await guardSet.allGuardsPass(dataArg); if (!guardResult) { const failedHint = await guardSet.getFailedHint(dataArg); throw new TypedResponseError(`guard failed: ${failedHint}`, { failedHint }); } } }