@dapplion/benchmark
Version:
Ensures that new code does not introduce performance regressions with CI. Tracks:
31 lines (30 loc) • 898 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.onlyBenchmarkOpts = onlyBenchmarkOpts;
/** Manual lodash.pick() function. Ensure no unwanted options end up in optsByRootSuite */
function onlyBenchmarkOpts(opts) {
// Define in this way so Typescript guarantees all keys are considered
const keysObj = {
maxRuns: true,
minRuns: true,
maxMs: true,
minMs: true,
maxWarmUpMs: true,
maxWarmUpRuns: true,
convergeFactor: true,
runsFactor: true,
yieldEventLoopAfterEach: true,
timeoutBench: true,
threshold: true,
noThreshold: true,
only: true,
skip: true,
};
const optsOut = {};
for (const key of Object.keys(keysObj)) {
if (opts[key] !== undefined) {
optsOut[key] = opts[key];
}
}
return optsOut;
}