fox-send/server/initScript.js

19 lines
454 B
JavaScript

const html = require('choo/html');
const raw = require('choo/html/raw');
module.exports = function(state) {
// return '';
return state.cspNonce
? html`
<script nonce="${state.cspNonce}">
const LOCALE = '${state.locale}';
const downloadMetadata = ${
state.downloadMetadata
? raw(JSON.stringify(state.downloadMetadata))
: '{}'
};
</script>
`
: '';
};