UNPKG

json-schema-spell-checker

Version:

Check the spelling of your JSON Schema (including OpenAPI!) documents

13 lines (10 loc) 339 B
const extract = require("./extract"); const check = require("./check"); module.exports = 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); };