diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..188bbcf --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/browser.js +/test/imagediff.js diff --git a/.eslintrc.json b/.eslintrc.json index 8e4a18e..a66e018 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,182 +1,19 @@ { - "rules": { - "no-alert": "error", - "no-array-constructor": "off", - "no-bitwise": "off", - "no-caller": "error", - "no-catch-shadow": "error", - "no-class-assign": "error", - "no-cond-assign": "error", - "no-console": "error", - "no-const-assign": "error", - "no-constant-condition": "error", - "no-continue": "off", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-div-regex": "off", - "no-dupe-keys": "error", - "no-dupe-args": "error", - "no-duplicate-case": "error", - "no-else-return": "error", - "no-empty": "error", - "no-empty-character-class": "error", - "no-eq-null": "off", - "no-eval": "error", - "no-ex-assign": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-boolean-cast": "error", - "no-extra-parens": "off", - "no-extra-semi": "error", - "no-fallthrough": "error", - "no-floating-decimal": "error", - "no-func-assign": "error", - "no-implicit-coercion": "error", - "no-implied-eval": "error", - "no-inline-comments": "off", - "no-inner-declarations": ["error", "functions"], - "no-invalid-regexp": "error", - "no-invalid-this": "error", - "no-irregular-whitespace": "error", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-loop-func": "error", - "no-mixed-requires": ["error", false], - "no-mixed-spaces-and-tabs": ["error", false], - "linebreak-style": ["off", "unix"], - "no-multi-spaces": "error", - "no-multi-str": "off", - "no-multiple-empty-lines": ["error", {"max": 2}], - "no-native-reassign": "error", - "no-negated-in-lhs": "error", - "no-nested-ternary": "error", - "no-new": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-octal-escape": "off", - "no-param-reassign": "off", - "no-path-concat": "off", - "no-plusplus": "off", - "no-process-env": "off", - "no-process-exit": "off", - "no-proto": "off", - "no-redeclare": "error", - "no-regex-spaces": "error", - "no-restricted-modules": "off", - "no-return-assign": "error", - "no-script-url": "off", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow": "error", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sparse-arrays": "error", - "no-sync": "off", - "no-ternary": "off", - "no-trailing-spaces": "error", - "no-this-before-super": "error", - "no-throw-literal": "error", - "no-undef": "error", - "no-undef-init": "error", - "no-undefined": "off", - "no-unexpected-multiline": "error", - "no-underscore-dangle": "off", - "no-unneeded-ternary": "off", - "no-unreachable": "error", - "no-unused-expressions": "error", - "no-unused-vars": ["error", {"vars": "all", "args": "after-used"}], - "no-use-before-define": "error", - "no-useless-call": "error", - "no-void": "off", - "no-var": "off", - "no-warning-comments": ["error", { "terms": ["todo", "fixme", "xxx"], "location": "start" }], - "no-with": "error", - - "array-bracket-spacing": ["error", "never"], - "arrow-parens": "error", - "arrow-spacing": "error", - "accessor-pairs": "error", - "block-scoped-var": "off", - "brace-style": ["error", "stroustrup"], - "callback-return": ["error", ["callback", "cb", "next"]], - "camelcase": ["error", {"properties": "always"}], - "comma-dangle": ["error", "never"], - "comma-spacing": "error", - "comma-style": "error", - "complexity": "off", - "computed-property-spacing": ["off", "never"], - "consistent-return": "off", - "consistent-this": ["off", "that"], - "constructor-super": "error", - "curly": ["error", "all"], - "default-case": "error", - "dot-location": ["error", "property"], - "dot-notation": ["error", { "allowKeywords": true }], - "eol-last": "off", - "eqeqeq": ["error", "smart"], - "func-names": "off", - "func-style": ["off", "declaration"], - "generator-star-spacing": "off", - "guard-for-in": "error", - "handle-callback-err": "error", - "id-length": ["error", {"min": 3, "max": 25, "exceptions":["x", "y", "i", "j", "ex", "up"]}], - "indent": ["error", 2, {"SwitchCase": 1}], - "init-declarations": "off", - "key-spacing": ["error", { "beforeColon": false, "afterColon": true }], - "keyword-spacing": "error", - "lines-around-comment": "off", - "max-depth": ["error", 6], - "max-len": ["error", { "code": 160 }], - "max-nested-callbacks": ["error", 1], - "max-params": ["error", 6], - "max-statements": "off", - "new-cap": "error", - "new-parens": "error", - "newline-after-var": "off", - "object-curly-spacing": ["error", "always"], - "object-shorthand": "off", - "one-var": ["error", { - "initialized": "never" - }], - "operator-assignment": ["off", "always"], - "operator-linebreak": ["error", "after"], - "padded-blocks": "off", - "prefer-const": "off", - "prefer-spread": "off", - "prefer-reflect": "off", - "quote-props": "off", - "quotes": ["error", "single"], - "radix": "off", - "id-match": "off", - "require-yield": "off", - "semi": ["error", "always"], - "semi-spacing": ["error", {"before": false, "after": true}], - "sort-vars": "off", - "space-before-blocks": ["error", "always"], - "space-before-function-paren": ["error", "never"], - "space-in-parens": ["error", "never"], - "space-infix-ops": "error", - "space-unary-ops": ["error", { "words": true, "nonwords": false }], - "spaced-comment": "off", - "strict": ["error", "global"], - "use-isnan": "error", - "valid-jsdoc": "off", - "valid-typeof": "error", - "vars-on-top": "off", - "wrap-iife": "off", - "wrap-regex": "off", - "yoda": ["off", "never"] - }, - "env": { - "node": true, - "es6": true + "parserOptions": { "ecmaVersion": 2018 }, + "extends": ["eslint:recommended", "prettier"], + "env": { + "node": true, + "es6": true + }, + "rules": { + "no-var": "error" + }, + "overrides": [ + { + "files": ["test/*.js", "examples/*.js"], + "rules": { + "no-console": "off" + } } + ] } diff --git a/.gitignore b/.gitignore index 0158613..c423d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules coverage examples/*.png browser\.js +.nyc_output diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..188bbcf --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +/browser.js +/test/imagediff.js diff --git a/.travis.yml b/.travis.yml index c284d08..8becd6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: node_js after_success: - - if [ "$TRAVIS_NODE_VERSION" = "10" ]; then npm run coverage && npm i coveralls@2 && npm run coveralls; fi + - if [ "$TRAVIS_NODE_VERSION" = "10" ]; then yarn coverage && yarn coveralls; fi node_js: - - "8" - "10" - - "11" - "12" diff --git a/README.md b/README.md index 7f07bad..8f967d3 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,60 @@ [![Build Status](https://travis-ci.org/lukeapage/pngjs.svg?branch=master)](https://travis-ci.org/lukeapage/pngjs) [![Build status](https://ci.appveyor.com/api/projects/status/tb8418jql1trkntd/branch/master?svg=true)](https://ci.appveyor.com/project/lukeapage/pngjs2/branch/master) [![Coverage Status](https://coveralls.io/repos/lukeapage/pngjs2/badge.svg?branch=master&service=github)](https://coveralls.io/github/lukeapage/pngjs2?branch=master) [![npm version](https://badge.fury.io/js/pngjs.svg)](http://badge.fury.io/js/pngjs) -pngjs -======== +# pngjs [![Greenkeeper badge](https://badges.greenkeeper.io/lukeapage/pngjs.svg)](https://greenkeeper.io/) Simple PNG encoder/decoder for Node.js with no dependencies. Based on the original [pngjs](https://github.com/niegowski/node-pngjs) with the follow enhancements. - * Support for reading 1,2,4 & 16 bit files - * Support for reading interlace files - * Support for reading `tTRNS` transparent colours - * Support for writing colortype 0 (grayscale), colortype 2 (RGB), colortype 4 (grayscale alpha) and colortype 6 (RGBA) - * Sync interface as well as async - * API compatible with pngjs and node-pngjs +- Support for reading 1,2,4 & 16 bit files +- Support for reading interlace files +- Support for reading `tTRNS` transparent colours +- Support for writing colortype 0 (grayscale), colortype 2 (RGB), colortype 4 (grayscale alpha) and colortype 6 (RGBA) +- Sync interface as well as async +- API compatible with pngjs and node-pngjs Known lack of support for: - * Extended PNG e.g. Animation - * Writing in colortype 3 (indexed color) +- Extended PNG e.g. Animation +- Writing in colortype 3 (indexed color) # Table of Contents -* [Requirements](#requirements) -* [Comparison Table](#comparison-table) -* [Tests](#tests) -* [Installation](#installation) -* [Browser](#browser) -* [Example](#example) -* [Async API](#async-api) -* [Sync API](#sync-api) -* [Changelog](#changelog) -Requirements -============ +- [Requirements](#requirements) +- [Comparison Table](#comparison-table) +- [Tests](#tests) +- [Installation](#installation) +- [Browser](#browser) +- [Example](#example) +- [Async API](#async-api) +- [Sync API](#sync-api) +- [Changelog](#changelog) -* Node.js v4 (use older v2.3.0 for 0.10/0.12/iojs support) +# Requirements -Comparison Table -================ +- Node.js v4 (use older v2.3.0 for 0.10/0.12/iojs support) -Name | Forked From | Sync | Async | 16 Bit | 1/2/4 Bit | Interlace | Gamma | Encodes | Tested ----------|--------------|------|-------|--------|-----------|-----------|-------|---------|-------- -pngjs | | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes -node-png | pngjs | No | Yes | No | No | No | Hidden| Yes | Manual -png-coder| pngjs | No | Yes | Yes | No | No | Hidden| Yes | Manual -pngparse | | No | Yes | No | Yes | No | No | No | Yes -pngparse-sync | pngparse| Yes | No | No | Yes | No | No | No | Yes -png-async| | No | Yes | No | No | No | No | Yes | Yes -png-js | | No | Yes | No | No | No | No | No | No +# Comparison Table +| Name | Forked From | Sync | Async | 16 Bit | 1/2/4 Bit | Interlace | Gamma | Encodes | Tested | +| ------------- | ----------- | ---- | ----- | ------ | --------- | --------- | ------ | ------- | ------ | +| pngjs | | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | +| node-png | pngjs | No | Yes | No | No | No | Hidden | Yes | Manual | +| png-coder | pngjs | No | Yes | Yes | No | No | Hidden | Yes | Manual | +| pngparse | | No | Yes | No | Yes | No | No | No | Yes | +| pngparse-sync | pngparse | Yes | No | No | Yes | No | No | No | Yes | +| png-async | | No | Yes | No | No | No | No | Yes | Yes | +| png-js | | No | Yes | No | No | No | No | No | No | Native C++ node decoders: - * png - * png-sync (sync version of above) - * pixel-png - * png-img -Tests -===== +- png +- png-sync (sync version of above) +- pixel-png +- png-img + +# Tests Tested using [PNG Suite](http://www.schaik.com/pngsuite/). We read every file into pngjs, output it in standard 8bit colour, synchronously and asynchronously, then compare the original with the newly saved images. @@ -67,65 +64,67 @@ The only thing not converted is gamma correction - this is because multiple vend In addition we use a tolerance of 3 for 16 bit images in PhantomJS because PhantomJS seems to have non-compliant rules for downscaling 16 bit images. -Installation -=============== +# Installation + ``` $ npm install pngjs --save ``` -Browser -=========== +# Browser + The package has been build with a [Browserify](browserify.org) version (`npm run browserify`) and you can use the browser version by including in your code: ``` import { PNG } from 'pngjs/browser'; ``` -Example -========== +# Example + ```js -var fs = require('fs'), - PNG = require('pngjs').PNG; +var fs = require("fs"), + PNG = require("pngjs").PNG; -fs.createReadStream('in.png') - .pipe(new PNG({ - filterType: 4 - })) - .on('parsed', function() { +fs.createReadStream("in.png") + .pipe( + new PNG({ + filterType: 4, + }) + ) + .on("parsed", function () { + for (var y = 0; y < this.height; y++) { + for (var x = 0; x < this.width; x++) { + var idx = (this.width * y + x) << 2; - for (var y = 0; y < this.height; y++) { - for (var x = 0; x < this.width; x++) { - var idx = (this.width * y + x) << 2; + // invert color + this.data[idx] = 255 - this.data[idx]; + this.data[idx + 1] = 255 - this.data[idx + 1]; + this.data[idx + 2] = 255 - this.data[idx + 2]; - // invert color - this.data[idx] = 255 - this.data[idx]; - this.data[idx+1] = 255 - this.data[idx+1]; - this.data[idx+2] = 255 - this.data[idx+2]; + // and reduce opacity + this.data[idx + 3] = this.data[idx + 3] >> 1; + } + } - // and reduce opacity - this.data[idx+3] = this.data[idx+3] >> 1; - } - } - - this.pack().pipe(fs.createWriteStream('out.png')); - }); + this.pack().pipe(fs.createWriteStream("out.png")); + }); ``` + For more examples see `examples` folder. -Async API -================ +# Async API As input any color type is accepted (grayscale, rgb, palette, grayscale with alpha, rgb with alpha) but 8 bit per sample (channel) is the only supported bit depth. Interlaced mode is not supported. ## Class: PNG + `PNG` is readable and writable `Stream`. - ### Options + - `width` - use this with `height` if you want to create png from scratch - `height` - as above - `checkCRC` - whether parser should be strict about checksums in source stream (default: `true`) -- `deflateChunkSize` - chunk size used for deflating data chunks, this should be power of 2 and must not be less than 256 and more than 32*1024 (default: 32 kB) +- `deflateChunkSize` - chunk size used for deflating data chunks, this should be power of 2 and must not be less than 256 and more than 32\*1024 (default: 32 kB) - `deflateLevel` - compression level for deflate (default: 9) - `deflateStrategy` - compression strategy for deflate (default: 3) - `deflateFactory` - deflate stream factory (default: `zlib.createDeflate`) @@ -133,15 +132,16 @@ As input any color type is accepted (grayscale, rgb, palette, grayscale with alp - `colorType` - the output colorType - see constants. 0 = grayscale, no alpha, 2 = color, no alpha, 4 = grayscale & alpha, 6 = color & alpha. Default currently 6, but in the future may calculate best mode. - `inputColorType` - the input colorType - see constants. Default is 6 (RGBA) - `bitDepth` - the bitDepth of the output, 8 or 16 bits. Input data is expected to have this bit depth. -16 bit data is expected in the system endianness (Default: 8) + 16 bit data is expected in the system endianness (Default: 8) - `inputHasAlpha` - whether the input bitmap has 4 bytes per pixel (rgb and alpha) or 3 (rgb - no alpha). - `bgColor` - an object containing red, green, and blue values between 0 and 255 -that is used when packing a PNG if alpha is not to be included (default: 255,255,255) - + that is used when packing a PNG if alpha is not to be included (default: 255,255,255) ### Event "metadata" + `function(metadata) { }` Image's header has been parsed, metadata contains this information: + - `width` image size in pixels - `height` image size in pixels - `palette` image is paletted @@ -149,17 +149,17 @@ Image's header has been parsed, metadata contains this information: - `alpha` image contains alpha channel - `interlace` image is interlaced - ### Event: "parsed" + `function(data) { }` Input image has been completely parsed, `data` is complete and ready for modification. - ### Event: "error" + `function(error) { }` - ### png.parse(data, [callback]) + Parses PNG file data. Can be `String` or `Buffer`. Alternatively you can stream data to instance of PNG. Optional `callback` is once called on `error` or `parsed`. The callback gets @@ -168,36 +168,39 @@ two arguments `(err, data)`. Returns `this` for method chaining. #### Example + ```js -new PNG({ filterType:4 }).parse( imageData, function(error, data) -{ - console.log(error, data) +new PNG({ filterType: 4 }).parse(imageData, function (error, data) { + console.log(error, data); }); ``` ### png.pack() + Starts converting data to PNG file Stream. Returns `this` for method chaining. - ### png.bitblt(dst, sx, sy, w, h, dx, dy) + Helper for image manipulation, copies a rectangle of pixels from current (i.e. the source) image (`sx`, `sy`, `w`, `h`) to `dst` image (at `dx`, `dy`). Returns `this` for method chaining. For example, the following code copies the top-left 100x50 px of `in.png` into dst and writes it to `out.png`: + ```js -var dst = new PNG({width: 100, height: 50}); -fs.createReadStream('in.png') - .pipe(new PNG()) - .on('parsed', function() { - this.bitblt(dst, 0, 0, 100, 50, 0, 0); - dst.pack().pipe(fs.createWriteStream('out.png')); - }); +var dst = new PNG({ width: 100, height: 50 }); +fs.createReadStream("in.png") + .pipe(new PNG()) + .on("parsed", function () { + this.bitblt(dst, 0, 0, 100, 50, 0, 0); + dst.pack().pipe(fs.createWriteStream("out.png")); + }); ``` ### Property: adjustGamma() + Helper that takes data and adjusts it to be gamma corrected. Note that it is not 100% reliable with transparent colours because that requires knowing the background colour the bitmap is rendered on to. In tests against PNG suite it compared 100% with chrome on all 8 bit and below images. On IE there were some differences. @@ -205,27 +208,28 @@ In tests against PNG suite it compared 100% with chrome on all 8 bit and below i The following example reads a file, adjusts the gamma (which sets the gamma to 0) and writes it out again, effectively removing any gamma correction from the image. ```js -fs.createReadStream('in.png') - .pipe(new PNG()) - .on('parsed', function() { - this.adjustGamma(); - this.pack().pipe(fs.createWriteStream('out.png')); - }); +fs.createReadStream("in.png") + .pipe(new PNG()) + .on("parsed", function () { + this.adjustGamma(); + this.pack().pipe(fs.createWriteStream("out.png")); + }); ``` ### Property: width + Width of image in pixels - ### Property: height + Height of image in pixels - ### Property: data + Buffer of image pixel data. Every pixel consists 4 bytes: R, G, B, A (opacity). - ### Property: gamma + Gamma of image (0 if not specified) ## Packing a PNG and removing alpha (RGBA to RGB) @@ -235,21 +239,23 @@ convert each pixel's transparency to the appropriate RGB value. By default, pngj the image against a white background. You can override this in the options: ```js -var fs = require('fs'), - PNG = require('pngjs').PNG; +var fs = require("fs"), + PNG = require("pngjs").PNG; -fs.createReadStream('in.png') - .pipe(new PNG({ - colorType: 2, - bgColor: { - red: 0, - green: 255, - blue: 0 - } - })) - .on('parsed', function() { - this.pack().pipe(fs.createWriteStream('out.png')); - }); +fs.createReadStream("in.png") + .pipe( + new PNG({ + colorType: 2, + bgColor: { + red: 0, + green: 255, + blue: 0, + }, + }) + ) + .on("parsed", function () { + this.pack().pipe(fs.createWriteStream("out.png")); + }); ``` # Sync API @@ -287,9 +293,7 @@ var png = PNG.sync.read(data); PNG.adjustGamma(png); ``` - -Changelog -============ +# Changelog ### 4.0.0 - 09/04/2020 @@ -325,62 +329,76 @@ Changelog - Support for encoding 8-bit grayscale images ### 3.1.0 - 30/04/2017 - - Support for pngs with zlib chunks that are malformed after valid data + +- Support for pngs with zlib chunks that are malformed after valid data ### 3.0.1 - 16/02/2017 - - Fix single pixel pngs + +- Fix single pixel pngs ### 3.0.0 - 03/08/2016 - - Drop support for node below v4 and iojs. Pin to 2.3.0 to use with old, unsupported or patched node versions. + +- Drop support for node below v4 and iojs. Pin to 2.3.0 to use with old, unsupported or patched node versions. ### 2.3.0 - 22/04/2016 - - Support for sync in node 0.10 + +- Support for sync in node 0.10 ### 2.2.0 - 04/12/2015 - - Add sync write api - - Fix newfile example - - Correct comparison table + +- Add sync write api +- Fix newfile example +- Correct comparison table ### 2.1.0 - 28/10/2015 - - rename package to pngjs - - added 'bgColor' option + +- rename package to pngjs +- added 'bgColor' option ### 2.0.0 - 08/10/2015 - - fixes to readme - - *breaking change* - bitblt on the png prototype now doesn't take a unused, unnecessary src first argument + +- fixes to readme +- _breaking change_ - bitblt on the png prototype now doesn't take a unused, unnecessary src first argument ### 1.2.0 - 13/09/2015 - - support passing colorType to write PNG's and writing bitmaps without alpha information + +- support passing colorType to write PNG's and writing bitmaps without alpha information ### 1.1.0 - 07/09/2015 - - support passing a deflate factory for controlled compression + +- support passing a deflate factory for controlled compression ### 1.0.2 - 22/08/2015 - - Expose all PNG creation info + +- Expose all PNG creation info ### 1.0.1 - 21/08/2015 - - Fix non square interlaced files + +- Fix non square interlaced files ### 1.0.0 - 08/08/2015 - - More tests - - source linted - - maintainability refactorings - - async API - exceptions in reading now emit warnings - - documentation improvement - sync api now documented, adjustGamma documented - - breaking change - gamma chunk is now written. previously a read then write would destroy gamma information, now it is persisted. + +- More tests +- source linted +- maintainability refactorings +- async API - exceptions in reading now emit warnings +- documentation improvement - sync api now documented, adjustGamma documented +- breaking change - gamma chunk is now written. previously a read then write would destroy gamma information, now it is persisted. ### 0.0.3 - 03/08/2015 - - Error handling fixes - - ignore files for smaller npm footprint + +- Error handling fixes +- ignore files for smaller npm footprint ### 0.0.2 - 02/08/2015 - - Bugfixes to interlacing, support for transparent colours + +- Bugfixes to interlacing, support for transparent colours ### 0.0.1 - 02/08/2015 - - Initial release, see pngjs for older changelog. -License -========= +- Initial release, see pngjs for older changelog. + +# License (The MIT License) diff --git a/appveyor.yml b/appveyor.yml index 5941cb6..b395160 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,8 @@ clone_depth: 10 environment: matrix: - - nodejs_version: '4' - - nodejs_version: '6' + - nodejs_version: "10" + - nodejs_version: "12" install: - ps: Install-Product node $env:nodejs_version @@ -18,7 +18,7 @@ test_script: - npm test cache: - - node_modules # local npm modules + - node_modules # local npm modules matrix: fast_finish: true diff --git a/examples/16bit_write.js b/examples/16bit_write.js index 801d795..f36e671 100644 --- a/examples/16bit_write.js +++ b/examples/16bit_write.js @@ -1,51 +1,50 @@ #!/usr/bin/env node -var fs = require('fs'); -var PNG = require("../lib/png").PNG; -var w = 32; -var h = 64; +let fs = require("fs"); +let PNG = require("../lib/png").PNG; +let w = 32; +let h = 64; /// RGBA input (color type 6) -var buffer = Buffer.alloc(2 * w * h * 4); -var bitmap = new Uint16Array(buffer.buffer); -for (var i = 0; i < h; i++) { - for (var j = 0; j < w; j++) { - bitmap[i * 4 * w + 4*j] = i * 65535 / h; - bitmap[i * 4 * w + 4*j + 1] = j * 65535 / w; - bitmap[i * 4 * w + 4*j + 2] = (h-i) * 65535 / h; - bitmap[i * 4 * w + 4*j + 3] = 65535; +let buffer = Buffer.alloc(2 * w * h * 4); +let bitmap = new Uint16Array(buffer.buffer); +for (let i = 0; i < h; i++) { + for (let j = 0; j < w; j++) { + bitmap[i * 4 * w + 4 * j] = (i * 65535) / h; + bitmap[i * 4 * w + 4 * j + 1] = (j * 65535) / w; + bitmap[i * 4 * w + 4 * j + 2] = ((h - i) * 65535) / h; + bitmap[i * 4 * w + 4 * j + 3] = 65535; } } -var png = new PNG({ +let png = new PNG({ width: w, - height:h, + height: h, bitDepth: 16, colorType: 6, inputColorType: 6, - inputHasAlpha: true + inputHasAlpha: true, }); png.data = buffer; -png.pack().pipe(fs.createWriteStream('colortype6.png')); +png.pack().pipe(fs.createWriteStream("colortype6.png")); //////// Grayscale 16 bits/////// -var buffer = Buffer.alloc(2 * w * h); -var bitmap = new Uint16Array(buffer.buffer); -for (var i = 0; i < h; i++) { - for (var j = 0; j < w; j++) - bitmap[i * w + j] = i * 65535 / h; +buffer = Buffer.alloc(2 * w * h); +bitmap = new Uint16Array(buffer.buffer); +for (let i = 0; i < h; i++) { + for (let j = 0; j < w; j++) bitmap[i * w + j] = (i * 65535) / h; } png = new PNG({ width: w, - height:h, + height: h, bitDepth: 16, colorType: 0, inputColorType: 0, - inputHasAlpha: false + inputHasAlpha: false, }); png.data = buffer; -png.pack().pipe(fs.createWriteStream('colortype0.png')); \ No newline at end of file +png.pack().pipe(fs.createWriteStream("colortype0.png")); diff --git a/examples/fromdocs.js b/examples/fromdocs.js index fd6ce71..edf9d57 100644 --- a/examples/fromdocs.js +++ b/examples/fromdocs.js @@ -1,25 +1,22 @@ +let fs = require("fs"), + PNG = require("../lib/png").PNG; // note require('pngjs') outside this project -var fs = require('fs'), - PNG = require('../lib/png').PNG; // note require('pngjs') outside this project +fs.createReadStream("test/in/basi0g01.png") + .pipe(new PNG({})) + .on("parsed", function () { + for (let y = 0; y < this.height; y++) { + for (let x = 0; x < this.width; x++) { + let idx = (this.width * y + x) << 2; -fs.createReadStream('test/in/basi0g01.png') - .pipe(new PNG({ - })) - .on('parsed', function() { + // invert color + this.data[idx] = 255 - this.data[idx]; + this.data[idx + 1] = 255 - this.data[idx + 1]; + this.data[idx + 2] = 255 - this.data[idx + 2]; - for (var y = 0; y < this.height; y++) { - for (var x = 0; x < this.width; x++) { - var idx = (this.width * y + x) << 2; + // and reduce opacity + this.data[idx + 3] = this.data[idx + 3] >> 1; + } + } - // invert color - this.data[idx] = 255 - this.data[idx]; - this.data[idx+1] = 255 - this.data[idx+1]; - this.data[idx+2] = 255 - this.data[idx+2]; - - // and reduce opacity - this.data[idx+3] = this.data[idx+3] >> 1; - } - } - - this.pack().pipe(fs.createWriteStream('out.png')); - }); + this.pack().pipe(fs.createWriteStream("out.png")); + }); diff --git a/examples/newfile.js b/examples/newfile.js index d7725fc..5c4f3ed 100644 --- a/examples/newfile.js +++ b/examples/newfile.js @@ -1,13 +1,14 @@ -var PNG = require("../lib/png").PNG; -var fs = require("fs"); +let PNG = require("../lib/png").PNG; +let fs = require("fs"); -var newfile = new PNG({width:10,height:10}); +let newfile = new PNG({ width: 10, height: 10 }); -for (var y = 0; y < newfile.height; y++) { - for (var x = 0; x < newfile.width; x++) { - var idx = (newfile.width * y + x) << 2; +for (let y = 0; y < newfile.height; y++) { + for (let x = 0; x < newfile.width; x++) { + let idx = (newfile.width * y + x) << 2; - var col = x < (newfile.width >> 1) ^ y < (newfile.height >> 1) ? 0xe5 : 0xff; + let col = + (x < newfile.width >> 1) ^ (y < newfile.height >> 1) ? 0xe5 : 0xff; newfile.data[idx] = col; newfile.data[idx + 1] = col; @@ -16,8 +17,9 @@ for (var y = 0; y < newfile.height; y++) { } } -newfile.pack() - .pipe(fs.createWriteStream(__dirname + '/newfile.png')) - .on('finish', function() { - console.log('Written!'); +newfile + .pack() + .pipe(fs.createWriteStream(__dirname + "/newfile.png")) + .on("finish", function () { + console.log("Written!"); }); diff --git a/examples/set-colortype.js b/examples/set-colortype.js index ae9b3f6..1db1a08 100644 --- a/examples/set-colortype.js +++ b/examples/set-colortype.js @@ -1,34 +1,34 @@ -var fs = require('fs'); -var PNG = require("../lib/png").PNG; -var w = 320; -var h = 200; +let fs = require("fs"); +let PNG = require("../lib/png").PNG; +let w = 320; +let h = 200; -var bitmapWithoutAlpha = Buffer.alloc(w * h * 3); -var ofs=0; -for (var i = 0; i < bitmapWithoutAlpha.length; i+=3) { - bitmapWithoutAlpha[ofs++] = 0xff; - bitmapWithoutAlpha[ofs++] = i % 0xff; - bitmapWithoutAlpha[ofs++] = (i/3) % 0xff; +let bitmapWithoutAlpha = Buffer.alloc(w * h * 3); +let ofs = 0; +for (let i = 0; i < bitmapWithoutAlpha.length; i += 3) { + bitmapWithoutAlpha[ofs++] = 0xff; + bitmapWithoutAlpha[ofs++] = i % 0xff; + bitmapWithoutAlpha[ofs++] = (i / 3) % 0xff; } -var png = new PNG({ +let png = new PNG({ width: w, - height:h, + height: h, bitDepth: 8, colorType: 2, - inputHasAlpha: false + inputHasAlpha: false, }); png.data = bitmapWithoutAlpha; -png.pack().pipe(fs.createWriteStream('colortype2.png')); +png.pack().pipe(fs.createWriteStream("colortype2.png")); -var png = new PNG({ +png = new PNG({ width: w, - height:h, + height: h, bitDepth: 8, colorType: 6, - inputHasAlpha: false + inputHasAlpha: false, }); png.data = bitmapWithoutAlpha; -png.pack().pipe(fs.createWriteStream('colortype6.png')); \ No newline at end of file +png.pack().pipe(fs.createWriteStream("colortype6.png")); diff --git a/examples/simple.js b/examples/simple.js index 9edaab6..e1f9d42 100755 --- a/examples/simple.js +++ b/examples/simple.js @@ -1,30 +1,28 @@ #!/usr/bin/env node -var fs = require('fs'), - PNG = require('../lib/png').PNG; +let fs = require("fs"), + PNG = require("../lib/png").PNG; +let png = new PNG({ + filterType: -1, + }), + src = fs.createReadStream(process.argv[2]), + dst = fs.createWriteStream(process.argv[3] || "out.png"); -var png = new PNG({ - filterType: -1 - }), - src = fs.createReadStream(process.argv[2]), - dst = fs.createWriteStream(process.argv[3] || 'out.png'); +png.on("parsed", function () { + for (let y = 0; y < png.height; y++) { + for (let x = 0; x < png.width; x++) { + let idx = (png.width * y + x) << 2; - -png.on('parsed', function() { - - for (var y = 0; y < png.height; y++) { - for (var x = 0; x < png.width; x++) { - var idx = (png.width * y + x) << 2; - - if (Math.abs(png.data[idx] - png.data[idx+1]) <= 1 - && Math.abs(png.data[idx+1] - png.data[idx+2]) <= 1) - png.data[idx] = png.data[idx+1] = png.data[idx+2]; - - } + if ( + Math.abs(png.data[idx] - png.data[idx + 1]) <= 1 && + Math.abs(png.data[idx + 1] - png.data[idx + 2]) <= 1 + ) + png.data[idx] = png.data[idx + 1] = png.data[idx + 2]; } + } - png.pack().pipe(dst); + png.pack().pipe(dst); }); src.pipe(png); diff --git a/examples/sync.js b/examples/sync.js index 98b964c..ab90e70 100644 --- a/examples/sync.js +++ b/examples/sync.js @@ -1,19 +1,18 @@ #!/usr/bin/env node -var fs = require('fs'), - PNG = require('../lib/png').PNG; +let fs = require("fs"), + PNG = require("../lib/png").PNG; - -var srcFname = process.argv[2], - dstFname = process.argv[3] || 'out.png'; +let srcFname = process.argv[2], + dstFname = process.argv[3] || "out.png"; // Read a PNG file -var data = fs.readFileSync(srcFname); +let data = fs.readFileSync(srcFname); // Parse it -var png = PNG.sync.read(data, { - filterType: -1 +let png = PNG.sync.read(data, { + filterType: -1, }); // Pack it back into a PNG data -var buff = PNG.sync.write(png); +let buff = PNG.sync.write(png); // Write a PNG file -fs.writeFileSync(dstFname, buff); \ No newline at end of file +fs.writeFileSync(dstFname, buff); diff --git a/lib/bitmapper.js b/lib/bitmapper.js index f236406..18378a0 100644 --- a/lib/bitmapper.js +++ b/lib/bitmapper.js @@ -1,19 +1,19 @@ -'use strict'; +"use strict"; -var interlaceUtils = require('./interlace'); +let interlaceUtils = require("./interlace"); -var pixelBppMapper = [ +let pixelBppMapper = [ // 0 - dummy entry - function() {}, + function () {}, // 1 - L // 0: 0, 1: 0, 2: 0, 3: 0xff - function(pxData, data, pxPos, rawPos) { + function (pxData, data, pxPos, rawPos) { if (rawPos === data.length) { - throw new Error('Ran out of data'); + throw new Error("Ran out of data"); } - var pixel = data[rawPos]; + let pixel = data[rawPos]; pxData[pxPos] = pixel; pxData[pxPos + 1] = pixel; pxData[pxPos + 2] = pixel; @@ -22,12 +22,12 @@ var pixelBppMapper = [ // 2 - LA // 0: 0, 1: 0, 2: 0, 3: 1 - function(pxData, data, pxPos, rawPos) { + function (pxData, data, pxPos, rawPos) { if (rawPos + 1 >= data.length) { - throw new Error('Ran out of data'); + throw new Error("Ran out of data"); } - var pixel = data[rawPos]; + let pixel = data[rawPos]; pxData[pxPos] = pixel; pxData[pxPos + 1] = pixel; pxData[pxPos + 2] = pixel; @@ -36,9 +36,9 @@ var pixelBppMapper = [ // 3 - RGB // 0: 0, 1: 1, 2: 2, 3: 0xff - function(pxData, data, pxPos, rawPos) { + function (pxData, data, pxPos, rawPos) { if (rawPos + 2 >= data.length) { - throw new Error('Ran out of data'); + throw new Error("Ran out of data"); } pxData[pxPos] = data[rawPos]; @@ -49,26 +49,26 @@ var pixelBppMapper = [ // 4 - RGBA // 0: 0, 1: 1, 2: 2, 3: 3 - function(pxData, data, pxPos, rawPos) { + function (pxData, data, pxPos, rawPos) { if (rawPos + 3 >= data.length) { - throw new Error('Ran out of data'); + throw new Error("Ran out of data"); } pxData[pxPos] = data[rawPos]; pxData[pxPos + 1] = data[rawPos + 1]; pxData[pxPos + 2] = data[rawPos + 2]; pxData[pxPos + 3] = data[rawPos + 3]; - } + }, ]; -var pixelBppCustomMapper = [ +let pixelBppCustomMapper = [ // 0 - dummy entry - function() {}, + function () {}, // 1 - L // 0: 0, 1: 0, 2: 0, 3: 0xff - function(pxData, pixelData, pxPos, maxBit) { - var pixel = pixelData[0]; + function (pxData, pixelData, pxPos, maxBit) { + let pixel = pixelData[0]; pxData[pxPos] = pixel; pxData[pxPos + 1] = pixel; pxData[pxPos + 2] = pixel; @@ -77,8 +77,8 @@ var pixelBppCustomMapper = [ // 2 - LA // 0: 0, 1: 0, 2: 0, 3: 1 - function(pxData, pixelData, pxPos) { - var pixel = pixelData[0]; + function (pxData, pixelData, pxPos) { + let pixel = pixelData[0]; pxData[pxPos] = pixel; pxData[pxPos + 1] = pixel; pxData[pxPos + 2] = pixel; @@ -87,7 +87,7 @@ var pixelBppCustomMapper = [ // 3 - RGB // 0: 0, 1: 1, 2: 2, 3: 0xff - function(pxData, pixelData, pxPos, maxBit) { + function (pxData, pixelData, pxPos, maxBit) { pxData[pxPos] = pixelData[0]; pxData[pxPos + 1] = pixelData[1]; pxData[pxPos + 2] = pixelData[2]; @@ -96,33 +96,32 @@ var pixelBppCustomMapper = [ // 4 - RGBA // 0: 0, 1: 1, 2: 2, 3: 3 - function(pxData, pixelData, pxPos) { + function (pxData, pixelData, pxPos) { pxData[pxPos] = pixelData[0]; pxData[pxPos + 1] = pixelData[1]; pxData[pxPos + 2] = pixelData[2]; pxData[pxPos + 3] = pixelData[3]; - } + }, ]; function bitRetriever(data, depth) { - - var leftOver = []; - var i = 0; + let leftOver = []; + let i = 0; function split() { if (i === data.length) { - throw new Error('Ran out of data'); + throw new Error("Ran out of data"); } - var byte = data[i]; + let byte = data[i]; i++; - var byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1; + let byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1; switch (depth) { default: - throw new Error('unrecognised depth'); + throw new Error("unrecognised depth"); case 16: byte2 = data[i]; i++; - leftOver.push(((byte << 8) + byte2)); + leftOver.push((byte << 8) + byte2); break; case 4: byte2 = byte & 0x0f; @@ -131,52 +130,53 @@ function bitRetriever(data, depth) { break; case 2: byte4 = byte & 3; - byte3 = byte >> 2 & 3; - byte2 = byte >> 4 & 3; - byte1 = byte >> 6 & 3; + byte3 = (byte >> 2) & 3; + byte2 = (byte >> 4) & 3; + byte1 = (byte >> 6) & 3; leftOver.push(byte1, byte2, byte3, byte4); break; case 1: byte8 = byte & 1; - byte7 = byte >> 1 & 1; - byte6 = byte >> 2 & 1; - byte5 = byte >> 3 & 1; - byte4 = byte >> 4 & 1; - byte3 = byte >> 5 & 1; - byte2 = byte >> 6 & 1; - byte1 = byte >> 7 & 1; + byte7 = (byte >> 1) & 1; + byte6 = (byte >> 2) & 1; + byte5 = (byte >> 3) & 1; + byte4 = (byte >> 4) & 1; + byte3 = (byte >> 5) & 1; + byte2 = (byte >> 6) & 1; + byte1 = (byte >> 7) & 1; leftOver.push(byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8); break; } } return { - get: function(count) { + get: function (count) { while (leftOver.length < count) { split(); } - var returner = leftOver.slice(0, count); + let returner = leftOver.slice(0, count); leftOver = leftOver.slice(count); return returner; }, - resetAfterLine: function() { + resetAfterLine: function () { leftOver.length = 0; }, - end: function() { + end: function () { if (i !== data.length) { - throw new Error('extra data found'); + throw new Error("extra data found"); } - } + }, }; } -function mapImage8Bit(image, pxData, getPxPos, bpp, data, rawPos) { // eslint-disable-line max-params - var imageWidth = image.width; - var imageHeight = image.height; - var imagePass = image.index; - for (var y = 0; y < imageHeight; y++) { - for (var x = 0; x < imageWidth; x++) { - var pxPos = getPxPos(x, y, imagePass); +function mapImage8Bit(image, pxData, getPxPos, bpp, data, rawPos) { + // eslint-disable-line max-params + let imageWidth = image.width; + let imageHeight = image.height; + let imagePass = image.index; + for (let y = 0; y < imageHeight; y++) { + for (let x = 0; x < imageWidth; x++) { + let pxPos = getPxPos(x, y, imagePass); pixelBppMapper[bpp](pxData, data, pxPos, rawPos); rawPos += bpp; //eslint-disable-line no-param-reassign } @@ -184,71 +184,82 @@ function mapImage8Bit(image, pxData, getPxPos, bpp, data, rawPos) { // eslint-di return rawPos; } -function mapImageCustomBit(image, pxData, getPxPos, bpp, bits, maxBit) { // eslint-disable-line max-params - var imageWidth = image.width; - var imageHeight = image.height; - var imagePass = image.index; - for (var y = 0; y < imageHeight; y++) { - for (var x = 0; x < imageWidth; x++) { - var pixelData = bits.get(bpp); - var pxPos = getPxPos(x, y, imagePass); +function mapImageCustomBit(image, pxData, getPxPos, bpp, bits, maxBit) { + // eslint-disable-line max-params + let imageWidth = image.width; + let imageHeight = image.height; + let imagePass = image.index; + for (let y = 0; y < imageHeight; y++) { + for (let x = 0; x < imageWidth; x++) { + let pixelData = bits.get(bpp); + let pxPos = getPxPos(x, y, imagePass); pixelBppCustomMapper[bpp](pxData, pixelData, pxPos, maxBit); } bits.resetAfterLine(); } } -exports.dataToBitMap = function(data, bitmapInfo) { - - var width = bitmapInfo.width; - var height = bitmapInfo.height; - var depth = bitmapInfo.depth; - var bpp = bitmapInfo.bpp; - var interlace = bitmapInfo.interlace; +exports.dataToBitMap = function (data, bitmapInfo) { + let width = bitmapInfo.width; + let height = bitmapInfo.height; + let depth = bitmapInfo.depth; + let bpp = bitmapInfo.bpp; + let interlace = bitmapInfo.interlace; + let bits; if (depth !== 8) { - var bits = bitRetriever(data, depth); + bits = bitRetriever(data, depth); } - var pxData; + let pxData; if (depth <= 8) { pxData = Buffer.alloc(width * height * 4); - } - else { + } else { pxData = new Uint16Array(width * height * 4); } - var maxBit = Math.pow(2, depth) - 1; - var rawPos = 0; - var images; - var getPxPos; + let maxBit = Math.pow(2, depth) - 1; + let rawPos = 0; + let images; + let getPxPos; if (interlace) { images = interlaceUtils.getImagePasses(width, height); getPxPos = interlaceUtils.getInterlaceIterator(width, height); - } - else { - var nonInterlacedPxPos = 0; - getPxPos = function() { - var returner = nonInterlacedPxPos; + } else { + let nonInterlacedPxPos = 0; + getPxPos = function () { + let returner = nonInterlacedPxPos; nonInterlacedPxPos += 4; return returner; }; images = [{ width: width, height: height }]; } - for (var imageIndex = 0; imageIndex < images.length; imageIndex++) { + for (let imageIndex = 0; imageIndex < images.length; imageIndex++) { if (depth === 8) { - rawPos = mapImage8Bit(images[imageIndex], pxData, getPxPos, bpp, data, rawPos); - } - else { - mapImageCustomBit(images[imageIndex], pxData, getPxPos, bpp, bits, maxBit); + rawPos = mapImage8Bit( + images[imageIndex], + pxData, + getPxPos, + bpp, + data, + rawPos + ); + } else { + mapImageCustomBit( + images[imageIndex], + pxData, + getPxPos, + bpp, + bits, + maxBit + ); } } if (depth === 8) { if (rawPos !== data.length) { - throw new Error('extra data found'); + throw new Error("extra data found"); } - } - else { + } else { bits.end(); } diff --git a/lib/bitpacker.js b/lib/bitpacker.js index fd75f1a..d7a4e65 100644 --- a/lib/bitpacker.js +++ b/lib/bitpacker.js @@ -1,12 +1,15 @@ -'use strict'; +"use strict"; -var constants = require('./constants'); +let constants = require("./constants"); -module.exports = function(dataIn, width, height, options) { - var outHasAlpha = [constants.COLORTYPE_COLOR_ALPHA, constants.COLORTYPE_ALPHA].indexOf(options.colorType) !== -1; +module.exports = function (dataIn, width, height, options) { + let outHasAlpha = + [constants.COLORTYPE_COLOR_ALPHA, constants.COLORTYPE_ALPHA].indexOf( + options.colorType + ) !== -1; if (options.colorType === options.inputColorType) { - var bigEndian = (function() { - var buffer = new ArrayBuffer(2); + let bigEndian = (function () { + let buffer = new ArrayBuffer(2); new DataView(buffer).setInt16(0, 256, true /* littleEndian */); // Int16Array uses the platform's endianness. return new Int16Array(buffer)[0] !== 256; @@ -18,24 +21,24 @@ module.exports = function(dataIn, width, height, options) { } // map to a UInt16 array if data is 16bit, fix endianness below - var data = options.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer); + let data = options.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer); - var maxValue = 255; - var inBpp = constants.COLORTYPE_TO_BPP_MAP[options.inputColorType]; + let maxValue = 255; + let inBpp = constants.COLORTYPE_TO_BPP_MAP[options.inputColorType]; if (inBpp === 4 && !options.inputHasAlpha) { inBpp = 3; } - var outBpp = constants.COLORTYPE_TO_BPP_MAP[options.colorType]; + let outBpp = constants.COLORTYPE_TO_BPP_MAP[options.colorType]; if (options.bitDepth === 16) { maxValue = 65535; outBpp *= 2; } - var outData = Buffer.alloc(width * height * outBpp); + let outData = Buffer.alloc(width * height * outBpp); - var inIndex = 0; - var outIndex = 0; + let inIndex = 0; + let outIndex = 0; - var bgColor = options.bgColor || {}; + let bgColor = options.bgColor || {}; if (bgColor.red === undefined) { bgColor.red = maxValue; } @@ -47,10 +50,10 @@ module.exports = function(dataIn, width, height, options) { } function getRGBA() { - var red; - var green; - var blue; - var alpha = maxValue; + let red; + let green; + let blue; + let alpha = maxValue; switch (options.inputColorType) { case constants.COLORTYPE_COLOR_ALPHA: alpha = data[inIndex + 3]; @@ -75,23 +78,36 @@ module.exports = function(dataIn, width, height, options) { blue = red; break; default: - throw new Error('input color type:' + options.inputColorType + ' is not supported at present'); + throw new Error( + "input color type:" + + options.inputColorType + + " is not supported at present" + ); } if (options.inputHasAlpha) { if (!outHasAlpha) { alpha /= maxValue; - red = Math.min(Math.max(Math.round((1 - alpha) * bgColor.red + alpha * red), 0), maxValue); - green = Math.min(Math.max(Math.round((1 - alpha) * bgColor.green + alpha * green), 0), maxValue); - blue = Math.min(Math.max(Math.round((1 - alpha) * bgColor.blue + alpha * blue), 0), maxValue); + red = Math.min( + Math.max(Math.round((1 - alpha) * bgColor.red + alpha * red), 0), + maxValue + ); + green = Math.min( + Math.max(Math.round((1 - alpha) * bgColor.green + alpha * green), 0), + maxValue + ); + blue = Math.min( + Math.max(Math.round((1 - alpha) * bgColor.blue + alpha * blue), 0), + maxValue + ); } } return { red: red, green: green, blue: blue, alpha: alpha }; } - for (var y = 0; y < height; y++) { - for (var x = 0; x < width; x++) { - var rgba = getRGBA(data, inIndex); + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + let rgba = getRGBA(data, inIndex); switch (options.colorType) { case constants.COLORTYPE_COLOR_ALPHA: @@ -103,8 +119,7 @@ module.exports = function(dataIn, width, height, options) { if (outHasAlpha) { outData[outIndex + 3] = rgba.alpha; } - } - else { + } else { outData.writeUInt16BE(rgba.red, outIndex); outData.writeUInt16BE(rgba.green, outIndex + 2); outData.writeUInt16BE(rgba.blue, outIndex + 4); @@ -114,24 +129,24 @@ module.exports = function(dataIn, width, height, options) { } break; case constants.COLORTYPE_ALPHA: - case constants.COLORTYPE_GRAYSCALE: + case constants.COLORTYPE_GRAYSCALE: { // Convert to grayscale and alpha - var grayscale = (rgba.red + rgba.green + rgba.blue) / 3; + let grayscale = (rgba.red + rgba.green + rgba.blue) / 3; if (options.bitDepth === 8) { outData[outIndex] = grayscale; if (outHasAlpha) { outData[outIndex + 1] = rgba.alpha; } - } - else { + } else { outData.writeUInt16BE(grayscale, outIndex); if (outHasAlpha) { outData.writeUInt16BE(rgba.alpha, outIndex + 2); } } break; + } default: - throw new Error('unrecognised color Type ' + options.colorType); + throw new Error("unrecognised color Type " + options.colorType); } inIndex += inBpp; diff --git a/lib/chunkstream.js b/lib/chunkstream.js index 56c4681..71c8ce0 100644 --- a/lib/chunkstream.js +++ b/lib/chunkstream.js @@ -1,11 +1,9 @@ -'use strict'; +"use strict"; +let util = require("util"); +let Stream = require("stream"); -var util = require('util'); -var Stream = require('stream'); - - -var ChunkStream = module.exports = function() { +let ChunkStream = (module.exports = function () { Stream.call(this); this._buffers = []; @@ -14,44 +12,42 @@ var ChunkStream = module.exports = function() { this._reads = []; this._paused = false; - this._encoding = 'utf8'; + this._encoding = "utf8"; this.writable = true; -}; +}); util.inherits(ChunkStream, Stream); - -ChunkStream.prototype.read = function(length, callback) { - +ChunkStream.prototype.read = function (length, callback) { this._reads.push({ length: Math.abs(length), // if length < 0 then at most this length allowLess: length < 0, - func: callback + func: callback, }); - process.nextTick(function() { - this._process(); + process.nextTick( + function () { + this._process(); - // its paused and there is not enought data then ask for more - if (this._paused && this._reads.length > 0) { - this._paused = false; + // its paused and there is not enought data then ask for more + if (this._paused && this._reads.length > 0) { + this._paused = false; - this.emit('drain'); - } - }.bind(this)); + this.emit("drain"); + } + }.bind(this) + ); }; -ChunkStream.prototype.write = function(data, encoding) { - +ChunkStream.prototype.write = function (data, encoding) { if (!this.writable) { - this.emit('error', new Error('Stream not writable')); + this.emit("error", new Error("Stream not writable")); return false; } - var dataBuffer; + let dataBuffer; if (Buffer.isBuffer(data)) { dataBuffer = data; - } - else { + } else { dataBuffer = Buffer.from(data, encoding || this._encoding); } @@ -68,8 +64,7 @@ ChunkStream.prototype.write = function(data, encoding) { return this.writable && !this._paused; }; -ChunkStream.prototype.end = function(data, encoding) { - +ChunkStream.prototype.end = function (data, encoding) { if (data) { this.write(data, encoding); } @@ -84,8 +79,7 @@ ChunkStream.prototype.end = function(data, encoding) { // enqueue or handle end if (this._buffers.length === 0) { this._end(); - } - else { + } else { this._buffers.push(null); this._process(); } @@ -93,19 +87,15 @@ ChunkStream.prototype.end = function(data, encoding) { ChunkStream.prototype.destroySoon = ChunkStream.prototype.end; -ChunkStream.prototype._end = function() { - +ChunkStream.prototype._end = function () { if (this._reads.length > 0) { - this.emit('error', - new Error('Unexpected end of input') - ); + this.emit("error", new Error("Unexpected end of input")); } this.destroy(); }; -ChunkStream.prototype.destroy = function() { - +ChunkStream.prototype.destroy = function () { if (!this._buffers) { return; } @@ -114,26 +104,23 @@ ChunkStream.prototype.destroy = function() { this._reads = null; this._buffers = null; - this.emit('close'); + this.emit("close"); }; -ChunkStream.prototype._processReadAllowingLess = function(read) { +ChunkStream.prototype._processReadAllowingLess = function (read) { // ok there is any data so that we can satisfy this request this._reads.shift(); // == read // first we need to peek into first buffer - var smallerBuf = this._buffers[0]; + let smallerBuf = this._buffers[0]; // ok there is more data than we need if (smallerBuf.length > read.length) { - this._buffered -= read.length; this._buffers[0] = smallerBuf.slice(read.length); read.func.call(this, smallerBuf.slice(0, read.length)); - - } - else { + } else { // ok this is less than maximum length so use it all this._buffered -= smallerBuf.length; this._buffers.shift(); // == smallerBuf @@ -142,18 +129,17 @@ ChunkStream.prototype._processReadAllowingLess = function(read) { } }; -ChunkStream.prototype._processRead = function(read) { +ChunkStream.prototype._processRead = function (read) { this._reads.shift(); // == read - var pos = 0; - var count = 0; - var data = Buffer.alloc(read.length); + let pos = 0; + let count = 0; + let data = Buffer.alloc(read.length); // create buffer for all data while (pos < read.length) { - - var buf = this._buffers[count++]; - var len = Math.min(buf.length, read.length - pos); + let buf = this._buffers[count++]; + let len = Math.min(buf.length, read.length - pos); buf.copy(data, pos, 0, len); pos += len; @@ -174,25 +160,20 @@ ChunkStream.prototype._processRead = function(read) { read.func.call(this, data); }; -ChunkStream.prototype._process = function() { - +ChunkStream.prototype._process = function () { try { // as long as there is any data and read requests while (this._buffered > 0 && this._reads && this._reads.length > 0) { - - var read = this._reads[0]; + let read = this._reads[0]; // read any data (but no more than length) if (read.allowLess) { this._processReadAllowingLess(read); - - } - else if (this._buffered >= read.length) { + } else if (this._buffered >= read.length) { // ok we can meet some expectations this._processRead(read); - } - else { + } else { // not enought data to satisfy first request in queue // so we need to wait for more break; @@ -202,8 +183,7 @@ ChunkStream.prototype._process = function() { if (this._buffers && !this.writable) { this._end(); } - } - catch (ex) { - this.emit('error', ex); + } catch (ex) { + this.emit("error", ex); } }; diff --git a/lib/constants.js b/lib/constants.js index 22d919d..21fdad6 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,8 +1,6 @@ -'use strict'; - +"use strict"; module.exports = { - PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], TYPE_IHDR: 0x49484452, @@ -27,8 +25,8 @@ module.exports = { 2: 3, 3: 1, 4: 2, - 6: 4 + 6: 4, }, - GAMMA_DIVISION: 100000 + GAMMA_DIVISION: 100000, }; diff --git a/lib/crc.js b/lib/crc.js index 0705ed2..950ec8a 100644 --- a/lib/crc.js +++ b/lib/crc.js @@ -1,43 +1,39 @@ -'use strict'; +"use strict"; -var crcTable = []; +let crcTable = []; -(function() { - for (var i = 0; i < 256; i++) { - var currentCrc = i; - for (var j = 0; j < 8; j++) { +(function () { + for (let i = 0; i < 256; i++) { + let currentCrc = i; + for (let j = 0; j < 8; j++) { if (currentCrc & 1) { currentCrc = 0xedb88320 ^ (currentCrc >>> 1); - } - else { + } else { currentCrc = currentCrc >>> 1; } } crcTable[i] = currentCrc; } -}()); +})(); -var CrcCalculator = module.exports = function() { +let CrcCalculator = (module.exports = function () { this._crc = -1; -}; +}); -CrcCalculator.prototype.write = function(data) { - - for (var i = 0; i < data.length; i++) { +CrcCalculator.prototype.write = function (data) { + for (let i = 0; i < data.length; i++) { this._crc = crcTable[(this._crc ^ data[i]) & 0xff] ^ (this._crc >>> 8); } return true; }; -CrcCalculator.prototype.crc32 = function() { +CrcCalculator.prototype.crc32 = function () { return this._crc ^ -1; }; - -CrcCalculator.crc32 = function(buf) { - - var crc = -1; - for (var i = 0; i < buf.length; i++) { +CrcCalculator.crc32 = function (buf) { + let crc = -1; + for (let i = 0; i < buf.length; i++) { crc = crcTable[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8); } return crc ^ -1; diff --git a/lib/filter-pack.js b/lib/filter-pack.js index ebb15ac..32c85c4 100644 --- a/lib/filter-pack.js +++ b/lib/filter-pack.js @@ -1,43 +1,37 @@ -'use strict'; +"use strict"; -var paethPredictor = require('./paeth-predictor'); +let paethPredictor = require("./paeth-predictor"); function filterNone(pxData, pxPos, byteWidth, rawData, rawPos) { - - for (var x = 0; x < byteWidth; x++) { + for (let x = 0; x < byteWidth; x++) { rawData[rawPos + x] = pxData[pxPos + x]; } } function filterSumNone(pxData, pxPos, byteWidth) { + let sum = 0; + let length = pxPos + byteWidth; - var sum = 0; - var length = pxPos + byteWidth; - - for (var i = pxPos; i < length; i++) { + for (let i = pxPos; i < length; i++) { sum += Math.abs(pxData[i]); } return sum; } function filterSub(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var val = pxData[pxPos + x] - left; + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let val = pxData[pxPos + x] - left; rawData[rawPos + x] = val; } } function filterSumSub(pxData, pxPos, byteWidth, bpp) { - - var sum = 0; - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var val = pxData[pxPos + x] - left; + let sum = 0; + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let val = pxData[pxPos + x] - left; sum += Math.abs(val); } @@ -46,24 +40,20 @@ function filterSumSub(pxData, pxPos, byteWidth, bpp) { } function filterUp(pxData, pxPos, byteWidth, rawData, rawPos) { - - for (var x = 0; x < byteWidth; x++) { - - var up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; - var val = pxData[pxPos + x] - up; + for (let x = 0; x < byteWidth; x++) { + let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; + let val = pxData[pxPos + x] - up; rawData[rawPos + x] = val; } } function filterSumUp(pxData, pxPos, byteWidth) { - - var sum = 0; - var length = pxPos + byteWidth; - for (var x = pxPos; x < length; x++) { - - var up = pxPos > 0 ? pxData[x - byteWidth] : 0; - var val = pxData[x] - up; + let sum = 0; + let length = pxPos + byteWidth; + for (let x = pxPos; x < length; x++) { + let up = pxPos > 0 ? pxData[x - byteWidth] : 0; + let val = pxData[x] - up; sum += Math.abs(val); } @@ -72,25 +62,21 @@ function filterSumUp(pxData, pxPos, byteWidth) { } function filterAvg(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; - var val = pxData[pxPos + x] - ((left + up) >> 1); + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; + let val = pxData[pxPos + x] - ((left + up) >> 1); rawData[rawPos + x] = val; } } function filterSumAvg(pxData, pxPos, byteWidth, bpp) { - - var sum = 0; - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; - var val = pxData[pxPos + x] - ((left + up) >> 1); + let sum = 0; + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; + let val = pxData[pxPos + x] - ((left + up) >> 1); sum += Math.abs(val); } @@ -99,26 +85,25 @@ function filterSumAvg(pxData, pxPos, byteWidth, bpp) { } function filterPaeth(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; - var upleft = pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0; - var val = pxData[pxPos + x] - paethPredictor(left, up, upleft); + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; + let upleft = + pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0; + let val = pxData[pxPos + x] - paethPredictor(left, up, upleft); rawData[rawPos + x] = val; } } function filterSumPaeth(pxData, pxPos, byteWidth, bpp) { - var sum = 0; - for (var x = 0; x < byteWidth; x++) { - - var left = x >= bpp ? pxData[pxPos + x - bpp] : 0; - var up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; - var upleft = pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0; - var val = pxData[pxPos + x] - paethPredictor(left, up, upleft); + let sum = 0; + for (let x = 0; x < byteWidth; x++) { + let left = x >= bpp ? pxData[pxPos + x - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0; + let upleft = + pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0; + let val = pxData[pxPos + x] - paethPredictor(left, up, upleft); sum += Math.abs(val); } @@ -126,53 +111,49 @@ function filterSumPaeth(pxData, pxPos, byteWidth, bpp) { return sum; } -var filters = { +let filters = { 0: filterNone, 1: filterSub, 2: filterUp, 3: filterAvg, - 4: filterPaeth + 4: filterPaeth, }; -var filterSums = { +let filterSums = { 0: filterSumNone, 1: filterSumSub, 2: filterSumUp, 3: filterSumAvg, - 4: filterSumPaeth + 4: filterSumPaeth, }; -module.exports = function(pxData, width, height, options, bpp) { - - var filterTypes; - if (!('filterType' in options) || options.filterType === -1) { +module.exports = function (pxData, width, height, options, bpp) { + let filterTypes; + if (!("filterType" in options) || options.filterType === -1) { filterTypes = [0, 1, 2, 3, 4]; - } - else if (typeof options.filterType === 'number') { + } else if (typeof options.filterType === "number") { filterTypes = [options.filterType]; - } - else { - throw new Error('unrecognised filter types'); + } else { + throw new Error("unrecognised filter types"); } if (options.bitDepth === 16) { bpp *= 2; } - var byteWidth = width * bpp; - var rawPos = 0; - var pxPos = 0; - var rawData = Buffer.alloc((byteWidth + 1) * height); + let byteWidth = width * bpp; + let rawPos = 0; + let pxPos = 0; + let rawData = Buffer.alloc((byteWidth + 1) * height); - var sel = filterTypes[0]; - - for (var y = 0; y < height; y++) { + let sel = filterTypes[0]; + for (let y = 0; y < height; y++) { if (filterTypes.length > 1) { // find best filter for this line (with lowest sum of values) - var min = Infinity; + let min = Infinity; - for (var i = 0; i < filterTypes.length; i++) { - var sum = filterSums[filterTypes[i]](pxData, pxPos, byteWidth, bpp); + for (let i = 0; i < filterTypes.length; i++) { + let sum = filterSums[filterTypes[i]](pxData, pxPos, byteWidth, bpp); if (sum < min) { sel = filterTypes[i]; min = sum; diff --git a/lib/filter-parse-async.js b/lib/filter-parse-async.js index 560c30e..832b86c 100644 --- a/lib/filter-parse-async.js +++ b/lib/filter-parse-async.js @@ -1,25 +1,24 @@ -'use strict'; +"use strict"; -var util = require('util'); -var ChunkStream = require('./chunkstream'); -var Filter = require('./filter-parse'); +let util = require("util"); +let ChunkStream = require("./chunkstream"); +let Filter = require("./filter-parse"); - -var FilterAsync = module.exports = function(bitmapInfo) { +let FilterAsync = (module.exports = function (bitmapInfo) { ChunkStream.call(this); - var buffers = []; - var that = this; + let buffers = []; + let that = this; this._filter = new Filter(bitmapInfo, { read: this.read.bind(this), - write: function(buffer) { + write: function (buffer) { buffers.push(buffer); }, - complete: function() { - that.emit('complete', Buffer.concat(buffers)); - } + complete: function () { + that.emit("complete", Buffer.concat(buffers)); + }, }); this._filter.start(); -}; +}); util.inherits(FilterAsync, ChunkStream); diff --git a/lib/filter-parse-sync.js b/lib/filter-parse-sync.js index 958c676..6924d16 100644 --- a/lib/filter-parse-sync.js +++ b/lib/filter-parse-sync.js @@ -1,24 +1,21 @@ -'use strict'; +"use strict"; -var SyncReader = require('./sync-reader'); -var Filter = require('./filter-parse'); +let SyncReader = require("./sync-reader"); +let Filter = require("./filter-parse"); - -exports.process = function(inBuffer, bitmapInfo) { - - var outBuffers = []; - var reader = new SyncReader(inBuffer); - var filter = new Filter(bitmapInfo, { +exports.process = function (inBuffer, bitmapInfo) { + let outBuffers = []; + let reader = new SyncReader(inBuffer); + let filter = new Filter(bitmapInfo, { read: reader.read.bind(reader), - write: function(bufferPart) { + write: function (bufferPart) { outBuffers.push(bufferPart); }, - complete: function() { - } + complete: function () {}, }); filter.start(); reader.process(); return Buffer.concat(outBuffers); -}; \ No newline at end of file +}; diff --git a/lib/filter-parse.js b/lib/filter-parse.js index 4c2e047..3a32e5e 100644 --- a/lib/filter-parse.js +++ b/lib/filter-parse.js @@ -1,23 +1,22 @@ -'use strict'; +"use strict"; -var interlaceUtils = require('./interlace'); -var paethPredictor = require('./paeth-predictor'); +let interlaceUtils = require("./interlace"); +let paethPredictor = require("./paeth-predictor"); function getByteWidth(width, bpp, depth) { - var byteWidth = width * bpp; + let byteWidth = width * bpp; if (depth !== 8) { byteWidth = Math.ceil(byteWidth / (8 / depth)); } return byteWidth; } -var Filter = module.exports = function(bitmapInfo, dependencies) { - - var width = bitmapInfo.width; - var height = bitmapInfo.height; - var interlace = bitmapInfo.interlace; - var bpp = bitmapInfo.bpp; - var depth = bitmapInfo.depth; +let Filter = (module.exports = function (bitmapInfo, dependencies) { + let width = bitmapInfo.width; + let height = bitmapInfo.height; + let interlace = bitmapInfo.interlace; + let bpp = bitmapInfo.bpp; + let depth = bitmapInfo.depth; this.read = dependencies.read; this.write = dependencies.write; @@ -26,20 +25,19 @@ var Filter = module.exports = function(bitmapInfo, dependencies) { this._imageIndex = 0; this._images = []; if (interlace) { - var passes = interlaceUtils.getImagePasses(width, height); - for (var i = 0; i < passes.length; i++) { + let passes = interlaceUtils.getImagePasses(width, height); + for (let i = 0; i < passes.length; i++) { this._images.push({ byteWidth: getByteWidth(passes[i].width, bpp, depth), height: passes[i].height, - lineIndex: 0 + lineIndex: 0, }); } - } - else { + } else { this._images.push({ byteWidth: getByteWidth(width, bpp, depth), height: height, - lineIndex: 0 + lineIndex: 0, }); } @@ -49,85 +47,95 @@ var Filter = module.exports = function(bitmapInfo, dependencies) { // a pixel rather than just a different byte part. However if we are sub byte, we ignore. if (depth === 8) { this._xComparison = bpp; - } - else if (depth === 16) { + } else if (depth === 16) { this._xComparison = bpp * 2; - } - else { + } else { this._xComparison = 1; } +}); + +Filter.prototype.start = function () { + this.read( + this._images[this._imageIndex].byteWidth + 1, + this._reverseFilterLine.bind(this) + ); }; -Filter.prototype.start = function() { - this.read(this._images[this._imageIndex].byteWidth + 1, this._reverseFilterLine.bind(this)); -}; +Filter.prototype._unFilterType1 = function ( + rawData, + unfilteredLine, + byteWidth +) { + let xComparison = this._xComparison; + let xBiggerThan = xComparison - 1; -Filter.prototype._unFilterType1 = function(rawData, unfilteredLine, byteWidth) { - - var xComparison = this._xComparison; - var xBiggerThan = xComparison - 1; - - for (var x = 0; x < byteWidth; x++) { - var rawByte = rawData[1 + x]; - var f1Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; + for (let x = 0; x < byteWidth; x++) { + let rawByte = rawData[1 + x]; + let f1Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; unfilteredLine[x] = rawByte + f1Left; } }; -Filter.prototype._unFilterType2 = function(rawData, unfilteredLine, byteWidth) { +Filter.prototype._unFilterType2 = function ( + rawData, + unfilteredLine, + byteWidth +) { + let lastLine = this._lastLine; - var lastLine = this._lastLine; - - for (var x = 0; x < byteWidth; x++) { - var rawByte = rawData[1 + x]; - var f2Up = lastLine ? lastLine[x] : 0; + for (let x = 0; x < byteWidth; x++) { + let rawByte = rawData[1 + x]; + let f2Up = lastLine ? lastLine[x] : 0; unfilteredLine[x] = rawByte + f2Up; } }; -Filter.prototype._unFilterType3 = function(rawData, unfilteredLine, byteWidth) { +Filter.prototype._unFilterType3 = function ( + rawData, + unfilteredLine, + byteWidth +) { + let xComparison = this._xComparison; + let xBiggerThan = xComparison - 1; + let lastLine = this._lastLine; - var xComparison = this._xComparison; - var xBiggerThan = xComparison - 1; - var lastLine = this._lastLine; - - for (var x = 0; x < byteWidth; x++) { - var rawByte = rawData[1 + x]; - var f3Up = lastLine ? lastLine[x] : 0; - var f3Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; - var f3Add = Math.floor((f3Left + f3Up) / 2); + for (let x = 0; x < byteWidth; x++) { + let rawByte = rawData[1 + x]; + let f3Up = lastLine ? lastLine[x] : 0; + let f3Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; + let f3Add = Math.floor((f3Left + f3Up) / 2); unfilteredLine[x] = rawByte + f3Add; } }; -Filter.prototype._unFilterType4 = function(rawData, unfilteredLine, byteWidth) { +Filter.prototype._unFilterType4 = function ( + rawData, + unfilteredLine, + byteWidth +) { + let xComparison = this._xComparison; + let xBiggerThan = xComparison - 1; + let lastLine = this._lastLine; - var xComparison = this._xComparison; - var xBiggerThan = xComparison - 1; - var lastLine = this._lastLine; - - for (var x = 0; x < byteWidth; x++) { - var rawByte = rawData[1 + x]; - var f4Up = lastLine ? lastLine[x] : 0; - var f4Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; - var f4UpLeft = x > xBiggerThan && lastLine ? lastLine[x - xComparison] : 0; - var f4Add = paethPredictor(f4Left, f4Up, f4UpLeft); + for (let x = 0; x < byteWidth; x++) { + let rawByte = rawData[1 + x]; + let f4Up = lastLine ? lastLine[x] : 0; + let f4Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0; + let f4UpLeft = x > xBiggerThan && lastLine ? lastLine[x - xComparison] : 0; + let f4Add = paethPredictor(f4Left, f4Up, f4UpLeft); unfilteredLine[x] = rawByte + f4Add; } }; -Filter.prototype._reverseFilterLine = function(rawData) { - - var filter = rawData[0]; - var unfilteredLine; - var currentImage = this._images[this._imageIndex]; - var byteWidth = currentImage.byteWidth; +Filter.prototype._reverseFilterLine = function (rawData) { + let filter = rawData[0]; + let unfilteredLine; + let currentImage = this._images[this._imageIndex]; + let byteWidth = currentImage.byteWidth; if (filter === 0) { unfilteredLine = rawData.slice(1, byteWidth + 1); - } - else { - + } else { unfilteredLine = Buffer.alloc(byteWidth); switch (filter) { @@ -144,7 +152,7 @@ Filter.prototype._reverseFilterLine = function(rawData) { this._unFilterType4(rawData, unfilteredLine, byteWidth); break; default: - throw new Error('Unrecognised filter type - ' + filter); + throw new Error("Unrecognised filter type - " + filter); } } @@ -155,16 +163,14 @@ Filter.prototype._reverseFilterLine = function(rawData) { this._lastLine = null; this._imageIndex++; currentImage = this._images[this._imageIndex]; - } - else { + } else { this._lastLine = unfilteredLine; } if (currentImage) { // read, using the byte width that may be from the new current image this.read(currentImage.byteWidth + 1, this._reverseFilterLine.bind(this)); - } - else { + } else { this._lastLine = null; this.complete(); } diff --git a/lib/format-normaliser.js b/lib/format-normaliser.js index 1e40cbc..634d566 100644 --- a/lib/format-normaliser.js +++ b/lib/format-normaliser.js @@ -1,17 +1,17 @@ -'use strict'; +"use strict"; function dePalette(indata, outdata, width, height, palette) { - var pxPos = 0; + let pxPos = 0; // use values from palette - for (var y = 0; y < height; y++) { - for (var x = 0; x < width; x++) { - var color = palette[indata[pxPos]]; + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + let color = palette[indata[pxPos]]; if (!color) { - throw new Error('index ' + indata[pxPos] + ' not in palette'); + throw new Error("index " + indata[pxPos] + " not in palette"); } - for (var i = 0; i < 4; i++) { + for (let i = 0; i < 4; i++) { outdata[pxPos + i] = color[i]; } pxPos += 4; @@ -20,21 +20,24 @@ function dePalette(indata, outdata, width, height, palette) { } function replaceTransparentColor(indata, outdata, width, height, transColor) { - var pxPos = 0; - for (var y = 0; y < height; y++) { - for (var x = 0; x < width; x++) { - var makeTrans = false; + let pxPos = 0; + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + let makeTrans = false; if (transColor.length === 1) { if (transColor[0] === indata[pxPos]) { makeTrans = true; } - } - else if (transColor[0] === indata[pxPos] && transColor[1] === indata[pxPos + 1] && transColor[2] === indata[pxPos + 2]) { + } else if ( + transColor[0] === indata[pxPos] && + transColor[1] === indata[pxPos + 1] && + transColor[2] === indata[pxPos + 2] + ) { makeTrans = true; } if (makeTrans) { - for (var i = 0; i < 4; i++) { + for (let i = 0; i < 4; i++) { outdata[pxPos + i] = 0; } } @@ -44,35 +47,36 @@ function replaceTransparentColor(indata, outdata, width, height, transColor) { } function scaleDepth(indata, outdata, width, height, depth) { - var maxOutSample = 255; - var maxInSample = Math.pow(2, depth) - 1; - var pxPos = 0; + let maxOutSample = 255; + let maxInSample = Math.pow(2, depth) - 1; + let pxPos = 0; - for (var y = 0; y < height; y++) { - for (var x = 0; x < width; x++) { - for (var i = 0; i < 4; i++) { - outdata[pxPos + i] = Math.floor((indata[pxPos + i] * maxOutSample) / maxInSample + 0.5); + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x++) { + for (let i = 0; i < 4; i++) { + outdata[pxPos + i] = Math.floor( + (indata[pxPos + i] * maxOutSample) / maxInSample + 0.5 + ); } pxPos += 4; } } } -module.exports = function(indata, imageData) { +module.exports = function (indata, imageData) { + let depth = imageData.depth; + let width = imageData.width; + let height = imageData.height; + let colorType = imageData.colorType; + let transColor = imageData.transColor; + let palette = imageData.palette; - var depth = imageData.depth; - var width = imageData.width; - var height = imageData.height; - var colorType = imageData.colorType; - var transColor = imageData.transColor; - var palette = imageData.palette; + let outdata = indata; // only different for 16 bits - var outdata = indata; // only different for 16 bits - - if (colorType === 3) { // paletted + if (colorType === 3) { + // paletted dePalette(indata, outdata, width, height, palette); - } - else { + } else { if (transColor) { replaceTransparentColor(indata, outdata, width, height, transColor); } diff --git a/lib/interlace.js b/lib/interlace.js index 734ea23..a035cb1 100644 --- a/lib/interlace.js +++ b/lib/interlace.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; // Adam 7 // 0 1 2 3 4 5 6 7 @@ -11,61 +11,65 @@ // 6 5 6 5 6 5 6 5 6 // 7 7 7 7 7 7 7 7 7 - -var imagePasses = [ - { // pass 1 - 1px +let imagePasses = [ + { + // pass 1 - 1px x: [0], - y: [0] + y: [0], }, - { // pass 2 - 1px + { + // pass 2 - 1px x: [4], - y: [0] + y: [0], }, - { // pass 3 - 2px + { + // pass 3 - 2px x: [0, 4], - y: [4] + y: [4], }, - { // pass 4 - 4px + { + // pass 4 - 4px x: [2, 6], - y: [0, 4] + y: [0, 4], }, - { // pass 5 - 8px + { + // pass 5 - 8px x: [0, 2, 4, 6], - y: [2, 6] + y: [2, 6], }, - { // pass 6 - 16px + { + // pass 6 - 16px x: [1, 3, 5, 7], - y: [0, 2, 4, 6] + y: [0, 2, 4, 6], }, - { // pass 7 - 32px + { + // pass 7 - 32px x: [0, 1, 2, 3, 4, 5, 6, 7], - y: [1, 3, 5, 7] - } + y: [1, 3, 5, 7], + }, ]; -exports.getImagePasses = function(width, height) { - var images = []; - var xLeftOver = width % 8; - var yLeftOver = height % 8; - var xRepeats = (width - xLeftOver) / 8; - var yRepeats = (height - yLeftOver) / 8; - for (var i = 0; i < imagePasses.length; i++) { - var pass = imagePasses[i]; - var passWidth = xRepeats * pass.x.length; - var passHeight = yRepeats * pass.y.length; - for (var j = 0; j < pass.x.length; j++) { +exports.getImagePasses = function (width, height) { + let images = []; + let xLeftOver = width % 8; + let yLeftOver = height % 8; + let xRepeats = (width - xLeftOver) / 8; + let yRepeats = (height - yLeftOver) / 8; + for (let i = 0; i < imagePasses.length; i++) { + let pass = imagePasses[i]; + let passWidth = xRepeats * pass.x.length; + let passHeight = yRepeats * pass.y.length; + for (let j = 0; j < pass.x.length; j++) { if (pass.x[j] < xLeftOver) { passWidth++; - } - else { + } else { break; } } - for (j = 0; j < pass.y.length; j++) { + for (let j = 0; j < pass.y.length; j++) { if (pass.y[j] < yLeftOver) { passHeight++; - } - else { + } else { break; } } @@ -76,12 +80,16 @@ exports.getImagePasses = function(width, height) { return images; }; -exports.getInterlaceIterator = function(width) { - return function(x, y, pass) { - var outerXLeftOver = x % imagePasses[pass].x.length; - var outerX = (((x - outerXLeftOver) / imagePasses[pass].x.length) * 8) + imagePasses[pass].x[outerXLeftOver]; - var outerYLeftOver = y % imagePasses[pass].y.length; - var outerY = (((y - outerYLeftOver) / imagePasses[pass].y.length) * 8) + imagePasses[pass].y[outerYLeftOver]; - return (outerX * 4) + (outerY * width * 4); +exports.getInterlaceIterator = function (width) { + return function (x, y, pass) { + let outerXLeftOver = x % imagePasses[pass].x.length; + let outerX = + ((x - outerXLeftOver) / imagePasses[pass].x.length) * 8 + + imagePasses[pass].x[outerXLeftOver]; + let outerYLeftOver = y % imagePasses[pass].y.length; + let outerY = + ((y - outerYLeftOver) / imagePasses[pass].y.length) * 8 + + imagePasses[pass].y[outerYLeftOver]; + return outerX * 4 + outerY * width * 4; }; -}; \ No newline at end of file +}; diff --git a/lib/packer-async.js b/lib/packer-async.js index 5be2653..f3df73a 100644 --- a/lib/packer-async.js +++ b/lib/packer-async.js @@ -1,45 +1,50 @@ -'use strict'; +"use strict"; -var util = require('util'); -var Stream = require('stream'); -var constants = require('./constants'); -var Packer = require('./packer'); +let util = require("util"); +let Stream = require("stream"); +let constants = require("./constants"); +let Packer = require("./packer"); -var PackerAsync = module.exports = function(opt) { +let PackerAsync = (module.exports = function (opt) { Stream.call(this); - var options = opt || {}; + let options = opt || {}; this._packer = new Packer(options); this._deflate = this._packer.createDeflate(); this.readable = true; -}; +}); util.inherits(PackerAsync, Stream); - -PackerAsync.prototype.pack = function(data, width, height, gamma) { +PackerAsync.prototype.pack = function (data, width, height, gamma) { // Signature - this.emit('data', Buffer.from(constants.PNG_SIGNATURE)); - this.emit('data', this._packer.packIHDR(width, height)); + this.emit("data", Buffer.from(constants.PNG_SIGNATURE)); + this.emit("data", this._packer.packIHDR(width, height)); if (gamma) { - this.emit('data', this._packer.packGAMA(gamma)); + this.emit("data", this._packer.packGAMA(gamma)); } - var filteredData = this._packer.filterData(data, width, height); + let filteredData = this._packer.filterData(data, width, height); // compress it - this._deflate.on('error', this.emit.bind(this, 'error')); + this._deflate.on("error", this.emit.bind(this, "error")); - this._deflate.on('data', function(compressedData) { - this.emit('data', this._packer.packIDAT(compressedData)); - }.bind(this)); + this._deflate.on( + "data", + function (compressedData) { + this.emit("data", this._packer.packIDAT(compressedData)); + }.bind(this) + ); - this._deflate.on('end', function() { - this.emit('data', this._packer.packIEND()); - this.emit('end'); - }.bind(this)); + this._deflate.on( + "end", + function () { + this.emit("data", this._packer.packIEND()); + this.emit("end"); + }.bind(this) + ); this._deflate.end(filteredData); }; diff --git a/lib/packer-sync.js b/lib/packer-sync.js index ad60a28..f5ab0b3 100644 --- a/lib/packer-sync.js +++ b/lib/packer-sync.js @@ -1,24 +1,25 @@ -'use strict'; +"use strict"; -var hasSyncZlib = true; -var zlib = require('zlib'); +let hasSyncZlib = true; +let zlib = require("zlib"); if (!zlib.deflateSync) { hasSyncZlib = false; } -var constants = require('./constants'); -var Packer = require('./packer'); - -module.exports = function(metaData, opt) { +let constants = require("./constants"); +let Packer = require("./packer"); +module.exports = function (metaData, opt) { if (!hasSyncZlib) { - throw new Error('To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0'); + throw new Error( + "To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0" + ); } - var options = opt || {}; + let options = opt || {}; - var packer = new Packer(options); + let packer = new Packer(options); - var chunks = []; + let chunks = []; // Signature chunks.push(Buffer.from(constants.PNG_SIGNATURE)); @@ -30,14 +31,21 @@ module.exports = function(metaData, opt) { chunks.push(packer.packGAMA(metaData.gamma)); } - var filteredData = packer.filterData(metaData.data, metaData.width, metaData.height); + let filteredData = packer.filterData( + metaData.data, + metaData.width, + metaData.height + ); // compress it - var compressedData = zlib.deflateSync(filteredData, packer.getDeflateOptions()); + let compressedData = zlib.deflateSync( + filteredData, + packer.getDeflateOptions() + ); filteredData = null; if (!compressedData || !compressedData.length) { - throw new Error('bad png - invalid compressed data response'); + throw new Error("bad png - invalid compressed data response"); } chunks.push(packer.packIDAT(compressedData)); diff --git a/lib/packer.js b/lib/packer.js index 1f0c515..4aba12c 100644 --- a/lib/packer.js +++ b/lib/packer.js @@ -1,71 +1,91 @@ -'use strict'; +"use strict"; -var constants = require('./constants'); -var CrcStream = require('./crc'); -var bitPacker = require('./bitpacker'); -var filter = require('./filter-pack'); -var zlib = require('zlib'); +let constants = require("./constants"); +let CrcStream = require("./crc"); +let bitPacker = require("./bitpacker"); +let filter = require("./filter-pack"); +let zlib = require("zlib"); -var Packer = module.exports = function(options) { +let Packer = (module.exports = function (options) { this._options = options; options.deflateChunkSize = options.deflateChunkSize || 32 * 1024; - options.deflateLevel = options.deflateLevel != null ? options.deflateLevel : 9; - options.deflateStrategy = options.deflateStrategy != null ? options.deflateStrategy : 3; - options.inputHasAlpha = options.inputHasAlpha != null ? options.inputHasAlpha : true; + options.deflateLevel = + options.deflateLevel != null ? options.deflateLevel : 9; + options.deflateStrategy = + options.deflateStrategy != null ? options.deflateStrategy : 3; + options.inputHasAlpha = + options.inputHasAlpha != null ? options.inputHasAlpha : true; options.deflateFactory = options.deflateFactory || zlib.createDeflate; options.bitDepth = options.bitDepth || 8; // This is outputColorType - options.colorType = (typeof options.colorType === 'number') ? options.colorType : constants.COLORTYPE_COLOR_ALPHA; - options.inputColorType = (typeof options.inputColorType === 'number') ? options.inputColorType : constants.COLORTYPE_COLOR_ALPHA; + options.colorType = + typeof options.colorType === "number" + ? options.colorType + : constants.COLORTYPE_COLOR_ALPHA; + options.inputColorType = + typeof options.inputColorType === "number" + ? options.inputColorType + : constants.COLORTYPE_COLOR_ALPHA; - if ([ - constants.COLORTYPE_GRAYSCALE, - constants.COLORTYPE_COLOR, - constants.COLORTYPE_COLOR_ALPHA, - constants.COLORTYPE_ALPHA - ].indexOf(options.colorType) === -1) { - throw new Error('option color type:' + options.colorType + ' is not supported at present'); + if ( + [ + constants.COLORTYPE_GRAYSCALE, + constants.COLORTYPE_COLOR, + constants.COLORTYPE_COLOR_ALPHA, + constants.COLORTYPE_ALPHA, + ].indexOf(options.colorType) === -1 + ) { + throw new Error( + "option color type:" + options.colorType + " is not supported at present" + ); } - if ([ - constants.COLORTYPE_GRAYSCALE, - constants.COLORTYPE_COLOR, - constants.COLORTYPE_COLOR_ALPHA, - constants.COLORTYPE_ALPHA - ].indexOf(options.inputColorType) === -1) { - throw new Error('option input color type:' + options.inputColorType + ' is not supported at present'); + if ( + [ + constants.COLORTYPE_GRAYSCALE, + constants.COLORTYPE_COLOR, + constants.COLORTYPE_COLOR_ALPHA, + constants.COLORTYPE_ALPHA, + ].indexOf(options.inputColorType) === -1 + ) { + throw new Error( + "option input color type:" + + options.inputColorType + + " is not supported at present" + ); } if (options.bitDepth !== 8 && options.bitDepth !== 16) { - throw new Error('option bit depth:' + options.bitDepth + ' is not supported at present'); + throw new Error( + "option bit depth:" + options.bitDepth + " is not supported at present" + ); } -}; +}); -Packer.prototype.getDeflateOptions = function() { +Packer.prototype.getDeflateOptions = function () { return { chunkSize: this._options.deflateChunkSize, level: this._options.deflateLevel, - strategy: this._options.deflateStrategy + strategy: this._options.deflateStrategy, }; }; -Packer.prototype.createDeflate = function() { +Packer.prototype.createDeflate = function () { return this._options.deflateFactory(this.getDeflateOptions()); }; -Packer.prototype.filterData = function(data, width, height) { +Packer.prototype.filterData = function (data, width, height) { // convert to correct format for filtering (e.g. right bpp and bit depth) - var packedData = bitPacker(data, width, height, this._options); + let packedData = bitPacker(data, width, height, this._options); // filter pixel data - var bpp = constants.COLORTYPE_TO_BPP_MAP[this._options.colorType]; - var filteredData = filter(packedData, width, height, this._options, bpp); + let bpp = constants.COLORTYPE_TO_BPP_MAP[this._options.colorType]; + let filteredData = filter(packedData, width, height, this._options, bpp); return filteredData; }; -Packer.prototype._packChunk = function(type, data) { - - var len = (data ? data.length : 0); - var buf = Buffer.alloc(len + 12); +Packer.prototype._packChunk = function (type, data) { + let len = data ? data.length : 0; + let buf = Buffer.alloc(len + 12); buf.writeUInt32BE(len, 0); buf.writeUInt32BE(type, 4); @@ -74,19 +94,21 @@ Packer.prototype._packChunk = function(type, data) { data.copy(buf, 8); } - buf.writeInt32BE(CrcStream.crc32(buf.slice(4, buf.length - 4)), buf.length - 4); + buf.writeInt32BE( + CrcStream.crc32(buf.slice(4, buf.length - 4)), + buf.length - 4 + ); return buf; }; -Packer.prototype.packGAMA = function(gamma) { - var buf = Buffer.alloc(4); +Packer.prototype.packGAMA = function (gamma) { + let buf = Buffer.alloc(4); buf.writeUInt32BE(Math.floor(gamma * constants.GAMMA_DIVISION), 0); return this._packChunk(constants.TYPE_gAMA, buf); }; -Packer.prototype.packIHDR = function(width, height) { - - var buf = Buffer.alloc(13); +Packer.prototype.packIHDR = function (width, height) { + let buf = Buffer.alloc(13); buf.writeUInt32BE(width, 0); buf.writeUInt32BE(height, 4); buf[8] = this._options.bitDepth; // Bit depth @@ -98,10 +120,10 @@ Packer.prototype.packIHDR = function(width, height) { return this._packChunk(constants.TYPE_IHDR, buf); }; -Packer.prototype.packIDAT = function(data) { +Packer.prototype.packIDAT = function (data) { return this._packChunk(constants.TYPE_IDAT, data); }; -Packer.prototype.packIEND = function() { +Packer.prototype.packIEND = function () { return this._packChunk(constants.TYPE_IEND, null); }; diff --git a/lib/paeth-predictor.js b/lib/paeth-predictor.js index 74d254e..9634497 100644 --- a/lib/paeth-predictor.js +++ b/lib/paeth-predictor.js @@ -1,17 +1,16 @@ -'use strict'; - -module.exports = function paethPredictor(left, above, upLeft) { - - var paeth = left + above - upLeft; - var pLeft = Math.abs(paeth - left); - var pAbove = Math.abs(paeth - above); - var pUpLeft = Math.abs(paeth - upLeft); - - if (pLeft <= pAbove && pLeft <= pUpLeft) { - return left; - } - if (pAbove <= pUpLeft) { - return above; - } - return upLeft; -}; \ No newline at end of file +"use strict"; + +module.exports = function paethPredictor(left, above, upLeft) { + let paeth = left + above - upLeft; + let pLeft = Math.abs(paeth - left); + let pAbove = Math.abs(paeth - above); + let pUpLeft = Math.abs(paeth - upLeft); + + if (pLeft <= pAbove && pLeft <= pUpLeft) { + return left; + } + if (pAbove <= pUpLeft) { + return above; + } + return upLeft; +}; diff --git a/lib/parser-async.js b/lib/parser-async.js index 4ff599a..a69d153 100644 --- a/lib/parser-async.js +++ b/lib/parser-async.js @@ -1,39 +1,37 @@ -'use strict'; +"use strict"; -var util = require('util'); -var zlib = require('zlib'); -var ChunkStream = require('./chunkstream'); -var FilterAsync = require('./filter-parse-async'); -var Parser = require('./parser'); -var bitmapper = require('./bitmapper'); -var formatNormaliser = require('./format-normaliser'); +let util = require("util"); +let zlib = require("zlib"); +let ChunkStream = require("./chunkstream"); +let FilterAsync = require("./filter-parse-async"); +let Parser = require("./parser"); +let bitmapper = require("./bitmapper"); +let formatNormaliser = require("./format-normaliser"); -var ParserAsync = module.exports = function(options) { +let ParserAsync = (module.exports = function (options) { ChunkStream.call(this); this._parser = new Parser(options, { read: this.read.bind(this), error: this._handleError.bind(this), metadata: this._handleMetaData.bind(this), - gamma: this.emit.bind(this, 'gamma'), + gamma: this.emit.bind(this, "gamma"), palette: this._handlePalette.bind(this), transColor: this._handleTransColor.bind(this), finished: this._finished.bind(this), inflateData: this._inflateData.bind(this), simpleTransparency: this._simpleTransparency.bind(this), - headersFinished: this._headersFinished.bind(this) + headersFinished: this._headersFinished.bind(this), }); this._options = options; this.writable = true; this._parser.start(); -}; +}); util.inherits(ParserAsync, ChunkStream); - -ParserAsync.prototype._handleError = function(err) { - - this.emit('error', err); +ParserAsync.prototype._handleError = function (err) { + this.emit("error", err); this.writable = false; @@ -48,42 +46,47 @@ ParserAsync.prototype._handleError = function(err) { // For backward compatibility with Node 7 and below. // Suppress errors due to _inflate calling write() even after // it's destroy()'ed. - this._filter.on('error', function() {}); + this._filter.on("error", function () {}); } this.errord = true; }; -ParserAsync.prototype._inflateData = function(data) { +ParserAsync.prototype._inflateData = function (data) { if (!this._inflate) { if (this._bitmapInfo.interlace) { this._inflate = zlib.createInflate(); - this._inflate.on('error', this.emit.bind(this, 'error')); - this._filter.on('complete', this._complete.bind(this)); + this._inflate.on("error", this.emit.bind(this, "error")); + this._filter.on("complete", this._complete.bind(this)); this._inflate.pipe(this._filter); - } - else { - var rowSize = ((this._bitmapInfo.width * this._bitmapInfo.bpp * this._bitmapInfo.depth + 7) >> 3) + 1; - var imageSize = rowSize * this._bitmapInfo.height; - var chunkSize = Math.max(imageSize, zlib.Z_MIN_CHUNK); + } else { + let rowSize = + ((this._bitmapInfo.width * + this._bitmapInfo.bpp * + this._bitmapInfo.depth + + 7) >> + 3) + + 1; + let imageSize = rowSize * this._bitmapInfo.height; + let chunkSize = Math.max(imageSize, zlib.Z_MIN_CHUNK); this._inflate = zlib.createInflate({ chunkSize: chunkSize }); - var leftToInflate = imageSize; + let leftToInflate = imageSize; - var emitError = this.emit.bind(this, 'error'); - this._inflate.on('error', function(err) { + let emitError = this.emit.bind(this, "error"); + this._inflate.on("error", function (err) { if (!leftToInflate) { return; } emitError(err); }); - this._filter.on('complete', this._complete.bind(this)); + this._filter.on("complete", this._complete.bind(this)); - var filterWrite = this._filter.write.bind(this._filter); - this._inflate.on('data', function(chunk) { + let filterWrite = this._filter.write.bind(this._filter); + this._inflate.on("data", function (chunk) { if (!leftToInflate) { return; } @@ -97,67 +100,66 @@ ParserAsync.prototype._inflateData = function(data) { filterWrite(chunk); }); - this._inflate.on('end', this._filter.end.bind(this._filter)); + this._inflate.on("end", this._filter.end.bind(this._filter)); } } this._inflate.write(data); }; -ParserAsync.prototype._handleMetaData = function(metaData) { +ParserAsync.prototype._handleMetaData = function (metaData) { this._metaData = metaData; this._bitmapInfo = Object.create(metaData); this._filter = new FilterAsync(this._bitmapInfo); }; -ParserAsync.prototype._handleTransColor = function(transColor) { +ParserAsync.prototype._handleTransColor = function (transColor) { this._bitmapInfo.transColor = transColor; }; -ParserAsync.prototype._handlePalette = function(palette) { +ParserAsync.prototype._handlePalette = function (palette) { this._bitmapInfo.palette = palette; }; -ParserAsync.prototype._simpleTransparency = function() { +ParserAsync.prototype._simpleTransparency = function () { this._metaData.alpha = true; }; -ParserAsync.prototype._headersFinished = function() { +ParserAsync.prototype._headersFinished = function () { // Up until this point, we don't know if we have a tRNS chunk (alpha) // so we can't emit metadata any earlier - this.emit('metadata', this._metaData); + this.emit("metadata", this._metaData); }; -ParserAsync.prototype._finished = function() { +ParserAsync.prototype._finished = function () { if (this.errord) { return; } if (!this._inflate) { - this.emit('error', 'No Inflate block'); - } - else { + this.emit("error", "No Inflate block"); + } else { // no more data to inflate this._inflate.end(); } }; -ParserAsync.prototype._complete = function(filteredData) { - +ParserAsync.prototype._complete = function (filteredData) { if (this.errord) { return; } - try { - var bitmapData = bitmapper.dataToBitMap(filteredData, this._bitmapInfo); + let normalisedBitmapData; - var normalisedBitmapData = formatNormaliser(bitmapData, this._bitmapInfo); + try { + let bitmapData = bitmapper.dataToBitMap(filteredData, this._bitmapInfo); + + normalisedBitmapData = formatNormaliser(bitmapData, this._bitmapInfo); bitmapData = null; - } - catch (ex) { + } catch (ex) { this._handleError(ex); return; } - this.emit('parsed', normalisedBitmapData); + this.emit("parsed", normalisedBitmapData); }; diff --git a/lib/parser-sync.js b/lib/parser-sync.js index ed899a4..e79796b 100644 --- a/lib/parser-sync.js +++ b/lib/parser-sync.js @@ -1,30 +1,30 @@ -'use strict'; +"use strict"; -var hasSyncZlib = true; -var zlib = require('zlib'); -var inflateSync = require('./sync-inflate'); +let hasSyncZlib = true; +let zlib = require("zlib"); +let inflateSync = require("./sync-inflate"); if (!zlib.deflateSync) { hasSyncZlib = false; } -var SyncReader = require('./sync-reader'); -var FilterSync = require('./filter-parse-sync'); -var Parser = require('./parser'); -var bitmapper = require('./bitmapper'); -var formatNormaliser = require('./format-normaliser'); - - -module.exports = function(buffer, options) { +let SyncReader = require("./sync-reader"); +let FilterSync = require("./filter-parse-sync"); +let Parser = require("./parser"); +let bitmapper = require("./bitmapper"); +let formatNormaliser = require("./format-normaliser"); +module.exports = function (buffer, options) { if (!hasSyncZlib) { - throw new Error('To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0'); + throw new Error( + "To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0" + ); } - var err; + let err; function handleError(_err_) { err = _err_; } - var metaData; + let metaData; function handleMetaData(_metaData_) { metaData = _metaData_; } @@ -41,19 +41,19 @@ module.exports = function(buffer, options) { metaData.alpha = true; } - var gamma; + let gamma; function handleGamma(_gamma_) { gamma = _gamma_; } - var inflateDataList = []; + let inflateDataList = []; function handleInflateData(inflatedData) { inflateDataList.push(inflatedData); } - var reader = new SyncReader(buffer); + let reader = new SyncReader(buffer); - var parser = new Parser(options, { + let parser = new Parser(options, { read: reader.read.bind(reader), error: handleError, metadata: handleMetaData, @@ -61,7 +61,7 @@ module.exports = function(buffer, options) { palette: handlePalette, transColor: handleTransColor, inflateData: handleInflateData, - simpleTransparency: handleSimpleTransparency + simpleTransparency: handleSimpleTransparency, }); parser.start(); @@ -72,31 +72,34 @@ module.exports = function(buffer, options) { } //join together the inflate datas - var inflateData = Buffer.concat(inflateDataList); + let inflateData = Buffer.concat(inflateDataList); inflateDataList.length = 0; - var inflatedData; + let inflatedData; if (metaData.interlace) { inflatedData = zlib.inflateSync(inflateData); - } - else { - var rowSize = ((metaData.width * metaData.bpp * metaData.depth + 7) >> 3) + 1; - var imageSize = rowSize * metaData.height; - inflatedData = inflateSync(inflateData, { chunkSize: imageSize, maxLength: imageSize }); + } else { + let rowSize = + ((metaData.width * metaData.bpp * metaData.depth + 7) >> 3) + 1; + let imageSize = rowSize * metaData.height; + inflatedData = inflateSync(inflateData, { + chunkSize: imageSize, + maxLength: imageSize, + }); } inflateData = null; if (!inflatedData || !inflatedData.length) { - throw new Error('bad png - invalid inflate data response'); + throw new Error("bad png - invalid inflate data response"); } - var unfilteredData = FilterSync.process(inflatedData, metaData); + let unfilteredData = FilterSync.process(inflatedData, metaData); inflateData = null; - var bitmapData = bitmapper.dataToBitMap(unfilteredData, metaData); + let bitmapData = bitmapper.dataToBitMap(unfilteredData, metaData); unfilteredData = null; - var normalisedBitmapData = formatNormaliser(bitmapData, metaData); + let normalisedBitmapData = formatNormaliser(bitmapData, metaData); metaData.data = normalisedBitmapData; metaData.gamma = gamma || 0; diff --git a/lib/parser.js b/lib/parser.js index 21a8109..51a8f2a 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,11 +1,9 @@ -'use strict'; +"use strict"; -var constants = require('./constants'); -var CrcCalculator = require('./crc'); - - -var Parser = module.exports = function(options, dependencies) { +let constants = require("./constants"); +let CrcCalculator = require("./crc"); +let Parser = (module.exports = function (options, dependencies) { this._options = options; options.checkCRC = options.checkCRC !== false; @@ -35,49 +33,45 @@ var Parser = module.exports = function(options, dependencies) { this.inflateData = dependencies.inflateData; this.finished = dependencies.finished; this.simpleTransparency = dependencies.simpleTransparency; - this.headersFinished = dependencies.headersFinished || function() {}; + this.headersFinished = dependencies.headersFinished || function () {}; +}); + +Parser.prototype.start = function () { + this.read(constants.PNG_SIGNATURE.length, this._parseSignature.bind(this)); }; -Parser.prototype.start = function() { - this.read(constants.PNG_SIGNATURE.length, - this._parseSignature.bind(this) - ); -}; +Parser.prototype._parseSignature = function (data) { + let signature = constants.PNG_SIGNATURE; -Parser.prototype._parseSignature = function(data) { - - var signature = constants.PNG_SIGNATURE; - - for (var i = 0; i < signature.length; i++) { + for (let i = 0; i < signature.length; i++) { if (data[i] !== signature[i]) { - this.error(new Error('Invalid file signature')); + this.error(new Error("Invalid file signature")); return; } } this.read(8, this._parseChunkBegin.bind(this)); }; -Parser.prototype._parseChunkBegin = function(data) { - +Parser.prototype._parseChunkBegin = function (data) { // chunk content length - var length = data.readUInt32BE(0); + let length = data.readUInt32BE(0); // chunk type - var type = data.readUInt32BE(4); - var name = ''; - for (var i = 4; i < 8; i++) { + let type = data.readUInt32BE(4); + let name = ""; + for (let i = 4; i < 8; i++) { name += String.fromCharCode(data[i]); } //console.log('chunk ', name, length); // chunk flags - var ancillary = Boolean(data[4] & 0x20); // or critical + let ancillary = Boolean(data[4] & 0x20); // or critical // priv = Boolean(data[5] & 0x20), // or public // safeToCopy = Boolean(data[7] & 0x20); // or unsafe if (!this._hasIHDR && type !== constants.TYPE_IHDR) { - this.error(new Error('Expected IHDR on beggining')); + this.error(new Error("Expected IHDR on beggining")); return; } @@ -89,29 +83,28 @@ Parser.prototype._parseChunkBegin = function(data) { } if (!ancillary) { - this.error(new Error('Unsupported critical chunk type ' + name)); + this.error(new Error("Unsupported critical chunk type " + name)); return; } this.read(length + 4, this._skipChunk.bind(this)); }; -Parser.prototype._skipChunk = function(/*data*/) { +Parser.prototype._skipChunk = function (/*data*/) { this.read(8, this._parseChunkBegin.bind(this)); }; -Parser.prototype._handleChunkEnd = function() { +Parser.prototype._handleChunkEnd = function () { this.read(4, this._parseChunkEnd.bind(this)); }; -Parser.prototype._parseChunkEnd = function(data) { - - var fileCrc = data.readInt32BE(0); - var calcCrc = this._crc.crc32(); +Parser.prototype._parseChunkEnd = function (data) { + let fileCrc = data.readInt32BE(0); + let calcCrc = this._crc.crc32(); // check CRC if (this._options.checkCRC && calcCrc !== fileCrc) { - this.error(new Error('Crc error - ' + fileCrc + ' - ' + calcCrc)); + this.error(new Error("Crc error - " + fileCrc + " - " + calcCrc)); return; } @@ -120,50 +113,55 @@ Parser.prototype._parseChunkEnd = function(data) { } }; -Parser.prototype._handleIHDR = function(length) { +Parser.prototype._handleIHDR = function (length) { this.read(length, this._parseIHDR.bind(this)); }; -Parser.prototype._parseIHDR = function(data) { - +Parser.prototype._parseIHDR = function (data) { this._crc.write(data); - var width = data.readUInt32BE(0); - var height = data.readUInt32BE(4); - var depth = data[8]; - var colorType = data[9]; // bits: 1 palette, 2 color, 4 alpha - var compr = data[10]; - var filter = data[11]; - var interlace = data[12]; + let width = data.readUInt32BE(0); + let height = data.readUInt32BE(4); + let depth = data[8]; + let colorType = data[9]; // bits: 1 palette, 2 color, 4 alpha + let compr = data[10]; + let filter = data[11]; + let interlace = data[12]; // console.log(' width', width, 'height', height, // 'depth', depth, 'colorType', colorType, // 'compr', compr, 'filter', filter, 'interlace', interlace // ); - if (depth !== 8 && depth !== 4 && depth !== 2 && depth !== 1 && depth !== 16) { - this.error(new Error('Unsupported bit depth ' + depth)); + if ( + depth !== 8 && + depth !== 4 && + depth !== 2 && + depth !== 1 && + depth !== 16 + ) { + this.error(new Error("Unsupported bit depth " + depth)); return; } if (!(colorType in constants.COLORTYPE_TO_BPP_MAP)) { - this.error(new Error('Unsupported color type')); + this.error(new Error("Unsupported color type")); return; } if (compr !== 0) { - this.error(new Error('Unsupported compression method')); + this.error(new Error("Unsupported compression method")); return; } if (filter !== 0) { - this.error(new Error('Unsupported filter method')); + this.error(new Error("Unsupported filter method")); return; } if (interlace !== 0 && interlace !== 1) { - this.error(new Error('Unsupported interlace method')); + this.error(new Error("Unsupported interlace method")); return; } this._colorType = colorType; - var bpp = constants.COLORTYPE_TO_BPP_MAP[this._colorType]; + let bpp = constants.COLORTYPE_TO_BPP_MAP[this._colorType]; this._hasIHDR = true; @@ -176,30 +174,23 @@ Parser.prototype._parseIHDR = function(data) { color: Boolean(colorType & constants.COLORTYPE_COLOR), alpha: Boolean(colorType & constants.COLORTYPE_ALPHA), bpp: bpp, - colorType: colorType + colorType: colorType, }); this._handleChunkEnd(); }; - -Parser.prototype._handlePLTE = function(length) { +Parser.prototype._handlePLTE = function (length) { this.read(length, this._parsePLTE.bind(this)); }; -Parser.prototype._parsePLTE = function(data) { - +Parser.prototype._parsePLTE = function (data) { this._crc.write(data); - var entries = Math.floor(data.length / 3); + let entries = Math.floor(data.length / 3); // console.log('Palette:', entries); - for (var i = 0; i < entries; i++) { - this._palette.push([ - data[i * 3], - data[i * 3 + 1], - data[i * 3 + 2], - 0xff - ]); + for (let i = 0; i < entries; i++) { + this._palette.push([data[i * 3], data[i * 3 + 1], data[i * 3 + 2], 0xff]); } this.palette(this._palette); @@ -207,25 +198,24 @@ Parser.prototype._parsePLTE = function(data) { this._handleChunkEnd(); }; -Parser.prototype._handleTRNS = function(length) { +Parser.prototype._handleTRNS = function (length) { this.simpleTransparency(); this.read(length, this._parseTRNS.bind(this)); }; -Parser.prototype._parseTRNS = function(data) { - +Parser.prototype._parseTRNS = function (data) { this._crc.write(data); // palette if (this._colorType === constants.COLORTYPE_PALETTE_COLOR) { if (this._palette.length === 0) { - this.error(new Error('Transparency chunk must be after palette')); + this.error(new Error("Transparency chunk must be after palette")); return; } if (data.length > this._palette.length) { - this.error(new Error('More transparent colors than palette size')); + this.error(new Error("More transparent colors than palette size")); return; } - for (var i = 0; i < data.length; i++) { + for (let i = 0; i < data.length; i++) { this._palette[i][3] = data[i]; } this.palette(this._palette); @@ -238,54 +228,57 @@ Parser.prototype._parseTRNS = function(data) { this.transColor([data.readUInt16BE(0)]); } if (this._colorType === constants.COLORTYPE_COLOR) { - this.transColor([data.readUInt16BE(0), data.readUInt16BE(2), data.readUInt16BE(4)]); + this.transColor([ + data.readUInt16BE(0), + data.readUInt16BE(2), + data.readUInt16BE(4), + ]); } this._handleChunkEnd(); }; -Parser.prototype._handleGAMA = function(length) { +Parser.prototype._handleGAMA = function (length) { this.read(length, this._parseGAMA.bind(this)); }; -Parser.prototype._parseGAMA = function(data) { - +Parser.prototype._parseGAMA = function (data) { this._crc.write(data); this.gamma(data.readUInt32BE(0) / constants.GAMMA_DIVISION); this._handleChunkEnd(); }; -Parser.prototype._handleIDAT = function(length) { +Parser.prototype._handleIDAT = function (length) { if (!this._emittedHeadersFinished) { this._emittedHeadersFinished = true; this.headersFinished(); } this.read(-length, this._parseIDAT.bind(this, length)); }; -Parser.prototype._parseIDAT = function(length, data) { - +Parser.prototype._parseIDAT = function (length, data) { this._crc.write(data); - if (this._colorType === constants.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) { - throw new Error('Expected palette not found'); + if ( + this._colorType === constants.COLORTYPE_PALETTE_COLOR && + this._palette.length === 0 + ) { + throw new Error("Expected palette not found"); } this.inflateData(data); - var leftOverLength = length - data.length; + let leftOverLength = length - data.length; if (leftOverLength > 0) { this._handleIDAT(leftOverLength); - } - else { + } else { this._handleChunkEnd(); } }; -Parser.prototype._handleIEND = function(length) { +Parser.prototype._handleIEND = function (length) { this.read(length, this._parseIEND.bind(this)); }; -Parser.prototype._parseIEND = function(data) { - +Parser.prototype._parseIEND = function (data) { this._crc.write(data); this._hasIEND = true; diff --git a/lib/png-sync.js b/lib/png-sync.js index 81d04a4..68cac9b 100644 --- a/lib/png-sync.js +++ b/lib/png-sync.js @@ -1,16 +1,12 @@ -'use strict'; +"use strict"; +let parse = require("./parser-sync"); +let pack = require("./packer-sync"); -var parse = require('./parser-sync'); -var pack = require('./packer-sync'); - - -exports.read = function(buffer, options) { - +exports.read = function (buffer, options) { return parse(buffer, options || {}); }; -exports.write = function(png, options) { - +exports.write = function (png, options) { return pack(png, options); }; diff --git a/lib/png.js b/lib/png.js index 8cf3988..0b8af3f 100644 --- a/lib/png.js +++ b/lib/png.js @@ -1,13 +1,12 @@ -'use strict'; +"use strict"; -var util = require('util'); -var Stream = require('stream'); -var Parser = require('./parser-async'); -var Packer = require('./packer-async'); -var PNGSync = require('./png-sync'); +let util = require("util"); +let Stream = require("stream"); +let Parser = require("./parser-async"); +let Packer = require("./packer-async"); +let PNGSync = require("./png-sync"); - -var PNG = exports.PNG = function(options) { +let PNG = (exports.PNG = function (options) { Stream.call(this); options = options || {}; // eslint-disable-line no-param-reassign @@ -16,8 +15,10 @@ var PNG = exports.PNG = function(options) { this.width = options.width | 0; this.height = options.height | 0; - this.data = this.width > 0 && this.height > 0 ? - Buffer.alloc(4 * this.width * this.height) : null; + this.data = + this.width > 0 && this.height > 0 + ? Buffer.alloc(4 * this.width * this.height) + : null; if (options.fill && this.data) { this.data.fill(0); @@ -28,95 +29,96 @@ var PNG = exports.PNG = function(options) { this._parser = new Parser(options); - this._parser.on('error', this.emit.bind(this, 'error')); - this._parser.on('close', this._handleClose.bind(this)); - this._parser.on('metadata', this._metadata.bind(this)); - this._parser.on('gamma', this._gamma.bind(this)); - this._parser.on('parsed', function(data) { - this.data = data; - this.emit('parsed', data); - }.bind(this)); + this._parser.on("error", this.emit.bind(this, "error")); + this._parser.on("close", this._handleClose.bind(this)); + this._parser.on("metadata", this._metadata.bind(this)); + this._parser.on("gamma", this._gamma.bind(this)); + this._parser.on( + "parsed", + function (data) { + this.data = data; + this.emit("parsed", data); + }.bind(this) + ); this._packer = new Packer(options); - this._packer.on('data', this.emit.bind(this, 'data')); - this._packer.on('end', this.emit.bind(this, 'end')); - this._parser.on('close', this._handleClose.bind(this)); - this._packer.on('error', this.emit.bind(this, 'error')); - -}; + this._packer.on("data", this.emit.bind(this, "data")); + this._packer.on("end", this.emit.bind(this, "end")); + this._parser.on("close", this._handleClose.bind(this)); + this._packer.on("error", this.emit.bind(this, "error")); +}); util.inherits(PNG, Stream); PNG.sync = PNGSync; -PNG.prototype.pack = function() { - +PNG.prototype.pack = function () { if (!this.data || !this.data.length) { - this.emit('error', 'No data provided'); + this.emit("error", "No data provided"); return this; } - process.nextTick(function() { - this._packer.pack(this.data, this.width, this.height, this.gamma); - }.bind(this)); + process.nextTick( + function () { + this._packer.pack(this.data, this.width, this.height, this.gamma); + }.bind(this) + ); return this; }; - -PNG.prototype.parse = function(data, callback) { - +PNG.prototype.parse = function (data, callback) { if (callback) { - var onParsed, onError; + let onParsed, onError; - onParsed = function(parsedData) { - this.removeListener('error', onError); + onParsed = function (parsedData) { + this.removeListener("error", onError); this.data = parsedData; callback(null, this); }.bind(this); - onError = function(err) { - this.removeListener('parsed', onParsed); + onError = function (err) { + this.removeListener("parsed", onParsed); callback(err, null); }.bind(this); - this.once('parsed', onParsed); - this.once('error', onError); + this.once("parsed", onParsed); + this.once("error", onError); } this.end(data); return this; }; -PNG.prototype.write = function(data) { +PNG.prototype.write = function (data) { this._parser.write(data); return true; }; -PNG.prototype.end = function(data) { +PNG.prototype.end = function (data) { this._parser.end(data); }; -PNG.prototype._metadata = function(metadata) { +PNG.prototype._metadata = function (metadata) { this.width = metadata.width; this.height = metadata.height; - this.emit('metadata', metadata); + this.emit("metadata", metadata); }; -PNG.prototype._gamma = function(gamma) { +PNG.prototype._gamma = function (gamma) { this.gamma = gamma; }; -PNG.prototype._handleClose = function() { +PNG.prototype._handleClose = function () { if (!this._parser.writable && !this._packer.readable) { - this.emit('close'); + this.emit("close"); } }; - -PNG.bitblt = function(src, dst, srcX, srcY, width, height, deltaX, deltaY) { // eslint-disable-line max-params +PNG.bitblt = function (src, dst, srcX, srcY, width, height, deltaX, deltaY) { + // eslint-disable-line max-params // coerce pixel dimensions to integers (also coerces undefined -> 0): /* eslint-disable no-param-reassign */ srcX |= 0; @@ -127,16 +129,27 @@ PNG.bitblt = function(src, dst, srcX, srcY, width, height, deltaX, deltaY) { // deltaY |= 0; /* eslint-enable no-param-reassign */ - if (srcX > src.width || srcY > src.height || srcX + width > src.width || srcY + height > src.height) { - throw new Error('bitblt reading outside image'); + if ( + srcX > src.width || + srcY > src.height || + srcX + width > src.width || + srcY + height > src.height + ) { + throw new Error("bitblt reading outside image"); } - if (deltaX > dst.width || deltaY > dst.height || deltaX + width > dst.width || deltaY + height > dst.height) { - throw new Error('bitblt writing outside image'); + if ( + deltaX > dst.width || + deltaY > dst.height || + deltaX + width > dst.width || + deltaY + height > dst.height + ) { + throw new Error("bitblt writing outside image"); } - for (var y = 0; y < height; y++) { - src.data.copy(dst.data, + for (let y = 0; y < height; y++) { + src.data.copy( + dst.data, ((deltaY + y) * dst.width + deltaX) << 2, ((srcY + y) * src.width + srcX) << 2, ((srcY + y) * src.width + srcX + width) << 2 @@ -144,21 +157,29 @@ PNG.bitblt = function(src, dst, srcX, srcY, width, height, deltaX, deltaY) { // } }; - -PNG.prototype.bitblt = function(dst, srcX, srcY, width, height, deltaX, deltaY) { // eslint-disable-line max-params +PNG.prototype.bitblt = function ( + dst, + srcX, + srcY, + width, + height, + deltaX, + deltaY +) { + // eslint-disable-line max-params PNG.bitblt(this, dst, srcX, srcY, width, height, deltaX, deltaY); return this; }; -PNG.adjustGamma = function(src) { +PNG.adjustGamma = function (src) { if (src.gamma) { - for (var y = 0; y < src.height; y++) { - for (var x = 0; x < src.width; x++) { - var idx = (src.width * y + x) << 2; + for (let y = 0; y < src.height; y++) { + for (let x = 0; x < src.width; x++) { + let idx = (src.width * y + x) << 2; - for (var i = 0; i < 3; i++) { - var sample = src.data[idx + i] / 255; + for (let i = 0; i < 3; i++) { + let sample = src.data[idx + i] / 255; sample = Math.pow(sample, 1 / 2.2 / src.gamma); src.data[idx + i] = Math.round(sample * 255); } @@ -168,6 +189,6 @@ PNG.adjustGamma = function(src) { } }; -PNG.prototype.adjustGamma = function() { +PNG.prototype.adjustGamma = function () { PNG.adjustGamma(this); }; diff --git a/lib/sync-inflate.js b/lib/sync-inflate.js index 87c19a1..4da0d5f 100644 --- a/lib/sync-inflate.js +++ b/lib/sync-inflate.js @@ -1,10 +1,10 @@ -'use strict'; +"use strict"; -var assert = require('assert').ok; -var zlib = require('zlib'); -var util = require('util'); +let assert = require("assert").ok; +let zlib = require("zlib"); +let util = require("util"); -var kMaxLength = require('buffer').kMaxLength; +let kMaxLength = require("buffer").kMaxLength; function Inflate(opts) { if (!(this instanceof Inflate)) { @@ -44,23 +44,23 @@ function _close(engine, callback) { engine._handle = null; } -Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { - if (typeof asyncCb === 'function') { +Inflate.prototype._processChunk = function (chunk, flushFlag, asyncCb) { + if (typeof asyncCb === "function") { return zlib.Inflate._processChunk.call(this, chunk, flushFlag, asyncCb); } - var self = this; + let self = this; - var availInBefore = chunk && chunk.length; - var availOutBefore = this._chunkSize - this._offset; - var leftToInflate = this._maxLength; - var inOff = 0; + let availInBefore = chunk && chunk.length; + let availOutBefore = this._chunkSize - this._offset; + let leftToInflate = this._maxLength; + let inOff = 0; - var buffers = []; - var nread = 0; + let buffers = []; + let nread = 0; - var error; - this.on('error', function(err) { + let error; + this.on("error", function (err) { error = err; }); @@ -69,11 +69,11 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { return; } - var have = availOutBefore - availOutAfter; - assert(have >= 0, 'have should not go down'); + let have = availOutBefore - availOutAfter; + assert(have >= 0, "have should not go down"); if (have > 0) { - var out = self._buffer.slice(self._offset, self._offset + have); + let out = self._buffer.slice(self._offset, self._offset + have); self._offset += have; if (out.length > leftToInflate) { @@ -96,7 +96,7 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { } if (availOutAfter === 0) { - inOff += (availInBefore - availInAfter); + inOff += availInBefore - availInAfter; availInBefore = availInAfter; return true; @@ -105,15 +105,18 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { return false; } - assert(this._handle, 'zlib binding closed'); + assert(this._handle, "zlib binding closed"); + let res; do { - var res = this._handle.writeSync(flushFlag, + res = this._handle.writeSync( + flushFlag, chunk, // in inOff, // in_off availInBefore, // in_len this._buffer, // out this._offset, //out_off - availOutBefore); // out_len + availOutBefore + ); // out_len // Node 8 --> 9 compatibility check res = res || this._writeState; } while (!this._hadError && handleChunk(res[0], res[1])); @@ -124,10 +127,14 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { if (nread >= kMaxLength) { _close(this); - throw new RangeError('Cannot create final Buffer. It would be larger than 0x' + kMaxLength.toString(16) + ' bytes'); + throw new RangeError( + "Cannot create final Buffer. It would be larger than 0x" + + kMaxLength.toString(16) + + " bytes" + ); } - var buf = Buffer.concat(buffers, nread); + let buf = Buffer.concat(buffers, nread); _close(this); return buf; @@ -136,14 +143,14 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) { util.inherits(Inflate, zlib.Inflate); function zlibBufferSync(engine, buffer) { - if (typeof buffer === 'string') { + if (typeof buffer === "string") { buffer = Buffer.from(buffer); } if (!(buffer instanceof Buffer)) { - throw new TypeError('Not a string or buffer'); + throw new TypeError("Not a string or buffer"); } - var flushFlag = engine._finishFlushFlag; + let flushFlag = engine._finishFlushFlag; if (flushFlag == null) { flushFlag = zlib.Z_FINISH; } diff --git a/lib/sync-reader.js b/lib/sync-reader.js index 70ee2db..15cbd4c 100644 --- a/lib/sync-reader.js +++ b/lib/sync-reader.js @@ -1,51 +1,45 @@ -'use strict'; - -var SyncReader = module.exports = function(buffer) { +"use strict"; +let SyncReader = (module.exports = function (buffer) { this._buffer = buffer; this._reads = []; -}; - -SyncReader.prototype.read = function(length, callback) { +}); +SyncReader.prototype.read = function (length, callback) { this._reads.push({ length: Math.abs(length), // if length < 0 then at most this length allowLess: length < 0, - func: callback + func: callback, }); }; -SyncReader.prototype.process = function() { - +SyncReader.prototype.process = function () { // as long as there is any data and read requests while (this._reads.length > 0 && this._buffer.length) { + let read = this._reads[0]; - var read = this._reads[0]; - - if (this._buffer.length && (this._buffer.length >= read.length || read.allowLess)) { - + if ( + this._buffer.length && + (this._buffer.length >= read.length || read.allowLess) + ) { // ok there is any data so that we can satisfy this request this._reads.shift(); // == read - var buf = this._buffer; + let buf = this._buffer; this._buffer = buf.slice(read.length); read.func.call(this, buf.slice(0, read.length)); - - } - else { + } else { break; } - } if (this._reads.length > 0) { - return new Error('There are some read requests waitng on finished stream'); + return new Error("There are some read requests waitng on finished stream"); } if (this._buffer.length > 0) { - return new Error('unrecognised content at end of stream'); + return new Error("unrecognised content at end of stream"); } - }; diff --git a/package.json b/package.json index 0234ca6..4dfd8c8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "pngjs" ], "engines": { - "node": ">=8.0.0" + "node": ">=10.13.0" }, "main": "./lib/png.js", "directories": { @@ -39,14 +39,15 @@ "test": "test" }, "scripts": { - "build": "npm run prepublish", - "prepublish": "npm run browserify", + "build": "yarn prepublish", + "prepublish": "yarn browserify", "browserify": "browserify lib/png.js --standalone png > browser.js", - "coverage": "istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge", - "coverage-report": "npm run coverage && istanbul report html", + "coverage": "nyc tape test/*-spec.js nolarge", "coveralls": "cat ./coverage/lcov.info | coveralls", - "test": "npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare", - "lint": "eslint lib" + "test": "yarn lint && yarn prettier:check && tape test/*-spec.js | tap-dot && node test/run-compare", + "lint": "eslint .", + "prettier:write": "prettier --write .", + "prettier:check": "prettier --check ." }, "repository": { "type": "git", @@ -57,14 +58,18 @@ "url": "https://github.com/lukeapage/pngjs2/issues" }, "devDependencies": { - "browserify": "^14.5.0", + "browserify": "16.5.1", "buffer-equal": "1.0.0", - "connect": "^3.4.0", - "eslint": "^5.15.2", - "istanbul": "^0.4.4", + "connect": "3.4.0", + "coveralls": "3.0.11", + "eslint": "5.15.2", + "eslint-config-prettier": "6.10.1", + "istanbul": "0.4.4", + "nyc": "15.0.1", + "prettier": "2.0.4", "puppeteer": "1.20.0", - "serve-static": "^1.10.0", - "tap-dot": "^2.0.0", - "tape": "^4.0.2" + "serve-static": "1.10.0", + "tap-dot": "2.0.0", + "tape": "4.0.2" } } diff --git a/test/bg-spec.js b/test/bg-spec.js index 7ece2cb..6fc0b0e 100644 --- a/test/bg-spec.js +++ b/test/bg-spec.js @@ -1,26 +1,24 @@ #!/usr/bin/env node -var fs = require('fs'); -var PNG = require('../lib/png').PNG; -var test = require('tape'); -var bufferEqual = require('buffer-equal'); - -test('outputs background, created from scratch', function (t) { +let fs = require("fs"); +let PNG = require("../lib/png").PNG; +let test = require("tape"); +let bufferEqual = require("buffer-equal"); +test("outputs background, created from scratch", function (t) { t.timeoutAfter(1000 * 60 * 5); - var png = new PNG({ + let png = new PNG({ width: 10, height: 10, - filterType: -1 + filterType: -1, }); + for (let y = 0; y < png.height; y++) { + for (let x = 0; x < png.width; x++) { + let idx = (png.width * y + x) << 2; - for (var y = 0; y < png.height; y++) { - for (var x = 0; x < png.width; x++) { - var idx = (png.width * y + x) << 2; - - var col = x < (png.width >> 1) ^ y < (png.height >> 1) ? 0xe5 : 0xff; + let col = (x < png.width >> 1) ^ (y < png.height >> 1) ? 0xe5 : 0xff; png.data[idx] = col; png.data[idx + 1] = col; @@ -29,13 +27,14 @@ test('outputs background, created from scratch', function (t) { } } - png.pack().pipe(fs.createWriteStream(__dirname + '/bg.png')) + png + .pack() + .pipe(fs.createWriteStream(__dirname + "/bg.png")) .on("finish", function () { + let out = fs.readFileSync(__dirname + "/bg.png"); + let ref = fs.readFileSync(__dirname + "/bg-ref.png"); - var out = fs.readFileSync(__dirname + '/bg.png'); - var ref = fs.readFileSync(__dirname + '/bg-ref.png'); - - var isBufferEqual = bufferEqual(out, ref); + let isBufferEqual = bufferEqual(out, ref); t.ok(isBufferEqual, "compares with working file ok"); if (!isBufferEqual) { diff --git a/test/convert-images-spec.js b/test/convert-images-spec.js index ec8d1e9..205520a 100644 --- a/test/convert-images-spec.js +++ b/test/convert-images-spec.js @@ -1,35 +1,44 @@ -var fs = require('fs'); -var PNG = require('../lib/png').PNG; -var test = require('tape'); +let fs = require("fs"); +let PNG = require("../lib/png").PNG; +let test = require("tape"); -var noLargeOption = process.argv.indexOf("nolarge") >= 0; +let noLargeOption = process.argv.indexOf("nolarge") >= 0; -fs.readdir(__dirname + '/in/', function (err, files) { +fs.readdir(__dirname + "/in/", function (err, files) { if (err) throw err; files = files.filter(function (file) { - return (!noLargeOption || !file.match(/large/i)) && Boolean(file.match(/\.png$/i)); + return ( + (!noLargeOption || !file.match(/large/i)) && + Boolean(file.match(/\.png$/i)) + ); }); console.log("Converting images"); files.forEach(function (file) { - - var expectedError = false; + let expectedError = false; if (file.match(/^x/)) { expectedError = true; } - test('convert sync - ' + file, function (t) { - + test("convert sync - " + file, function (t) { t.timeoutAfter(1000 * 60 * 5); - var data = fs.readFileSync(__dirname + '/in/' + file); + let data = fs.readFileSync(__dirname + "/in/" + file); + let png; try { - var png = PNG.sync.read(data); + png = PNG.sync.read(data); } catch (e) { if (!expectedError) { - t.fail('Unexpected error parsing..' + file + '\n' + e.message + "\n" + e.stack); + t.fail( + "Unexpected error parsing.." + + file + + "\n" + + e.message + + "\n" + + e.stack + ); } else { t.pass("completed"); } @@ -41,47 +50,55 @@ fs.readdir(__dirname + '/in/', function (err, files) { return t.end(); } - var outpng = new PNG(); + let outpng = new PNG(); outpng.gamma = png.gamma; outpng.data = png.data; outpng.width = png.width; outpng.height = png.height; - outpng.pack() - .pipe(fs.createWriteStream(__dirname + '/outsync/' + file) + outpng.pack().pipe( + fs + .createWriteStream(__dirname + "/outsync/" + file) .on("finish", function () { t.pass("completed"); t.end(); - })); + }) + ); }); - test('convert async - ' + file, function (t) { - + test("convert async - " + file, function (t) { t.timeoutAfter(1000 * 60 * 5); - fs.createReadStream(__dirname + '/in/' + file) + fs.createReadStream(__dirname + "/in/" + file) .pipe(new PNG()) - .on('error', function (err) { + .on("error", function (err) { if (!expectedError) { - t.fail("Async: Unexpected error parsing.." + file + '\n' + err.message + '\n' + err.stack); + t.fail( + "Async: Unexpected error parsing.." + + file + + "\n" + + err.message + + "\n" + + err.stack + ); } else { t.pass("completed"); } t.end(); }) - .on('parsed', function () { - + .on("parsed", function () { if (expectedError) { t.fail("Async: Error expected, parsed fine .." + file); return t.end(); } - this.pack() - .pipe( - fs.createWriteStream(__dirname + '/out/' + file) + this.pack().pipe( + fs + .createWriteStream(__dirname + "/out/" + file) .on("finish", function () { t.pass("completed"); t.end(); - })); + }) + ); }); }); }); diff --git a/test/http-server.js b/test/http-server.js index 711c87b..e888e92 100644 --- a/test/http-server.js +++ b/test/http-server.js @@ -1,14 +1,16 @@ -var serveStatic = require('serve-static'); -//var serveIndex = require('serve-index'); -var http = require('http'); -var connect = require('connect'); +let serveStatic = require("serve-static"); +let http = require("http"); +let connect = require("connect"); -var app = connect(); -server = http.createServer(app); +let app = connect(); +let server = http.createServer(app); -app.use(serveStatic('test')); -//app.use(serveIndex('test')); +app.use(serveStatic("test")); server.listen(8000); +module.exports = () => { + server.close(); +}; + console.log("Tests available at http://localhost:8000/"); diff --git a/test/index.html b/test/index.html index 2a523d0..47445c1 100644 --- a/test/index.html +++ b/test/index.html @@ -1,292 +1,999 @@ - + PNG Test - - + + +

