sanitized 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ if (DOMPurify.sanitize) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function sanitized(dirty, DOMPurifyOptions,
|
|
20
|
+
function sanitized(dirty, DOMPurifyOptions, errorCallback) {
|
|
21
21
|
try {
|
|
22
22
|
let clone = JSON.parse(JSON.stringify(dirty));
|
|
23
23
|
|
|
@@ -28,12 +28,12 @@ function sanitized(dirty, DOMPurifyOptions, errorHandler) {
|
|
|
28
28
|
clone[i] = sanitized(clone[i], DOMPurifyOptions);
|
|
29
29
|
|
|
30
30
|
if (clone instanceof Object)
|
|
31
|
-
for (cloneKey of Object.keys(clone))
|
|
31
|
+
for (let cloneKey of Object.keys(clone))
|
|
32
32
|
clone[cloneKey] = sanitized(clone[cloneKey], DOMPurifyOptions);
|
|
33
33
|
|
|
34
34
|
return clone;
|
|
35
35
|
} catch (err) {
|
|
36
|
-
if (
|
|
36
|
+
if (errorCallback) errorCallback(err);
|
|
37
37
|
|
|
38
38
|
return dirty;
|
|
39
39
|
}
|