Skip to content

Commit

Permalink
[core] add proper parameter type for TrustedTypePolicy createHTML c…
Browse files Browse the repository at this point in the history
…allback

Fixes issue Azure#24872.
  • Loading branch information
jeremymeng committed May 9, 2023
1 parent 4022610 commit a2f7d90
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion common/config/rush/common-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* instead of the latest version.
*/
// "some-library": "1.2.3"
"@types/trusted-types": "2.0.2" // #24872
},
/**
* When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions,
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/src/util/xml.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getSerializer(): XMLSerializer {
let ttPolicy: Pick<TrustedTypePolicy, "createHTML"> | undefined;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/core-http#xml.browser", {
createHTML: (s) => s,
createHTML: (s: string) => s,
});
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-xml/src/xml.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let ttPolicy: Pick<TrustedTypePolicy, "createHTML"> | undefined;
try {
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/core-xml#xml.browser", {
createHTML: (s: any) => s,
createHTML: (s: string) => s,
});
}
} catch (e: any) {
Expand Down

0 comments on commit a2f7d90

Please sign in to comment.