Closed
Description
As was discovered in PR #33 there is potential issue with camelizing type's values inside relationships data objects.
Despite camelizing option explicitly called: camelizeKeys: true
it's affecting type values too.
It will be great to have separate configurable option to camelize type values.
Input:
const json = {
data: [
{
type: 'post',
relationships: {
'rel1-to-camelize': {
data: [
{
id: 4,
type: 'type1-to-camelize',
},
],
},
},
id: 2620,
},
],
};
Output:
const output = {
post: {
2620: {
type: 'post',
id: 2620,
relationships: {
rel1ToCamelize: {
data: [
{
id: 4,
type: 'type1ToCamelize',
},
],
},
},
},
},
};
In my point of view this should work by this way:
result = normalize(json, {
camelizeKeys: true,
camelizeTypeValues: true,
});
And camelizeTypeValues
should be in false
state by default.
This is breaking change
Metadata
Metadata
Assignees
Labels
No labels