summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_common.ts
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2020-06-06 22:56:49 +0300
committerGitHub <noreply@github.com>2020-06-06 15:56:49 -0400
commit09ee9a828009ab1fbe59f611da64f48f9e9e573b (patch)
tree9333c9878682afe2f473b0203afd9a63dc8fd820 /std/node/_fs/_fs_common.ts
parent26287ef87b2b238e25a1ab44a43cde24eea15bfc (diff)
feat(std/node): Buffer (#5925)
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";
}