Skip to content
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

Accept buffers instead of strings #34

Open
gagern opened this issue Nov 20, 2015 · 0 comments
Open

Accept buffers instead of strings #34

gagern opened this issue Nov 20, 2015 · 0 comments

Comments

@gagern
Copy link
Collaborator

gagern commented Nov 20, 2015

This is a spin-off from #30 (comment).

Several API functions in index.js accept either an XML document or a string as an argument. A check using typeof source === 'string' is usually used to make this distinction. It would be nice if these functions were to accept Buffer objects as well. Buffer.isBuffer(source) could be used to distinguish that case.

The code in XmlDocument::FromXml reads like it should support auto-detecing the encoding if a buffer gets passed in, so we wouldn't have to worry about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants