Skip to content

Commit

Permalink
See #712
Browse files Browse the repository at this point in the history
fix: marked cfg for sanitize() as optional / default param
  • Loading branch information
cure53 committed Aug 23, 2022
1 parent 30af6c8 commit b4c57a8
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/purify.cjs.d.ts
Expand Up @@ -19,7 +19,7 @@ declare function purify(root: any): {
* @param {String|Node} dirty string or DOM node
* @param {Object} configuration object
*/
sanitize(dirty: string | Node, cfg: any): any;
sanitize(dirty: string | Node, ...args: any[]): any;
/**
* Public method to set the configuration once
* setConfig
Expand Down Expand Up @@ -86,7 +86,7 @@ declare namespace purify {
* @param {String|Node} dirty string or DOM node
* @param {Object} configuration object
*/
function sanitize(dirty: string | Node, cfg: any): any;
function sanitize(dirty: string | Node, ...args: any[]): any;
/**
* Public method to set the configuration once
* setConfig
Expand Down
3 changes: 2 additions & 1 deletion 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.cjs.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/purify.es.d.ts
Expand Up @@ -19,7 +19,7 @@ declare function purify(root: any): {
* @param {String|Node} dirty string or DOM node
* @param {Object} configuration object
*/
sanitize(dirty: string | Node, cfg: any): any;
sanitize(dirty: string | Node, ...args: any[]): any;
/**
* Public method to set the configuration once
* setConfig
Expand Down Expand Up @@ -86,7 +86,7 @@ declare namespace purify {
* @param {String|Node} dirty string or DOM node
* @param {Object} configuration object
*/
function sanitize(dirty: string | Node, cfg: any): any;
function sanitize(dirty: string | Node, ...args: any[]): any;
/**
* Public method to set the configuration once
* setConfig
Expand Down
3 changes: 2 additions & 1 deletion dist/purify.es.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.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/purify.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.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/purify.js
Expand Up @@ -1316,7 +1316,7 @@ function createDOMPurify(window = getGlobal()) {
* @param {Object} configuration object
*/
// eslint-disable-next-line complexity
DOMPurify.sanitize = function (dirty, cfg) {
DOMPurify.sanitize = function (dirty, cfg = {}) {
let body;
let importedNode;
let currentNode;
Expand Down

0 comments on commit b4c57a8

Please sign in to comment.