Stuk/jszip — pull request #36 by dduponchel (2013-03-02 22:44:04+00:00)
Title: Fix file.as<output_format>() with bad data.

If a file is added with unexpected data (null or undefined), the
results of .asText/asBinary/asUint8Array/asArrayBuffer aren't
consistent (and the generate method will fail).

With a null / undefined value, asText() will return this value but will
fail if the file is flagged as binary (or base64). The other getters
will also fail : if asBinary does not return a string, asUint8Array and
asArrayBuffer will fail.

With this patch, every getters will return "" (instead of null /
undefined / exception) for bad data. As a side effect,
zip.file("test.txt", undefined) won't break anything (we will treat it
like "").