We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf61b36 commit b714c4aCopy full SHA for b714c4a
index.js
@@ -20,6 +20,7 @@ var addComma = `
20
21
function build (schema, options) {
22
options = options || {}
23
+ isValidSchema(schema, options.schema)
24
/* eslint no-new-func: "off" */
25
var code = `
26
'use strict'
@@ -600,4 +601,14 @@ function loadUglify () {
600
601
}
602
603
604
+function isValidSchema (schema, externalSchema) {
605
+ const ajv = new Ajv()
606
+ if (externalSchema) {
607
+ Object.keys(externalSchema).forEach(key => {
608
+ ajv.addSchema(externalSchema[key], key)
609
+ })
610
+ }
611
+ ajv.compile(schema)
612
+}
613
+
614
module.exports = build
0 commit comments