jsonld.js
jsonld.js copied to clipboard
Improve `jsonld.UnsupportedVersion` error for strings.
jsonld.UnsupportedVersion error should be more helpful when the error is due to a string value being used. "@version": "1.1" will report jsonld.UnsupportedVersion: Unsupported JSON-LD version: 1.1, which is confusing and doesn't hint that a number should be used like "@version": 1.1.
Otherwise: At least display the version in quotes if it's a string, jsonld.UnsupportedVersion: Unsupported JSON-LD version: "1.1" If you don't want to give a more descriptive error as suggested by @davidlehn