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

Deprecate internal functions exposed in the public API #123

Closed
dduponchel opened this issue Apr 27, 2014 · 3 comments · Fixed by #138
Closed

Deprecate internal functions exposed in the public API #123

dduponchel opened this issue Apr 27, 2014 · 3 comments · Fixed by #138

Comments

@dduponchel
Copy link
Collaborator

Currently, JSZip exposes a lot of internal functions :

JSZip.base64.decode
JSZip.base64.encode
JSZip.prototype.crc32
JSZip.prototype.utf8decode
JSZip.prototype.utf8encode

JSZip.utils.MAX_VALUE_16BITS
JSZip.utils.MAX_VALUE_32BITS
JSZip.utils.arrayBuffer2Blob
JSZip.utils.checkSupport
JSZip.utils.findCompression
JSZip.utils.getTypeOf
JSZip.utils.isRegExp
JSZip.utils.pretty
JSZip.utils.string2Blob
JSZip.utils.string2Uint8Array
JSZip.utils.string2binary
JSZip.utils.transformTo
JSZip.utils.uint8Array2String

These functions/objects are not documented and in my opinion not really useful outside JSZip. The base64/crc32/utf8 methods may have some uses for other people but their signatures are sometimes surprising (utf8encode takes a string and return a string for example).

I think we should deprecate the list above (keep them internally but flag their inclusion in the public API as deprecated).
Thoughts, anyone ?

@dduponchel dduponchel changed the title Deprecate exposed internal functions. Deprecate internal functions exposed in the public API Apr 27, 2014
@Stuk
Copy link
Owner

Stuk commented Apr 28, 2014

Yep, deprecating from the public API sounds good to me

@shytikov
Copy link

I have a question, why base64 should be abandoned?

So far as I can tell passing base64 string as an input for reading zip is the only common method for in-memory file handling between node and browser.

Or there are another ways I'm missing?

Thank you so much in advance for your answer.

@dduponchel
Copy link
Collaborator Author

@shytikov this deprecates the object JSZip.base64, not the support of base64 input/output.
Regarding the node <-> browser communication, I would use xhr.responseType = "arraybuffer" (if you can ignore IE <= 9)

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

Successfully merging a pull request may close this issue.

3 participants