Filtering

+

+ + + filter changing per + scanline, grayscale, 4 bit +

+

+ + + no filtering, colour, + 8 bit +

+

+ + + no filtering, + grayscale, 8 bit +

+

+ + + filter 3, colour, 8 + bit +

+

+ + + filter 3, grayscale, + 8 bit +

+

+ + + filter 2, colour, 8 + bit +

+

+ + + filter 2, grayscale, + 8 bit +

+

+ + + filter 1, colour, 8 + bit +

+

+ + + filter 1, grayscale, + 8 bit +

+

+ + + filter 0, colour, 8 + bit +

+

+ + + filter 0, grayscale, + 8 bit +

-

Filtering

-

filter changing per scanline, grayscale, 4 bit

-

no filtering, colour, 8 bit

-

no filtering, grayscale, 8 bit

-

filter 3, colour, 8 bit

-

filter 3, grayscale, 8 bit

-

filter 2, colour, 8 bit

-

filter 2, grayscale, 8 bit

-

filter 1, colour, 8 bit

-

filter 1, grayscale, 8 bit

-

filter 0, colour, 8 bit

-

filter 0, grayscale, 8 bit

+

Ancilary chunks

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

Ancilary chunks

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

+

Basic

+

+ + + basn0g01 - black & + white +

+

