Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(files => files.map(f => {
const queryFile = new pgp.QueryFile(f, {minify: true});
const sql = queryFile.formatDBType();
const valuesMatch = sql.match(patterns.multipleValues);
const namesMatch = sql.match(patterns.namedParameters);
return {
schema: path.relative(config.scripts, path.dirname(f)).replace(path.sep, '.'),
name: path.basename(f, '.sql'),
sql: queryFile,
paramCount: (valuesMatch && valuesMatch.length || 0) + (namesMatch && namesMatch.length || 0)
};
}));