@shopify/react-network
Version:
A collection of components that allow you to set common HTTP headers from within your React application
24 lines (19 loc) • 473 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var network = require('@shopify/network');
var hooks = require('../hooks.js');
function RequireSriFor({
scripts,
styles
}) {
const value = [];
if (scripts) {
value.push(network.SriAsset.Script);
}
if (styles) {
value.push(network.SriAsset.Style);
}
hooks.useCspDirective(network.CspDirective.RequireSriFor, value);
return null;
}
exports["default"] = RequireSriFor;