import { P_MAIN , TableInterface , CompactFormatter } from '../../../typings' ; import { Database } from './models/database' ; param json export const format = ( json ) : TableInterface [ ] => { if ( json . id === 'MAIN' ) { const database = new Database ( ) ; database . parseDdsCollection ( json . def ) ; return database . getTables ( ) . map ( ( t ) => t . toJSON ( ) ) ; } throw new TypeError ( 'Invalid JSON format provided for CompactFormatter. ' + 'Please provide JSON from root element, containing { id: MAIN }.' ) ; } ;