Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _GET (path) {
let result = null;
if (path === '/') return this.state;
try {
result = pointer.get(this.state, path);
} catch (E) {
this.error(`Could not _GET() ${path}:`, E);
}
return result;
}
validate (obj: any, context: Context, path: string = ''): Promise[] {
obj = cloneDeep(obj)
if (path !== '') {
set(obj, path, this.parse(get(obj, path)))
return super.validate(obj, context, path)
} else {
return super.validate(this.parse(obj), context, path)
}
}
}
export function get(entity: any, path: string): any {
return jsonPointer.get(entity, path);
}
exports.getData = function (state, props) {
var schemaKey = props.schemaKey, mergeSchema = props.mergeSchema;
var _a = mergeSchema.keys, keys = _a === void 0 ? [] : _a;
var _b = state[props.schemaKey].data, data = _b === void 0 ? {} : _b;
return jpp.has(data, jpp.compile(keys)) ? jpp.get(data, jpp.compile(keys)) : undefined;
};
/**
export var getData = function (state, props) {
var schemaKey = props.schemaKey, mergeSchema = props.mergeSchema;
var _a = mergeSchema.keys, keys = _a === void 0 ? [] : _a;
var _b = getCurrentState(state, props).data, data = _b === void 0 ? {} : _b;
return jpp.has(data, jpp.compile(keys)) ? jpp.get(data, jpp.compile(keys)) : undefined;
};
export var getMetaStateData = function (state, props) {