mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
11 lines
320 B
JavaScript
11 lines
320 B
JavaScript
module.exports = function (helpers, done) {
|
|
var template = require("./template.marko").default;
|
|
|
|
template.render({ $global: { cspNonce: "abc123" } }, function (err, html) {
|
|
if (!/<script.*nonce="?abc123"?.*>/.test(html)) {
|
|
throw new Error("script tag does not contain a nonce");
|
|
}
|
|
done();
|
|
});
|
|
};
|