import { type } from "arktype"
const BaseSchema = type({
name: "string.integer",
});
const ASchema = BaseSchema.and({
type: "'typeA'",
fieldA: "number",
});
const BSchema = BaseSchema.and({
type: "'typeB'",
configuration: "object",
});
export const Thing = ASchema.or(BSchema);
const out = Thing({
name: "MyName",
})
import { type } from "arktype"
const BaseSchema = type({
name: "string.integer",
});
const ASchema = BaseSchema.and({
type: "'typeA'",
fieldA: "number",
});
const BSchema = BaseSchema.and({
type: "'typeB'",
configuration: "object",
});
export const Thing = ASchema.or(BSchema);
const out = Thing({
name: "MyName",
})