@dapplion/benchmark
Version:
Ensures that new code does not introduce performance regressions with CI. Tracks:
26 lines (25 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHistoryLocation = resolveHistoryLocation;
const context_js_1 = require("../github/context.js");
const options_js_1 = require("../options.js");
function resolveHistoryLocation(opts) {
if (opts.historyLocal && opts.historyGaCache) {
throw Error("Must not set 'historyLocal' and 'historyGaCache'");
}
if (opts.historyLocal) {
const filepath = typeof opts.historyLocal === "string" ? opts.historyLocal : options_js_1.optionsDefault.historyLocalPath;
return { type: "local", path: filepath };
}
if (opts.historyGaCache) {
const cacheKey = typeof opts.historyGaCache === "string" ? opts.historyGaCache : options_js_1.optionsDefault.historyCacheKey;
return { type: "ga-cache", key: cacheKey };
}
// Defaults
if ((0, context_js_1.isGaRun)()) {
return { type: "ga-cache", key: options_js_1.optionsDefault.historyCacheKey };
}
else {
return { type: "local", path: options_js_1.optionsDefault.historyLocalPath };
}
}