Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getConns(config) {
if (config.connection) {
// deprecated (v1.1.0)
console.warn(chalk_1.default.yellow('Warning! The config `connection` object is deprecated. Use `connections` instead.'));
var legacyConn = config.connection;
config.connections = (ts_util_is_1.isString(legacyConn) ? legacyConn : [legacyConn]);
}
if (ts_util_is_1.isString(config.connections)) {
// get form web config
return getWebConfigConns(config.connections);
}
else {
return config.connections;
}
}
exports.getConns = getConns;
function getConns(config) {
if (config.connection) {
// deprecated (v1.1.0)
console.warn(chalk_1.default.yellow('Warning! The config `connection` object is deprecated. Use `connections` instead.'));
var legacyConn = config.connection;
config.connections = (ts_util_is_1.isString(legacyConn) ? legacyConn : [legacyConn]);
}
if (ts_util_is_1.isString(config.connections)) {
// get form web config
return getWebConfigConns(config.connections);
}
else {
return config.connections;
}
}
exports.getConns = getConns;
getConnections() {
if (!isString(this.connections)) {
return this.connections;
}
const configFile = /\.config$/;
if (configFile.test(this.connections)) {
return Config.getConnectionsFromWebConfig(this.connections);
} else {
return this.getConnectionsFromJson(this.connections);
}
}
private safeValue(value: any): any {
if (isNull(value)) {
return 'NULL';
}
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
function safeValue(value: any): any {
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
private safeValue(value: any): any {
if (isNull(value)) {
return 'NULL';
}
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
function safeValue(value: any): any {
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
private safeValue(value: any): any {
if (isNull(value)) {
return 'NULL';
}
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
function safeValue(value: any): any {
if (isString(value)) {
value = value.replace("'", "''");
return `'${value}'`;
}
if (isDate(value)) {
value = value.toISOString();
return `'${value}'`;
}
if (isBoolean(value)) {
return value ? 1 : 0;
}
return value;
}
function include(config, file) {
if (!config.files || !config.files.length) {
return true;
}
if (!ts_util_is_1.isArray(file)) {
file = [file];
}
var results = multimatch(file, config.files);
return !!results.length;
}
/**