zlib.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. var zlib = require("zlib");
  2. var promisify = require("./_promisify.js");
  3. var bind = function(c, f) { return f && f.bind(c); };
  4. Object.defineProperties(module.exports, {
  5. DEFLATE: { enumerable: true, value: zlib.DEFLATE },
  6. DEFLATERAW: { enumerable: true, value: zlib.DEFLATERAW },
  7. Deflate: { enumerable: true, value: zlib.Deflate },
  8. DeflateRaw: { enumerable: true, value: zlib.DeflateRaw },
  9. GUNZIP: { enumerable: true, value: zlib.GUNZIP },
  10. GZIP: { enumerable: true, value: zlib.GZIP },
  11. Gunzip: { enumerable: true, value: zlib.Gunzip },
  12. Gzip: { enumerable: true, value: zlib.Gzip },
  13. INFLATE: { enumerable: true, value: zlib.INFLATE },
  14. INFLATERAW: { enumerable: true, value: zlib.INFLATERAW },
  15. Inflate: { enumerable: true, value: zlib.Inflate },
  16. InflateRaw: { enumerable: true, value: zlib.InflateRaw },
  17. UNZIP: { enumerable: true, value: zlib.UNZIP },
  18. Unzip: { enumerable: true, value: zlib.Unzip },
  19. ZLIB_VERNUM: { enumerable: true, value: zlib.ZLIB_VERNUM },
  20. ZLIB_VERSION: { enumerable: true, value: zlib.ZLIB_VERSION },
  21. Z_BEST_COMPRESSION: { enumerable: true, value: zlib.Z_BEST_COMPRESSION },
  22. Z_BEST_SPEED: { enumerable: true, value: zlib.Z_BEST_SPEED },
  23. Z_BLOCK: { enumerable: true, value: zlib.Z_BLOCK },
  24. Z_BUF_ERROR: { enumerable: true, value: zlib.Z_BUF_ERROR },
  25. Z_DATA_ERROR: { enumerable: true, value: zlib.Z_DATA_ERROR },
  26. Z_DEFAULT_CHUNK: { enumerable: true, value: zlib.Z_DEFAULT_CHUNK },
  27. Z_DEFAULT_COMPRESSION: { enumerable: true, value: zlib.Z_DEFAULT_COMPRESSION },
  28. Z_DEFAULT_LEVEL: { enumerable: true, value: zlib.Z_DEFAULT_LEVEL },
  29. Z_DEFAULT_MEMLEVEL: { enumerable: true, value: zlib.Z_DEFAULT_MEMLEVEL },
  30. Z_DEFAULT_STRATEGY: { enumerable: true, value: zlib.Z_DEFAULT_STRATEGY },
  31. Z_DEFAULT_WINDOWBITS: { enumerable: true, value: zlib.Z_DEFAULT_WINDOWBITS },
  32. Z_ERRNO: { enumerable: true, value: zlib.Z_ERRNO },
  33. Z_FILTERED: { enumerable: true, value: zlib.Z_FILTERED },
  34. Z_FINISH: { enumerable: true, value: zlib.Z_FINISH },
  35. Z_FIXED: { enumerable: true, value: zlib.Z_FIXED },
  36. Z_FULL_FLUSH: { enumerable: true, value: zlib.Z_FULL_FLUSH },
  37. Z_HUFFMAN_ONLY: { enumerable: true, value: zlib.Z_HUFFMAN_ONLY },
  38. Z_MAX_CHUNK: { enumerable: true, value: zlib.Z_MAX_CHUNK },
  39. Z_MAX_LEVEL: { enumerable: true, value: zlib.Z_MAX_LEVEL },
  40. Z_MAX_MEMLEVEL: { enumerable: true, value: zlib.Z_MAX_MEMLEVEL },
  41. Z_MAX_WINDOWBITS: { enumerable: true, value: zlib.Z_MAX_WINDOWBITS },
  42. Z_MEM_ERROR: { enumerable: true, value: zlib.Z_MEM_ERROR },
  43. Z_MIN_CHUNK: { enumerable: true, value: zlib.Z_MIN_CHUNK },
  44. Z_MIN_LEVEL: { enumerable: true, value: zlib.Z_MIN_LEVEL },
  45. Z_MIN_MEMLEVEL: { enumerable: true, value: zlib.Z_MIN_MEMLEVEL },
  46. Z_MIN_WINDOWBITS: { enumerable: true, value: zlib.Z_MIN_WINDOWBITS },
  47. Z_NEED_DICT: { enumerable: true, value: zlib.Z_NEED_DICT },
  48. Z_NO_COMPRESSION: { enumerable: true, value: zlib.Z_NO_COMPRESSION },
  49. Z_NO_FLUSH: { enumerable: true, value: zlib.Z_NO_FLUSH },
  50. Z_OK: { enumerable: true, value: zlib.Z_OK },
  51. Z_PARTIAL_FLUSH: { enumerable: true, value: zlib.Z_PARTIAL_FLUSH },
  52. Z_RLE: { enumerable: true, value: zlib.Z_RLE },
  53. Z_STREAM_END: { enumerable: true, value: zlib.Z_STREAM_END },
  54. Z_STREAM_ERROR: { enumerable: true, value: zlib.Z_STREAM_ERROR },
  55. Z_SYNC_FLUSH: { enumerable: true, value: zlib.Z_SYNC_FLUSH },
  56. Z_VERSION_ERROR: { enumerable: true, value: zlib.Z_VERSION_ERROR },
  57. Zlib: { enumerable: true, value: zlib.Zlib },
  58. codes: { enumerable: true, value: zlib.codes },
  59. constants: { enumerable: true, get: function() { return zlib.constants; }, set: function(v) { zlib.constants = v; } },
  60. createDeflate: { enumerable: true, value: bind(zlib, zlib.createDeflate) },
  61. createDeflateRaw: { enumerable: true, value: bind(zlib, zlib.createDeflateRaw) },
  62. createGunzip: { enumerable: true, value: bind(zlib, zlib.createGunzip) },
  63. createGzip: { enumerable: true, value: bind(zlib, zlib.createGzip) },
  64. createInflate: { enumerable: true, value: bind(zlib, zlib.createInflate) },
  65. createInflateRaw: { enumerable: true, value: bind(zlib, zlib.createInflateRaw) },
  66. createUnzip: { enumerable: true, value: bind(zlib, zlib.createUnzip) },
  67. deflate: { enumerable: true, value: promisify(zlib, zlib.deflate, 1) },
  68. deflateRaw: { enumerable: true, value: promisify(zlib, zlib.deflateRaw, 1) },
  69. deflateRawSync: { enumerable: true, value: bind(zlib, zlib.deflateRawSync) },
  70. deflateSync: { enumerable: true, value: bind(zlib, zlib.deflateSync) },
  71. gunzip: { enumerable: true, value: promisify(zlib, zlib.gunzip, 1) },
  72. gunzipSync: { enumerable: true, value: bind(zlib, zlib.gunzipSync) },
  73. gzip: { enumerable: true, value: promisify(zlib, zlib.gzip, 1) },
  74. gzipSync: { enumerable: true, value: bind(zlib, zlib.gzipSync) },
  75. inflate: { enumerable: true, value: promisify(zlib, zlib.inflate, 1) },
  76. inflateRaw: { enumerable: true, value: promisify(zlib, zlib.inflateRaw, 1) },
  77. inflateRawSync: { enumerable: true, value: bind(zlib, zlib.inflateRawSync) },
  78. inflateSync: { enumerable: true, value: bind(zlib, zlib.inflateSync) },
  79. unzip: { enumerable: true, value: promisify(zlib, zlib.unzip, 1) },
  80. unzipSync: { enumerable: true, value: bind(zlib, zlib.unzipSync) },
  81. });