function storeResponseToContext(r, context) { var selfStore = ObjUtils.valueForKeyPath(r, "body._links.self.store"); if (selfStore === undefined) { return; } Object.keys(selfStore) .forEach(function (prop) { var o = selfStore[prop]; o.forEach(function (item) { context[item.name] = ObjUtils.valueForKeyPath(r[prop], item.key); }); }); }
o.forEach(function (item) { context[item.name] = ObjUtils.valueForKeyPath(r[prop], item.key); });