@wpe-tkpd/xss
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -1,9 +0,14 @@ | ||
declare type Fixture = [ | ||
string | undefined | null | number | boolean, | ||
string | ||
]; | ||
export declare const fixtures: Fixture[]; | ||
export declare const decodeToSingleQuoteFixtures: string[][]; | ||
export declare const decodeToDoubleQuoteFixtures: string[][]; | ||
export {}; | ||
export declare const fixtures: ({ | ||
decoded: string; | ||
encoded: string; | ||
} | { | ||
decoded: undefined; | ||
encoded: string; | ||
} | { | ||
decoded: null; | ||
encoded: string; | ||
} | { | ||
decoded: number; | ||
encoded: string; | ||
})[]; | ||
//# sourceMappingURL=encodeDecodeHtml.d.ts.map |
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
export default function decodeHtml(encoded: string): string; | ||
export default function decodeHtml(encoded: unknown): string; | ||
//# sourceMappingURL=decodeHtml.d.ts.map |
@@ -9,3 +9,4 @@ "use strict"; | ||
function decodeHtml(encoded) { | ||
return encoded.replace(/>/g, '>').replace(/</g, '<').replace(/'/g, "'").replace(/�?39;/g, "'").replace(/"/g, '"').replace(/�?34;/g, '"').replace(/&/g, '&'); | ||
var asString = String(encoded); | ||
return asString.replace(/>/g, '>').replace(/</g, '<').replace(/'/g, "'").replace(/�?39;/g, "'").replace(/"/g, '"').replace(/"/g, '"').replace(/�?34;/g, '"').replace(/&|�?38;|&/g, '&'); | ||
} |
@@ -30,3 +30,3 @@ /** | ||
*/ | ||
export default function encodeHtml(input: any): string; | ||
export default function encodeHtml(input: unknown): string; | ||
//# sourceMappingURL=encodeHtml.d.ts.map |
{ | ||
"name": "@wpe-tkpd/xss", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "Various sanitizer, escaper, encoder, and utilities to prevent XSS", | ||
@@ -46,3 +46,3 @@ "sideEffects": false, | ||
"@types/dompurify": "^2.0.4", | ||
"@types/jest": "^27.0.0", | ||
"@types/jest": "^29.0.0", | ||
"@types/jsdom": "^16.2.5", | ||
@@ -54,3 +54,3 @@ "@types/mongo-sanitize": "^1.0.1", | ||
"babel-eslint": "^10.1.0", | ||
"babel-jest": "^27.5.1", | ||
"babel-jest": "^29.0.0", | ||
"babel-plugin-lodash": "^3.3.4", | ||
@@ -64,6 +64,7 @@ "confusing-browser-globals": "^1.0.10", | ||
"eslint-plugin-prettier": "^3.3.0", | ||
"jest": "^27.5.1", | ||
"jest": "^29.0.0", | ||
"jest-environment-jsdom": "^29.0.0", | ||
"lint-staged": "^10.5.3", | ||
"ts-jest": "~27.1.3", | ||
"typescript": "^4.0.0" | ||
"ts-jest": "~29.0.3", | ||
"typescript": "^4.3.0" | ||
}, | ||
@@ -70,0 +71,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
215
16047
37