diff --git a/dist/purify.cjs.d.ts b/dist/purify.cjs.d.ts index bce52bde1..045d459d6 100644 --- a/dist/purify.cjs.d.ts +++ b/dist/purify.cjs.d.ts @@ -277,7 +277,7 @@ interface DOMPurify { /** * Provides core sanitation functionality. * - * @param { string | Node} dirty string or DOM node + * @param {string | Node} dirty string or DOM node * @param {Config} cfg object * @returns {string} Sanitized string. */ diff --git a/dist/purify.cjs.js b/dist/purify.cjs.js index 8e3af24f1..ab154ccc0 100644 --- a/dist/purify.cjs.js +++ b/dist/purify.cjs.js @@ -246,8 +246,8 @@ const getGlobal = function getGlobal() { /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! - * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. - * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @param {TrustedTypePolicyFactory} trustedTypes - The policy factory. + * @param {HTMLScriptElement} purifyHostElement - The Script element used to load DOMPurify (to determine policy name suffix). * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported or creating the policy failed). */ @@ -497,7 +497,7 @@ function createDOMPurify() { /** * _parseConfig * - * @param {Config} cfg optional config literal + * @param {Config} cfg optional config literal * @returns {void} */ // eslint-disable-next-line complexity @@ -655,7 +655,7 @@ function createDOMPurify() { const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); /** - * @param {Element} element a DOM element whose namespace is being checked + * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. @@ -735,7 +735,7 @@ function createDOMPurify() { /** * _forceRemove * - * @param {Node} node a DOM node + * @param {Node} node a DOM node */ const _forceRemove = function _forceRemove(node) { arrayPush(DOMPurify.removed, { @@ -751,8 +751,8 @@ function createDOMPurify() { /** * _removeAttribute * - * @param {string} name an Attribute name - * @param {Element} element a DOM node + * @param {string} name an Attribute name + * @param {Element} element a DOM node * @returns {void} */ const _removeAttribute = function _removeAttribute(name, element) { @@ -784,7 +784,7 @@ function createDOMPurify() { /** * _initDocument * - * @param {string} dirty a string of dirty markup + * @param {string} dirty - a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ const _initDocument = function _initDocument(dirty) { @@ -834,7 +834,7 @@ function createDOMPurify() { /** * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. * - * @param {Node} root The root element or node to start traversing on. + * @param {Node} root The root element or node to start traversing on. * @return {NodeIterator} The created NodeIterator */ const _createNodeIterator = function _createNodeIterator(root) { @@ -845,16 +845,16 @@ function createDOMPurify() { /** * _isClobbered * - * @param {Node} elm element to check for clobbering attacks + * @param {Element} element element to check for clobbering attacks * @return {boolean} true if clobbered, false if safe */ - const _isClobbered = function _isClobbered(elm) { - return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + const _isClobbered = function _isClobbered(element) { + return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); }; /** * Checks whether the given object is a DOM node. * - * @param {unknown} value object to check whether it's a DOM node + * @param {unknown} value object to check whether it's a DOM node * @return {value is Node} true is object is a DOM node */ const _isNode = function _isNode(value) { @@ -1018,7 +1018,7 @@ function createDOMPurify() { * @protect removeAttribute * @protect setAttribute * - * @param {Element} currentNode to sanitize + * @param {Element} currentNode to sanitize * @returns {void} */ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { @@ -1134,7 +1134,7 @@ function createDOMPurify() { /** * _sanitizeShadowDOM * - * @param {DocumentFragment} fragment to iterate over recursively + * @param {DocumentFragment} fragment to iterate over recursively * @returns {void} */ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { diff --git a/dist/purify.es.d.mts b/dist/purify.es.d.mts index 01eecaa06..002bb47a4 100644 --- a/dist/purify.es.d.mts +++ b/dist/purify.es.d.mts @@ -277,7 +277,7 @@ interface DOMPurify { /** * Provides core sanitation functionality. * - * @param { string | Node} dirty string or DOM node + * @param {string | Node} dirty string or DOM node * @param {Config} cfg object * @returns {string} Sanitized string. */ diff --git a/dist/purify.es.mjs b/dist/purify.es.mjs index 9941730b6..d16f06495 100644 --- a/dist/purify.es.mjs +++ b/dist/purify.es.mjs @@ -244,8 +244,8 @@ const getGlobal = function getGlobal() { /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! - * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. - * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @param {TrustedTypePolicyFactory} trustedTypes - The policy factory. + * @param {HTMLScriptElement} purifyHostElement - The Script element used to load DOMPurify (to determine policy name suffix). * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported or creating the policy failed). */ @@ -495,7 +495,7 @@ function createDOMPurify() { /** * _parseConfig * - * @param {Config} cfg optional config literal + * @param {Config} cfg optional config literal * @returns {void} */ // eslint-disable-next-line complexity @@ -653,7 +653,7 @@ function createDOMPurify() { const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); /** - * @param {Element} element a DOM element whose namespace is being checked + * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. @@ -733,7 +733,7 @@ function createDOMPurify() { /** * _forceRemove * - * @param {Node} node a DOM node + * @param {Node} node a DOM node */ const _forceRemove = function _forceRemove(node) { arrayPush(DOMPurify.removed, { @@ -749,8 +749,8 @@ function createDOMPurify() { /** * _removeAttribute * - * @param {string} name an Attribute name - * @param {Element} element a DOM node + * @param {string} name an Attribute name + * @param {Element} element a DOM node * @returns {void} */ const _removeAttribute = function _removeAttribute(name, element) { @@ -782,7 +782,7 @@ function createDOMPurify() { /** * _initDocument * - * @param {string} dirty a string of dirty markup + * @param {string} dirty - a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ const _initDocument = function _initDocument(dirty) { @@ -832,7 +832,7 @@ function createDOMPurify() { /** * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. * - * @param {Node} root The root element or node to start traversing on. + * @param {Node} root The root element or node to start traversing on. * @return {NodeIterator} The created NodeIterator */ const _createNodeIterator = function _createNodeIterator(root) { @@ -843,16 +843,16 @@ function createDOMPurify() { /** * _isClobbered * - * @param {Node} elm element to check for clobbering attacks + * @param {Element} element element to check for clobbering attacks * @return {boolean} true if clobbered, false if safe */ - const _isClobbered = function _isClobbered(elm) { - return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + const _isClobbered = function _isClobbered(element) { + return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); }; /** * Checks whether the given object is a DOM node. * - * @param {unknown} value object to check whether it's a DOM node + * @param {unknown} value object to check whether it's a DOM node * @return {value is Node} true is object is a DOM node */ const _isNode = function _isNode(value) { @@ -1016,7 +1016,7 @@ function createDOMPurify() { * @protect removeAttribute * @protect setAttribute * - * @param {Element} currentNode to sanitize + * @param {Element} currentNode to sanitize * @returns {void} */ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { @@ -1132,7 +1132,7 @@ function createDOMPurify() { /** * _sanitizeShadowDOM * - * @param {DocumentFragment} fragment to iterate over recursively + * @param {DocumentFragment} fragment to iterate over recursively * @returns {void} */ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { diff --git a/dist/purify.js b/dist/purify.js index d72dabf76..c2b6fcb97 100644 --- a/dist/purify.js +++ b/dist/purify.js @@ -250,8 +250,8 @@ /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! - * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. - * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @param {TrustedTypePolicyFactory} trustedTypes - The policy factory. + * @param {HTMLScriptElement} purifyHostElement - The Script element used to load DOMPurify (to determine policy name suffix). * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported or creating the policy failed). */ @@ -501,7 +501,7 @@ /** * _parseConfig * - * @param {Config} cfg optional config literal + * @param {Config} cfg optional config literal * @returns {void} */ // eslint-disable-next-line complexity @@ -659,7 +659,7 @@ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); /** - * @param {Element} element a DOM element whose namespace is being checked + * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. @@ -739,7 +739,7 @@ /** * _forceRemove * - * @param {Node} node a DOM node + * @param {Node} node a DOM node */ const _forceRemove = function _forceRemove(node) { arrayPush(DOMPurify.removed, { @@ -755,8 +755,8 @@ /** * _removeAttribute * - * @param {string} name an Attribute name - * @param {Element} element a DOM node + * @param {string} name an Attribute name + * @param {Element} element a DOM node * @returns {void} */ const _removeAttribute = function _removeAttribute(name, element) { @@ -788,7 +788,7 @@ /** * _initDocument * - * @param {string} dirty a string of dirty markup + * @param {string} dirty - a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ const _initDocument = function _initDocument(dirty) { @@ -838,7 +838,7 @@ /** * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. * - * @param {Node} root The root element or node to start traversing on. + * @param {Node} root The root element or node to start traversing on. * @return {NodeIterator} The created NodeIterator */ const _createNodeIterator = function _createNodeIterator(root) { @@ -849,16 +849,16 @@ /** * _isClobbered * - * @param {Node} elm element to check for clobbering attacks + * @param {Element} element element to check for clobbering attacks * @return {boolean} true if clobbered, false if safe */ - const _isClobbered = function _isClobbered(elm) { - return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + const _isClobbered = function _isClobbered(element) { + return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); }; /** * Checks whether the given object is a DOM node. * - * @param {unknown} value object to check whether it's a DOM node + * @param {unknown} value object to check whether it's a DOM node * @return {value is Node} true is object is a DOM node */ const _isNode = function _isNode(value) { @@ -1022,7 +1022,7 @@ * @protect removeAttribute * @protect setAttribute * - * @param {Element} currentNode to sanitize + * @param {Element} currentNode to sanitize * @returns {void} */ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { @@ -1138,7 +1138,7 @@ /** * _sanitizeShadowDOM * - * @param {DocumentFragment} fragment to iterate over recursively + * @param {DocumentFragment} fragment to iterate over recursively * @returns {void} */ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { diff --git a/dist/purify.min.js b/dist/purify.min.js index 9e2450bb0..fa4b00886 100644 --- a/dist/purify.min.js +++ b/dist/purify.min.js @@ -250,8 +250,8 @@ /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! - * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. - * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @param {TrustedTypePolicyFactory} trustedTypes - The policy factory. + * @param {HTMLScriptElement} purifyHostElement - The Script element used to load DOMPurify (to determine policy name suffix). * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported or creating the policy failed). */ @@ -501,7 +501,7 @@ /** * _parseConfig * - * @param {Config} cfg optional config literal + * @param {Config} cfg optional config literal * @returns {void} */ // eslint-disable-next-line complexity @@ -659,7 +659,7 @@ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); /** - * @param {Element} element a DOM element whose namespace is being checked + * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. @@ -739,7 +739,7 @@ /** * _forceRemove * - * @param {Node} node a DOM node + * @param {Node} node a DOM node */ const _forceRemove = function _forceRemove(node) { arrayPush(DOMPurify.removed, { @@ -755,8 +755,8 @@ /** * _removeAttribute * - * @param {string} name an Attribute name - * @param {Element} element a DOM node + * @param {string} name an Attribute name + * @param {Element} element a DOM node * @returns {void} */ const _removeAttribute = function _removeAttribute(name, element) { @@ -788,7 +788,7 @@ /** * _initDocument * - * @param {string} dirty a string of dirty markup + * @param {string} dirty - a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ const _initDocument = function _initDocument(dirty) { @@ -838,7 +838,7 @@ /** * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. * - * @param {Node} root The root element or node to start traversing on. + * @param {Node} root The root element or node to start traversing on. * @return {NodeIterator} The created NodeIterator */ const _createNodeIterator = function _createNodeIterator(root) { @@ -849,16 +849,16 @@ /** * _isClobbered * - * @param {Node} elm element to check for clobbering attacks + * @param {Element} element element to check for clobbering attacks * @return {boolean} true if clobbered, false if safe */ - const _isClobbered = function _isClobbered(elm) { - return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + const _isClobbered = function _isClobbered(element) { + return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); }; /** * Checks whether the given object is a DOM node. * - * @param {unknown} value object to check whether it's a DOM node + * @param {unknown} value object to check whether it's a DOM node * @return {value is Node} true is object is a DOM node */ const _isNode = function _isNode(value) { @@ -1022,7 +1022,7 @@ * @protect removeAttribute * @protect setAttribute * - * @param {Element} currentNode to sanitize + * @param {Element} currentNode to sanitize * @returns {void} */ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { @@ -1138,7 +1138,7 @@ /** * _sanitizeShadowDOM * - * @param {DocumentFragment} fragment to iterate over recursively + * @param {DocumentFragment} fragment to iterate over recursively * @returns {void} */ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { diff --git a/src/purify.ts b/src/purify.ts index d11d0704d..0dda4cba0 100644 --- a/src/purify.ts +++ b/src/purify.ts @@ -52,12 +52,15 @@ const getGlobal = function (): WindowLike { /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! - * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. - * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @param {TrustedTypePolicyFactory} trustedTypes - The policy factory. + * @param {HTMLScriptElement} purifyHostElement - The Script element used to load DOMPurify (to determine policy name suffix). * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported or creating the policy failed). */ -const _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) { +const _createTrustedTypesPolicy = function ( + trustedTypes: TrustedTypePolicyFactory, + purifyHostElement: HTMLScriptElement +) { if ( typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function' @@ -96,7 +99,7 @@ const _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) { } }; -function createDOMPurify(window: WindowLike = getGlobal()) { +function createDOMPurify(window: WindowLike = getGlobal()): DOMPurify { const DOMPurify: DOMPurify = (root: WindowLike) => createDOMPurify(root); DOMPurify.version = VERSION; @@ -445,7 +448,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _parseConfig * - * @param {Config} cfg optional config literal + * @param {Config} cfg optional config literal * @returns {void} */ // eslint-disable-next-line complexity @@ -695,7 +698,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { ]); /** - * @param {Element} element a DOM element whose namespace is being checked + * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. @@ -806,9 +809,9 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _forceRemove * - * @param {Node} node a DOM node + * @param {Node} node a DOM node */ - const _forceRemove = function (node) { + const _forceRemove = function (node: Node) { arrayPush(DOMPurify.removed, { element: node }); try { @@ -822,8 +825,8 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _removeAttribute * - * @param {string} name an Attribute name - * @param {Element} element a DOM node + * @param {string} name an Attribute name + * @param {Element} element a DOM node * @returns {void} */ const _removeAttribute = function (name: string, element: Element): void { @@ -858,7 +861,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _initDocument * - * @param {string} dirty a string of dirty markup + * @param {string} dirty - a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ const _initDocument = function (dirty: string): Document { @@ -933,7 +936,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. * - * @param {Node} root The root element or node to start traversing on. + * @param {Node} root The root element or node to start traversing on. * @return {NodeIterator} The created NodeIterator */ const _createNodeIterator = function (root: Node): NodeIterator { @@ -953,28 +956,28 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _isClobbered * - * @param {Node} elm element to check for clobbering attacks + * @param {Element} element element to check for clobbering attacks * @return {boolean} true if clobbered, false if safe */ - const _isClobbered = function (elm: Node): boolean { + const _isClobbered = function (element: Element): boolean { return ( - elm instanceof HTMLFormElement && - (typeof elm.nodeName !== 'string' || - typeof elm.textContent !== 'string' || - typeof elm.removeChild !== 'function' || - !(elm.attributes instanceof NamedNodeMap) || - typeof elm.removeAttribute !== 'function' || - typeof elm.setAttribute !== 'function' || - typeof elm.namespaceURI !== 'string' || - typeof elm.insertBefore !== 'function' || - typeof elm.hasChildNodes !== 'function') + element instanceof HTMLFormElement && + (typeof element.nodeName !== 'string' || + typeof element.textContent !== 'string' || + typeof element.removeChild !== 'function' || + !(element.attributes instanceof NamedNodeMap) || + typeof element.removeAttribute !== 'function' || + typeof element.setAttribute !== 'function' || + typeof element.namespaceURI !== 'string' || + typeof element.insertBefore !== 'function' || + typeof element.hasChildNodes !== 'function') ); }; /** * Checks whether the given object is a DOM node. * - * @param {unknown} value object to check whether it's a DOM node + * @param {unknown} value object to check whether it's a DOM node * @return {value is Node} true is object is a DOM node */ const _isNode = function (value: unknown): value is Node { @@ -988,11 +991,18 @@ function createDOMPurify(window: WindowLike = getGlobal()) { * _executeHook * Execute user configurable hooks * - * @param entryPoint Name of the hook's entry point + * @param { + * | BasicHookName + * | UponSanitizeElementHookName + * | UponSanitizeAttributeHookName + * | HookName + * } entryPoint Name of the hook's entry point * @param currentNode node to work on with the hook - * @param {UponSanitizeAttributeHookEvent - * | UponSanitizeElementHookEvent - * | null} data additional hook parameters + * @param { + * | UponSanitizeAttributeHookEvent + * | UponSanitizeElementHookEvent + * | null + * } data additional hook parameters * @returns {void} */ function _executeHook( @@ -1283,7 +1293,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { * @protect removeAttribute * @protect setAttribute * - * @param {Element} currentNode to sanitize + * @param {Element} currentNode to sanitize * @returns {void} */ const _sanitizeAttributes = function (currentNode: Element): void { @@ -1422,7 +1432,7 @@ function createDOMPurify(window: WindowLike = getGlobal()) { /** * _sanitizeShadowDOM * - * @param {DocumentFragment} fragment to iterate over recursively + * @param {DocumentFragment} fragment to iterate over recursively * @returns {void} */ const _sanitizeShadowDOM = function (fragment: DocumentFragment): void { @@ -1763,7 +1773,7 @@ interface DOMPurify { /** * Provides core sanitation functionality. * - * @param { string | Node} dirty string or DOM node + * @param {string | Node} dirty string or DOM node * @param {Config} cfg object * @returns {string} Sanitized string. */