typebox-schema-faker
Version:
Generate fake data from TypeBox schemas for testing, prototyping and development.
12 lines (11 loc) • 336 B
JavaScript
import { rootFake } from '../root';
/**
* Generates fake data for tuple schemas
*/
export const fakeTuple = (schema, ctx, options) => {
if (!schema.items) {
return [];
}
// Map over each schema in the tuple and generate fake data
return schema.items.map((itemSchema) => rootFake(itemSchema, ctx, options));
};