typia
Version:
Superfast runtime validators with only one line
1 lines • 616 B
Source Map (JSON)
{"version":3,"file":"_assertGuard.mjs","names":[],"sources":["../../src/internal/_assertGuard.ts"],"sourcesContent":["import { TypeGuardError } from \"../TypeGuardError\";\n\nexport const _assertGuard = (\n exceptionable: boolean,\n props: TypeGuardError.IProps,\n factory?: (props: TypeGuardError.IProps) => Error,\n): false => {\n if (exceptionable === true) {\n if (factory) throw factory(props);\n else throw new TypeGuardError(props);\n }\n return false;\n};\n"],"mappings":";;AAEA,MAAa,gBACX,eACA,OACA,YACU;CACV,IAAI,kBAAkB,MACpB,IAAI,SAAS,MAAM,QAAQ,KAAK;MAC3B,MAAM,IAAI,eAAe,KAAK;CAErC,OAAO;AACT"}