({ gen, schemaEnv, schema, errSchemaPath, opts })
| 2909 | throw new Error("async schema in sync schema"); |
| 2910 | } |
| 2911 | function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { |
| 2912 | const msg = schema.$comment; |
| 2913 | if (opts.$comment === true) { |
| 2914 | gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`); |
| 2915 | } |
| 2916 | else if (typeof opts.$comment == "function") { |
| 2917 | const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`; |
| 2918 | const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); |
| 2919 | gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); |
| 2920 | } |
| 2921 | } |
| 2922 | function returnResults(it) { |
| 2923 | const { gen, schemaEnv, validateName, ValidationError, opts } = it; |
| 2924 | if (schemaEnv.$async) { |
no test coverage detected