UNPKG

552 BJavaScriptView Raw
1const {normalise} = require('./normalise')
2const {validate} = require('./validate')
3const {schema} = require('./schema')
4
5module.exports.normalise = normalise
6module.exports.validate = validate
7module.exports.schema = schema
8
9module.exports.Manifest =
10class Manifest {
11 constructor (manifest = []) {
12 this.manifest = manifest
13 if (!Array.isArray(this.manifest)) {
14 throw new TypeError('Manifest must be an Array')
15 }
16 }
17
18 validate () {
19 return validate(this.manifest)
20 }
21
22 normalise () {
23 return normalise(this.manifest)
24 }
25}