Allow default imports in TS
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"module": "commonjs"
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
5
typings/xss-default-import.ts
Normal file
5
typings/xss-default-import.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="./xss.d.ts" />
|
||||
|
||||
import xss from "xss";
|
||||
|
||||
console.log(xss("<script>alert('xss');</script>"));
|
||||
8
typings/xss.d.ts
vendored
8
typings/xss.d.ts
vendored
@@ -4,7 +4,8 @@
|
||||
* @author Zongmin Lei<leizongmin@gmail.com>
|
||||
*/
|
||||
|
||||
declare global {
|
||||
declare module "xss" {
|
||||
global {
|
||||
function filterXSS(html: string, options?: IFilterXSSOptions): string;
|
||||
|
||||
namespace XSS {
|
||||
@@ -116,7 +117,6 @@ declare global {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface IFilterXSSOptions extends XSS.IFilterXSSOptions {}
|
||||
|
||||
export interface IWhiteList extends XSS.IWhiteList {}
|
||||
@@ -187,3 +187,7 @@ export const stripCommentTag: EscapeHandler;
|
||||
export const stripBlankChar: EscapeHandler;
|
||||
export const cssFilter: ICSSFilter;
|
||||
export function getDefaultCSSWhiteList(): ICSSFilter;
|
||||
|
||||
const xss: (html: string, options?: IFilterXSSOptions) => string;
|
||||
export default xss;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user