Skip to content

Commit

Permalink
[#256] use io-ts brand to avoid breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-alford committed Feb 14, 2023
1 parent 054290a commit 0e42df3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
*
* @since 1.4.0
*/
import { Brand as Brand_ } from 'io-ts'

/**
* Represents a unique identifier to prevent non-branded types from being assigned to branded types.
*
* @since 1.4.0
* @category Model
*/
export interface Brand<B> {
readonly [brand]: B
}

declare const brand: unique symbol
export interface Brand<B> extends Brand_<B> {}

/**
* A newtype that's assignable to its underlying type.
Expand Down

0 comments on commit 0e42df3

Please sign in to comment.