콘텐츠로 이동
한국어

ExistsPredicate

이 콘텐츠는 아직 번역되지 않았습니다.

ExistsPredicate = (candidate) => boolean

Defined in: src/util/RandomString.ts:62

Whether a drawn candidate is already taken — the while condition of the do/while loop that the exists argument replaces.

true means “draw again”. That polarity is what keeps a ! off the call site: randomUuid((id) => state.users.has(id)) reads as the loop it stands in for, where an accept-predicate would read as that loop’s negation.

It reads; it does not write. Nothing records the accepted candidate for you, so whatever exists consults is still the caller’s to update.

string

boolean