Stremio JSON Schema Validator for Node.js using stremio-core types
Additional properties that are not part of the schema got removed. Validation functions throws error if the argument does not match the schema.
npm run build
- Manifest
- ManifestPreview
- Descriptor
- DescriptorPreview
- MetaItem
- MetaItemPreview
- Stream
- Subtitles
- Video
- ResourceResponse
meta refers to javascript object with valid MetaItemPreview schema
const validator = require('@stremio/stremio-core-validator');
const meta = validator.meta_item_preview({
id: 'id',
type: 'type',
name: 'name'
});
error refers to Error object with message describing which field is invalid
const validator = require('@stremio/stremio-core-validator');
try {
const meta = validator.meta_item_preview({
id: 'id',
// type: 'type',
name: 'name'
});
} catch (error) {
console.log(error.message);
}