summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_common.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/node/_fs/_fs_common.ts')
-rw-r--r--std/node/_fs/_fs_common.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/std/node/_fs/_fs_common.ts b/std/node/_fs/_fs_common.ts
index 1f00bc481..bf7c0f675 100644
--- a/std/node/_fs/_fs_common.ts
+++ b/std/node/_fs/_fs_common.ts
@@ -35,6 +35,11 @@ export function getEncoding(
const encoding =
typeof optOrCallback === "string" ? optOrCallback : optOrCallback.encoding;
if (!encoding) return null;
+ return encoding;
+}
+
+export function checkEncoding(encoding: string | null): string | null {
+ if (!encoding) return null;
if (encoding === "utf8" || encoding === "utf-8") {
return "utf8";
}