Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get(pointer, data) {
if (data) {
const result = jsl.getSchema(this.core, pointer, data, this.schema);
return copy(result);
}
if (this.cache[pointer] === undefined) {
const result = jsl.getSchema(this.core, pointer, this.data, this.schema);
if (result.variableSchema === true) {
// @special case: do not cache dynamic schema object (oneOf)
return result;
}
this.cache[pointer] = copy(result);
}
return this.cache[pointer];
}
get(pointer, data) {
if (data) {
const result = jsl.getSchema(this.core, pointer, data, this.schema);
return copy(result);
}
if (this.cache[pointer] === undefined) {
const result = jsl.getSchema(this.core, pointer, this.data, this.schema);
if (result.variableSchema === true) {
// @special case: do not cache dynamic schema object (oneOf)
return result;
}
this.cache[pointer] = copy(result);
}
return this.cache[pointer];
}