summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_common.ts
diff options
context:
space:
mode:
authorFarsen976 <etudacfarsen@gmail.com>2023-03-16 04:16:03 +0100
committerGitHub <noreply@github.com>2023-03-16 12:16:03 +0900
commit96bc15dfa237b506c4f2d8bf1c041f25000e9878 (patch)
treef8281b35910cc1881fab99b1898d26be67fef696 /ext/node/polyfills/_fs/_fs_common.ts
parent392f91da005809782cae53cc05c9f45589d3b051 (diff)
fix(ext/node): implement "ascii" encoding for node:fs writeFile() (#18097)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_common.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_common.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/polyfills/_fs/_fs_common.ts b/ext/node/polyfills/_fs/_fs_common.ts
index c704cd975..19f0d7d17 100644
--- a/ext/node/polyfills/_fs/_fs_common.ts
+++ b/ext/node/polyfills/_fs/_fs_common.ts
@@ -74,7 +74,7 @@ export function checkEncoding(encoding: Encodings | null): Encodings | null {
if (!encoding) return null;
encoding = encoding.toLowerCase() as Encodings;
- if (["utf8", "hex", "base64"].includes(encoding)) return encoding;
+ if (["utf8", "hex", "base64", "ascii"].includes(encoding)) return encoding;
if (encoding === "utf-8") {
return "utf8";
@@ -85,7 +85,7 @@ export function checkEncoding(encoding: Encodings | null): Encodings | null {
// node -e "require('fs').readFile('../world.txt', 'buffer', console.log)"
}
- const notImplementedEncodings = ["utf16le", "latin1", "ascii", "ucs2"];
+ const notImplementedEncodings = ["utf16le", "latin1", "ucs2"];
if (notImplementedEncodings.includes(encoding as string)) {
notImplemented(`"${encoding}" encoding`);