JSON Schema all the Objects! It works in the browser and Node.
Checkout the example code sandbox.
Install:
yarn add @getcrft/jsonizer
then call it like:
import { schemaGenerator } from '@getcrft/jsonizer';
const result = schemaGenerator({
bacon: true
});
the result will look like:
{
type: 'object',
required: [],
properties: {
bacon: {
title: 'Bacon',
type: 'boolean',
examples: [true]
}
}
}