license author lwe google unrestricted export class Finding { param type param description param severity param directive param value constructor ( public type , public description , public severity , public directive , public value ? ) { } param findings return static getHighestSeverity ( findings ) { if ( findings . length === 0 ) { return Severity . NONE ; } const severities = findings . map ( ( finding ) => finding . severity ) ; const min = ( prev , cur ) => prev < cur ? prev : cur ; return severities . reduce ( min , Severity . NONE ) ; } equals ( obj ) { if ( ! ( obj instanceof Finding ) ) { return false ; } return obj . type === this . type && obj . description === this . description && obj . severity === this . severity && obj . directive === this . directive && obj . value === this . value ; } } /**
 * Finding severities.
 */ export enum Severity { HIGH = 10 , SYNTAX = 20 , MEDIUM = 30 , HIGH_MAYBE = 40 , STRICT_CSP = 45 , MEDIUM_MAYBE = 50 , INFO = 60 , NONE = 100 } /**
 * Finding types for evluator checks.
 */ export enum Type { MISSING_SEMICOLON = 100 , UNKNOWN_DIRECTIVE , INVALID_KEYWORD , NONCE_CHARSET = 106 , MISSING_DIRECTIVES = 300 , SCRIPT_UNSAFE_INLINE , SCRIPT_UNSAFE_EVAL , PLAIN_URL_SCHEMES , PLAIN_WILDCARD , SCRIPT_ALLOWLIST_BYPASS , OBJECT_ALLOWLIST_BYPASS , NONCE_LENGTH , IP_SOURCE , DEPRECATED_DIRECTIVE , SRC_HTTP , STRICT_DYNAMIC = 400 , STRICT_DYNAMIC_NOT_STANDALONE , NONCE_HASH , UNSAFE_INLINE_FALLBACK , ALLOWLIST_FALLBACK , IGNORED , REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS = 500 , REPORTING_DESTINATION_MISSING = 600 , REPORT_TO_ONLY }