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