joinMetaCSP()function
joinMetaCSP(csp: Nullish<MetaCSP>): string | undefined
| Param | Type | |
|---|---|---|
csp | Nullish<MetaCSP> | The CSP to join, as a { resource: string[] } object or a ready-made string. required |
| Return | |
|---|---|
string | undefined | The joined CSP string, or undefined if csp was nullish. |
Turn a deconstructed MetaCSP into a Content-Security-Policy string.
Examples
joinMetaCSP({ "default-src": ["'self'"], "img-src": ["*"] }) // "default-src 'self'; img-src *"