import { flatMap , sortBy } from 'lodash' ; type TablesJSON = Array < { name : string ; } > ; export const normalizeTables = ( tablesJSON ) => sortBy ( tablesJSON , 'name' ) ; let osqueryTables = null ; export const getOsqueryTables = ( ) => { if ( ! osqueryTables ) { osqueryTables = normalizeTables ( require ( '../common/schemas/osquery/v5.0.1.json' ) ) ; } return osqueryTables ; } ; export const getOsqueryTableNames = ( ) => flatMap ( getOsqueryTables ( ) , 'name' ) ;