json-schema-spell-checker
Version:
Check the spelling of your JSON Schema (including OpenAPI!) documents
13 lines (10 loc) • 332 B
JavaScript
import extract from "./extract.js";
import check from "./check.js";
export default async function (input, fields = [], options = {}) {
let checks = [];
for (let s of extract(input, fields)) {
checks.push(await check(s, options));
}
const all = await Promise.all(checks);
return all.filter((a) => a.errors.length);
}