generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
28 lines (27 loc) • 759 B
JavaScript
export const stringifyApplicationData = data => JSON.stringify(data, (key, value) => {
if (!value) {
return value;
}
if (key === 'faker') {
return '[faker]';
}
if (key === 'otherEntity' || key === 'entity') {
return `[${value.name} Entity]`;
}
if (key === 'reference') {
return `[${value.name} Reference]`;
}
if (key === 'otherRelationship') {
return `[${value.relationshipName} relationship]`;
}
if (key === 'otherRelationships') {
return '[otherRelationships]';
}
if (key === 'derivedPrimaryKey') {
return `[${value.type} derivedPrimaryKey]`;
}
if (key === 'derivedFields') {
return '[derivedFields]';
}
return value;
}, 4);