UNPKG

@twilio-labs/languagetool-cli

Version:

Run LanguageTool for linting Markdown files during CI

19 lines 729 B
import { readFile } from "fs/promises"; function loadFile(pathItem) { const path = typeof pathItem === "string" ? pathItem : pathItem.filename; const changedLines = typeof pathItem === "string" ? undefined : pathItem.changedLines; return new Promise((resolve) => { readFile(path, { encoding: "utf-8" }) .then((contents) => { resolve({ contents, path, changedLines }); }) .catch(() => resolve(null)); }); } export async function loadFiles(paths) { const responses = await Promise.all(paths.map((path) => loadFile(path))); return responses .filter((response) => !!response) .map((response) => response); } //# sourceMappingURL=files.js.map