stream: use validateString for consumer encoding · nodejs/node@59ef178 · GitHub
Skip to content

Commit 59ef178

Browse files
sjungwon03aduh95
authored andcommitted
stream: use validateString for consumer encoding
Replace the manual `options.encoding` type check in stream iterator consumers with the shared validator. Add coverage for non-string values in the async and sync text consumers. Signed-off-by: sjungwon03 <sjungwon03@gmail.com> PR-URL: #64754 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
1 parent 7c534bf commit 59ef178

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

lib/internal/streams/iter/consumers.js

Lines changed: 2 additions & 5 deletions

test/parallel/test-stream-iter-consumers-text.js

Lines changed: 16 additions & 0 deletions

0 commit comments

Comments
 (0)