nl_tokens: Simple response checker for remote files . Expected use in robots . txt or sitemap . xml only .
pl_tokens: function ( <mask> , mediaTypes ) { var contentTypeOk , result = "status: '" + res . statusCode + "', GET failed." ; mediaTypes = ! Array . isArray ( mediaTypes ) ? [ mediaTypes ] : mediaTypes ; if ( res . statusCode === 200 ) { // if content-type exists, and media type found then contentTypeOk contentTypeOk = res . headers [ "content-type" ] && // empty array and none found return true ! mediaTypes . every ( function ( mediaType ) { // flip -1 to 0 and NOT, so that true == NOT found, found stops loop w/false return ! ~ res . headers [ "content-type" ] . indexOf ( mediaType ) ; } ) ; result = contentTypeOk ? "" : "content-type not one of '" + mediaTypes . join ( "," ) + "'" ; } return result ; }