Moved exported constants to .constants.

This commit is contained in:
Vitaly Puzrin 2020-11-12 15:49:20 +03:00
parent cb6d67d157
commit 5638105893
4 changed files with 19 additions and 16 deletions

View file

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed support of `Inflate` & `Deflate` instance create without `new`. - Removed support of `Inflate` & `Deflate` instance create without `new`.
- `Inflate.push()` no longer needs second param (end is auto-detected). - `Inflate.push()` no longer needs second param (end is auto-detected).
- Increased default inflate chunk size to 64K. - Increased default inflate chunk size to 64K.
- Moved exported constants to `.constants`.
- Switched to es6. Legacy es5 builds available in `/dist`. - Switched to es6. Legacy es5 builds available in `/dist`.
- Structure of `/dist` folder changed. - Structure of `/dist` folder changed.
- Upgraded build tools to modern ones. - Upgraded build tools to modern ones.

View file

@ -1,14 +1,14 @@
// Top level file is just a mixin of submodules & constants // Top level file is just a mixin of submodules & constants
'use strict'; 'use strict';
const assign = require('./lib/utils/common').assign; const { Deflate, deflate, deflateRaw, gzip } = require('./lib/deflate');
const { Inflate, inflate, inflateRaw, ungzip } = require('./lib/inflate');
const deflate = require('./lib/deflate');
const inflate = require('./lib/inflate');
const constants = require('./lib/zlib/constants'); const constants = require('./lib/zlib/constants');
let pako = {}; module.exports = {
Deflate, deflate, deflateRaw, gzip,
assign(pako, deflate, inflate, constants); Inflate, inflate, inflateRaw, ungzip,
constants
module.exports = pako; };

View file

@ -374,8 +374,9 @@ function gzip(input, options) {
module.exports = { module.exports = {
Deflate: Deflate, Deflate,
deflate: deflate, deflate,
deflateRaw: deflateRaw, deflateRaw,
gzip: gzip gzip,
constants: require('./zlib/constants')
}; };

View file

@ -413,8 +413,9 @@ function inflateRaw(input, options) {
module.exports = { module.exports = {
Inflate: Inflate, Inflate,
inflate: inflate, inflate,
inflateRaw: inflateRaw, inflateRaw,
ungzip: inflate ungzip: inflate,
constants: require('./zlib/constants')
}; };