Skip to content

Commit 77d6d44

Browse files
committed
chore: Update deps
Signed-off-by: Richie Bendall <[email protected]>
1 parent 65ddb79 commit 77d6d44

File tree

4 files changed

+328
-279
lines changed

4 files changed

+328
-279
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10-
indent_style = space
11-
indent_size = 4
10+
indent_style = tab
1211

1312
[*.md]
1413
trim_trailing_whitespace = false

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/cheerio": "^0.22.13",
3636
"@types/content-type": "^1.1.3",
3737
"ava": "^2.4.0",
38-
"eslint-config-richienb": "^0.2.3",
38+
"eslint-config-richienb": "^0.3.0",
3939
"node-fetch": "^2.6.0",
4040
"ts-node": "^8.5.4",
4141
"typedoc": "^0.16.4",

test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@ import { encode } from "iconv-lite"
44
import convertBody from "./src"
55

66
test("should support encoding decode, xml dtd detect", (t) => {
7-
const text = "<?xml version=\"1.0\" encoding=\"EUC-JP\"?><title>日本語</title>"
8-
t.is(convertBody(encode(text, "EUC-JP"), new Headers({ "Content-Type": "text/xml" })), text)
7+
const text = "<?xml version=\"1.0\" encoding=\"EUC-JP\"?><title>日本語</title>"
8+
t.is(convertBody(encode(text, "EUC-JP"), new Headers({ "Content-Type": "text/xml" })), text)
99
})
1010

1111
test("should support encoding decode, content-type detect", (t) => {
12-
const text = "<div>日本語</div>"
13-
t.is(convertBody(encode(text, "Shift_JIS"), new Headers({ "Content-Type": "text/html; charset=Shift-JIS" })), text)
12+
const text = "<div>日本語</div>"
13+
t.is(convertBody(encode(text, "Shift_JIS"), new Headers({ "Content-Type": "text/html; charset=Shift-JIS" })), text)
1414
})
1515

1616
test("should support encoding decode, html5 detect", (t) => {
17-
const text = "<meta charset=\"gbk\"><div>中文</div>"
18-
t.is(convertBody(encode(text, "gbk"), new Headers({ "Content-Type": "text/html" })), text)
17+
const text = "<meta charset=\"gbk\"><div>中文</div>"
18+
t.is(convertBody(encode(text, "gbk"), new Headers({ "Content-Type": "text/html" })), text)
1919
})
2020

2121
test("should support encoding decode, html4 detect", (t) => {
22-
const text = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"><div>中文</div>"
23-
t.is(convertBody(encode(text, "gb2312"), new Headers({ "Content-Type": "text/html" })), text)
22+
const text = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"><div>中文</div>"
23+
t.is(convertBody(encode(text, "gb2312"), new Headers({ "Content-Type": "text/html" })), text)
2424
})
2525

2626
test("should default to utf8 encoding", (t) => {
27-
const text = "中文"
28-
t.is(convertBody(text), text)
27+
const text = "中文"
28+
t.is(convertBody(text), text)
2929
})
3030

3131
test("should support uncommon content-type order, end with qs", (t) => {
32-
const text = "中文"
33-
t.is(convertBody(encode(text, "gbk"), new Headers({ "Content-Type": "text/plain; charset=gbk; qs=1" })), text)
32+
const text = "中文"
33+
t.is(convertBody(encode(text, "gbk"), new Headers({ "Content-Type": "text/plain; charset=gbk; qs=1" })), text)
3434
})
3535

3636
test("should support chunked encoding, html4 detect", (t) => {
37-
const text = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\" /><div>日本語</div>"
38-
const padding = "a".repeat(10)
39-
t.is(convertBody(encode(padding + text, "Shift_JIS"), new Headers({ "Content-Type": "text/html", "Transfer-Encoding": "chunked" })), padding + text)
37+
const text = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\" /><div>日本語</div>"
38+
const padding = "a".repeat(10)
39+
t.is(convertBody(encode(padding + text, "Shift_JIS"), new Headers({ "Content-Type": "text/html", "Transfer-Encoding": "chunked" })), padding + text)
4040
})
4141

4242
test("should only do encoding detection up to 1024 bytes", (t) => {
43-
const text = "中文"
44-
const padding = "a".repeat(1200)
45-
t.not(convertBody(encode(padding + text, "gbk"), new Headers({ "Content-Type": "text/html", "Transfer-Encoding": "chunked" })), text)
43+
const text = "中文"
44+
const padding = "a".repeat(1200)
45+
t.not(convertBody(encode(padding + text, "gbk"), new Headers({ "Content-Type": "text/html", "Transfer-Encoding": "chunked" })), text)
4646
})

0 commit comments

Comments
 (0)