hasIdentifier()function

hasIdentifier(item: T | Item<I, T>, id: I): item is Item<I, T>
ParamType
itemT
Item<I, T>
The data or item object to test. required
idI
The identifier to match against the object's id property. required
Return
item is Item<I, T>
true if item.id equals id, otherwise false.

Does a data object have a given identifier (and is therefore an Item).

Examples

hasIdentifier({ id: "abc" }, "abc") // true