Comparing version 1.0.5 to 1.0.6
@@ -5,3 +5,3 @@ { | ||
"typings": "./typings/xss.d.ts", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist", | ||
@@ -8,0 +8,0 @@ "author": "Zongmin Lei <leizongmin@gmail.com> (http://ucdok.com)", |
@@ -9,111 +9,127 @@ /** | ||
function filterXSS(html: string, options?: IFilterXSSOptions): string; | ||
} | ||
export interface IFilterXSSOptions { | ||
whiteList?: IWhiteList; | ||
onTag?: OnTagHandler; | ||
onTagAttr?: OnTagAttrHandler; | ||
onIgnoreTag?: OnTagHandler; | ||
onIgnoreTagAttr?: OnTagAttrHandler; | ||
safeAttrValue?: SafeAttrValueHandler; | ||
escapeHtml?: EscapeHandler; | ||
stripIgnoreTag?: boolean; | ||
stripIgnoreTagBody?: boolean | string[]; | ||
allowCommentTag?: boolean; | ||
stripBlankChar?: boolean; | ||
css?: {} | boolean; | ||
} | ||
namespace XSS { | ||
export interface IFilterXSSOptions { | ||
whiteList?: IWhiteList; | ||
onTag?: OnTagHandler; | ||
onTagAttr?: OnTagAttrHandler; | ||
onIgnoreTag?: OnTagHandler; | ||
onIgnoreTagAttr?: OnTagAttrHandler; | ||
safeAttrValue?: SafeAttrValueHandler; | ||
escapeHtml?: EscapeHandler; | ||
stripIgnoreTag?: boolean; | ||
stripIgnoreTagBody?: boolean | string[]; | ||
allowCommentTag?: boolean; | ||
stripBlankChar?: boolean; | ||
css?: {} | boolean; | ||
} | ||
export interface IWhiteList { | ||
a?: string[]; | ||
abbr?: string[]; | ||
address?: string[]; | ||
area?: string[]; | ||
article?: string[]; | ||
aside?: string[]; | ||
audio?: string[]; | ||
b?: string[]; | ||
bdi?: string[]; | ||
bdo?: string[]; | ||
big?: string[]; | ||
blockquote?: string[]; | ||
br?: string[]; | ||
caption?: string[]; | ||
center?: string[]; | ||
cite?: string[]; | ||
code?: string[]; | ||
col?: string[]; | ||
colgroup?: string[]; | ||
dd?: string[]; | ||
del?: string[]; | ||
details?: string[]; | ||
div?: string[]; | ||
dl?: string[]; | ||
dt?: string[]; | ||
em?: string[]; | ||
font?: string[]; | ||
footer?: string[]; | ||
h1?: string[]; | ||
h2?: string[]; | ||
h3?: string[]; | ||
h4?: string[]; | ||
h5?: string[]; | ||
h6?: string[]; | ||
header?: string[]; | ||
hr?: string[]; | ||
i?: string[]; | ||
img?: string[]; | ||
ins?: string[]; | ||
li?: string[]; | ||
mark?: string[]; | ||
nav?: string[]; | ||
ol?: string[]; | ||
p?: string[]; | ||
pre?: string[]; | ||
s?: string[]; | ||
section?: string[]; | ||
small?: string[]; | ||
span?: string[]; | ||
sub?: string[]; | ||
sup?: string[]; | ||
strong?: string[]; | ||
table?: string[]; | ||
tbody?: string[]; | ||
td?: string[]; | ||
tfoot?: string[]; | ||
th?: string[]; | ||
thead?: string[]; | ||
tr?: string[]; | ||
tt?: string[]; | ||
u?: string[]; | ||
ul?: string[]; | ||
video?: string[]; | ||
} | ||
interface IWhiteList { | ||
a?: string[]; | ||
abbr?: string[]; | ||
address?: string[]; | ||
area?: string[]; | ||
article?: string[]; | ||
aside?: string[]; | ||
audio?: string[]; | ||
b?: string[]; | ||
bdi?: string[]; | ||
bdo?: string[]; | ||
big?: string[]; | ||
blockquote?: string[]; | ||
br?: string[]; | ||
caption?: string[]; | ||
center?: string[]; | ||
cite?: string[]; | ||
code?: string[]; | ||
col?: string[]; | ||
colgroup?: string[]; | ||
dd?: string[]; | ||
del?: string[]; | ||
details?: string[]; | ||
div?: string[]; | ||
dl?: string[]; | ||
dt?: string[]; | ||
em?: string[]; | ||
font?: string[]; | ||
footer?: string[]; | ||
h1?: string[]; | ||
h2?: string[]; | ||
h3?: string[]; | ||
h4?: string[]; | ||
h5?: string[]; | ||
h6?: string[]; | ||
header?: string[]; | ||
hr?: string[]; | ||
i?: string[]; | ||
img?: string[]; | ||
ins?: string[]; | ||
li?: string[]; | ||
mark?: string[]; | ||
nav?: string[]; | ||
ol?: string[]; | ||
p?: string[]; | ||
pre?: string[]; | ||
s?: string[]; | ||
section?: string[]; | ||
small?: string[]; | ||
span?: string[]; | ||
sub?: string[]; | ||
sup?: string[]; | ||
strong?: string[]; | ||
table?: string[]; | ||
tbody?: string[]; | ||
td?: string[]; | ||
tfoot?: string[]; | ||
th?: string[]; | ||
thead?: string[]; | ||
tr?: string[]; | ||
tt?: string[]; | ||
u?: string[]; | ||
ul?: string[]; | ||
video?: string[]; | ||
} | ||
export type OnTagHandler = ( | ||
tag: string, | ||
html: string, | ||
options: {} | ||
) => string | void; | ||
type OnTagHandler = ( | ||
tag: string, | ||
html: string, | ||
options: {} | ||
) => string | void; | ||
export type OnTagAttrHandler = ( | ||
tag: string, | ||
name: string, | ||
value: string, | ||
isWhiteAttr: boolean | ||
) => string | void; | ||
type OnTagAttrHandler = ( | ||
tag: string, | ||
name: string, | ||
value: string, | ||
isWhiteAttr: boolean | ||
) => string | void; | ||
export type SafeAttrValueHandler = ( | ||
tag: string, | ||
name: string, | ||
value: string, | ||
cssFilter: ICSSFilter | ||
) => string; | ||
type SafeAttrValueHandler = ( | ||
tag: string, | ||
name: string, | ||
value: string, | ||
cssFilter: ICSSFilter | ||
) => string; | ||
export type EscapeHandler = (str: string) => string; | ||
type EscapeHandler = (str: string) => string; | ||
export interface ICSSFilter { | ||
process(value: string): string; | ||
interface ICSSFilter { | ||
process(value: string): string; | ||
} | ||
} | ||
} | ||
export interface IFilterXSSOptions extends XSS.IFilterXSSOptions {} | ||
export interface IWhiteList extends XSS.IWhiteList {} | ||
export type OnTagHandler = XSS.OnTagHandler; | ||
export type OnTagAttrHandler = XSS.OnTagAttrHandler; | ||
export type SafeAttrValueHandler = XSS.SafeAttrValueHandler; | ||
export type EscapeHandler = XSS.EscapeHandler; | ||
export interface ICSSFilter extends XSS.ICSSFilter {} | ||
export function StripTagBody( | ||
@@ -120,0 +136,0 @@ tags: string[], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138701
2560