Hyperlinkv0.8.0-beta.28

PrimaryKey

PrimaryKey.isPrimaryKeyconsteffect/PrimaryKey.ts:87
(u: unknown): u is PrimaryKey

Checks whether a value implements the PrimaryKey protocol.

When to use

Use to narrow an unknown value before treating it as a PrimaryKey.

Details

This is a structural guard for the PrimaryKey.symbol property.

Gotchas

This guard does not call the method or verify that it returns a string.

export const isPrimaryKey = (u: unknown): u is PrimaryKey => hasProperty(u, symbol)