0.7.9 • Published 6 months ago

@tramvai/safe-strings v0.7.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

@tramvai/safe-strings

Utility kit for a safe string encoding/decoding

safeParseJSON

Tries to parse json and if it successful returns it, otherwise returns second argument as default value.

safeStringify

Converts object to json with a replacement of insecure symbols that allows to insert result string in the response html

safeStringiyfJSON

Converts object to json with a circular reference handling

Encoding

Set of utility functions for encoding, mostly for XSS protection

encodeForHTMLContext

String encoding for HTML context - escapes all symbols with possible XSS attack - <, >, &, ', "

encodeForJSContext

String encoding for JS context - escapes all symbols with possible XSS attack or breaking code - <, >, /, \u2028, \u2029

encodeForURLContext

String encoding for URL context - escapes all symbols with possible XSS attack or breaking code, removes javascript:alert('xss') and other unsafe protocols (data:, vbscript:)

0.6.8

6 months ago

0.8.4

7 months ago

0.7.9

7 months ago

0.6.7

9 months ago

0.7.8

9 months ago

0.8.3

9 months ago

0.7.7

9 months ago

0.7.5

10 months ago

0.6.6

10 months ago

0.8.2

10 months ago

0.7.4

10 months ago

0.6.5

10 months ago

0.7.3

11 months ago

0.6.4

11 months ago

0.7.2

1 year ago

0.6.3

1 year ago

0.7.1

1 year ago

0.6.2

2 years ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.12

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.4

3 years ago

0.5.2

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago