MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromBrand

Function fromBrand

packages/effect/src/Schema.ts:5241–5247  ·  view source on GitHub ↗
(identifier: string, ctor: Brand.Constructor<A>)

Source from the content-addressed store, hash-verified

5239 * @since 3.10.0
5240 */
5241export function fromBrand<A extends Brand.Brand<any>>(identifier: string, ctor: Brand.Constructor<A>) {
5242 return <S extends Top & { readonly "Type": Brand.Brand.Unbranded<A> }>(
5243 self: S
5244 ): brand<S["Rebuild"], Brand.Brand.Keys<A>> => {
5245 return (ctor.checks ? self.check(...ctor.checks) : self).pipe(brand(identifier))
5246 }
5247}
5248
5249/**
5250 * Type-level representation returned by {@link middlewareDecoding}.

Callers

nothing calls this directly

Calls 3

brandFunction · 0.70
pipeMethod · 0.65
checkMethod · 0.65

Tested by

no test coverage detected