UNPKG

rbt_mssql-pool-party

Version:

Extension of mssql that provides management of multiple connection pools, dsns, retries, and more

15 lines (14 loc) 795 B
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = validateConfig;var dsnSources = ['dsn', 'dsns', 'dsnProvider']; function validateConfig(config) { if (!config) { throw new Error('config is a required parameter when instantiating ConnectionPoolParty'); } var dsnSourcesInConfig = Object.keys(config).filter(function (key) {return dsnSources.includes(key);}); if (dsnSourcesInConfig.length === 0) { throw new Error("One of the following config items is required: ".concat(dsnSources.join(', '))); } if (dsnSourcesInConfig.length > 1) { throw new Error("You can only specify one of the following config items: ".concat(dsnSources.join(', '))); } }module.exports = exports.default; //# sourceMappingURL=validate-config.js.map