UNPKG

datainout

Version:

Import and reports data

25 lines (23 loc) 963 B
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); // src/helpers/datainout-config.ts import * as path from "path"; import * as fs from "fs"; var globalConfig = {}; function getConfig() { if (Object.keys(globalConfig).length === 0) { const jsPath = path.join(process.cwd(), "datainout.config.js"); const tsPath = path.join(process.cwd(), "datainout.config.ts"); if (fs.existsSync(jsPath)) globalConfig = __require(jsPath); else if (fs.existsSync(tsPath)) globalConfig = __require(tsPath).default; else globalConfig = { templateExtension: ".js", dateFormat: "DD-MM-YYYY" }; } return globalConfig; } export { getConfig };