node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* @internal
* @description Get the label of a relation, the contract has [key: string]: unknown,
* so we need to check if the mainFieldKey is defined and if the relation has a value
* under that property. If it does, we then verify it's type of string and return it.
*
* We fallback to the documentId.
*/ const getRelationLabel = (relation, mainField)=>{
const label = mainField && relation[mainField.name] ? relation[mainField.name] : null;
if (typeof label === 'string') {
return label;
}
return relation.documentId;
};
export { getRelationLabel };
//# sourceMappingURL=relations.mjs.map