import { findExists } from './findExists' ; param filePath returns export const compatRequire = ( filePath ) => { const mod = require ( filePath ) ; return mod ?. __esModule ? mod . default : mod ; } ; export const requireExistModule = ( filename , extensions = [ '.ts' , '.js' ] ) => { const exist = findExists ( extensions . map ( ext => `${ filename }${ ext }` ) ) ; if ( ! exist ) { return null ; } return compatRequire ( exist ) ; } ;