(u: unknown): u is PrimaryKeyChecks 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 const isPrimaryKey: (
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.
isPrimaryKey = (u: unknownu: unknown): u: unknownu is PrimaryKey => import hasPropertyhasProperty(u: unknownu, const symbol: "~effect/interfaces/PrimaryKey"Defines the unique identifier used to identify objects that implement the PrimaryKey interface.
When to use
Use to implement the PrimaryKey protocol as a computed property key on
classes or object literals that expose a stable string identifier.
symbol)