createPolicy

fun createPolicy(policyName: String, policyOptions: TrustedTypePolicyOptions = definedExternally): TrustedTypePolicy(source)

The createPolicy() method of the TrustedTypePolicyFactory interface creates a TrustedTypePolicy object that implements the rules passed as policyOptions.

MDN Reference