+ + + basn0g02 - 2 bit (4 + level) grayscale +

+

+ + + basn0g04 - 4 bit (16 + level) grayscale +

+

+ + + basn0g08 - 8 bit (256 + level) grayscale +

+

+ + + basn0g16 - 16 bit (64k + level) grayscale +

+

+ + + basn2c08 - 3x8 bits + rgb color +

+

+ + + basn2c16 - 3x16 bits + rgb color +

+

+ + + basn3p01 - 1 bit (2 + color) paletted +

+

+ + + basn3p02 - 2 bit (4 + color) paletted +

+

+ + + basn3p04 - 4 bit (16 + color) paletted +

+

+ + + basn3p08 - 8 bit (256 + color) paletted +

+

+ + + basn4a08 - 8 bit + grayscale + 8 bit alpha-channel +

+

+ + + basn4a16 - 16 bit + grayscale + 16 bit alpha-channel +

+

+ + + basn6a08 - 3x8 bits + rgb color + 8 bit alpha-channel +

+

+ + + basn6a16 - 3x16 bits + rgb color + 16 bit alpha-channel +

-

Basic

-

basn0g01 - black & white

-

basn0g02 - 2 bit (4 level) grayscale

-

basn0g04 - 4 bit (16 level) grayscale

-

basn0g08 - 8 bit (256 level) grayscale

