createYupSchematizer
The createYupSchematizer function creates a YupSchematizer instance for converting Yup schemas to TinyBase schemas.
createYupSchematizer(): YupSchematizer| returns | YupSchematizer | A new |
|---|
Example
This example creates a Yup schematizer.
import {createYupSchematizer} from 'tinybase/schematizers/schematizer-yup';
import {object, string} from 'yup';
const schematizer = createYupSchematizer();
const tablesSchema = schematizer.toTablesSchema({
pets: object({
species: string(),
}),
});
console.log(tablesSchema);
// -> {pets: {species: {type: 'string'}}}
Since
v7.1.0