UNPKG

v8r

Version:

A command-line JSON, YAML and TOML validator that's on your wavelength

19 lines (14 loc) 469 B
import { BasePlugin } from "../plugins.js"; import { formatErrors, getDocumentLocation } from "../output-formatters.js"; class TextOutput extends BasePlugin { static name = "v8r-plugin-text-output"; registerOutputFormats() { return ["text"]; } getSingleResultLogMessage(result, format) { if (result.valid === false && format === "text") { return formatErrors(getDocumentLocation(result), result.errors); } } } export default TextOutput;