Initial commit
This commit is contained in:
12
node_modules/knex/lib/migrations/util/import-file.js
generated
vendored
Executable file
12
node_modules/knex/lib/migrations/util/import-file.js
generated
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
const isModuleType = require('./is-module-type');
|
||||
|
||||
/**
|
||||
* imports 'mjs', else requires.
|
||||
* NOTE: require me late!
|
||||
* @param {string} filepath
|
||||
*/
|
||||
module.exports = async function importFile(filepath) {
|
||||
return (await isModuleType(filepath))
|
||||
? import(require('url').pathToFileURL(filepath))
|
||||
: require(filepath);
|
||||
};
|
||||
Reference in New Issue
Block a user