This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Description
Support more complex normalization. E.g. an object like this:
{
outerDocument: {
id: 'outer1',
subDocument: {
id: 'sub1',
subSubDocument: { id: 'subSub1', foo: 'bar' }
}
}
};
could be normalized to this:
{
outer: [{
id: 'outer1',
subDocument: {
id: 'sub1',
subSubDocument: 'subSub1'
}
}],
subSub: [{ id: 'subSub1', foo: 'bar' }]
};
by using this schema-configuration:
const schemaConfig: ISchemaConfig = {
_defaults: { key: 'id' },
outer: { targets: { 'subDocument.subSubDocument': 'subSub' } },
subSub: true
};
At the moment of writing normalizing the subSubDocument is only possible by also normalizing the subDocument. Nested targets like subDocument.subSubDocument: 'subSub' are not yet supported.
The schema would support this as it is now but the denormalizer-module has to be adopted as well.