Nav apraksta

support.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. exports.base64 = true;
  3. exports.array = true;
  4. exports.string = true;
  5. exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
  6. exports.nodebuffer = typeof Buffer !== "undefined";
  7. // contains true if JSZip can read/generate Uint8Array, false otherwise.
  8. exports.uint8array = typeof Uint8Array !== "undefined";
  9. if (typeof ArrayBuffer === "undefined") {
  10. exports.blob = false;
  11. }
  12. else {
  13. var buffer = new ArrayBuffer(0);
  14. try {
  15. exports.blob = new Blob([buffer], {
  16. type: "application/zip"
  17. }).size === 0;
  18. }
  19. catch (e) {
  20. try {
  21. var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
  22. var builder = new Builder();
  23. builder.append(buffer);
  24. exports.blob = builder.getBlob('application/zip').size === 0;
  25. }
  26. catch (e) {
  27. exports.blob = false;
  28. }
  29. }
  30. }
  31. try {
  32. exports.nodestream = !!require('readable-stream').Readable;
  33. } catch(e) {
  34. exports.nodestream = false;
  35. }