Skip to content

Commit

Permalink
docs: fixed ts-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 committed Nov 7, 2024
1 parent 5529184 commit 0f7fc8a
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 94 deletions.
2 changes: 1 addition & 1 deletion dist/purify.cjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
30 changes: 15 additions & 15 deletions dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.es.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
30 changes: 15 additions & 15 deletions dist/purify.es.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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, {
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
30 changes: 15 additions & 15 deletions dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0f7fc8a

Please sign in to comment.