Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"validator": function(instance, schema, self, report, parent, parentSchema, name) {
var newValue, filter = schema.getValueOfProperty("filter");
if (filter) {
try {
newValue = filter(instance.getValue(), schema);
instance._value = newValue;
if (parent) {
if (newValue !== undefined) {
parent._value[name] = newValue;
} else if (jsv.typeOf(parent._value) === "array") {
parent._value.splice(name, name + 1);
} else {
delete parent._value[name];
}
}
} catch(e) {
console.log("Unexpected error while running filter", e);
}
}
oldValidator.apply(this, arguments);
}
});