Skip to content

Commit

Permalink
fix: πŸ› allow assertEncoding to be called w/ undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 6, 2019
1 parent af3f4e8 commit e37ab9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encoding.ts
Expand Up @@ -6,7 +6,7 @@ export type TEncodingExtended = TEncoding | 'buffer';

export const ENCODING_UTF8: TEncoding = 'utf8';

export function assertEncoding(encoding: string) {
export function assertEncoding(encoding: string | undefined) {
if (encoding && !Buffer.isEncoding(encoding)) throw new errors.TypeError('ERR_INVALID_OPT_VALUE_ENCODING', encoding);
}

Expand Down

0 comments on commit e37ab9a

Please sign in to comment.