How to use the ajv.default function in ajv

To help you get started, we’ve selected a few ajv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nick121212 / fx-schema-form / packages / fx-schema-form-antd / libs / demo / init.js View on Github external
index_1.defaultTheme.widgetFactory.add(key, widget);
    }
}
for (var key in templates_1.default) {
    if (templates_1.default.hasOwnProperty(key)) {
        var template = templates_1.default[key];
        index_1.defaultTheme.tempFactory.add(key, template);
    }
}
for (var key in templates_2.default) {
    if (templates_2.default.hasOwnProperty(key)) {
        var template = templates_2.default[key];
        index_1.defaultTheme.tempFactory.add(key, template);
    }
}
var curAjv = new ajv_1.default({
    allErrors: true,
    removeAdditional: false,
    jsonPointers: true,
    extendRefs: true,
    inlineRefs: true,
    format: "full",
    multipleOfPrecision: 12,
    transpile: "nodent",
    loopRequired: Infinity,
    sourceCode: true,
    coerceTypes: true,
    missingRefs: true,
    // inlineRefs: false,
    // v5: true,
    async: "es7",
    useDefaults: true,
github MaibornWolff / TestVille / visualization / app / TestVille / core / data / dataValidatorService.js View on Github external
(response) => {

                    if(response.status === 200) {
                        var ajv = Ajv.default();
                        var compare = ajv.compile(response.data);
                        var valid = compare(data);
                        valid &= ctx.uniqueName(data);

                        if (valid) {
                            resolve({valid: true, errors: []});
                        } else {
                            reject({valid: false, errors: compare.errors});
                        }
                    } else {
                        reject({valid: false, errors: [{
                            "message":response.status,
                            "dataPath": "http"
                        }]});
                    }