UNPKG

typebox-schema-faker

Version:

Generate fake data from TypeBox schemas for testing, prototyping and development.

9 lines (8 loc) 265 B
import { rootFake } from '../root'; /** * Generates fake data for union schemas */ export const fakeUnion = (schema, ctx, options) => { const selectedSchema = ctx.faker.helpers.arrayElement(schema.anyOf); return rootFake(selectedSchema, ctx, options); };