mirror of
https://github.com/hanzoai/DOMPurify.git
synced 2026-09-24 16:55:05 +00:00
fix(trusted-types): Use 'trusted-types/lib'
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/// <reference types="trusted-types" />
|
||||
/// <reference types="trusted-types/lib" />
|
||||
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/// <reference types="trusted-types" />
|
||||
/// <reference types="trusted-types/lib" />
|
||||
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,6 +53,8 @@ function addTrustedTypesReference(types) {
|
||||
// We need to tell TypeScript that we use the type declarations from
|
||||
// `trusted-types` so that it ends up in our type declaration type).
|
||||
// Without this, the references to trusted-types in the type declaration
|
||||
// file can cause compilation errors for certain configurations.
|
||||
return `/// <reference types="trusted-types" />\n${types}`;
|
||||
// file can cause compilation errors for certain configurations. We use
|
||||
// the '/lib' entrypoint to avoid modifying global scope, see:
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/trusted-types#library-usage
|
||||
return `/// <reference types="trusted-types/lib" />\n${types}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user