import path from 'path' ; import { existsSync , PathLike , readFileSync } from 'fs' ; export const COMPILED_IGS_DIRECTORY = 'compiledImplementationGuides' ; param moduleName param implementationGuidesPath export const loadImplementationGuides = ( moduleName , implementationGuidesPath ? ) : any [ ] | undefined => { const resolvedImplementationGuidesPath = implementationGuidesPath ?? path . join ( __dirname , '..' , COMPILED_IGS_DIRECTORY ) ; const igsPath = path . join ( resolvedImplementationGuidesPath . toString ( ) , `${ moduleName }.json` ) ; if ( existsSync ( igsPath ) ) { return JSON . parse ( readFileSync ( igsPath , { encoding : 'utf8' } ) ) ; } return undefined ; } ;