import { ts } from 'ts-morph' ; const getCurrentDirectory = ts . sys . getCurrentDirectory ; const useCaseSensitiveFileNames = ts . sys . useCaseSensitiveFileNames ; const newLine = ts . sys . newLine ; export function getNewLine ( ) { return newLine ; } export function cleanNameWithoutSpaceAndToLowerCase ( name ) { return name . toLowerCase ( ) . replace ( / /g , '-' ) ; } export function getCanonicalFileName ( fileName ) { return useCaseSensitiveFileNames ? fileName : fileName . toLowerCase ( ) ; } export const formatDiagnosticsHost = { getCurrentDirectory , getCanonicalFileName , getNewLine } ; /**
 * Read and parse tsconfig file with tsc APIs
 */ export function readTsconfigFile ( tsconfigFile ) { let result = ts . readConfigFile ( tsconfigFile , ts . sys . readFile ) ; if ( result . error ) { let message = ts . formatDiagnostics ( [ result . error ] , formatDiagnosticsHost ) ; throw new Error ( message ) ; } return result . config ; }