Skip to content

Commit d1b12da

Browse files
committed
Preserve ids in entities
1 parent b003117 commit d1b12da

File tree

2 files changed

+79
-101
lines changed

2 files changed

+79
-101
lines changed

src/normalize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ function extract(json, { camelizeKeys }) {
2020
const type = camelizeKeys ? camelCase(elem.type) : elem.type;
2121

2222
ret[type] = ret[type] || {};
23-
ret[type][elem.id] = ret[type][elem.id] || {};
23+
ret[type][elem.id] = ret[type][elem.id] || {
24+
id: elem.id
25+
};
2426

2527
if (camelizeKeys) {
2628
ret[type][elem.id].attributes = {};

0 commit comments

Comments
 (0)