export const isClientField = (field) => !field.skipClient;
export const isClientRelationship = (rel) => rel.skipClient ?? !(rel.persistableRelationship || rel.relationshipEagerLoad || rel.otherEntity.jpaMetamodelFiltering);
/**
 * Clone entity properties for frontend templates.
 * To be used in writing operations.
 */
export const filterEntityPropertiesForClient = (entity) => ({
    ...entity,
    fields: entity.fields.filter(field => isClientField(field)),
    relationships: entity.relationships.filter(rel => isClientRelationship(rel)),
});
/**
 * Filter entities for frontend templates.
 */
export const filterEntitiesForClient = (entities) => entities.filter(entity => !entity.skipClient);
/**
 * Filter entities and properties for frontend templates.
 */
export const filterEntitiesAndPropertiesForClient = (entities) => entities.filter(entity => !entity.skipClient).map(filterEntityPropertiesForClient);