-

basn0g16 - 16 bit (64k level) grayscale

-

basn2c08 - 3x8 bits rgb color

-

basn2c16 - 3x16 bits rgb color

-

basn3p01 - 1 bit (2 color) paletted

-

basn3p02 - 2 bit (4 color) paletted

-

basn3p04 - 4 bit (16 color) paletted

-

basn3p08 - 8 bit (256 color) paletted

-

basn4a08 - 8 bit grayscale + 8 bit alpha-channel

-

basn4a16 - 16 bit grayscale + 16 bit alpha-channel

-

basn6a08 - 3x8 bits rgb color + 8 bit alpha-channel

-

basn6a16 - 3x16 bits rgb color + 16 bit alpha-channel

+

Interlace

+

+ + + basi0g01 - black & + white +

+

+ + + basi0g02 - 2 bit (4 + level) grayscale +

+

+ + + basi0g04 - 4 bit (16 + level) grayscale +

+

+ + + basi0g08 - 8 bit (256 + level) grayscale +

+

+ + + basi0g16 - 16 bit (64k + level) grayscale +

+

+ + + basi2c08 - 3x8 bits + rgb color +

+

+ + + basi2c16 - 3x16 bits + rgb color +

-

Interlace

-

basi0g01 - black & white

-

basi0g02 - 2 bit (4 level) grayscale

