function
Source: index.ts ↗
bucketAttribute()
Gets first attribute matching the provided predicate from the bucket.
export declare function bucketAttribute(bucket: IBucket, idOrFun?: string | AttributePredicate): IAttribute | undefined;
Parameters
Parameter | Type | Description |
|---|---|---|
bucket | bucket to to search in | |
idOrFun | string | AttributePredicate | (Optional) attribute identifier or instance of AttributePredicate; anyAttribute predicate is default |
Returns
IAttribute | undefined
undefined if no matching attribute is found
Remarks
If no predicate is provided, then the function defaults to anyAttribute predicate - meaning first found attribute will be returned.
This function also provides convenience to find attribute by its local identifier - if you pass predicate as string the function will automatically create idMatchAttribute predicate.