import { JSONSchema7 } from 'json-schema' ; import { JSONSchemaFormatter , TableInterface , JSONSchemaFormatOptions } from '../../../typings' ; import { Database } from './models/database' ; param json param options export const format = ( json , options ) : JSONSchema7 [ ] => { const database = new Database ( ) ; database . parseCompactJson ( json ) ; const jsonSchema = database . getTables ( ) . map ( ( t ) => t . toJSON ( options ) ) ; return jsonSchema ; } ;