-

basi0g04 - 4 bit (16 level) grayscale

-

basi0g08 - 8 bit (256 level) grayscale

-

basi0g16 - 16 bit (64k level) grayscale

-

basi2c08 - 3x8 bits rgb color

-

basi2c16 - 3x16 bits rgb color

+

+ + + basi3p01 - 1 bit (2 + color) paletted +

+

+ + + basi3p02 - 2 bit (4 + color) paletted +

+

+ + + basi3p04 - 4 bit (16 + color) paletted +

+

+ + + basi3p08 - 8 bit (256 + color) paletted +

+

+ + + basi4a08 - 8 bit + grayscale + 8 bit alpha-channel +

+

+ + + basi4a16 - 16 bit + grayscale + 16 bit alpha-channel +

+

+ + + basi6a08 - 3x8 bits + rgb color + 8 bit alpha-channel +

+

+ + + basi6a16 - 3x16 bits + rgb color + 16 bit alpha-channel +

-

basi3p01 - 1 bit (2 color) paletted

-

basi3p02 - 2 bit (4 color) paletted

-

basi3p04 - 4 bit (16 color) paletted

-

basi3p08 - 8 bit (256 color) paletted

-

basi4a08 - 8 bit grayscale + 8 bit alpha-channel

-

basi4a16 - 16 bit grayscale + 16 bit alpha-channel

