Skip to content

Commit 881282b

Browse files
authored
chore: Rename getCharSet to getCharset
1 parent a8e4811 commit 881282b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/convert-body.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import getCharSet from "../utils/get-charset"
1+
import getCharset from "../utils/get-charset"
22
import { decode as convert } from "iconv-lite"
33
import { load as $ } from "cheerio"
44

@@ -14,14 +14,14 @@ export function convertBody(buffer: Buffer, headers?: Headers): string {
1414
let charset: string
1515

1616
// Header
17-
if (contentType) charset = getCharSet(contentType)
17+
if (contentType) charset = getCharset(contentType)
1818

1919
// No charset in content type, peek at response body for at most 1024 bytes
2020
const res = buffer.slice(0, 1024).toString()
2121

2222
// HTML5, HTML4 and XML
2323
if (!charset && res) {
24-
charset = getCharSet(
24+
charset = getCharset(
2525
$(res)("meta[charset]").attr("charset") || // HTML5
2626
$(res)("meta[http-equiv][content]").attr("content") || // HTML4
2727
$(res.replace(/<\?(.*)\?>/im, "<$1>"), { xmlMode: true }).root().find("xml").attr("encoding"), // XML

0 commit comments

Comments
 (0)