UNPKG

@creditkarma/dynamic-config

Version:

Dynamic Config for Node.js backed by Consul and Vault

28 lines 820 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.jsLoader = void 0; const logger_1 = require("../logger"); exports.jsLoader = { type: 'js', async load(filePath) { try { const configObj = require(filePath); if (typeof configObj.default === 'object') { return configObj.default; } else { return configObj; } } catch (err) { if (err instanceof Error && err.message !== undefined) { logger_1.defaultLogger.error(err.message); } else { logger_1.defaultLogger.error(`Error loading file[${filePath}].`); } return {}; } }, }; //# sourceMappingURL=javascript.js.map