diff options
author | Nikolai Vavilov <vvnicholas@gmail.com> | 2020-06-06 22:56:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-06 15:56:49 -0400 |
commit | 09ee9a828009ab1fbe59f611da64f48f9e9e573b (patch) | |
tree | 9333c9878682afe2f473b0203afd9a63dc8fd820 /std/node/_fs/_fs_common.ts | |
parent | 26287ef87b2b238e25a1ab44a43cde24eea15bfc (diff) |
feat(std/node): Buffer (#5925)
Diffstat (limited to 'std/node/_fs/_fs_common.ts')
-rw-r--r-- | std/node/_fs/_fs_common.ts | 5 |
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"; } |