UNPKG

typebox-schema-faker

Version:

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

9 lines (8 loc) 229 B
/** * Generates fake data for integer schemas */ export const fakeInteger = (schema, ctx) => { const min = schema.minimum ?? 0; const max = schema.maximum ?? min + 100; return ctx.faker.number.int({ min, max }); };