Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
minify(
this.grunt.file.read( TEMPLATE_FILE ),
{
removeComments : true,
// TODO fix me
// https://github.com/stefanjudis/grunt-phantomas/issues/93
collapseWhitespace : true
}
),
{ data : {
additionalStylesheet : this.options.additionalStylesheet,
assertions : this.options.assertions,
failedAssertions : this.failedAssertions,
group : this.options.group,
images : images,
meta : phantomas.metadata.metrics,
results : templateResults,
timestamp : this.timestamp,
url : this.options.url,
version : this.version
} }
)
);
this.grunt.log.ok(
'Phantomas created new \'index.html\' at \'' + this.options.indexPath + '\'.'
);
resolve( templateResults );
}.bind( this ) );
};
export default async function(req, res) {
const query = url.parse(req.url, true).query;
if (!query.url) {
send(res, 403);
}
try {
const data = await phantomas(query.url);
send(res, 200, formatRes(data.json));
}
catch(err) {
send(res, formatErr(err));
}
}