From 09ee9a828009ab1fbe59f611da64f48f9e9e573b Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sat, 6 Jun 2020 22:56:49 +0300 Subject: feat(std/node): Buffer (#5925) --- std/node/_fs/_fs_common.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'std/node/_fs/_fs_common.ts') 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"; } -- cgit v1.2.3