2018-08-08 00:40:17 +02:00
|
|
|
const html = require('choo/html');
|
|
|
|
const raw = require('choo/html/raw');
|
|
|
|
|
|
|
|
module.exports = function(state) {
|
|
|
|
// return '';
|
|
|
|
return state.cspNonce
|
|
|
|
? html`
|
2018-11-16 21:39:36 +01:00
|
|
|
<script nonce="${state.cspNonce}">
|
2018-11-20 15:50:59 +01:00
|
|
|
const LOCALE = '${state.locale}';
|
2018-11-16 21:39:36 +01:00
|
|
|
const downloadMetadata = ${
|
|
|
|
state.downloadMetadata
|
|
|
|
? raw(JSON.stringify(state.downloadMetadata))
|
|
|
|
: '{}'
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
`
|
2018-08-08 00:40:17 +02:00
|
|
|
: '';
|
|
|
|
};
|