import { pipe, Schema, SchemaAST } from "effect"
const schema = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"))
).annotations({
message: () => ({
message: `Expected Foo`,
override: true
}),
identifier: "Foo"
})
console.log(SchemaAST.getIdentifierAnnotation(schema.ast)) // finds Foo
const schema2 = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
).annotations({
message: () => ({
message: `Expected Foo`,
override: true
}),
})
console.log(SchemaAST.getIdentifierAnnotation(schema2.ast)) // does not finds Foo
const schema3 = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
)
console.log(SchemaAST.getIdentifierAnnotation(schema3.ast)) // finds Foo
import { pipe, Schema, SchemaAST } from "effect"
const schema = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"))
).annotations({
message: () => ({
message: `Expected Foo`,
override: true
}),
identifier: "Foo"
})
console.log(SchemaAST.getIdentifierAnnotation(schema.ast)) // finds Foo
const schema2 = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
).annotations({
message: () => ({
message: `Expected Foo`,
override: true
}),
})
console.log(SchemaAST.getIdentifierAnnotation(schema2.ast)) // does not finds Foo
const schema3 = pipe(
Schema.String,
Schema.brand(Symbol.for("Foo"), {identifier: 'Foo'})
)
console.log(SchemaAST.getIdentifierAnnotation(schema3.ast)) // finds Foo