(fmtDef)
| 6191 | } |
| 6192 | } |
| 6193 | function getFormat(fmtDef) { |
| 6194 | const code = fmtDef instanceof RegExp |
| 6195 | ? (0, codegen_1.regexpCode)(fmtDef) |
| 6196 | : opts.code.formats |
| 6197 | ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` |
| 6198 | : undefined; |
| 6199 | const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); |
| 6200 | if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { |
| 6201 | return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`]; |
| 6202 | } |
| 6203 | return ["string", fmtDef, fmt]; |
| 6204 | } |
| 6205 | function validCondition() { |
| 6206 | if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { |
| 6207 | if (!schemaEnv.$async) |
no test coverage detected