-

basi6a08 - 3x8 bits rgb color + 8 bit alpha-channel

-

basi6a16 - 3x16 bits rgb color + 16 bit alpha-channel

+

Background

+

+ + + bgyn6a16 - 3x16 bits + rgb color, alpha, yellow background chunk +

+

+ + + bgwn6a08 - 3x8 bits + rgb color, alpha, white background chunk +

+

+ + + bggn4a16 - 16 bit + grayscale, alpha, gray background chunk +

+

+ + + bgbn4a08 - 8 bit + grayscale, alpha, black background chunk +

+

+ + + bgan6a16 - 3x16 bits + rgb color, alpha, no background chunk +

+

+ + + bgan6a08 - 3x8 bits + rgb color, alpha, no background chunk +

+

+ + + bgai4a16 - 16 bit + grayscale, alpha, no background chunk, interlaced +

+

+ + + bgai4a08 - 8 bit + grayscale, alpha, no background chunk, interlaced +

-

Background

-

bgyn6a16 - 3x16 bits rgb color, alpha, yellow background chunk

-

bgwn6a08 - 3x8 bits rgb color, alpha, white background chunk

-

bggn4a16 - 16 bit grayscale, alpha, gray background chunk

-

bgbn4a08 - 8 bit grayscale, alpha, black background chunk

-

bgan6a16 - 3x16 bits rgb color, alpha, no background chunk

-

bgan6a08 - 3x8 bits rgb color, alpha, no background chunk

-

bgai4a16 - 16 bit grayscale, alpha, no background chunk, interlaced

-

bgai4a08 - 8 bit grayscale, alpha, no background chunk, interlaced

+

ZLib

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

ZLib

-

-

-

-

+

Transparency

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

Transparency

-

-

-

-

-

-

-

-

-

-

-

-

-

-

+

Sizing

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

Sizing

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

+

Pallettes

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

Pallettes

-

-

-

-

-

-

+

Chunk Ordering

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

-

Chunk Ordering

-

-

-

-

-

-

-

-

+

Gamma

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+

+ + + +

