csp-toolkit
Version:
A comprehensive toolkit for working with Content Security Policy (CSP) directives in TypeScript.
17 lines • 679 B
TypeScript
import { CSPPolicy } from "./types";
/**
*
* @param {CSPPolicy} basePolicy - Base Policy, used as a starting point
* @param {CSPPolicy} newPolicy - New Policy, will be merged to the Base Policy
* @param {boolean} shouldOverride - New Policy overrides the Base Policy
* @returns
*/
export declare const mergePolicies: (basePolicy: CSPPolicy, newPolicy: CSPPolicy | undefined, shouldOverride: boolean) => CSPPolicy;
/**
* Transforms your policy into a csp string to be used in a meta tag or header
* @param {CSPPolicy} policy
* @returns
*/
export declare const policyToString: (policy: CSPPolicy) => string;
export * from "./types";
//# sourceMappingURL=index.d.ts.map