-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: export chunks in std/io #3497
Conversation
We talked about naming this in denoland/std#581. I like |
@nayeemrmn thanks for pointing this out, I forgot about it. As for the naming I'm open to changes. Reading my comment from that issue I had idea to expose Furthermore, thinking about it now, it might make more sense to place those functions in |
@bartlomieju Ah, right. I think we wanted to remove the tacked-on encoding/decoding from this and make it binary. Then call it Edit: |
Then maybe |
std/io/bufio.ts
Outdated
for await (const line of chunks(reader, "\n")) { | ||
yield line; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield* chunks(reader, "\n");
@bartlomieju How would you go about adding them on Just add a top-level |
Not really related, but maybe a Boyer-Moore-Horspool implementation could work better than KMP (I realized that v8 uses this for |
720641c
to
88849ba
Compare
This PR addresses old TODO to export
chunks
utility method instd
.chunks
fromstd/xeval/mod.ts
tostd/io/bufio.ts
lines
helper which ischunks(reader, "\n")
CC @kevinkassimo @David-Else