Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
export default new JSONSchemaBridge(schema, schemaValidator);
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
export default new JSONSchemaBridge(schema, schemaValidator);
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
const bridge = new JSONSchemaBridge(schema, schemaValidator);
export default bridge;
function makeUniformsSchema(
jsonSchema: Omit, 'type'>
) {
const fullSchema: JsonSchema = {
type: 'object',
...jsonSchema,
};
return new JSONSchemaBridge(fullSchema, createValidator(fullSchema));
}
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
const bridge = new JSONSchemaBridge(schema, schemaValidator);
export default bridge;
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
export default new JSONSchemaBridge(schema, schemaValidator);
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
const bridge = new JSONSchemaBridge(schema, schemaValidator);
export default bridge;
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
const bridge = new JSONSchemaBridge(schema, schemaValidator);
export default bridge;
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
export default new JSONSchemaBridge(schema, schemaValidator);
function createValidator(schema) {
const validator = ajv.compile(schema);
return model => {
validator(model);
if (validator.errors && validator.errors.length) {
throw { details: validator.errors };
}
};
}
const schemaValidator = createValidator(schema);
export default new JSONSchemaBridge(schema, schemaValidator);