Skip to content

Commit

Permalink
fix: brand assert type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Benricheson101 committed Dec 28, 2024
1 parent 3d8b4a0 commit 8919190
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/types/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export type Brander<B extends UnknownBrand> = typeof brand<B>;
/** Downcasts a branded type to its concrete type */
export const identify = <B extends UnknownBrand>(b: B): Identify<B> => b;

export type BrandAssertion<B extends UnknownBrand> = Assertion<Identify<B>, B>;
export type BrandAssertion<B extends UnknownBrand> =
| Assertion<Identify<B>, B>
| ((v: Identify<B>) => boolean);

/**
* Creates a factory for creating branded types. The optional assertion function should
Expand Down

0 comments on commit 8919190

Please sign in to comment.