/** Standard (non-custom) metadata names exclude C_ and R_ segments. */
export function isStandardMetadataName(name) {
    return !name.includes("C_") && !name.includes("R_");
}
export function filterStandardTypeNames(typeNames) {
    return typeNames.filter(isStandardMetadataName);
}
export function sanitizeEntityDescription(desc) {
    const typeName = desc.typeName;
    if (!typeName || !isStandardMetadataName(typeName)) {
        return null;
    }
    const fields = (desc.fields ?? []).filter((f) => f.name && isStandardMetadataName(f.name));
    const relations = (desc.relations ?? []).filter((r) => r.name &&
        isStandardMetadataName(r.name) &&
        (!r.relatedTypeName || isStandardMetadataName(r.relatedTypeName)));
    return {
        typeName,
        label: desc.label,
        fields,
        relations,
    };
}
//# sourceMappingURL=filter.js.map