From 2acfcc2764a5f678ab3b1583089c347e84d47295 Mon Sep 17 00:00:00 2001 From: Kyle Sletten Date: Mon, 16 Sep 2019 12:06:34 -0600 Subject: [PATCH] Correct allowedAttributes type (#38370) Correct the allowedAttribute to match https://www.npmjs.com/package/sanitize-html#what-if-i-want-to-allow-only-specific-values-on-some-attributes --- types/sanitize-html/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/sanitize-html/index.d.ts b/types/sanitize-html/index.d.ts index 8eed6f6261..b738c4a476 100644 --- a/types/sanitize-html/index.d.ts +++ b/types/sanitize-html/index.d.ts @@ -29,9 +29,10 @@ declare namespace sanitize { type Transformer = (tagName: string, attribs: Attributes) => Tag; + type AllowedAttribute = string | { name: string; multiple?: boolean; values: string[] }; interface IDefaults { - allowedAttributes: { [index: string]: string[] }; + allowedAttributes: { [index: string]: AllowedAttribute[] }; allowedSchemes: string[]; allowedSchemesByTag: { [index: string]: string[] }; allowedTags: string[]; @@ -48,7 +49,7 @@ declare namespace sanitize { interface IOptions { - allowedAttributes?: { [index: string]: string[] } | boolean; + allowedAttributes?: { [index: string]: AllowedAttribute[] } | boolean; allowedStyles?: { [index: string]: { [index: string]: RegExp[] } }; allowedClasses?: { [index: string]: string[] } | boolean; allowedIframeHostnames?: string[];