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

Function assertJsonOrYaml

cli.js:905–920  ·  view source on GitHub ↗
(
        /** @type {string} */ url,
        /** @type {string} */ str,
      )

Source from the content-addressed store, hash-verified

903 })
904
905 function assertJsonOrYaml(
906 /** @type {string} */ url,
907 /** @type {string} */ str,
908 ) {
909 try {
910 JSON.parse(str)
911 return
912 } catch {}
913
914 try {
915 YAML.parse(str)
916 return
917 } catch {}
918
919 console.info(`NOT OK (Not JSON/YAML): ${url}`)
920 }
921 })
922 }
923 // await printDowngradableSchemaVersions()

Callers 1

taskMaintenanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected