har-to-k6
Version:
Convert LI-HAR to k6 script
19 lines (15 loc) • 420 B
JavaScript
function combineImports(results) {
const [main = {}] = results
const imports = { ...(main.imports || {}) }
if (results.length > 1) {
for (const result of results) {
Object.entries(result.imports || {}).forEach(([key, value]) => {
if (value === true || imports[key] === undefined) {
imports[key] = value
}
})
}
}
return imports
}
module.exports = combineImports