Skip to content

isIdsError

isIdsError(value): value is IdsError

Defined in: src/error.ts:75

Type guard for IdsError. Checks a non-enumerable brand rather than bare instanceof so it survives realm/dual-package duplication (ESM + CJS dual package hazard).

unknown

value is IdsError

if (isIdsError(err)) {
switch (err.code) {
case "verification_failed": // ...
case "invalid_id": // ...
}
}