Skip to content

unwrap

unwrap<K, T>(branded): T

Defined in: Types/Brand.ts:50

Strips the brand and returns the underlying value. Since Brand<K, T> extends T this is rarely needed, but can improve readability.

K extends string

T

Brand<K, T>

T

const userId: UserId = toUserId("user-123");
const raw: string = Brand.unwrap(userId); // "user-123"