The label to check for.
A function that takes an optional object and returns true if the label matches, or false otherwise.
import { PlatformServiceName, hasLabel } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeTypeRepository);
const personType = repository.getLimeType('person');
const properties = Object.values(personType?.properties ?? {});
const emailProperty = properties.find(hasLabel('primaryemailaddress'));
Creates a function to check if a given object has a specific label.
The returned function takes an object (a
LimeTypeorLimeProperty) and checks whether it contains the specified label. This function is typically used as a callback for array methods like.findor.filter.