You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
336 B
JavaScript
15 lines
336 B
JavaScript
2 years ago
|
"use strict";
|
||
|
|
||
|
const createJSONParser = require("../../text-parser-json");
|
||
|
|
||
|
module.exports = function asJson(resultMapper) {
|
||
|
return function (command) {
|
||
|
return command
|
||
|
.requireOnStdout(createJSONParser(resultMapper))
|
||
|
.withFlags({
|
||
|
reportformat: "json",
|
||
|
units: "h" // Prevent < rounding indicator in output
|
||
|
});
|
||
|
};
|
||
|
};
|