Swap-Aggregator-Subgraph/node_modules/gluegun/build/loaders/module-loader.js
2022-07-03 07:27:35 +05:30

17 lines
595 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var filesystem_tools_1 = require("../toolbox/filesystem-tools");
var string_tools_1 = require("../toolbox/string-tools");
// try loading this module
function loadModule(path) {
if (string_tools_1.strings.isBlank(path)) {
throw new Error('path is required');
}
if (filesystem_tools_1.filesystem.isNotFile(path)) {
throw new Error(path + " is not a file");
}
require.resolve(path);
return require(path);
}
exports.loadModule = loadModule;
//# sourceMappingURL=module-loader.js.map