MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / taskCheckStrict

Function taskCheckStrict

cli.js:810–844  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

808}
809
810async function taskCheckStrict() {
811 const ajv = await ajvFactory({
812 draftVersion: 'draft-07',
813 fullStrictMode: false,
814 })
815 const metaSchemaFile = await toFile(
816 './src/schemas/json/metaschema-draft-07-unofficial-strict.json',
817 )
818 let validateFn
819 try {
820 validateFn = ajv.compile(metaSchemaFile.json)
821 } catch (err) {
822 printErrorAndExit(err, [
823 `Failed to compile schema file "./${metaSchemaFile.path}"`,
824 ])
825 }
826
827 await forEachFile({
828 actionName: 'strict metaschema check',
829 async onSchemaFile(schemaFile, { spinner }) {
830 if (!validateFn(schemaFile.json)) {
831 spinner.fail()
832 printSchemaValidationErrorAndExit(
833 schemaFile.path,
834 metaSchemaFile.path,
835 validateFn.errors,
836 )
837 }
838 },
839 })
840
841 // Print information.
842 console.info(`===== REPORT =====`)
843 await printSimpleStatistics()
844}
845
846async function taskCheckRemote() {
847 console.info('TODO')

Callers

nothing calls this directly

Calls 5

ajvFactoryFunction · 0.85
toFileFunction · 0.85
printErrorAndExitFunction · 0.85
forEachFileFunction · 0.85
printSimpleStatisticsFunction · 0.85

Tested by

no test coverage detected