nl_tokens: Validate a document against its resource
pl_tokens: function validate ( resource , <mask> , doValidate ) { return new Promise ( ( resolve , reject ) => { if ( doValidate !== true ) { return resolve ( ) ; } if ( resource . validate ( doc ) ) { return resolve ( ) ; } else { debug ( 'model have %d error(s)' , resource . validate . errors . length ) ; return reject ( resource . validate . errors ) ; } } ) ; }