Skip to content

brand

brand: <S, B>(brand, annotations?) => (self) => brand<S, B>

Defined in: node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/dts/Schema.d.ts:1572

Returns a nominal branded schema by applying a brand to a given schema.

Schema<A> + B -> Schema<A & Brand<B>>

S extends AnyNoContext

B extends string | symbol

B

Schema<Type<S> & Brand<B>, readonly []>

(self): brand<S, B>

S

brand<S, B>

import * as Schema from "effect/Schema"
const Int = Schema.Number.pipe(Schema.int(), Schema.brand("Int"))
type Int = Schema.Schema.Type<typeof Int> // number & Brand<"Int">

3.10.0