+ - - + + - - + }.bind(null, inImage, asyncImage, syncImage, testLine) + ); + } + + diff --git a/test/png-parse-spec.js b/test/png-parse-spec.js index ad9365a..ea735b5 100644 --- a/test/png-parse-spec.js +++ b/test/png-parse-spec.js @@ -1,38 +1,37 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var PNG = require('../lib/png').PNG; -var stream = require('stream'); +let test = require("tape"); +let fs = require("fs"); +let path = require("path"); +let PNG = require("../lib/png").PNG; +let stream = require("stream"); function parseFile(filename, cb) { fs.createReadStream(path.join(__dirname, "png-parse-data", filename)) .pipe(new PNG()) - .on('error', function (e) { + .on("error", function (e) { console.log("error"); cb(e); }) - .on('parsed', function () { + .on("parsed", function () { cb(null, this); }); } function parseBuffer(buffer, cb) { - - var bufferStream = new stream.PassThrough(); + let bufferStream = new stream.PassThrough(); bufferStream.end(buffer); bufferStream .pipe(new PNG({})) - .on('error', function (e) { + .on("error", function (e) { cb(e); }) - .on('parse', function () { + .on("parse", function () { cb(null, this); }); } function getPixel(png, x, y) { - return png.data.readUInt32BE((x + (y * png.width)) * 4); + return png.data.readUInt32BE((x + y * png.width) * 4); } test("should correctly parse an 1-bit colormap png", function (t) { @@ -45,15 +44,17 @@ test("should correctly parse an 1-bit colormap png", function (t) { t.equal(png.data.length, 1024 * 1024 * 4); //t.equal(png.trailer.length, 0); - var y = 1024, + let y = 1024, x; - var isOk = true; + let isOk = true; while (y--) { x = 1024; while (x--) - if (getPixel(png, x, y) !== 0x000000FF) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== 0x000000FF"); + if (getPixel(png, x, y) !== 0x000000ff) { + t.fail( + "pixel does not match - " + getPixel(png, x, y) + " !== 0x000000FF" + ); isOk = false; break; } @@ -73,15 +74,20 @@ test("should correctly parse an 8-bit grayscale png", function (t) { t.equal(png.data.length, 16 * 16 * 4); //t.equal(png.trailer.toString(), "Hello, world!\n"); - var y = 16, + let y = 16, x; - var isOk = true; + let isOk = true; while (y--) { x = 16; while (x--) { if (getPixel(png, x, y) !== (x ^ y) * 286331136 + 255) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== " + ((x ^ y) * 286331136 + 255)); + t.fail( + "pixel does not match - " + + getPixel(png, x, y) + + " !== " + + ((x ^ y) * 286331136 + 255) + ); isOk = false; break; } @@ -90,7 +96,7 @@ test("should correctly parse an 8-bit grayscale png", function (t) { t.ok(isOk, "The pixels should match"); t.end(); - }) + }); }); test("should correctly parse an 8-bit truecolor png", function (t) { @@ -102,15 +108,23 @@ test("should correctly parse an 8-bit truecolor png", function (t) { t.equal(png.data.length, 16 * 16 * 4); //t.equal(png.trailer.length, 0); - var y = 16, + let y = 16, x; - var isOk = true; + let isOk = true; while (y--) { x = 16; while (x--) { - if (getPixel(png, x, y) !== x * 285212672 + y * 1114112 + (x ^ y) * 4352 + 255) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== " + (x * 285212672 + y * 1114112 + (x ^ y) * 4352 + 255)); + if ( + getPixel(png, x, y) !== + x * 285212672 + y * 1114112 + (x ^ y) * 4352 + 255 + ) { + t.fail( + "pixel does not match - " + + getPixel(png, x, y) + + " !== " + + (x * 285212672 + y * 1114112 + (x ^ y) * 4352 + 255) + ); isOk = false; break; } @@ -119,8 +133,8 @@ test("should correctly parse an 8-bit truecolor png", function (t) { t.ok(isOk, "The pixels should match"); t.end(); - }) -}) + }); +}); test("should correctly parse an 8-bit truecolor png with alpha", function (t) { parseFile("truecoloralpha.png", function (err, png) { @@ -131,15 +145,23 @@ test("should correctly parse an 8-bit truecolor png with alpha", function (t) { t.equal(png.data.length, 16 * 16 * 4); //t.equal(png.trailer.length, 0); - var y = 16, + let y = 16, x; - var isOk = true; + let isOk = true; while (y--) { x = 16; while (x--) { - if (getPixel(png, x, y) !== x * 285212672 + y * 1114112 + (x ^ y) * 17) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== " + (x * 285212672 + y * 1114112 + (x ^ y) * 17)); + if ( + getPixel(png, x, y) !== + x * 285212672 + y * 1114112 + (x ^ y) * 17 + ) { + t.fail( + "pixel does not match - " + + getPixel(png, x, y) + + " !== " + + (x * 285212672 + y * 1114112 + (x ^ y) * 17) + ); isOk = false; break; } @@ -148,8 +170,8 @@ test("should correctly parse an 8-bit truecolor png with alpha", function (t) { t.ok(isOk, "The pixels should match"); t.end(); - }) -}) + }); +}); test("should correctly read image with scanline filter", function (t) { parseFile("accum.png", function (err, png) { @@ -160,16 +182,16 @@ test("should correctly read image with scanline filter", function (t) { t.equal(png.data.length, 1024 * 1024 * 4); //t.equal(png.trailer.length, 0); - t.equal(getPixel(png, 0, 0), 0xFF0000FF); - t.equal(getPixel(png, 1, 0), 0xFF0000FF); - t.equal(getPixel(png, 420, 308), 0xFF0029FF); - t.equal(getPixel(png, 433, 308), 0x0A299DFF); - t.equal(getPixel(png, 513, 308), 0x0066FFFF); - t.equal(getPixel(png, 728, 552), 0xFF0047FF); + t.equal(getPixel(png, 0, 0), 0xff0000ff); + t.equal(getPixel(png, 1, 0), 0xff0000ff); + t.equal(getPixel(png, 420, 308), 0xff0029ff); + t.equal(getPixel(png, 433, 308), 0x0a299dff); + t.equal(getPixel(png, 513, 308), 0x0066ffff); + t.equal(getPixel(png, 728, 552), 0xff0047ff); t.end(); - }) -}) + }); +}); test("should correctly read an indexed color image", function (t) { parseFile("indexed.png", function (err, png) { @@ -180,29 +202,28 @@ test("should correctly read an indexed color image", function (t) { t.equal(png.data.length, 16 * 16 * 4); //t.equal(png.trailer.length, 0); - var y = 16, + let y = 16, x; - var isOk = true; + let isOk = true; while (y--) { x = 16; while (x--) { - var expected; + let expected; if (x + y < 8) { - expected = 0xFF0000FF; - + expected = 0xff0000ff; } else if (x + y < 16) { - expected = 0x00FF00FF; - + expected = 0x00ff00ff; } else if (x + y < 24) { - expected = 0x0000FFFF; - + expected = 0x0000ffff; } else { - expected = 0x000000FF; + expected = 0x000000ff; } if (getPixel(png, x, y) !== expected) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== " + expected); + t.fail( + "pixel does not match - " + getPixel(png, x, y) + " !== " + expected + ); isOk = false; break; } @@ -222,32 +243,30 @@ test("should correctly read an indexed color image with alpha", function (t) { t.equal(png.data.length, 16 * 16 * 4); //t.equal(png.trailer.length, 0); - var y = 16, + let y = 16, x; - var isOk = true; + let isOk = true; while (y--) { x = 16; while (x--) { - var expected; + let expected; if (x >= 4 && x < 12) { expected = 0x00000000; - } else if (x + y < 8) { - expected = 0xFF0000FF; - + expected = 0xff0000ff; } else if (x + y < 16) { - expected = 0x00FF00FF; - + expected = 0x00ff00ff; } else if (x + y < 24) { - expected = 0x0000FFFF; - + expected = 0x0000ffff; } else { - expected = 0x000000FF; + expected = 0x000000ff; } if (getPixel(png, x, y) !== expected) { - t.fail("pixel does not match - " + getPixel(png, x, y) + " !== " + expected); + t.fail( + "pixel does not match - " + getPixel(png, x, y) + " !== " + expected + ); isOk = false; break; } @@ -267,70 +286,73 @@ test("should correctly support crazily-filtered images", function (t) { //t.equal(png.bpp, 4); t.equal(png.data.length, 512 * 512 * 4); - t.equal(getPixel(png, 0, 0), 0xFF000000) - t.equal(getPixel(png, 1, 0), 0xFF000000) - t.equal(getPixel(png, 0, 1), 0xFF000000) - t.equal(getPixel(png, 2, 2), 0xFF000000) - t.equal(getPixel(png, 0, 50), 0xFF000000) - t.equal(getPixel(png, 219, 248), 0xFF000D00) - t.equal(getPixel(png, 220, 248), 0xFF000D00) - t.equal(getPixel(png, 215, 249), 0xFF000C00) - t.equal(getPixel(png, 216, 249), 0xFF000C00) - t.equal(getPixel(png, 217, 249), 0xFF000D00) - t.equal(getPixel(png, 218, 249), 0xFF000D00) - t.equal(getPixel(png, 219, 249), 0xFF000E00) - t.equal(getPixel(png, 220, 249), 0xFF000E00) - t.equal(getPixel(png, 263, 319), 0xFF002100) - t.equal(getPixel(png, 145, 318), 0x05535A00) - t.equal(getPixel(png, 395, 286), 0x0007FF00) - t.equal(getPixel(png, 152, 167), 0x052C3500) - t.equal(getPixel(png, 153, 167), 0x04303600) - t.equal(getPixel(png, 154, 167), 0x042F3700) - t.equal(getPixel(png, 100, 168), 0xFF000400) - t.equal(getPixel(png, 120, 168), 0xFF000900) - t.equal(getPixel(png, 140, 168), 0xFF001B00) - t.equal(getPixel(png, 150, 168), 0x05313600) - t.equal(getPixel(png, 152, 168), 0x04343C00) - t.equal(getPixel(png, 153, 168), 0x03343F00) - t.equal(getPixel(png, 154, 168), 0x03344100) - t.equal(getPixel(png, 155, 168), 0x02344300) - t.equal(getPixel(png, 156, 168), 0x02314400) - t.equal(getPixel(png, 157, 168), 0x02323F00) - t.equal(getPixel(png, 158, 168), 0x03313900) + t.equal(getPixel(png, 0, 0), 0xff000000); + t.equal(getPixel(png, 1, 0), 0xff000000); + t.equal(getPixel(png, 0, 1), 0xff000000); + t.equal(getPixel(png, 2, 2), 0xff000000); + t.equal(getPixel(png, 0, 50), 0xff000000); + t.equal(getPixel(png, 219, 248), 0xff000d00); + t.equal(getPixel(png, 220, 248), 0xff000d00); + t.equal(getPixel(png, 215, 249), 0xff000c00); + t.equal(getPixel(png, 216, 249), 0xff000c00); + t.equal(getPixel(png, 217, 249), 0xff000d00); + t.equal(getPixel(png, 218, 249), 0xff000d00); + t.equal(getPixel(png, 219, 249), 0xff000e00); + t.equal(getPixel(png, 220, 249), 0xff000e00); + t.equal(getPixel(png, 263, 319), 0xff002100); + t.equal(getPixel(png, 145, 318), 0x05535a00); + t.equal(getPixel(png, 395, 286), 0x0007ff00); + t.equal(getPixel(png, 152, 167), 0x052c3500); + t.equal(getPixel(png, 153, 167), 0x04303600); + t.equal(getPixel(png, 154, 167), 0x042f3700); + t.equal(getPixel(png, 100, 168), 0xff000400); + t.equal(getPixel(png, 120, 168), 0xff000900); + t.equal(getPixel(png, 140, 168), 0xff001b00); + t.equal(getPixel(png, 150, 168), 0x05313600); + t.equal(getPixel(png, 152, 168), 0x04343c00); + t.equal(getPixel(png, 153, 168), 0x03343f00); + t.equal(getPixel(png, 154, 168), 0x03344100); + t.equal(getPixel(png, 155, 168), 0x02344300); + t.equal(getPixel(png, 156, 168), 0x02314400); + t.equal(getPixel(png, 157, 168), 0x02323f00); + t.equal(getPixel(png, 158, 168), 0x03313900); t.end(); }); }); test("should bail with an error given an invalid PNG", function (t) { - var buf = Buffer.from("I AM NOT ACTUALLY A PNG", "utf8") + let buf = Buffer.from("I AM NOT ACTUALLY A PNG", "utf8"); return parseBuffer(buf, function (err) { t.ok(err instanceof Error, "Error should be received"); t.end(); - }) -}) + }); +}); test("should bail with an error given an empty file", function (t) { - var buf = Buffer.from("") + let buf = Buffer.from(""); return parseBuffer(buf, function (err) { t.ok(err instanceof Error, "Error should be received"); t.end(); - }) -}) + }); +}); test("should bail with an error given a truncated PNG", function (t) { - var buf = Buffer.from("89504e470d0a1a0a000000", "hex") + let buf = Buffer.from("89504e470d0a1a0a000000", "hex"); return parseBuffer(buf, function (err) { t.ok(err instanceof Error, "Error should be received"); t.end(); - }) -}) + }); +}); test("should return an error if a PNG is normal except for a missing IEND", function (t) { - var buf = Buffer.from("89504e470d0a1a0a0000000d49484452000000100000001008000000003a98a0bd000000017352474200aece1ce90000002174455874536f6674776172650047726170686963436f6e7665727465722028496e74656c297787fa190000008849444154789c448e4111c020100363010b58c00216b080052c60010b58c0c259c00216ae4d3b69df99dd0d1062caa5b63ee6b27d1c012996dceae86b6ef38398106acb65ae3e8edbbef780564b5e73743fdb409e1ef2f4803c3de4e901797ac8d3f3f0f490a7077ffffd03f5f507eaeb0fd4d71fa8af3f505f7fa0befe7c7dfdb9000000ffff0300c0fd7f8179301408", "hex") + let buf = Buffer.from( + "89504e470d0a1a0a0000000d49484452000000100000001008000000003a98a0bd000000017352474200aece1ce90000002174455874536f6674776172650047726170686963436f6e7665727465722028496e74656c297787fa190000008849444154789c448e4111c020100363010b58c00216b080052c60010b58c0c259c00216ae4d3b69df99dd0d1062caa5b63ee6b27d1c012996dceae86b6ef38398106acb65ae3e8edbbef780564b5e73743fdb409e1ef2f4803c3de4e901797ac8d3f3f0f490a7077ffffd03f5f507eaeb0fd4d71fa8af3f505f7fa0befe7c7dfdb9000000ffff0300c0fd7f8179301408", + "hex" + ); return parseBuffer(buf, function (err) { t.ok(err instanceof Error, "Error should be received"); @@ -341,20 +363,22 @@ test("should return an error if a PNG is normal except for a missing IEND", func test("should set alpha=true in metadata for images with tRNS chunk", function (t) { fs.createReadStream(path.join(__dirname, "in", "tbbn0g04.png")) .pipe(new PNG()) - .on('metadata', function (metadata) { + .on("metadata", function (metadata) { t.ok(metadata.alpha, "Image should have alpha=true"); t.end(); }); }); test("Should parse with low highWaterMark", function (t) { - fs.createReadStream(path.join(__dirname, "in", "tbbn0g04.png"), { highWaterMark: 2 }) + fs.createReadStream(path.join(__dirname, "in", "tbbn0g04.png"), { + highWaterMark: 2, + }) .pipe(new PNG()) - .on('parsed', function () { + .on("parsed", function () { t.pass("Image should have parsed"); t.end(); }) - .on('error', function (e) { + .on("error", function (e) { t.error(e, "Should not error"); }); }); diff --git a/test/run-compare.js b/test/run-compare.js index d8fefe5..70152e6 100644 --- a/test/run-compare.js +++ b/test/run-compare.js @@ -1,17 +1,22 @@ -require('./http-server') -const puppeteer = require('puppeteer'); -const URL = 'http://localhost:8000'; +const closeServer = require("./http-server"); +const puppeteer = require("puppeteer"); +const URL = "http://localhost:8000"; -puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox'] }).then(async browser => { +puppeteer + .launch({ + headless: true, + args: ["--no-sandbox", "--disable-setuid-sandbox"], + }) + .then(async (browser) => { const page = await browser.newPage(); - await page.goto(URL, {waitUntil: 'networkidle0'}); + await page.goto(URL, { waitUntil: "networkidle0" }); const results = await page.evaluate(() => { + /* global window:false */ try { - if (window.isFinished && window.isFinished()) { - return window.results; - } - } catch(err) { - reject(err.toString()); + if (window.isFinished && window.isFinished()) { + return window.results; + } + } catch (err) { console.log("Failed", err); } }); @@ -19,24 +24,34 @@ puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sand console.log("Comparison Test Results:"); await browser.close(); if (results) { - var success = true; - var successes = [],failures = []; - for (var i = 0; i < results.length; i++) { - var result = results[i]; - if (result.success) { - successes.push(result.name); - } else { - failures.push(result.name); - } - success = success && result.success; + let success = true; + let successes = [], + failures = []; + for (let i = 0; i < results.length; i++) { + let result = results[i]; + if (result.success) { + successes.push(result.name); + } else { + failures.push(result.name); + } + success = success && result.success; } console.log("Success:", successes.join(", ")); if (failures.length) { console.log("Failure:", failures.join(", ")); + if (failures.length > 10) { + console.error("failures higher than expected"); + process.exitCode = 1; + } } + } else { + process.exitCode = 1; } - process.exit(); -}).catch(function(error) { + }) + .catch((error) => { console.error(error); - process.exit(); -}); + process.exitCode = 1; + }) + .finally(() => { + closeServer(); + }); diff --git a/yarn.lock b/yarn.lock index fbfed73..fb1f497 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,18 +2,134 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== dependencies: "@babel/highlight" "^7.8.3" -"@babel/helper-validator-identifier@^7.9.0": +"@babel/core@^7.7.5": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" + integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.9.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helpers" "^7.9.0" + "@babel/parser" "^7.9.0" + "@babel/template" "^7.8.6" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.9.0", "@babel/generator@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" + integrity sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ== + dependencies: + "@babel/types" "^7.9.5" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + +"@babel/helper-function-name@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz#2b53820d35275120e1874a82e5aabe1376920a5c" + integrity sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.9.5" + +"@babel/helper-get-function-arity@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" + integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-member-expression-to-functions@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz#659b710498ea6c1d9907e0c73f206eee7dadc24c" + integrity sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-module-imports@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz#7fe39589b39c016331b6b8c3f441e8f0b1419498" + integrity sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-module-transforms@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz#43b34dfe15961918707d247327431388e9fe96e5" + integrity sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA== + dependencies: + "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" + "@babel/helper-simple-access" "^7.8.3" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/template" "^7.8.6" + "@babel/types" "^7.9.0" + lodash "^4.17.13" + +"@babel/helper-optimise-call-expression@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz#7ed071813d09c75298ef4f208956006b6111ecb9" + integrity sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-replace-supers@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" + integrity sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.8.3" + "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/traverse" "^7.8.6" + "@babel/types" "^7.8.6" + +"@babel/helper-simple-access@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz#7f8109928b4dab4654076986af575231deb639ae" + integrity sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw== + dependencies: + "@babel/template" "^7.8.3" + "@babel/types" "^7.8.3" + +"@babel/helper-split-export-declaration@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" + integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== +"@babel/helpers@^7.9.0": + version "7.9.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.9.2.tgz#b42a81a811f1e7313b88cba8adc66b3d9ae6c09f" + integrity sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA== + dependencies: + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" + "@babel/highlight@^7.8.3": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" @@ -23,6 +139,64 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" + integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== + +"@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" + integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" + +"@babel/traverse@^7.7.4", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.0": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" + integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.9.5" + "@babel/helper-function-name" "^7.9.5" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/parser" "^7.9.0" + "@babel/types" "^7.9.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" + integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== + dependencies: + "@babel/helper-validator-identifier" "^7.9.5" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" + integrity sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" + integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== + +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + JSONStream@^1.0.3: version "1.3.2" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" @@ -39,19 +213,34 @@ acorn-jsx@^5.0.0: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== +acorn-node@^1.6.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== + dependencies: + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" + +acorn-walk@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" + integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== + acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" - acorn@^6.0.7: version "6.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== +acorn@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" + integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== + agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" @@ -59,7 +248,15 @@ agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" -ajv@^6.10.2, ajv@^6.9.1: +aggregate-error@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" + integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.10.2, ajv@^6.5.5, ajv@^6.9.1: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== @@ -100,6 +297,11 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -111,9 +313,30 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + +append-transform@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-2.0.0.tgz#99d9d29c7b38391e6f428d28ce136551f0b77e12" + integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== + dependencies: + default-require-extensions "^3.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" @@ -137,6 +360,18 @@ asn1.js@^4.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + assert@^1.4.0: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" @@ -163,6 +398,21 @@ async@1.x, async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" + integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== + balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -170,11 +420,19 @@ balanced-match@^0.4.1: balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -187,8 +445,9 @@ brace-expansion@^1.0.0: concat-map "0.0.1" brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -265,26 +524,27 @@ browserify-zlib@~0.2.0: dependencies: pako "~1.0.5" -browserify@^14.5.0: - version "14.5.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5" +browserify@16.5.1: + version "16.5.1" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.1.tgz#3c13c97436802930d5c3ae28658ddc33bfd37dc2" + integrity sha512-EQX0h59Pp+0GtSRb5rL6OTfrttlzv+uyaUVlK6GX3w11SQ0jKPKyjC/54RhPR2ib2KmfcELM06e8FxcI5XNU2A== dependencies: JSONStream "^1.0.3" assert "^1.4.0" browser-pack "^6.0.1" browser-resolve "^1.11.0" browserify-zlib "~0.2.0" - buffer "^5.0.2" + buffer "~5.2.1" cached-path-relative "^1.0.0" - concat-stream "~1.5.1" + concat-stream "^1.6.0" console-browserify "^1.1.0" constants-browserify "~1.0.0" crypto-browserify "^3.0.0" defined "^1.0.0" deps-sort "^2.0.0" - domain-browser "~1.1.0" + domain-browser "^1.2.0" duplexer2 "~0.1.2" - events "~1.1.0" + events "^2.0.0" glob "^7.1.0" has "^1.0.0" htmlescape "^1.1.0" @@ -292,7 +552,8 @@ browserify@^14.5.0: inherits "~2.0.1" insert-module-globals "^7.0.0" labeled-stream-splicer "^2.0.0" - module-deps "^4.0.8" + mkdirp-classic "^0.5.2" + module-deps "^6.0.0" os-browserify "~0.3.0" parents "^1.0.1" path-browserify "~0.0.0" @@ -305,16 +566,16 @@ browserify@^14.5.0: shasum "^1.0.0" shell-quote "^1.6.1" stream-browserify "^2.0.0" - stream-http "^2.0.0" - string_decoder "~1.0.0" + stream-http "^3.0.0" + string_decoder "^1.1.1" subarg "^1.0.0" syntax-error "^1.1.1" through2 "^2.0.0" timers-browserify "^1.0.1" - tty-browserify "~0.0.0" + tty-browserify "0.0.1" url "~0.11.0" util "~0.10.1" - vm-browserify "~0.0.1" + vm-browserify "^1.0.0" xtend "^4.0.0" buffer-crc32@~0.2.3: @@ -339,9 +600,10 @@ buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" -buffer@^5.0.2: - version "5.0.8" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.8.tgz#84daa52e7cf2fa8ce4195bc5cf0f7809e0930b24" +buffer@~5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" + integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -354,6 +616,21 @@ cached-path-relative@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" +cached-path-relative@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.2.tgz#a13df4196d26776220cc3356eb147a52dba2c6db" + integrity sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg== + +caching-transform@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" + integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== + dependencies: + hasha "^5.0.0" + make-dir "^3.0.0" + package-hash "^4.0.0" + write-file-atomic "^3.0.0" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -363,6 +640,16 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" +camelcase@^5.0.0, camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -401,6 +688,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -409,8 +701,9 @@ cli-cursor@^2.1.0: restore-cursor "^2.0.0" cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= cliui@^2.1.0: version "2.1.0" @@ -420,6 +713,15 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -427,11 +729,23 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + combine-source-map@~0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" @@ -441,11 +755,24 @@ combine-source-map@~0.7.1: lodash.memoize "~3.0.3" source-map "~0.5.3" +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.6.2: +concat-stream@^1.6.0, concat-stream@^1.6.2, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -455,7 +782,7 @@ concat-stream@^1.6.2: readable-stream "^2.2.2" typedarray "^0.0.6" -concat-stream@~1.5.0, concat-stream@~1.5.1: +concat-stream@~1.5.1: version "1.5.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" dependencies: @@ -463,13 +790,14 @@ concat-stream@~1.5.0, concat-stream@~1.5.1: readable-stream "~2.0.0" typedarray "~0.0.5" -connect@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.0.tgz#f09a4f7dcd17324b663b725c815bdb1c4158a46e" +connect@3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.4.0.tgz#ee8789a3bd4604bfda39dbcf1d3bb482dfe6cf24" + integrity sha1-7oeJo71GBL/aOdvPHTu0gt/mzyQ= dependencies: - debug "2.6.1" - finalhandler "1.0.0" - parseurl "~1.3.1" + debug "~2.2.0" + finalhandler "0.4.0" + parseurl "~1.3.0" utils-merge "1.0.0" console-browserify@^1.1.0: @@ -482,14 +810,32 @@ constants-browserify@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" +convert-source-map@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + convert-source-map@~1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" -core-util-is@~1.0.0: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +coveralls@3.0.11: + version "3.0.11" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.11.tgz#e141da0922b632fcc66620f334460c3f0026a4ce" + integrity sha512-LZPWPR2NyGKyaABnc49dR0fpeP6UqhvGq4B5nUrTQ1UBy55z96+ga7r+/ChMdMJUwBgyJDXBi88UBgz2rs9IiQ== + dependencies: + js-yaml "^3.13.1" + lcov-parse "^1.0.0" + log-driver "^1.2.7" + minimist "^1.2.5" + request "^2.88.0" + create-ecdh@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" @@ -528,6 +874,15 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.2.tgz#d0d7dcfa74e89115c7619f4f721a94e1fdb716d6" + integrity sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.0.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -544,16 +899,17 @@ crypto-browserify@^3.0.0: randombytes "^2.0.0" randomfill "^1.0.3" +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" - dependencies: - ms "0.7.2" - debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -568,39 +924,59 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" -decamelize@^1.0.0: +debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + integrity sha1-+HBX6ZWxofauaklgZkE3vFbwOdo= + dependencies: + ms "0.7.1" + +decamelize@^1.0.0, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-equal@~1.0.1: +deep-equal@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" +default-require-extensions@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-3.0.0.tgz#e03f93aac9b2b6443fc52e5e4a37b3ad9ad8df96" + integrity sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg== dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" + strip-bom "^4.0.0" -defined@^1.0.0, defined@~1.0.0: +defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" -depd@1.1.0, depd@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" +defined@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e" + integrity sha1-817qfXBekzuvE7LwOz+D2SFAOz4= + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +depd@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.0.1.tgz#80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa" + integrity sha1-gK7GTJ1tl+ZcwqnKqTwKpqv3Oqo= deps-sort@^2.0.0: version "2.0.0" @@ -618,16 +994,19 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +destroy@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.3.tgz#b433b4724e71fd8551d9885174851c5fc377e2c9" + integrity sha1-tDO0ck5x/YVR2YhRdIUcX8N34sk= -detective@^4.0.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.0.tgz#6276e150f9e50829ad1f90ace4d9a2304188afcf" +detective@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" + integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== dependencies: - acorn "^5.2.1" + acorn-node "^1.6.1" defined "^1.0.0" + minimist "^1.1.1" diffie-hellman@^5.0.0: version "5.0.2" @@ -644,9 +1023,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -domain-browser@~1.1.0: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" +domain-browser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: version "0.1.4" @@ -654,6 +1034,14 @@ duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: dependencies: readable-stream "^2.0.2" +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -675,26 +1063,15 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== -encodeurl@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -es-abstract@^1.5.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.0" - is-callable "^1.1.3" - is-regex "^1.0.3" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" +es6-error@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" + integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== es6-promise@^4.0.3: version "4.2.8" @@ -708,9 +1085,10 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" +escape-html@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.2.tgz#d77d32fa98e38c2f41ae85e9278e0e0e6ba1022c" + integrity sha1-130y+pjjjC9BroXpJ44ODmuhAiw= escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" @@ -727,6 +1105,13 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" +eslint-config-prettier@6.10.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a" + integrity sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ== + dependencies: + get-stdin "^6.0.0" + eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -747,10 +1132,10 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^5.15.2: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@5.15.2: + version "5.15.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.15.2.tgz#0237bbb2362f89f4effef2f191eb0fea5279c0a5" + integrity sha512-I8VM4SILpMwUvsRt83bQVwIRQAJ2iPMXun1FVZ/lV1OHklH2tJaXqoDnNzdiFc6bnCtGKXvQIQNP3kj1eMskSw== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.9.1" @@ -772,7 +1157,7 @@ eslint@^5.15.2: import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.2.2" - js-yaml "^3.13.0" + js-yaml "^3.12.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" lodash "^4.17.11" @@ -819,40 +1204,40 @@ esquery@^1.0.1: estraverse "^5.0.0" esrecurse@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: - estraverse "~4.1.0" - object-assign "^4.0.1" + estraverse "^4.1.0" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" +estraverse@^4.1.0, estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.0.0.tgz#ac81750b482c11cca26e4b07e83ed8f75fbcdc22" integrity sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A== -estraverse@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" - esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -etag@~1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051" +etag@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8" + integrity sha1-A9MLX2fdbmMtKUXTDWZScxo01dg= -events@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" +events@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" + integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" @@ -861,6 +1246,11 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -880,6 +1270,16 @@ extract-zip@^1.6.6: mkdirp "^0.5.4" yauzl "^2.10.0" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + fast-deep-equal@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" @@ -890,9 +1290,10 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@~2.0.4: +fast-levenshtein@~2.0.4, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fd-slicer@~1.1.0: version "1.1.0" @@ -915,18 +1316,41 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" -finalhandler@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.0.tgz#b5691c2c0912092f18ac23e9416bde5cd7dc6755" +fileset@0.2.x: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-0.2.1.tgz#588ef8973c6623b2a76df465105696b96aac8067" + integrity sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc= dependencies: - debug "2.6.1" - encodeurl "~1.0.1" - escape-html "~1.0.3" + glob "5.x" + minimatch "2.x" + +finalhandler@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.4.0.tgz#965a52d9e8d05d2b857548541fb89b53a2497d9b" + integrity sha1-llpS2ejQXSuFdUhUH7ibU6JJfZs= + dependencies: + debug "~2.2.0" + escape-html "1.0.2" on-finished "~2.3.0" - parseurl "~1.3.1" - statuses "~1.3.1" unpipe "~1.0.0" +find-cache-dir@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -941,25 +1365,44 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== -for-each@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" +foreground-child@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" + integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== dependencies: - is-function "~1.0.0" + cross-spawn "^7.0.0" + signal-exit "^3.0.2" -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -fresh@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.0.tgz#f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e" +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fresh@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" + integrity sha1-ZR+DjiJCTnVm3hYdg1jKoZn4PU8= + +fromentries@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" + integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -function-bind@^1.0.2, function-bind@^1.1.0, function-bind@~1.1.0: +function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" @@ -968,9 +1411,32 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -glob@^5.0.15: +gensync@^1.0.0-beta.1: + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" + integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob@5.x, glob@~5.0.3: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= dependencies: inflight "^1.0.4" inherits "2" @@ -989,7 +1455,7 @@ glob@^7.1.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.2, glob@^7.1.3: +glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1001,22 +1467,16 @@ glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.7.0: +globals@^11.1.0, globals@^11.7.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +graceful-fs@^4.1.15: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + handlebars@^4.0.1: version "4.0.6" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" @@ -1027,6 +1487,19 @@ handlebars@^4.0.1: optionalDependencies: uglify-js "^2.6" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -1042,7 +1515,12 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has@^1.0.0, has@^1.0.1, has@~1.0.1: +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" dependencies: @@ -1068,6 +1546,14 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.0" +hasha@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/hasha/-/hasha-5.2.0.tgz#33094d1f69c40a4a6ac7be53d5fe3ff95a269e0c" + integrity sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw== + dependencies: + is-stream "^2.0.0" + type-fest "^0.8.0" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -1076,18 +1562,31 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + htmlescape@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" -http-errors@~1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257" +http-errors@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.3.1.tgz#197e22cdebd4198585e8694ef6786197b91ed942" + integrity sha1-GX4izevUGYWF6GlO9nhhl7ke2UI= dependencies: - depd "1.1.0" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" + inherits "~2.0.1" + statuses "1" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" https-browserify@^1.0.0: version "1.0.0" @@ -1128,26 +1627,34 @@ import-fresh@^3.0.0: imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" +inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + inline-source-map@~0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" @@ -1194,36 +1701,35 @@ is-buffer@^1.1.0: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= -is-function@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= -is-regex@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@~0.0.1: version "0.0.1" @@ -1242,15 +1748,85 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -istanbul@^0.4.4: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" + integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== + +istanbul-lib-hook@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" + integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== + dependencies: + append-transform "^2.0.0" + +istanbul-lib-instrument@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz#61f13ac2c96cfefb076fe7131156cc05907874e6" + integrity sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg== + dependencies: + "@babel/core" "^7.7.5" + "@babel/parser" "^7.7.5" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + +istanbul-lib-processinfo@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz#e1426514662244b2f25df728e8fd1ba35fe53b9c" + integrity sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw== + dependencies: + archy "^1.0.0" + cross-spawn "^7.0.0" + istanbul-lib-coverage "^3.0.0-alpha.1" + make-dir "^3.0.0" + p-map "^3.0.0" + rimraf "^3.0.0" + uuid "^3.3.3" + +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" + integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" + integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +istanbul@0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.4.tgz#e8cf718dfedb713c8334ab9ffade35f1042d2a56" + integrity sha1-6M9xjf7bcTyDNKuf+t418QQtKlY= dependencies: abbrev "1.0.x" async "1.x" escodegen "1.8.x" esprima "2.7.x" - glob "^5.0.15" + fileset "0.2.x" handlebars "^4.0.1" js-yaml "3.x" mkdirp "0.5.x" @@ -1273,7 +1849,7 @@ js-yaml@3.x: argparse "^1.0.7" esprima "^3.1.1" -js-yaml@^3.13.0: +js-yaml@^3.12.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -1281,11 +1857,26 @@ js-yaml@^3.13.0: argparse "^1.0.7" esprima "^4.0.0" +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -1297,6 +1888,18 @@ json-stable-stringify@~0.0.0: dependencies: jsonify "~0.0.0" +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" + integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== + dependencies: + minimist "^1.2.5" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -1305,6 +1908,16 @@ jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + kind-of@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" @@ -1323,9 +1936,15 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +lcov-parse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -1336,19 +1955,43 @@ lexical-scope@^1.2.0: dependencies: astw "^2.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + lodash.memoize@~3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14: +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" + integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w== + dependencies: + semver "^6.0.0" + md5.js@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" @@ -1363,6 +2006,18 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" +mime-db@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" + integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.26" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" + integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== + dependencies: + mime-db "1.43.0" + mime@1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" @@ -1385,15 +2040,23 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@^3.0.2: +"minimatch@2 || 3": version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" +minimatch@2.x: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" + integrity sha1-jQh8OcazjAAbl/ynzm0OHoCvusc= + dependencies: + brace-expansion "^1.0.0" + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" @@ -1401,51 +2064,58 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.0, minimist@~1.2.0: +minimist@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -minimist@^1.2.5: +minimist@^1.1.1, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -mkdirp@0.5.x, mkdirp@^0.5.1: +mkdirp-classic@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.2.tgz#54c441ce4c96cd7790e10b41a87aa51068ecab2b" + integrity sha512-ejdnDQcR75gwknmMw/tx02AuRs8jCtqFoFqDZMjiNxsu85sRIJVXDKHuLYvUUPRBUtV2FpSZa9bL1BUa3BdR2g== + +mkdirp@0.5.x: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -mkdirp@^0.5.4: +mkdirp@^0.5.1, mkdirp@^0.5.4: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" -module-deps@^4.0.8: - version "4.1.1" - resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" +module-deps@^6.0.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.2.2.tgz#d8a15c2265dfc119153c29bb47386987d0ee423b" + integrity sha512-a9y6yDv5u5I4A+IPHTnqFxcaKr4p50/zxTjcQJaX2ws9tN/W6J6YXnEKhqRyPhl494dkcxx951onSKVezmI+3w== dependencies: JSONStream "^1.0.3" browser-resolve "^1.7.0" - cached-path-relative "^1.0.0" - concat-stream "~1.5.0" + cached-path-relative "^1.0.2" + concat-stream "~1.6.0" defined "^1.0.0" - detective "^4.0.0" + detective "^5.2.0" duplexer2 "^0.1.2" inherits "^2.0.1" parents "^1.0.0" readable-stream "^2.0.2" - resolve "^1.1.3" + resolve "^1.4.0" stream-combiner2 "^1.1.1" subarg "^1.0.0" through2 "^2.0.0" xtend "^4.0.0" -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + integrity sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg= ms@2.0.0: version "2.0.0" @@ -1465,29 +2135,67 @@ mute-stream@0.0.7: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +node-preload@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" + integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== + dependencies: + process-on-spawn "^1.0.0" + nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: abbrev "1" -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +nyc@15.0.1: + version "15.0.1" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-15.0.1.tgz#bd4d5c2b17f2ec04370365a5ca1fc0ed26f9f93d" + integrity sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg== + dependencies: + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + caching-transform "^4.0.0" + convert-source-map "^1.7.0" + decamelize "^1.2.0" + find-cache-dir "^3.2.0" + find-up "^4.1.0" + foreground-child "^2.0.0" + glob "^7.1.6" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-hook "^3.0.0" + istanbul-lib-instrument "^4.0.0" + istanbul-lib-processinfo "^2.0.2" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + make-dir "^3.0.0" + node-preload "^0.2.1" + p-map "^3.0.0" + process-on-spawn "^1.0.0" + resolve-from "^5.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + spawn-wrap "^2.0.0" + test-exclude "^6.0.0" + yargs "^15.0.2" -object-inspect@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.2.1.tgz#3b62226eb8f6d441751c7d8f22a20ff80ac9dc3f" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-keys@^1.0.8: - version "1.0.11" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" +object-inspect@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.0.2.tgz#a97885b553e575eb4009ebc09bdda9b1cd21979a" + integrity sha1-qXiFtVPldetACevAm92psc0hl5o= on-finished@~2.3.0: version "2.3.0" @@ -1498,6 +2206,7 @@ on-finished@~2.3.0: once@1.x, once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" @@ -1515,7 +2224,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1, optionator@^0.8.2: +optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -1526,6 +2235,18 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" +optionator@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + os-browserify@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -1535,6 +2256,42 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-map@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" + integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +package-hash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-4.0.0.tgz#3537f654665ec3cc38827387fc904c163c54f506" + integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== + dependencies: + graceful-fs "^4.1.15" + hasha "^5.0.0" + lodash.flattendeep "^4.4.0" + release-zalgo "^1.0.0" + pako@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" @@ -1562,17 +2319,24 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" -parseurl@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" +parseurl@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== path-browserify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.2: version "1.0.2" @@ -1584,10 +2348,20 @@ path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-platform@~0.11.15: version "0.11.15" resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" @@ -1606,14 +2380,39 @@ pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pkg-dir@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prettier@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.4.tgz#2d1bae173e355996ee355ec9830a7a1ee05457ef" + integrity sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w== process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +process-on-spawn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/process-on-spawn/-/process-on-spawn-1.0.0.tgz#95b05a23073d30a17acfdc92a440efd2baefdc93" + integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== + dependencies: + fromentries "^1.2.0" + process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -1628,6 +2427,11 @@ proxy-from-env@^1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + public-encrypt@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" @@ -1646,7 +2450,7 @@ punycode@^1.3.2: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -1665,6 +2469,11 @@ puppeteer@1.20.0: rimraf "^2.6.1" ws "^6.1.0" +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + querystring-es3@~0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -1686,9 +2495,10 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" +range-parser@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.0.3.tgz#6872823535c692e2c2a0103826afd82c2e0ff175" + integrity sha1-aHKCNTXGkuLCoBA4Jq/YLC4P8XU= re-emitter@^1.0.0: version "1.1.3" @@ -1712,7 +2522,7 @@ readable-stream@^2.0.0, readable-stream@^2.1.5, readable-stream@^2.2.2: string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@^2.0.2, readable-stream@^2.2.6: +readable-stream@^2.0.2: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -1724,6 +2534,15 @@ readable-stream@^2.0.2, readable-stream@^2.2.6: string_decoder "~1.0.3" util-deprecate "~1.0.1" +readable-stream@^3.0.6: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@~2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" @@ -1740,25 +2559,80 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +release-zalgo@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + integrity sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA= + dependencies: + es6-error "^4.0.1" + repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" +request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@1.1.7, resolve@1.1.x, resolve@~1.1.7: +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@1.1.7, resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.3, resolve@^1.1.4: +resolve@^1.1.4: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" +resolve@^1.3.2, resolve@^1.4.0: + version "1.15.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -1793,6 +2667,13 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -1818,46 +2699,57 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -"safer-buffer@>= 2.1.2 < 3": +safe-buffer@^5.1.2, safe-buffer@~5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^5.5.0, semver@^5.5.1: +semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.15.1.tgz#8a02354c26e6f5cca700065f5f0cdeba90ec7b5f" +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +send@0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.13.0.tgz#518f921aeb0560aec7dcab2990b14cf6f3cce5de" + integrity sha1-UY+SGusFYK7H3KspkLFM9vPM5d4= dependencies: - debug "2.6.1" - depd "~1.1.0" - destroy "~1.0.4" - encodeurl "~1.0.1" - escape-html "~1.0.3" - etag "~1.8.0" - fresh "0.5.0" - http-errors "~1.6.1" + debug "~2.2.0" + depd "~1.0.1" + destroy "1.0.3" + escape-html "1.0.2" + etag "~1.7.0" + fresh "0.3.0" + http-errors "~1.3.1" mime "1.3.4" - ms "0.7.2" + ms "0.7.1" on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.3.1" + range-parser "~1.0.2" + statuses "~1.2.1" -serve-static@^1.10.0: - version "1.12.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.1.tgz#7443a965e3ced647aceb5639fa06bf4d1bbe0039" +serve-static@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.10.0.tgz#be632faa685820e4a43ed3df1379135cc4f370d7" + integrity sha1-vmMvqmhYIOSkPtPfE3kTXMTzcNc= dependencies: - encodeurl "~1.0.1" - escape-html "~1.0.3" - parseurl "~1.3.1" - send "0.15.1" + escape-html "1.0.2" + parseurl "~1.3.0" + send "0.13.0" -setprototypeof@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: version "2.4.9" @@ -1880,11 +2772,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" @@ -1914,6 +2818,15 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" +source-map@^0.5.0, source-map@~0.5.3: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" @@ -1924,9 +2837,17 @@ source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -source-map@~0.5.3: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +spawn-wrap@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" + integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== + dependencies: + foreground-child "^2.0.0" + is-windows "^1.0.2" + make-dir "^3.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + which "^2.0.1" split@^1.0.0: version "1.0.0" @@ -1937,10 +2858,32 @@ split@^1.0.0: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -"statuses@>= 1.3.1 < 2", statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +statuses@1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +statuses@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.2.1.tgz#dded45cc18256d51ed40aec142489d5c61026d28" + integrity sha1-3e1FzBglbVHtQK7BQkidXGECbSg= stream-browserify@^2.0.0: version "2.0.1" @@ -1956,14 +2899,14 @@ stream-combiner2@^1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" -stream-http@^2.0.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" +stream-http@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.1.0.tgz#22fb33fe9b4056b4eccf58bd8f400c4b993ffe57" + integrity sha512-cuB6RgO7BqC4FBYzmnvhob5Do3wIdIsXAgGycHJnW+981gHqoYcYz9lqjJrk8WXRddbwPuqPYRl+bag6mYv4lw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.2.6" - to-arraybuffer "^1.0.0" + readable-stream "^3.0.6" xtend "^4.0.0" stream-splicer@^2.0.0: @@ -1990,19 +2933,27 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string.prototype.trim@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.0" - function-bind "^1.0.2" + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -string_decoder@~1.0.0, string_decoder@~1.0.3: +string_decoder@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" dependencies: @@ -2028,6 +2979,18 @@ strip-ansi@^5.1.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2056,6 +3019,13 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" + integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + dependencies: + has-flag "^4.0.0" + syntax-error@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" @@ -2072,7 +3042,7 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" -tap-dot@^2.0.0: +tap-dot@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/tap-dot/-/tap-dot-2.0.0.tgz#3d6c5fe54ba4e1a419fa64db74b5eebfcf8cf840" integrity sha512-7N1yPcRDgdfHCUbG6lZ0hXo53NyXhKIjJNhqKBixl9HVEG4QasG16Nlvr8wRnqr2ZRYVWmbmxwF3NOBbTLtQLQ== @@ -2090,23 +3060,27 @@ tap-out@^1.3.2: split "^1.0.0" trim "0.0.1" -tape@^4.0.2: - version "4.6.3" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.6.3.tgz#637e77581e9ab2ce17577e9bd4ce4f575806d8b6" +tape@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.0.2.tgz#7e484577d7fb2ec97365b934ad57601cc623c3f1" + integrity sha1-fkhFd9f7LslzZbk0rVdgHMYjw/E= dependencies: - deep-equal "~1.0.1" - defined "~1.0.0" - for-each "~0.3.2" - function-bind "~1.1.0" - glob "~7.1.1" - has "~1.0.1" - inherits "~2.0.3" - minimist "~1.2.0" - object-inspect "~1.2.1" - resolve "~1.1.7" + deep-equal "~1.0.0" + defined "~0.0.0" + glob "~5.0.3" + inherits "~2.0.1" + object-inspect "~1.0.0" resumer "~0.0.0" - string.prototype.trim "~1.1.2" - through "~2.3.8" + through "~2.3.4" + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" text-table@^0.2.0: version "0.2.0" @@ -2120,7 +3094,7 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4, through@~2.3.8: +through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -2137,9 +3111,18 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" trim@0.0.1: version "0.0.1" @@ -2150,16 +3133,42 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== -tty-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" +tty-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" +type-fest@^0.8.0: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typedarray@^0.0.6, typedarray@~0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -2198,7 +3207,7 @@ url@~0.11.0: punycode "1.3.2" querystring "0.2.0" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -2212,11 +3221,29 @@ utils-merge@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" -vm-browserify@~0.0.1: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" +uuid@^3.3.2, uuid@^3.3.3: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: - indexof "0.0.1" + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vm-browserify@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" + integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.1.1: version "1.2.12" @@ -2231,10 +3258,22 @@ which@^1.2.9: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" @@ -2247,9 +3286,29 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" write@1.0.3: version "1.0.3" @@ -2269,6 +3328,41 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" +xtend@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yargs-parser@^18.1.1: + version "18.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" + integrity sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^15.0.2: + version "15.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" + integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.1" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"