INNER CODE UNIT · JavaScript
getTrials
m4heshd/better-sqlite3-multiple-ciphers · benchmark/index.js:5
const getTrials = (searchTerms) => {
// Without any command-line arguments, we do a general-purpose benchmark.
if (!searchTerms.length) return require('./trials').default;
// With command-line arguments, the user can run specific groups of trials.
return require('./trials').searchable.filter(filterBySearchTerms(searchTerms));
};
const filterBySearchTerms = (searchTerms) => (trial) => {
const terms = [
trial.type,
trial.table,
`(${trial.columns.join(', ')})`,
`(${trial.columns.join(',')})`,
...trial.columns,
...trial.customPragma,
];
return searchTerms.every(arg => terms.includes(arg));