hasIdentifier()function
hasIdentifier(item: T | Item<I, T>, id: I): item is Item<I, T>
| Param | Type | |
|---|---|---|
item | TItem<I, T> | The data or item object to test. required |
id | I | 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