Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const updateSummary = (summary, {plugin, rawTime}, {precise}) => {
const summaryForPlugin = summary[plugin] || {rawTime: [0, 0]};
const newRawTime = hrtimeAdd(summaryForPlugin.rawTime, rawTime);
const formatted = pretty(newRawTime, {precise});
const text = 'Completed in ' + pretty(newRawTime, {precise});
const time = convert(newRawTime);
return {
...summary,
[plugin]: {rawTime: newRawTime, formatted, text, time},
};
};