Skip to content

helix / holdingPredicate

Function: holdingPredicate()

holdingPredicate(dp, item, opts?): string | PredicateRef

Defined in: core/values/holding.ts:60

Register (once) the holding predicate for item on dp and return its ref - the shared held-detection primitive. Built from the same ItemValue you give, via Predicate.holding, so an item is detected exactly the way it was granted. Idempotent: re-registering the same name with a fresh Predicate would throw, so an already-seen item reuses its file. The slug + dedup live here (not duplicated per package) so spool and twine can't drift apart.

Parameters

dp

Datapack

item

ItemValue

opts?

HoldingOptions = {}

Returns

string | PredicateRef

Released under the MIT License · Credits