Skip to content

Instantly share code, notes, and snippets.

@victorjonsson
Last active December 11, 2015 21:49
Show Gist options
  • Save victorjonsson/4665605 to your computer and use it in GitHub Desktop.
Save victorjonsson/4665605 to your computer and use it in GitHub Desktop.
var mval = require('mval'),
MANIFEST = mval.MANIFEST;
// Validate android manifest file
var errors = mval.validate('AndroidManifest.xml', MANIFEST.ANDROID);
if( errors.length > 0 ) {
throw new Error('AndroidManifest.xml is invalid \n'+errors.join('\n'));
}
// You can of course also validate ordinary objects
var obj = {...};
var errors = mval.validate(obj, MANIFEST.COMPOSER);
if( errors.length > 0 ) {
throw new Error('Composer manifest is invalid \n'+errors.join('\n'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment