import { Effect, Schema, SchemaAST } from "effect";
const AccountNumber = Schema.NonEmptyString.annotations({
examples: ["1300"],
title: "Konto",
description: "Konto",
});
const SomeSchema = Schema.Struct({
number: AccountNumber,
}).annotations({
title: "Foo",
identifier: "Should be kept",
});
const SomeOtherSchema = SomeSchema.annotations({
title: "Bar",
});
const a1 = SchemaAST.getIdentifierAnnotation(SomeSchema.ast); // Some
const a2 = SchemaAST.getIdentifierAnnotation(SomeOtherSchema.ast); // None
console.log({ a1, a2 });
import { Effect, Schema, SchemaAST } from "effect";
const AccountNumber = Schema.NonEmptyString.annotations({
examples: ["1300"],
title: "Konto",
description: "Konto",
});
const SomeSchema = Schema.Struct({
number: AccountNumber,
}).annotations({
title: "Foo",
identifier: "Should be kept",
});
const SomeOtherSchema = SomeSchema.annotations({
title: "Bar",
});
const a1 = SchemaAST.getIdentifierAnnotation(SomeSchema.ast); // Some
const a2 = SchemaAST.getIdentifierAnnotation(SomeOtherSchema.ast); // None
console.log({ a1, a2 });