diff --git a/.gitignore b/.gitignore index 14df299..b226527 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,30 @@ typings/ # dotenv environment variables file .env +# Mac stuff +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/.travis.yml b/.travis.yml index aa6ab92..c356a8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ language: node_js node_js: - "stable" +before_install: + - npm update + install: - npm install @@ -14,5 +17,5 @@ script: - npm run cover # Send coverage data to Coveralls -after_script: "cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js" +after_script: "cat test/coverage/lcov.info | node_modules/coveralls/bin/coveralls.js" diff --git a/.vscode/launch.json b/.vscode/launch.json index 0fb7f9d..09a3249 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,34 +7,13 @@ { "type": "node", "request": "launch", - "name": "Mocha Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "name": "Jest Tests", + "program": "${workspaceFolder}/node_modules/jest/bin/jest", "args": [ - "-u", - "bdd", - "--timeout", - "10000", - "--colors", - "${workspaceFolder}/test" + "--runInBand", ], "preLaunchTask": "build", "internalConsoleOptions": "openOnSessionStart" - }, - { - "type": "node", - "request": "launch", - "name": "TS:Mocha Tests", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": [ - "--compilers", - "ts:ts-node/register", - "--timeout", - "10000", - "--colors", - "${workspaceRoot}/test/*.spec.ts" - // "${workspaceRoot}/test/maxrects_bin.spec.js" - ], - "internalConsoleOptions": "openOnSessionStart" } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c60d994..89ef5af 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,12 +4,10 @@ "version": "2.0.0", "tasks": [ { + "type": "npm", + "script": "build:clean", "label": "build", - "type": "typescript", - "tsconfig": "tsconfig.json", - "problemMatcher": [ - "$tsc" - ], + "problemMatcher": [ "$tsc" ], "group": { "kind": "build", "isDefault": true diff --git a/README.md b/README.md index 8c8b914..7444caa 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Max Rects Packer + [![Build Status](https://travis-ci.org/soimy/maxrects-packer.svg?branch=master)](https://travis-ci.org/soimy/maxrects-packer) [![Coverage Status](https://coveralls.io/repos/github/soimy/maxrects-packer/badge.svg?branch=master)](https://coveralls.io/github/soimy/maxrects-packer?branch=master) [![npm version](https://badge.fury.io/js/maxrects-packer.svg)](https://badge.fury.io/js/maxrects-packer) ![npm](https://img.shields.io/npm/dm/maxrects-packer.svg) +![npm type definitions](https://shields-staging.herokuapp.com/npm/types/maxrects-packer.svg) A simple max rectangle 2d bin packing algorithm for packing glyphs or images into multiple sprite-sheet/atlas. Minimalist with no module dependency. @@ -14,13 +16,18 @@ And you can also save/load to reuse packer to add new sprites. (Below is a demo ![Preview image](https://raw.githubusercontent.com/soimy/maxrects-packer/master/preview.png) -## Usage: -**Notice:** *Since version 2.0.0beta Max Rects Packer is rewritten in `typescript` and change the import method from old `require("maxrects-packer")` to `require("maxrects-packer").MaxRectsPacker` or more fashioned `import` statement.* +## Installing ```bash npm install maxrects-packer --save ``` +## Usage + +**Note:** *Since version 2.0.0 Max Rects Packer is rewritten in `typescript` and change the import method from old `require("maxrects-packer")` to `require("maxrects-packer").MaxRectsPacker` or more fashioned `import` statement.* + +**Note:** *Since version 2.1.0 packer can be fed with any object with `width & height` members, no need to follow `{ width: number, height: number, data: any }` pattern, if you are using `typescript`, that also mean any class extending `MaxRectsPacker.IRectangle`* + ```javascript let MaxRectsPacker = require("maxrects-packer").MaxRectsPacker; const options = { @@ -31,12 +38,12 @@ const options = { }; // Set packing options let packer = new MaxRectsPacker(1024, 1024, 2, options); // width, height, padding, options -let input = [ - {width: 600, height: 20, data: {name: "tree", foo: "bar"}}, - {width: 600, height: 20, data: {name: "flower"}}, - {width: 2000, height: 2000, data: {name: "oversized background"}}, - {width: 1000, height: 1000, data: {name: "background"}}, - {width: 1000, height: 1000, data: {name: "overlay"}} +let input = [ // any object with width & height is OK since v2.1.0 + {width: 600, height: 20, name: "tree", foo: "bar"}, + {width: 600, height: 20, name: "flower"}, + {width: 2000, height: 2000, name: "oversized background", {frameWidth: 500, frameHeight: 500}}, + {width: 1000, height: 1000, name: "background", color: 0x000000ff}, + {width: 1000, height: 1000, name: "overlay"} ]; packer.addArray(input); // Start packing with input array @@ -44,16 +51,16 @@ packer.bins.forEach(bin => { console.log(bin.rects); }); -// Reuse packer +// Reuse packer let bins = packer.save(); packer.load(bins); packer.addArray(input); - ``` ## Test -``` + +```bash npm test ``` @@ -62,35 +69,50 @@ npm test Note: maxrects-packer requires node >= 4.0.0 #### ```new MaxRectsPacker(maxWidth, maxHeight[, padding, options])``` + Creates a new Packer. maxWidth and maxHeight are passed on to all bins. If ```padding``` is supplied all rects will be kept at least ```padding``` pixels apart. + - `options.smart` packing with smallest possible size. (default is `true`) - `options.pot` bin size round up to smallest power of 2. (defalt is `true`) - `options.square` bin size shall alway be square. (defaut is `false`) - `options.allowRotation` allow 90-degree rotation while packing. (defaut is `false`) -#### ```packer.add(width, height, data)``` +#### ```packer.add(width, height, data)``` +1 overload + Adds a rect to an existing bin or creates a new one to accomodate it. ```data``` can be anything, it will be stored along with the position data of each rect. -#### ```packer.addArray([{width: width, height: height, data: data}, ...])``` +#### ```packer.add({width: number, height: number, ... })``` +1 overload + +Adds a rect to an existing bin or creates a new one to accomodate it. Accept any object with `width & height`. If you are using `typescript`, that means any class extends `MaxRectsPacker.IRectangle` + +#### ```packer.addArray([{width: number, height: number, ...}, ...])``` + Adds multiple rects. Since the input is automatically sorted before adding this approach usually leads to fewer bins created than separate calls to ```.add()``` #### ```let bins = packer.save()``` + Save current bins settings and free area to an Array of objects for later use. Better to `JSON.stringify(bins)` and store in file. #### ```packer.load(bins)``` + Restore previous saved `let bins = JSON.parse(fs.readFileSync(savedFile, 'utf8'));` settings and overwrite current one. Continue packing and previous packed area will not be overlaped. #### ```packer.bins``` + Array of bins. Every bin has a ```width``` and ```height``` parameter as well as an array ```rects```. #### ```packer.bins[n].rects``` + Array of rects for a specific bin. Every rect has ```x```, ```y```, ```width```, ```height```, ```rot``` and ```data```. In case of an rect exceeding ```maxWidth```/```maxHeight``` there will also be an ```oversized``` flag set to ```true```. ## Support for 90-degree rotation packing + If `options.allowRotation` is set to `true`, packer will attempt to do an extra test in `findNode()` on rotated `Rectangle`. If the rotated one gives the best score, the given `Rectangle` will be rotated in the `Rectangle.rot` set to `true`. ## Support for oversized rectangles + Normally all bins are of equal size or smaller than ```maxWidth```/```maxHeight```. If a rect is added that individually does not fit into those constraints a special bin will be created. This bin will only contain a single rect with a special "oversized" flag. This can be handled further on in the chain by displaying an error/warning or by simply ignoring it. ## Packing algorithm + Use Max Rectangle Algorithm for packing, same as famous **Texture Packer** diff --git a/TODO b/TODO new file mode 100644 index 0000000..f017c39 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +✔ 用Rollup一体化打包 @done(19-05-26 14:45) +✔ 测试引擎Mocha->Jest @done(19-05-26 14:45) +✔ 更新Covers 从Istanble->Jest @done(19-05-26 14:45) +✔ 更新README.md @done(19-05-26 17:34) +✔ Test增加Generic type部分 @done(19-05-26 17:04) +☐ 发布2.1.0版 +☐ 增加Bin.border控制参数 \ No newline at end of file diff --git a/dist/maxrects-packer.d.ts b/dist/maxrects-packer.d.ts new file mode 100644 index 0000000..bbfa0a2 --- /dev/null +++ b/dist/maxrects-packer.d.ts @@ -0,0 +1,149 @@ + +// FILE GENERATED BY `rollup-plugin-dts@0.15.1` +// https://github.com/Swatinem/rollup-plugin-dts + +interface IRectangle { + width: number; + height: number; + x: number; + y: number; + [propName: string]: any; +} +declare class Rectangle implements IRectangle { + width: number; + height: number; + x: number; + y: number; + rot: boolean; + data: any; + oversized: boolean; + constructor(width?: number, height?: number, x?: number, y?: number, rot?: boolean); + static Collide(first: Rectangle, second: Rectangle): boolean; + static Contain(first: Rectangle, second: Rectangle): boolean; + area(): number; + collide(rect: Rectangle): boolean; + contain(rect: Rectangle): boolean; +} + +interface IBin { + width: number; + height: number; + maxWidth: number; + maxHeight: number; + freeRects: IRectangle[]; + rects: IRectangle[]; + options: IOption; +} +declare abstract class Bin implements IBin { + width: number; + height: number; + maxWidth: number; + maxHeight: number; + freeRects: IRectangle[]; + rects: IRectangle[]; + options: IOption; + abstract add(rect: IRectangle): IRectangle | undefined; + abstract add(width: number, height: number, data: any): IRectangle | undefined; +} + +/** + * Options for MaxRect Packer + * @property {boolean} options.smart Smart sizing packer (default is true) + * @property {boolean} options.pot use power of 2 sizing (default is true) + * @property {boolean} options.square use square size (default is false) + * @export + * @interface Option + */ +interface IOption { + smart?: boolean; + pot?: boolean; + square?: boolean; + allowRotation?: boolean; +} +declare class MaxRectsPacker { + width: number; + height: number; + padding: number; + options: IOption; + bins: Bin[]; + /** + * Creates an instance of MaxRectsPacker. + * @param {number} width of the output atlas (default is 4096) + * @param {number} height of the output atlas (default is 4096) + * @param {number} padding between glyphs/images (default is 0) + * @param {IOption} [options={}] (Optional) packing options + * @memberof MaxRectsPacker + */ + constructor(width?: number, height?: number, padding?: number, options?: IOption); + /** + * Add a bin/rectangle object with data to packer + * @param {number} width of the input bin/rectangle + * @param {number} height of the input bin/rectangle + * @param {*} data custom data object + * @memberof MaxRectsPacker + */ + add(width: number, height: number, data: any): IRectangle; + /** + * Add a bin/rectangle object extends IRectangle to packer + * @template T Generic type extends IRectangle interface + * @param {T} rect the rect object add to the packer bin + * @memberof MaxRectsPacker + */ + add(rect: T): T; + /** + * Add an Array of bins/rectangles to the packer. + * Object structure: { width, height, data } + * @param {IRectangle[]} rects Array of bin/rectangles + * @memberof MaxRectsPacker + */ + addArray(rects: T[]): void; + /** + * Load bins to the packer, overwrite exist bins + * @param {MaxRectsBin[]} bins MaxRectsBin objects + * @memberof MaxRectsPacker + */ + load(bins: Bin[]): void; + /** + * Output current bins to save + * @memberof MaxRectsPacker + */ + save(): IBin[]; + private sort; +} + +declare class MaxRectsBin extends Bin { + maxWidth: number; + maxHeight: number; + padding: number; + options: IOption; + width: number; + height: number; + freeRects: Rectangle[]; + rects: IRectangle[]; + private verticalExpand; + private stage; + constructor(maxWidth?: number, maxHeight?: number, padding?: number, options?: IOption); + add(rect: T): T | undefined; + add(width: number, height: number, data: any): Rectangle | undefined; + private findNode; + private splitNode; + private pruneFreeList; + private updateBinSize; + private expandFreeRects; +} + +declare class OversizedElementBin extends Bin { + width: number; + height: number; + data: any; + maxWidth: number; + maxHeight: number; + options: IOption; + rects: T[]; + freeRects: IRectangle[]; + constructor(rect: T); + constructor(width: number, height: number, data: any); + add(): undefined; +} + +export { Bin, IOption, IRectangle, MaxRectsBin, MaxRectsPacker, OversizedElementBin, Rectangle }; diff --git a/dist/maxrects-packer.js b/dist/maxrects-packer.js new file mode 100644 index 0000000..b6c9f0b --- /dev/null +++ b/dist/maxrects-packer.js @@ -0,0 +1,393 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.MaxRectsPacker = {})); +}(this, function (exports) { 'use strict'; + + class Rectangle { + constructor(width = 0, height = 0, x = 0, y = 0, rot = false) { + this.width = width; + this.height = height; + this.x = x; + this.y = y; + this.rot = rot; + this.oversized = false; + this.data = {}; + } + static Collide(first, second) { return first.collide(second); } + static Contain(first, second) { return first.contain(second); } + area() { return this.width * this.height; } + collide(rect) { + return (rect.x < this.x + this.width && + rect.x + rect.width > this.x && + rect.y < this.y + this.height && + rect.y + rect.height > this.y); + } + contain(rect) { + return (rect.x >= this.x && rect.y >= this.y && + rect.x + rect.width <= this.x + this.width && rect.y + rect.height <= this.y + this.height); + } + } + + class Bin { + } + + class MaxRectsBin extends Bin { + constructor(maxWidth = EDGE_MAX_VALUE, maxHeight = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { + super(); + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this.padding = padding; + this.options = options; + this.freeRects = []; + this.rects = []; + this.verticalExpand = false; + this.width = this.options.smart ? 0 : maxWidth; + this.height = this.options.smart ? 0 : maxHeight; + this.freeRects.push(new Rectangle(this.maxWidth + this.padding, this.maxHeight + this.padding)); + this.stage = new Rectangle(this.width, this.height); + } + add(...args) { + let width; + let height; + let data; + let rect; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsBin.add(): Wrong parameters"); + rect = args[0]; + width = rect.width; + height = rect.height; + } + else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + } + let node = this.findNode(width + this.padding, height + this.padding); + if (node) { + this.updateBinSize(node); + let numRectToProcess = this.freeRects.length; + let i = 0; + while (i < numRectToProcess) { + if (this.splitNode(this.freeRects[i], node)) { + this.freeRects.splice(i, 1); + numRectToProcess--; + i--; + } + i++; + } + this.pruneFreeList(); + this.verticalExpand = this.width > this.height ? true : false; + if (!rect) { + rect = new Rectangle(width, height, node.x, node.y, node.rot); + rect.data = data; + } + else { + rect.x = node.x; + rect.y = node.y; + rect.rot = node.rot; + } + this.rects.push(rect); + return rect; + } + else if (!this.verticalExpand) { + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0)) + || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding))) { + return rect ? this.add(rect) : this.add(width, height, data); + } + } + else { + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding)) || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0))) { + return rect ? this.add(rect) : this.add(width, height, data); + } + } + return undefined; + } + findNode(width, height) { + let score = Number.MAX_VALUE; + let areaFit; + let r; + let bestNode; + for (let i in this.freeRects) { + r = this.freeRects[i]; + if (r.width >= width && r.height >= height) { + areaFit = r.width * r.height - width * height; + if (areaFit < score) { + bestNode = new Rectangle(width, height, r.x, r.y); + score = areaFit; + } + } + if (!this.options.allowRotation) + continue; + // Continue to test 90-degree rotated rectangle + if (r.width >= height && r.height >= width) { + areaFit = r.width * r.height - height * width; + if (areaFit < score) { + bestNode = new Rectangle(height, width, r.x, r.y, true); // Rotated node + score = areaFit; + } + } + } + return bestNode; + } + splitNode(freeRect, usedNode) { + // Test if usedNode intersect with freeRect + if (!freeRect.collide(usedNode)) + return false; + // Do vertical split + if (usedNode.x < freeRect.x + freeRect.width && usedNode.x + usedNode.width > freeRect.x) { + // New node at the top side of the used node + if (usedNode.y > freeRect.y && usedNode.y < freeRect.y + freeRect.height) { + let newNode = new Rectangle(freeRect.width, usedNode.y - freeRect.y, freeRect.x, freeRect.y); + this.freeRects.push(newNode); + } + // New node at the bottom side of the used node + if (usedNode.y + usedNode.height < freeRect.y + freeRect.height) { + let newNode = new Rectangle(freeRect.width, freeRect.y + freeRect.height - (usedNode.y + usedNode.height), freeRect.x, usedNode.y + usedNode.height); + this.freeRects.push(newNode); + } + } + // Do Horizontal split + if (usedNode.y < freeRect.y + freeRect.height && + usedNode.y + usedNode.height > freeRect.y) { + // New node at the left side of the used node. + if (usedNode.x > freeRect.x && usedNode.x < freeRect.x + freeRect.width) { + let newNode = new Rectangle(usedNode.x - freeRect.x, freeRect.height, freeRect.x, freeRect.y); + this.freeRects.push(newNode); + } + // New node at the right side of the used node. + if (usedNode.x + usedNode.width < freeRect.x + freeRect.width) { + let newNode = new Rectangle(freeRect.x + freeRect.width - (usedNode.x + usedNode.width), freeRect.height, usedNode.x + usedNode.width, freeRect.y); + this.freeRects.push(newNode); + } + } + return true; + } + pruneFreeList() { + // Go through each pair of freeRects and remove any rects that is redundant + let i = 0; + let j = 0; + let len = this.freeRects.length; + while (i < len) { + j = i + 1; + let tmpRect1 = this.freeRects[i]; + while (j < len) { + let tmpRect2 = this.freeRects[j]; + if (tmpRect2.contain(tmpRect1)) { + this.freeRects.splice(i, 1); + i--; + len--; + break; + } + if (tmpRect1.contain(tmpRect2)) { + this.freeRects.splice(j, 1); + j--; + len--; + } + j++; + } + i++; + } + } + updateBinSize(node) { + if (!this.options.smart) + return false; + if (this.stage.contain(node)) + return false; + let tmpWidth = Math.max(this.width, node.x + node.width - this.padding); + let tmpHeight = Math.max(this.height, node.y + node.height - this.padding); + if (this.options.pot) { + tmpWidth = Math.pow(2, Math.ceil(Math.log(tmpWidth) * Math.LOG2E)); + tmpHeight = Math.pow(2, Math.ceil(Math.log(tmpHeight) * Math.LOG2E)); + } + if (this.options.square) { + tmpWidth = tmpHeight = Math.max(tmpWidth, tmpHeight); + } + if (tmpWidth > this.maxWidth + this.padding || tmpHeight > this.maxHeight + this.padding) { + return false; + } + this.expandFreeRects(tmpWidth + this.padding, tmpHeight + this.padding); + this.width = this.stage.width = tmpWidth; + this.height = this.stage.height = tmpHeight; + return true; + } + expandFreeRects(width, height) { + this.freeRects.forEach((freeRect, index) => { + if (freeRect.x + freeRect.width >= Math.min(this.width + this.padding, width)) { + freeRect.width = width - freeRect.x; + } + if (freeRect.y + freeRect.height >= Math.min(this.height + this.padding, height)) { + freeRect.height = height - freeRect.y; + } + }, this); + this.freeRects.push(new Rectangle(width - this.width - this.padding, height, this.width + this.padding, 0)); + this.freeRects.push(new Rectangle(width, height - this.height - this.padding, 0, this.height + this.padding)); + this.freeRects.forEach((freeRect, index) => { + if (freeRect.width <= 0 || freeRect.height <= 0) { + this.freeRects.splice(index, 1); + } + }, this); + this.pruneFreeList(); + } + } + + class OversizedElementBin extends Bin { + constructor(...args) { + super(); + this.rects = []; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("OversizedElementBin: Wrong parameters"); + const rect = args[0]; + this.rects = [rect]; + this.width = rect.width; + this.height = rect.height; + this.data = rect.data; + rect.oversized = true; + } + else { + this.width = args[0]; + this.height = args[1]; + this.data = args.length > 2 ? args[2] : null; + const rect = new Rectangle(this.width, this.height); + rect.oversized = true; + rect.data = this.data; + this.rects.push(rect); + } + this.freeRects = []; + this.maxWidth = this.width; + this.maxHeight = this.height; + this.options = { smart: false, pot: false, square: false }; + } + add() { return undefined; } + } + + const EDGE_MAX_VALUE = 4096; + class MaxRectsPacker { + /** + * Creates an instance of MaxRectsPacker. + * @param {number} width of the output atlas (default is 4096) + * @param {number} height of the output atlas (default is 4096) + * @param {number} padding between glyphs/images (default is 0) + * @param {IOption} [options={}] (Optional) packing options + * @memberof MaxRectsPacker + */ + constructor(width = EDGE_MAX_VALUE, height = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { + this.width = width; + this.height = height; + this.padding = padding; + this.options = options; + this.bins = []; + } + add(...args) { + let width; + let height; + let data; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsPacker.add(): Wrong parameters"); + const rect = args[0]; + if (rect.width > this.width || rect.height > this.height) { + this.bins.push(new OversizedElementBin(rect)); + } + else { + let added = this.bins.find(bin => bin.add(rect) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(rect); + this.bins.push(bin); + } + } + } + else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + if (width > this.width || height > this.height) { + this.bins.push(new OversizedElementBin(width, height, data)); + } + else { + let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(width, height, data); + this.bins.push(bin); + } + } + } + } + /** + * Add an Array of bins/rectangles to the packer. + * Object structure: { width, height, data } + * @param {IRectangle[]} rects Array of bin/rectangles + * @memberof MaxRectsPacker + */ + addArray(rects) { + this.sort(rects).forEach(rect => this.add(rect)); + } + /** + * Load bins to the packer, overwrite exist bins + * @param {MaxRectsBin[]} bins MaxRectsBin objects + * @memberof MaxRectsPacker + */ + load(bins) { + bins.forEach((bin, index) => { + if (bin.maxWidth > this.width || bin.maxHeight > this.height) { + this.bins.push(new OversizedElementBin(bin.width, bin.height, {})); + } + else { + let newBin = new MaxRectsBin(this.width, this.height, this.padding, bin.options); + newBin.freeRects.splice(0); + bin.freeRects.forEach((r, i) => { + newBin.freeRects.push(new Rectangle(r.width, r.height, r.x, r.y)); + }); + newBin.width = bin.width; + newBin.height = bin.height; + this.bins[index] = newBin; + } + }, this); + } + /** + * Output current bins to save + * @memberof MaxRectsPacker + */ + save() { + let saveBins = []; + this.bins.forEach((bin => { + let saveBin = { + width: bin.width, + height: bin.height, + maxWidth: bin.maxWidth, + maxHeight: bin.maxHeight, + freeRects: [], + rects: [], + options: bin.options + }; + bin.freeRects.forEach(r => { + saveBin.freeRects.push({ + x: r.x, + y: r.y, + width: r.width, + height: r.height + }); + }); + saveBins.push(saveBin); + })); + return saveBins; + } + sort(rects) { + return rects.slice().sort((a, b) => Math.max(b.width, b.height) - Math.max(a.width, a.height)); + } + } + + exports.Bin = Bin; + exports.MaxRectsBin = MaxRectsBin; + exports.MaxRectsPacker = MaxRectsPacker; + exports.OversizedElementBin = OversizedElementBin; + exports.Rectangle = Rectangle; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=maxrects-packer.js.map diff --git a/dist/maxrects-packer.js.map b/dist/maxrects-packer.js.map new file mode 100644 index 0000000..fa9891e --- /dev/null +++ b/dist/maxrects-packer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"maxrects-packer.js","sources":["../src/geom/Rectangle.ts","../src/abstract-bin.ts","../src/maxrects-bin.ts","../src/oversized-element-bin.ts","../src/maxrects-packer.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;;;;;UAQa,SAAS;QAGlB,YACW,QAAgB,CAAC,EACjB,SAAiB,CAAC,EAClB,IAAY,CAAC,EACb,IAAY,CAAC,EACb,MAAe,KAAK;YAJpB,UAAK,GAAL,KAAK,CAAY;YACjB,WAA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,EAAE,EAAE;oBACb,KAAK,EAAE,EAAE;oBACT,OAAO,EAAE,GAAG,CAAC,OAAO;iBACvB,CAAC;gBACF,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;oBACnB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;wBACnB,CAAC,EAAE,CAAC,CAAC,CAAC;wBACN,CAAC,EAAE,CAAC,CAAC,CAAC;wBACN,KAAK,EAAE,CAAC,CAAC,KAAK;wBACd,MAAM,EAAE,CAAC,CAAC,MAAM;qBACnB,CAAC,CAAC;iBACN,CAAC,CAAC;gBACH,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC1B,EAAE,CAAC;YACJ,OAAO,QAAQ,CAAC;SACnB;QAEO,IAAI,CAAE,KAAU;YACpB,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;SAClG;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/maxrects-packer.min.js b/dist/maxrects-packer.min.js new file mode 100644 index 0000000..5a605e1 --- /dev/null +++ b/dist/maxrects-packer.min.js @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class Rectangle{constructor(t=0,i=0,h=0,e=0,s=!1){this.width=t,this.height=i,this.x=h,this.y=e,this.rot=s,this.oversized=!1,this.data={}}static Collide(t,i){return t.collide(i)}static Contain(t,i){return t.contain(i)}area(){return this.width*this.height}collide(t){return t.xthis.x&&t.ythis.y}contain(t){return t.x>=this.x&&t.y>=this.y&&t.x+t.width<=this.x+this.width&&t.y+t.height<=this.y+this.height}}class Bin{}class MaxRectsBin extends Bin{constructor(t=EDGE_MAX_VALUE,i=EDGE_MAX_VALUE,h=0,e={smart:!0,pot:!0,square:!0,allowRotation:!1}){super(),this.maxWidth=t,this.maxHeight=i,this.padding=h,this.options=e,this.freeRects=[],this.rects=[],this.verticalExpand=!1,this.width=this.options.smart?0:t,this.height=this.options.smart?0:i,this.freeRects.push(new Rectangle(this.maxWidth+this.padding,this.maxHeight+this.padding)),this.stage=new Rectangle(this.width,this.height)}add(...t){let i,h,e,s;if(1===t.length){if("object"!=typeof t[0])throw new Error("MacrectsBin.add(): Wrong parameters");i=(s=t[0]).width,h=s.height}else i=t[0],h=t[1],e=t.length>2?t[2]:null;let n=this.findNode(i+this.padding,h+this.padding);if(n){this.updateBinSize(n);let t=this.freeRects.length,d=0;for(;dthis.height,s?(s.x=n.x,s.y=n.y,s.rot=n.rot):(s=new Rectangle(i,h,n.x,n.y,n.rot)).data=e,this.rects.push(s),s}if(this.verticalExpand){if(this.updateBinSize(new Rectangle(i+this.padding,h+this.padding,0,this.height+this.padding))||this.updateBinSize(new Rectangle(i+this.padding,h+this.padding,this.width+this.padding,0)))return s?this.add(s):this.add(i,h,e)}else if(this.updateBinSize(new Rectangle(i+this.padding,h+this.padding,this.width+this.padding,0))||this.updateBinSize(new Rectangle(i+this.padding,h+this.padding,0,this.height+this.padding)))return s?this.add(s):this.add(i,h,e)}findNode(t,i){let h,e,s,n=Number.MAX_VALUE;for(let d in this.freeRects)(e=this.freeRects[d]).width>=t&&e.height>=i&&(h=e.width*e.height-t*i)=i&&e.height>=t&&(h=e.width*e.height-i*t)t.x){if(i.y>t.y&&i.yt.y){if(i.x>t.x&&i.xthis.maxWidth+this.padding||h>this.maxHeight+this.padding)&&(this.expandFreeRects(i+this.padding,h+this.padding),this.width=this.stage.width=i,this.height=this.stage.height=h,!0)}expandFreeRects(t,i){this.freeRects.forEach((h,e)=>{h.x+h.width>=Math.min(this.width+this.padding,t)&&(h.width=t-h.x);h.y+h.height>=Math.min(this.height+this.padding,i)&&(h.height=i-h.y)},this),this.freeRects.push(new Rectangle(t-this.width-this.padding,i,this.width+this.padding,0)),this.freeRects.push(new Rectangle(t,i-this.height-this.padding,0,this.height+this.padding)),this.freeRects.forEach((t,i)=>{(t.width<=0||t.height<=0)&&this.freeRects.splice(i,1)},this),this.pruneFreeList()}}class OversizedElementBin extends Bin{constructor(...t){if(super(),this.rects=[],1===t.length){if("object"!=typeof t[0])throw new Error("OversizedElementBin: Wrong parameters");const i=t[0];this.rects=[i],this.width=i.width,this.height=i.height,this.data=i.data,i.oversized=!0}else{this.width=t[0],this.height=t[1],this.data=t.length>2?t[2]:null;const i=new Rectangle(this.width,this.height);i.oversized=!0,i.data=this.data,this.rects.push(i)}this.freeRects=[],this.maxWidth=this.width,this.maxHeight=this.height,this.options={smart:!1,pot:!1,square:!1}}add(){}}const EDGE_MAX_VALUE=4096;class MaxRectsPacker{constructor(t=EDGE_MAX_VALUE,i=EDGE_MAX_VALUE,h=0,e={smart:!0,pot:!0,square:!0,allowRotation:!1}){this.width=t,this.height=i,this.padding=h,this.options=e,this.bins=[]}add(...t){let i,h,e;if(1===t.length){if("object"!=typeof t[0])throw new Error("MacrectsPacker.add(): Wrong parameters");const i=t[0];if(i.width>this.width||i.height>this.height)this.bins.push(new OversizedElementBin(i));else{let t=this.bins.find(t=>void 0!==t.add(i));if(!t){let t=new MaxRectsBin(this.width,this.height,this.padding,this.options);t.add(i),this.bins.push(t)}}}else if(i=t[0],h=t[1],e=t.length>2?t[2]:null,i>this.width||h>this.height)this.bins.push(new OversizedElementBin(i,h,e));else{let t=this.bins.find(t=>void 0!==t.add(i,h,e));if(!t){let t=new MaxRectsBin(this.width,this.height,this.padding,this.options);t.add(i,h,e),this.bins.push(t)}}}addArray(t){this.sort(t).forEach(t=>this.add(t))}load(t){t.forEach((t,i)=>{if(t.maxWidth>this.width||t.maxHeight>this.height)this.bins.push(new OversizedElementBin(t.width,t.height,{}));else{let h=new MaxRectsBin(this.width,this.height,this.padding,t.options);h.freeRects.splice(0),t.freeRects.forEach((t,i)=>{h.freeRects.push(new Rectangle(t.width,t.height,t.x,t.y))}),h.width=t.width,h.height=t.height,this.bins[i]=h}},this)}save(){let t=[];return this.bins.forEach(i=>{let h={width:i.width,height:i.height,maxWidth:i.maxWidth,maxHeight:i.maxHeight,freeRects:[],rects:[],options:i.options};i.freeRects.forEach(t=>{h.freeRects.push({x:t.x,y:t.y,width:t.width,height:t.height})});t.push(h)}),t}sort(t){return t.slice().sort((t,i)=>Math.max(i.width,i.height)-Math.max(t.width,t.height))}}exports.Bin=Bin,exports.MaxRectsBin=MaxRectsBin,exports.MaxRectsPacker=MaxRectsPacker,exports.OversizedElementBin=OversizedElementBin,exports.Rectangle=Rectangle; diff --git a/dist/maxrects-packer.mjs b/dist/maxrects-packer.mjs new file mode 100644 index 0000000..88820df --- /dev/null +++ b/dist/maxrects-packer.mjs @@ -0,0 +1,379 @@ +class Rectangle { + constructor(width = 0, height = 0, x = 0, y = 0, rot = false) { + this.width = width; + this.height = height; + this.x = x; + this.y = y; + this.rot = rot; + this.oversized = false; + this.data = {}; + } + static Collide(first, second) { return first.collide(second); } + static Contain(first, second) { return first.contain(second); } + area() { return this.width * this.height; } + collide(rect) { + return (rect.x < this.x + this.width && + rect.x + rect.width > this.x && + rect.y < this.y + this.height && + rect.y + rect.height > this.y); + } + contain(rect) { + return (rect.x >= this.x && rect.y >= this.y && + rect.x + rect.width <= this.x + this.width && rect.y + rect.height <= this.y + this.height); + } +} + +class Bin { +} + +class MaxRectsBin extends Bin { + constructor(maxWidth = EDGE_MAX_VALUE, maxHeight = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { + super(); + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this.padding = padding; + this.options = options; + this.freeRects = []; + this.rects = []; + this.verticalExpand = false; + this.width = this.options.smart ? 0 : maxWidth; + this.height = this.options.smart ? 0 : maxHeight; + this.freeRects.push(new Rectangle(this.maxWidth + this.padding, this.maxHeight + this.padding)); + this.stage = new Rectangle(this.width, this.height); + } + add(...args) { + let width; + let height; + let data; + let rect; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsBin.add(): Wrong parameters"); + rect = args[0]; + width = rect.width; + height = rect.height; + } + else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + } + let node = this.findNode(width + this.padding, height + this.padding); + if (node) { + this.updateBinSize(node); + let numRectToProcess = this.freeRects.length; + let i = 0; + while (i < numRectToProcess) { + if (this.splitNode(this.freeRects[i], node)) { + this.freeRects.splice(i, 1); + numRectToProcess--; + i--; + } + i++; + } + this.pruneFreeList(); + this.verticalExpand = this.width > this.height ? true : false; + if (!rect) { + rect = new Rectangle(width, height, node.x, node.y, node.rot); + rect.data = data; + } + else { + rect.x = node.x; + rect.y = node.y; + rect.rot = node.rot; + } + this.rects.push(rect); + return rect; + } + else if (!this.verticalExpand) { + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0)) + || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding))) { + return rect ? this.add(rect) : this.add(width, height, data); + } + } + else { + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding)) || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0))) { + return rect ? this.add(rect) : this.add(width, height, data); + } + } + return undefined; + } + findNode(width, height) { + let score = Number.MAX_VALUE; + let areaFit; + let r; + let bestNode; + for (let i in this.freeRects) { + r = this.freeRects[i]; + if (r.width >= width && r.height >= height) { + areaFit = r.width * r.height - width * height; + if (areaFit < score) { + bestNode = new Rectangle(width, height, r.x, r.y); + score = areaFit; + } + } + if (!this.options.allowRotation) + continue; + // Continue to test 90-degree rotated rectangle + if (r.width >= height && r.height >= width) { + areaFit = r.width * r.height - height * width; + if (areaFit < score) { + bestNode = new Rectangle(height, width, r.x, r.y, true); // Rotated node + score = areaFit; + } + } + } + return bestNode; + } + splitNode(freeRect, usedNode) { + // Test if usedNode intersect with freeRect + if (!freeRect.collide(usedNode)) + return false; + // Do vertical split + if (usedNode.x < freeRect.x + freeRect.width && usedNode.x + usedNode.width > freeRect.x) { + // New node at the top side of the used node + if (usedNode.y > freeRect.y && usedNode.y < freeRect.y + freeRect.height) { + let newNode = new Rectangle(freeRect.width, usedNode.y - freeRect.y, freeRect.x, freeRect.y); + this.freeRects.push(newNode); + } + // New node at the bottom side of the used node + if (usedNode.y + usedNode.height < freeRect.y + freeRect.height) { + let newNode = new Rectangle(freeRect.width, freeRect.y + freeRect.height - (usedNode.y + usedNode.height), freeRect.x, usedNode.y + usedNode.height); + this.freeRects.push(newNode); + } + } + // Do Horizontal split + if (usedNode.y < freeRect.y + freeRect.height && + usedNode.y + usedNode.height > freeRect.y) { + // New node at the left side of the used node. + if (usedNode.x > freeRect.x && usedNode.x < freeRect.x + freeRect.width) { + let newNode = new Rectangle(usedNode.x - freeRect.x, freeRect.height, freeRect.x, freeRect.y); + this.freeRects.push(newNode); + } + // New node at the right side of the used node. + if (usedNode.x + usedNode.width < freeRect.x + freeRect.width) { + let newNode = new Rectangle(freeRect.x + freeRect.width - (usedNode.x + usedNode.width), freeRect.height, usedNode.x + usedNode.width, freeRect.y); + this.freeRects.push(newNode); + } + } + return true; + } + pruneFreeList() { + // Go through each pair of freeRects and remove any rects that is redundant + let i = 0; + let j = 0; + let len = this.freeRects.length; + while (i < len) { + j = i + 1; + let tmpRect1 = this.freeRects[i]; + while (j < len) { + let tmpRect2 = this.freeRects[j]; + if (tmpRect2.contain(tmpRect1)) { + this.freeRects.splice(i, 1); + i--; + len--; + break; + } + if (tmpRect1.contain(tmpRect2)) { + this.freeRects.splice(j, 1); + j--; + len--; + } + j++; + } + i++; + } + } + updateBinSize(node) { + if (!this.options.smart) + return false; + if (this.stage.contain(node)) + return false; + let tmpWidth = Math.max(this.width, node.x + node.width - this.padding); + let tmpHeight = Math.max(this.height, node.y + node.height - this.padding); + if (this.options.pot) { + tmpWidth = Math.pow(2, Math.ceil(Math.log(tmpWidth) * Math.LOG2E)); + tmpHeight = Math.pow(2, Math.ceil(Math.log(tmpHeight) * Math.LOG2E)); + } + if (this.options.square) { + tmpWidth = tmpHeight = Math.max(tmpWidth, tmpHeight); + } + if (tmpWidth > this.maxWidth + this.padding || tmpHeight > this.maxHeight + this.padding) { + return false; + } + this.expandFreeRects(tmpWidth + this.padding, tmpHeight + this.padding); + this.width = this.stage.width = tmpWidth; + this.height = this.stage.height = tmpHeight; + return true; + } + expandFreeRects(width, height) { + this.freeRects.forEach((freeRect, index) => { + if (freeRect.x + freeRect.width >= Math.min(this.width + this.padding, width)) { + freeRect.width = width - freeRect.x; + } + if (freeRect.y + freeRect.height >= Math.min(this.height + this.padding, height)) { + freeRect.height = height - freeRect.y; + } + }, this); + this.freeRects.push(new Rectangle(width - this.width - this.padding, height, this.width + this.padding, 0)); + this.freeRects.push(new Rectangle(width, height - this.height - this.padding, 0, this.height + this.padding)); + this.freeRects.forEach((freeRect, index) => { + if (freeRect.width <= 0 || freeRect.height <= 0) { + this.freeRects.splice(index, 1); + } + }, this); + this.pruneFreeList(); + } +} + +class OversizedElementBin extends Bin { + constructor(...args) { + super(); + this.rects = []; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("OversizedElementBin: Wrong parameters"); + const rect = args[0]; + this.rects = [rect]; + this.width = rect.width; + this.height = rect.height; + this.data = rect.data; + rect.oversized = true; + } + else { + this.width = args[0]; + this.height = args[1]; + this.data = args.length > 2 ? args[2] : null; + const rect = new Rectangle(this.width, this.height); + rect.oversized = true; + rect.data = this.data; + this.rects.push(rect); + } + this.freeRects = []; + this.maxWidth = this.width; + this.maxHeight = this.height; + this.options = { smart: false, pot: false, square: false }; + } + add() { return undefined; } +} + +const EDGE_MAX_VALUE = 4096; +class MaxRectsPacker { + /** + * Creates an instance of MaxRectsPacker. + * @param {number} width of the output atlas (default is 4096) + * @param {number} height of the output atlas (default is 4096) + * @param {number} padding between glyphs/images (default is 0) + * @param {IOption} [options={}] (Optional) packing options + * @memberof MaxRectsPacker + */ + constructor(width = EDGE_MAX_VALUE, height = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { + this.width = width; + this.height = height; + this.padding = padding; + this.options = options; + this.bins = []; + } + add(...args) { + let width; + let height; + let data; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsPacker.add(): Wrong parameters"); + const rect = args[0]; + if (rect.width > this.width || rect.height > this.height) { + this.bins.push(new OversizedElementBin(rect)); + } + else { + let added = this.bins.find(bin => bin.add(rect) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(rect); + this.bins.push(bin); + } + } + } + else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + if (width > this.width || height > this.height) { + this.bins.push(new OversizedElementBin(width, height, data)); + } + else { + let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(width, height, data); + this.bins.push(bin); + } + } + } + } + /** + * Add an Array of bins/rectangles to the packer. + * Object structure: { width, height, data } + * @param {IRectangle[]} rects Array of bin/rectangles + * @memberof MaxRectsPacker + */ + addArray(rects) { + this.sort(rects).forEach(rect => this.add(rect)); + } + /** + * Load bins to the packer, overwrite exist bins + * @param {MaxRectsBin[]} bins MaxRectsBin objects + * @memberof MaxRectsPacker + */ + load(bins) { + bins.forEach((bin, index) => { + if (bin.maxWidth > this.width || bin.maxHeight > this.height) { + this.bins.push(new OversizedElementBin(bin.width, bin.height, {})); + } + else { + let newBin = new MaxRectsBin(this.width, this.height, this.padding, bin.options); + newBin.freeRects.splice(0); + bin.freeRects.forEach((r, i) => { + newBin.freeRects.push(new Rectangle(r.width, r.height, r.x, r.y)); + }); + newBin.width = bin.width; + newBin.height = bin.height; + this.bins[index] = newBin; + } + }, this); + } + /** + * Output current bins to save + * @memberof MaxRectsPacker + */ + save() { + let saveBins = []; + this.bins.forEach((bin => { + let saveBin = { + width: bin.width, + height: bin.height, + maxWidth: bin.maxWidth, + maxHeight: bin.maxHeight, + freeRects: [], + rects: [], + options: bin.options + }; + bin.freeRects.forEach(r => { + saveBin.freeRects.push({ + x: r.x, + y: r.y, + width: r.width, + height: r.height + }); + }); + saveBins.push(saveBin); + })); + return saveBins; + } + sort(rects) { + return rects.slice().sort((a, b) => Math.max(b.width, b.height) - Math.max(a.width, a.height)); + } +} + +export { Bin, MaxRectsBin, MaxRectsPacker, OversizedElementBin, Rectangle }; +//# sourceMappingURL=maxrects-packer.mjs.map diff --git a/dist/maxrects-packer.mjs.map b/dist/maxrects-packer.mjs.map new file mode 100644 index 0000000..afd103d --- /dev/null +++ b/dist/maxrects-packer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"maxrects-packer.mjs","sources":["../src/geom/Rectangle.ts","../src/abstract-bin.ts","../src/maxrects-bin.ts","../src/oversized-element-bin.ts","../src/maxrects-packer.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":"MAQa,SAAS;IAGlB,YACW,QAAgB,CAAC,EACjB,SAAiB,CAAC,EAClB,IAAY,CAAC,EACb,IAAY,CAAC,EACb,MAAe,KAAK;QAJpB,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAY;QAClB,MAAC,GAAD,CAAC,CAAY;QACb,MAAC,GAAD,CAAC,CAAY;QACb,QAAG,GAAH,GAAG,CAAiB;QANxB,cAAS,GAAY,KAAK,CAAC;QAO9B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;KAClB;IACM,OAAO,OAAO,CAAE,KAAgB,EAAE,MAAiB,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;IACtF,OAAO,OAAO,CAAE,KAAgB,EAAE,MAAiB,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;IAEtF,IAAI,KAAc,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC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CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;KAClG;;;;;"} \ No newline at end of file diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..4ad9541 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + verbose: true, + coverageDirectory: './test/coverage' +}; \ No newline at end of file diff --git a/lib/abstract-bin.js b/lib/abstract-bin.js new file mode 100644 index 0000000..2ef253f --- /dev/null +++ b/lib/abstract-bin.js @@ -0,0 +1,3 @@ +export class Bin { +} +//# sourceMappingURL=abstract-bin.js.map \ No newline at end of file diff --git a/lib/abstract-bin.js.map b/lib/abstract-bin.js.map new file mode 100644 index 0000000..5f1436c --- /dev/null +++ b/lib/abstract-bin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract-bin.js","sourceRoot":"","sources":["../src/abstract-bin.ts"],"names":[],"mappings":"AAaA,MAAM,OAAgB,GAAG;CAUxB"} \ No newline at end of file diff --git a/lib/abstract_bin.js b/lib/abstract_bin.js deleted file mode 100644 index 3536fdc..0000000 --- a/lib/abstract_bin.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -class Bin { -} -exports.Bin = Bin; -//# sourceMappingURL=abstract_bin.js.map \ No newline at end of file diff --git a/lib/abstract_bin.js.map b/lib/abstract_bin.js.map deleted file mode 100644 index 8f24fa8..0000000 --- a/lib/abstract_bin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract_bin.js","sourceRoot":"","sources":["../src/abstract_bin.ts"],"names":[],"mappings":";;AAaA,MAAsB,GAAG;CASxB;AATD,kBASC"} \ No newline at end of file diff --git a/lib/geom/Rectangle.js b/lib/geom/Rectangle.js index a3cc56a..8e5d496 100644 --- a/lib/geom/Rectangle.js +++ b/lib/geom/Rectangle.js @@ -1,25 +1,25 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -class Rectangle { - constructor(x = 0, y = 0, width = 0, height = 0, rot = false) { - this.x = x; - this.y = y; +export class Rectangle { + constructor(width = 0, height = 0, x = 0, y = 0, rot = false) { this.width = width; this.height = height; + this.x = x; + this.y = y; this.rot = rot; + this.oversized = false; this.data = {}; } static Collide(first, second) { return first.collide(second); } static Contain(first, second) { return first.contain(second); } area() { return this.width * this.height; } collide(rect) { - return !(rect.x >= this.x + this.width || rect.x + rect.width <= this.x || - rect.y >= this.y + this.height || rect.y + rect.height <= this.y); + return (rect.x < this.x + this.width && + rect.x + rect.width > this.x && + rect.y < this.y + this.height && + rect.y + rect.height > this.y); } contain(rect) { return (rect.x >= this.x && rect.y >= this.y && rect.x + rect.width <= this.x + this.width && rect.y + rect.height <= this.y + this.height); } } -exports.Rectangle = Rectangle; //# sourceMappingURL=Rectangle.js.map \ No newline at end of file diff --git a/lib/geom/Rectangle.js.map b/lib/geom/Rectangle.js.map index bed611a..b1fc426 100644 --- a/lib/geom/Rectangle.js.map +++ b/lib/geom/Rectangle.js.map @@ -1 +1 @@ -{"version":3,"file":"Rectangle.js","sourceRoot":"","sources":["../../src/geom/Rectangle.ts"],"names":[],"mappings":";;AAQA,MAAa,SAAS;IAElB,YAAoB,IAAY,CAAC,EAAS,IAAY,CAAC,EAAS,QAAgB,CAAC,EAAS,SAAiB,CAAC,EAAS,MAAe,KAAK;QAArH,MAAC,GAAD,CAAC,CAAY;QAAS,MAAC,GAAD,CAAC,CAAY;QAAS,UAAK,GAAL,KAAK,CAAY;QAAS,WAAM,GAAN,MAAM,CAAY;QAAS,QAAG,GAAH,GAAG,CAAiB;QACrI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;IACM,MAAM,CAAC,OAAO,CAAE,KAAgB,EAAE,MAAiB,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,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mode 100644 index 0000000..841c42b --- /dev/null +++ b/lib/index.js @@ -0,0 +1,6 @@ +export { Rectangle } from "./geom/Rectangle"; +export { MaxRectsPacker } from "./maxrects-packer"; +export { Bin } from "./abstract-bin"; +export { MaxRectsBin } from "./maxrects-bin"; +export { OversizedElementBin } from "./oversized-element-bin"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 0000000..245727a --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAW,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"} \ No newline at end of file diff --git a/lib/maxrects_bin.js b/lib/maxrects-bin.js similarity index 66% rename from lib/maxrects_bin.js rename to lib/maxrects-bin.js index c42d479..2e47350 100644 --- a/lib/maxrects_bin.js +++ b/lib/maxrects-bin.js @@ -1,10 +1,8 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const maxrects_packer_1 = require("./maxrects_packer"); -const Rectangle_1 = require("./geom/Rectangle"); -const abstract_bin_1 = require("./abstract_bin"); -class MaxRectsBin extends abstract_bin_1.Bin { - constructor(maxWidth = maxrects_packer_1.EDGE_MAX_VALUE, maxHeight = maxrects_packer_1.EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { +import { EDGE_MAX_VALUE } from "./maxrects-packer"; +import { Rectangle } from "./geom/Rectangle"; +import { Bin } from "./abstract-bin"; +export class MaxRectsBin extends Bin { + constructor(maxWidth = EDGE_MAX_VALUE, maxHeight = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { super(); this.maxWidth = maxWidth; this.maxHeight = maxHeight; @@ -15,10 +13,26 @@ class MaxRectsBin extends abstract_bin_1.Bin { this.verticalExpand = false; this.width = this.options.smart ? 0 : maxWidth; this.height = this.options.smart ? 0 : maxHeight; - this.freeRects.push(new Rectangle_1.Rectangle(0, 0, this.maxWidth + this.padding, this.maxHeight + this.padding)); - this.stage = new Rectangle_1.Rectangle(0, 0, this.width, this.height); + this.freeRects.push(new Rectangle(this.maxWidth + this.padding, this.maxHeight + this.padding)); + this.stage = new Rectangle(this.width, this.height); } - add(width, height, data) { + add(...args) { + let width; + let height; + let data; + let rect; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsBin.add(): Wrong parameters"); + rect = args[0]; + width = rect.width; + height = rect.height; + } + else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + } let node = this.findNode(width + this.padding, height + this.padding); if (node) { this.updateBinSize(node); @@ -34,20 +48,27 @@ class MaxRectsBin extends abstract_bin_1.Bin { } this.pruneFreeList(); this.verticalExpand = this.width > this.height ? true : false; - let rect = new Rectangle_1.Rectangle(node.x, node.y, width, height, node.rot); - rect.data = data; + if (!rect) { + rect = new Rectangle(width, height, node.x, node.y, node.rot); + rect.data = data; + } + else { + rect.x = node.x; + rect.y = node.y; + rect.rot = node.rot; + } this.rects.push(rect); return rect; } else if (!this.verticalExpand) { - if (this.updateBinSize(new Rectangle_1.Rectangle(this.width + this.padding, 0, width + this.padding, height + this.padding)) - || this.updateBinSize(new Rectangle_1.Rectangle(0, this.height + this.padding, width + this.padding, height + this.padding))) { - return this.add(width, height, data); + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0)) + || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding))) { + return rect ? this.add(rect) : this.add(width, height, data); } } else { - if (this.updateBinSize(new Rectangle_1.Rectangle(0, this.height + this.padding, width + this.padding, height + this.padding)) || this.updateBinSize(new Rectangle_1.Rectangle(this.width + this.padding, 0, width + this.padding, height + this.padding))) { - return this.add(width, height, data); + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding)) || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0))) { + return rect ? this.add(rect) : this.add(width, height, data); } } return undefined; @@ -62,7 +83,7 @@ class MaxRectsBin extends abstract_bin_1.Bin { if (r.width >= width && r.height >= height) { areaFit = r.width * r.height - width * height; if (areaFit < score) { - bestNode = new Rectangle_1.Rectangle(r.x, r.y, width, height); + bestNode = new Rectangle(width, height, r.x, r.y); score = areaFit; } } @@ -72,7 +93,7 @@ class MaxRectsBin extends abstract_bin_1.Bin { if (r.width >= height && r.height >= width) { areaFit = r.width * r.height - height * width; if (areaFit < score) { - bestNode = new Rectangle_1.Rectangle(r.x, r.y, height, width, true); // Rotated node + bestNode = new Rectangle(height, width, r.x, r.y, true); // Rotated node score = areaFit; } } @@ -87,12 +108,12 @@ class MaxRectsBin extends abstract_bin_1.Bin { if (usedNode.x < freeRect.x + freeRect.width && usedNode.x + usedNode.width > freeRect.x) { // New node at the top side of the used node if (usedNode.y > freeRect.y && usedNode.y < freeRect.y + freeRect.height) { - let newNode = new Rectangle_1.Rectangle(freeRect.x, freeRect.y, freeRect.width, usedNode.y - freeRect.y); + let newNode = new Rectangle(freeRect.width, usedNode.y - freeRect.y, freeRect.x, freeRect.y); this.freeRects.push(newNode); } // New node at the bottom side of the used node if (usedNode.y + usedNode.height < freeRect.y + freeRect.height) { - let newNode = new Rectangle_1.Rectangle(freeRect.x, usedNode.y + usedNode.height, freeRect.width, freeRect.y + freeRect.height - (usedNode.y + usedNode.height)); + let newNode = new Rectangle(freeRect.width, freeRect.y + freeRect.height - (usedNode.y + usedNode.height), freeRect.x, usedNode.y + usedNode.height); this.freeRects.push(newNode); } } @@ -101,12 +122,12 @@ class MaxRectsBin extends abstract_bin_1.Bin { usedNode.y + usedNode.height > freeRect.y) { // New node at the left side of the used node. if (usedNode.x > freeRect.x && usedNode.x < freeRect.x + freeRect.width) { - let newNode = new Rectangle_1.Rectangle(freeRect.x, freeRect.y, usedNode.x - freeRect.x, freeRect.height); + let newNode = new Rectangle(usedNode.x - freeRect.x, freeRect.height, freeRect.x, freeRect.y); this.freeRects.push(newNode); } // New node at the right side of the used node. if (usedNode.x + usedNode.width < freeRect.x + freeRect.width) { - let newNode = new Rectangle_1.Rectangle(usedNode.x + usedNode.width, freeRect.y, freeRect.x + freeRect.width - (usedNode.x + usedNode.width), freeRect.height); + let newNode = new Rectangle(freeRect.x + freeRect.width - (usedNode.x + usedNode.width), freeRect.height, usedNode.x + usedNode.width, freeRect.y); this.freeRects.push(newNode); } } @@ -169,8 +190,8 @@ class MaxRectsBin extends abstract_bin_1.Bin { freeRect.height = height - freeRect.y; } }, this); - this.freeRects.push(new Rectangle_1.Rectangle(this.width + this.padding, 0, width - this.width - this.padding, height)); - this.freeRects.push(new Rectangle_1.Rectangle(0, this.height + this.padding, width, height - this.height - this.padding)); + this.freeRects.push(new Rectangle(width - this.width - this.padding, height, this.width + this.padding, 0)); + this.freeRects.push(new Rectangle(width, height - this.height - this.padding, 0, this.height + this.padding)); this.freeRects.forEach((freeRect, index) => { if (freeRect.width <= 0 || freeRect.height <= 0) { this.freeRects.splice(index, 1); @@ -179,5 +200,4 @@ class MaxRectsBin extends abstract_bin_1.Bin { this.pruneFreeList(); } } -exports.MaxRectsBin = MaxRectsBin; -//# sourceMappingURL=maxrects_bin.js.map \ No newline at end of file +//# sourceMappingURL=maxrects-bin.js.map \ No newline at end of file diff --git a/lib/maxrects-bin.js.map b/lib/maxrects-bin.js.map new file mode 100644 index 0000000..68e2ae0 --- /dev/null +++ b/lib/maxrects-bin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"maxrects-bin.js","sourceRoot":"","sources":["../src/maxrects-bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAW,MAAM,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AAC,MAAM,IAAI,CAAC,EAAE;gBAC7C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACnC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;CACJ"} \ No newline at end of file diff --git a/lib/maxrects_packer.js b/lib/maxrects-packer.js similarity index 51% rename from lib/maxrects_packer.js rename to lib/maxrects-packer.js index 3274949..b11c3ca 100644 --- a/lib/maxrects_packer.js +++ b/lib/maxrects-packer.js @@ -1,11 +1,9 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const Rectangle_1 = require("./geom/Rectangle"); -const maxrects_bin_1 = require("./maxrects_bin"); -const oversized_element_bin_1 = require("./oversized_element_bin"); -exports.EDGE_MAX_VALUE = 4096; -exports.EDGE_MIN_VALUE = 128; -class MaxRectsPacker { +import { Rectangle } from "./geom/Rectangle"; +import { MaxRectsBin } from "./maxrects-bin"; +import { OversizedElementBin } from "./oversized-element-bin"; +export const EDGE_MAX_VALUE = 4096; +export const EDGE_MIN_VALUE = 128; +export class MaxRectsPacker { /** * Creates an instance of MaxRectsPacker. * @param {number} width of the output atlas (default is 4096) @@ -14,30 +12,47 @@ class MaxRectsPacker { * @param {IOption} [options={}] (Optional) packing options * @memberof MaxRectsPacker */ - constructor(width = exports.EDGE_MAX_VALUE, height = exports.EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { + constructor(width = EDGE_MAX_VALUE, height = EDGE_MAX_VALUE, padding = 0, options = { smart: true, pot: true, square: true, allowRotation: false }) { this.width = width; this.height = height; this.padding = padding; this.options = options; this.bins = []; } - /** - * Add a bin/rectangle object with data to packer - * @param {number} width of the input bin/rectangle - * @param {number} height of the input bin/rectangle - * @param {*} data custom data object - * @memberof MaxRectsPacker - */ - add(width, height, data) { - if (width > this.width || height > this.height) { - this.bins.push(new oversized_element_bin_1.OversizedElementBin(width, height, data)); + add(...args) { + let width; + let height; + let data; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("MacrectsPacker.add(): Wrong parameters"); + const rect = args[0]; + if (rect.width > this.width || rect.height > this.height) { + this.bins.push(new OversizedElementBin(rect)); + } + else { + let added = this.bins.find(bin => bin.add(rect) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(rect); + this.bins.push(bin); + } + } } else { - let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); - if (!added) { - let bin = new maxrects_bin_1.MaxRectsBin(this.width, this.height, this.padding, this.options); - bin.add(width, height, data); - this.bins.push(bin); + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + if (width > this.width || height > this.height) { + this.bins.push(new OversizedElementBin(width, height, data)); + } + else { + let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(width, height, data); + this.bins.push(bin); + } } } } @@ -48,7 +63,7 @@ class MaxRectsPacker { * @memberof MaxRectsPacker */ addArray(rects) { - this.sort(rects).forEach(r => this.add(r.width, r.height, r.data)); + this.sort(rects).forEach(rect => this.add(rect)); } /** * Load bins to the packer, overwrite exist bins @@ -58,13 +73,13 @@ class MaxRectsPacker { load(bins) { bins.forEach((bin, index) => { if (bin.maxWidth > this.width || bin.maxHeight > this.height) { - this.bins.push(new oversized_element_bin_1.OversizedElementBin(bin.width, bin.height, {})); + this.bins.push(new OversizedElementBin(bin.width, bin.height, {})); } else { - let newBin = new maxrects_bin_1.MaxRectsBin(this.width, this.height, this.padding, bin.options); + let newBin = new MaxRectsBin(this.width, this.height, this.padding, bin.options); newBin.freeRects.splice(0); bin.freeRects.forEach((r, i) => { - newBin.freeRects.push(new Rectangle_1.Rectangle(r.x, r.y, r.width, r.height)); + newBin.freeRects.push(new Rectangle(r.width, r.height, r.x, r.y)); }); newBin.width = bin.width; newBin.height = bin.height; @@ -104,5 +119,4 @@ class MaxRectsPacker { return rects.slice().sort((a, b) => Math.max(b.width, b.height) - Math.max(a.width, a.height)); } } -exports.MaxRectsPacker = MaxRectsPacker; -//# sourceMappingURL=maxrects_packer.js.map \ No newline at end of file +//# sourceMappingURL=maxrects-packer.js.map \ No newline at end of file diff --git a/lib/maxrects-packer.js.map b/lib/maxrects-packer.js.map new file mode 100644 index 0000000..6cab50d --- /dev/null +++ b/lib/maxrects-packer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"maxrects-packer.js","sourceRoot":"","sources":["../src/maxrects-packer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,CAAC,MAAM,cAAc,GAAW,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAW,GAAG,CAAC;AAiB1C,MAAM,OAAO,cAAc;IAGvB;;;;;;;OAOG;IACH,YACW,QAAgB,cAAc,EAC9B,SAAiB,cAAc,EAC/B,UAAkB,CAAC,EACnB,UAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;QAHjF,UAAK,GAAL,KAAK,CAAyB;QAC9B,WAAM,GAAN,MAAM,CAAyB;QAC/B,YAAO,GAAP,OAAO,CAAY;QACnB,YAAO,GAAP,OAAO,CAA0E;QAExF,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;IAiBM,GAAG,CAAE,GAAG,IAAW;QACtB,IAAI,KAAa,CAAC;QAClB,IAAI,MAAc,CAAC;QACnB,IAAI,IAAS,CAAC;QACd,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACnB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAA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C;QAC3B,CAAC,CAAC,CAAC,CAAC;QACJ,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,IAAI,CAAE,KAAU;QACpB,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;CACJ"} \ No newline at end of file diff --git a/lib/maxrects_bin.js.map b/lib/maxrects_bin.js.map deleted file mode 100644 index f1a8e08..0000000 --- a/lib/maxrects_bin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maxrects_bin.js","sourceRoot":"","sources":["../src/maxrects_bin.ts"],"names":[],"mappings":";;AAAA,uDAA4D;AAC5D,gDAAyD;AACzD,iDAAqC;AAErC,MAAa,WAAY,SAAQ,kBAAG;IAQhC,YACW,WAAmB,gCAAc,EACjC,YAAoB,gCAAc,EAClC,UAAkB,CAAC,EACnB,UAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;QAExF,KAAK,EAAE,CAAC;QALD,aAAQ,GAAR,QAAQ,CAAyB;QACjC,cAAS,GAAT,SAAS,CAAyB;QAClC,YAAO,GAAP,OAAO,CAAY;QACnB,YAAO,GAAP,OAAO,CAA0E;QATrF,cAAS,GAAgB,EAAE,CAAC;QAC5B,UAAK,GAAgB,EAAE,CAAC;QACvB,mBAAc,GAAY,KAAK,CAAC;QAUpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,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AAC,CAAC,CAAC;aACvC;YACD,IAAI,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;gBAC9E,QAAQ,CAAC,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;aACzC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,qBAAS,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5G,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,qBAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9G,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;YACvC,IAAI,QAAQ,CAAC,KAAK,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;gBAC7C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACnC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;CACJ;AAtMD,kCAsMC"} \ No newline at end of file diff --git a/lib/maxrects_packer.js.map b/lib/maxrects_packer.js.map deleted file mode 100644 index bc57ff4..0000000 --- a/lib/maxrects_packer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maxrects_packer.js","sourceRoot":"","sources":["../src/maxrects_packer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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;CACJ;AAxGD,wCAwGC"} \ No newline at end of file diff --git a/lib/oversized-element-bin.js b/lib/oversized-element-bin.js new file mode 100644 index 0000000..8c926d4 --- /dev/null +++ b/lib/oversized-element-bin.js @@ -0,0 +1,33 @@ +import { Rectangle } from "./geom/Rectangle"; +import { Bin } from "./abstract-bin"; +export class OversizedElementBin extends Bin { + constructor(...args) { + super(); + this.rects = []; + if (args.length === 1) { + if (typeof args[0] !== 'object') + throw new Error("OversizedElementBin: Wrong parameters"); + const rect = args[0]; + this.rects = [rect]; + this.width = rect.width; + this.height = rect.height; + this.data = rect.data; + rect.oversized = true; + } + else { + this.width = args[0]; + this.height = args[1]; + this.data = args.length > 2 ? args[2] : null; + const rect = new Rectangle(this.width, this.height); + rect.oversized = true; + rect.data = this.data; + this.rects.push(rect); + } + this.freeRects = []; + this.maxWidth = this.width; + this.maxHeight = this.height; + this.options = { smart: false, pot: false, square: false }; + } + add() { return undefined; } +} +//# sourceMappingURL=oversized-element-bin.js.map \ No newline at end of file diff --git a/lib/oversized-element-bin.js.map b/lib/oversized-element-bin.js.map new file mode 100644 index 0000000..bad1bb9 --- /dev/null +++ b/lib/oversized-element-bin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"oversized-element-bin.js","sourceRoot":"","sources":["../src/oversized-element-bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,OAAO,mBAAsD,SAAQ,GAAG;IAY1E,YAAa,GAAG,IAAW;QACvB,KAAK,EAAE,CAAC;QANL,UAAK,GAAQ,EAAE,CAAC;QAOnB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACnB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,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versized_element_bin.d.ts deleted file mode 100644 index 67a3af6..0000000 --- a/lib/oversized_element_bin.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { IRectangle } from "./geom/Rectangle"; -import { IOption } from "./maxrects_packer"; -import { Bin } from "./abstract_bin"; -export declare class OversizedElementBin extends Bin { - width: number; - height: number; - data: any; - maxWidth: number; - maxHeight: number; - options: IOption; - rects: IRectangle[]; - freeRects: IRectangle[]; - constructor(width: number, height: number, data: any); - add(): undefined; -} diff --git a/lib/oversized_element_bin.js b/lib/oversized_element_bin.js deleted file mode 100644 index 1978919..0000000 --- a/lib/oversized_element_bin.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const abstract_bin_1 = require("./abstract_bin"); -class OversizedElementBin extends abstract_bin_1.Bin { - constructor(width, height, data) { - super(); - this.width = width; - this.height = height; - this.data = data; - this.rects = [{ - x: 0, - y: 0, - width: this.width, - height: this.height, - data: data, - oversized: true - }]; - this.freeRects = []; - this.maxWidth = width; - this.maxHeight = height; - this.options = { smart: false, pot: false, square: false }; - } - add() { return undefined; } -} -exports.OversizedElementBin = OversizedElementBin; -//# sourceMappingURL=oversized_element_bin.js.map \ No newline at end of file diff --git a/lib/oversized_element_bin.js.map b/lib/oversized_element_bin.js.map deleted file mode 100644 index 1adc990..0000000 --- a/lib/oversized_element_bin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oversized_element_bin.js","sourceRoot":"","sources":["../src/oversized_element_bin.ts"],"names":[],"mappings":";;AAEA,iDAAqC;AAErC,MAAa,mBAAoB,SAAQ,kBAAG;IAOxC,YAAoB,KAAa,EAAS,MAAc,EAAS,IAAS;QACtE,KAAK,EAAE,CAAC;QADQ,UAAK,GAAL,KAAK,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAK;QAEtE,IAAI,CAAC,KAAK,GAAG,CAAC;gBACV,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI;gBACV,SAAS,EAAE,IAAI;aAClB,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC/D,CAAC;IAED,GAAG,KAAM,OAAO,SAAS,CAAC,CAAC,CAAC;CAC/B;AAxBD,kDAwBC"} \ No newline at end of file diff --git a/lib/abstract_bin.d.ts b/lib/types/abstract-bin.d.ts similarity index 83% rename from lib/abstract_bin.d.ts rename to lib/types/abstract-bin.d.ts index 276e8a7..1a45314 100644 --- a/lib/abstract_bin.d.ts +++ b/lib/types/abstract-bin.d.ts @@ -1,5 +1,5 @@ import { IRectangle } from "./geom/Rectangle"; -import { IOption } from "./maxrects_packer"; +import { IOption } from "./maxrects-packer"; export interface IBin { width: number; height: number; @@ -17,5 +17,6 @@ export declare abstract class Bin implements IBin { freeRects: IRectangle[]; rects: IRectangle[]; options: IOption; + abstract add(rect: IRectangle): IRectangle | undefined; abstract add(width: number, height: number, data: any): IRectangle | undefined; } diff --git a/lib/geom/Rectangle.d.ts b/lib/types/geom/Rectangle.d.ts similarity index 86% rename from lib/geom/Rectangle.d.ts rename to lib/types/geom/Rectangle.d.ts index 7090fab..cb6e2c9 100644 --- a/lib/geom/Rectangle.d.ts +++ b/lib/types/geom/Rectangle.d.ts @@ -1,18 +1,19 @@ export interface IRectangle { - x: number; - y: number; width: number; height: number; + x: number; + y: number; [propName: string]: any; } export declare class Rectangle implements IRectangle { - x: number; - y: number; width: number; height: number; + x: number; + y: number; rot: boolean; data: any; - constructor(x?: number, y?: number, width?: number, height?: number, rot?: boolean); + oversized: boolean; + constructor(width?: number, height?: number, x?: number, y?: number, rot?: boolean); static Collide(first: Rectangle, second: Rectangle): boolean; static Contain(first: Rectangle, second: Rectangle): boolean; area(): number; diff --git a/lib/types/index.d.ts b/lib/types/index.d.ts new file mode 100644 index 0000000..195a958 --- /dev/null +++ b/lib/types/index.d.ts @@ -0,0 +1,5 @@ +export { Rectangle, IRectangle } from "./geom/Rectangle"; +export { MaxRectsPacker, IOption } from "./maxrects-packer"; +export { Bin } from "./abstract-bin"; +export { MaxRectsBin } from "./maxrects-bin"; +export { OversizedElementBin } from "./oversized-element-bin"; diff --git a/lib/maxrects_bin.d.ts b/lib/types/maxrects-bin.d.ts similarity index 64% rename from lib/maxrects_bin.d.ts rename to lib/types/maxrects-bin.d.ts index 0ae61aa..2fd1336 100644 --- a/lib/maxrects_bin.d.ts +++ b/lib/types/maxrects-bin.d.ts @@ -1,7 +1,7 @@ -import { IOption } from "./maxrects_packer"; -import { Rectangle } from "./geom/Rectangle"; -import { Bin } from "./abstract_bin"; -export declare class MaxRectsBin extends Bin { +import { IOption } from "./maxrects-packer"; +import { Rectangle, IRectangle } from "./geom/Rectangle"; +import { Bin } from "./abstract-bin"; +export declare class MaxRectsBin extends Bin { maxWidth: number; maxHeight: number; padding: number; @@ -9,10 +9,11 @@ export declare class MaxRectsBin extends Bin { width: number; height: number; freeRects: Rectangle[]; - rects: Rectangle[]; + rects: IRectangle[]; private verticalExpand; private stage; constructor(maxWidth?: number, maxHeight?: number, padding?: number, options?: IOption); + add(rect: T): T | undefined; add(width: number, height: number, data: any): Rectangle | undefined; private findNode; private splitNode; diff --git a/lib/maxrects_packer.d.ts b/lib/types/maxrects-packer.d.ts similarity index 76% rename from lib/maxrects_packer.d.ts rename to lib/types/maxrects-packer.d.ts index 312d7dd..6b99164 100644 --- a/lib/maxrects_packer.d.ts +++ b/lib/types/maxrects-packer.d.ts @@ -1,5 +1,5 @@ -import { IRectangle } from "./geom/Rectangle"; -import { Bin, IBin } from "./abstract_bin"; +import { Rectangle, IRectangle } from "./geom/Rectangle"; +import { Bin, IBin } from "./abstract-bin"; export declare const EDGE_MAX_VALUE: number; export declare const EDGE_MIN_VALUE: number; /** @@ -16,7 +16,7 @@ export interface IOption { square?: boolean; allowRotation?: boolean; } -export declare class MaxRectsPacker { +export declare class MaxRectsPacker { width: number; height: number; padding: number; @@ -38,20 +38,27 @@ export declare class MaxRectsPacker { * @param {*} data custom data object * @memberof MaxRectsPacker */ - add(width: number, height: number, data: any): void; + add(width: number, height: number, data: any): IRectangle; + /** + * Add a bin/rectangle object extends IRectangle to packer + * @template T Generic type extends IRectangle interface + * @param {T} rect the rect object add to the packer bin + * @memberof MaxRectsPacker + */ + add(rect: T): T; /** * Add an Array of bins/rectangles to the packer. * Object structure: { width, height, data } * @param {IRectangle[]} rects Array of bin/rectangles * @memberof MaxRectsPacker */ - addArray(rects: IRectangle[]): void; + addArray(rects: T[]): void; /** * Load bins to the packer, overwrite exist bins * @param {MaxRectsBin[]} bins MaxRectsBin objects * @memberof MaxRectsPacker */ - load(bins: IBin[]): void; + load(bins: Bin[]): void; /** * Output current bins to save * @memberof MaxRectsPacker diff --git a/lib/types/oversized-element-bin.d.ts b/lib/types/oversized-element-bin.d.ts new file mode 100644 index 0000000..229512d --- /dev/null +++ b/lib/types/oversized-element-bin.d.ts @@ -0,0 +1,16 @@ +import { IRectangle, Rectangle } from "./geom/Rectangle"; +import { IOption } from "./maxrects-packer"; +import { Bin } from "./abstract-bin"; +export declare class OversizedElementBin extends Bin { + width: number; + height: number; + data: any; + maxWidth: number; + maxHeight: number; + options: IOption; + rects: T[]; + freeRects: IRectangle[]; + constructor(rect: T); + constructor(width: number, height: number, data: any); + add(): undefined; +} diff --git a/package-lock.json b/package-lock.json index 294349c..f585f1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,28 +4,570 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/chai": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", - "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/core": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.5.tgz", + "integrity": "sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.4.4", + "@babel/helpers": "^7.4.4", + "@babel/parser": "^7.4.5", + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.5", + "@babel/types": "^7.4.4", + "convert-source-map": "^1.1.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.11", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "resolve": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.11", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/helpers": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz", + "integrity": "sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==", + "dev": true, + "requires": { + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } + } + }, + "@babel/parser": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", + "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "dev": true + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", + "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/traverse": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", + "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.4.4", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.4.5", + "@babel/types": "^7.4.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.11" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@babel/types": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" + } + }, + "@cnakazawa/watch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", + "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", + "dev": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "@jest/console": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", + "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==", + "dev": true, + "requires": { + "@jest/source-map": "^24.3.0", + "chalk": "^2.0.1", + "slash": "^2.0.0" + } + }, + "@jest/core": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz", + "integrity": "sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.8.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve-dependencies": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "jest-watcher": "^24.8.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "pirates": "^4.0.1", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "@jest/environment": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz", + "integrity": "sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==", + "dev": true, + "requires": { + "@jest/fake-timers": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0" + } + }, + "@jest/fake-timers": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz", + "integrity": "sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0" + } + }, + "@jest/reporters": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz", + "integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==", + "dev": true, + "requires": { + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "istanbul-lib-coverage": "^2.0.2", + "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.1", + "istanbul-reports": "^2.1.1", + "jest-haste-map": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", + "node-notifier": "^5.2.1", + "slash": "^2.0.0", + "source-map": "^0.6.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/source-map": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.3.0.tgz", + "integrity": "sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.1.15", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/test-result": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz", + "integrity": "sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/types": "^24.8.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz", + "integrity": "sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==", + "dev": true, + "requires": { + "@jest/test-result": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0" + } + }, + "@jest/transform": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz", + "integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^24.8.0", + "babel-plugin-istanbul": "^5.1.0", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.15", + "jest-haste-map": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-util": "^24.8.0", + "micromatch": "^3.1.10", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "2.4.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/types": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", + "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^12.0.9" + } + }, + "@types/babel__core": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", + "integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz", + "integrity": "sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", + "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.6.tgz", + "integrity": "sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, - "@types/mocha": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", - "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, + "@types/jest": { + "version": "24.0.13", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.13.tgz", + "integrity": "sha512-3m6RPnO35r7Dg+uMLj1+xfZaOgIHHHut61djNjzwExXN4/Pm9has9C6I1KMYSfz7mahDhWUOVg4HW/nZdv5Pww==", + "dev": true, + "requires": { + "@types/jest-diff": "*" + } + }, + "@types/jest-diff": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz", + "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", "dev": true }, "@types/node": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.3.tgz", - "integrity": "sha512-wp6IOGu1lxsfnrD+5mX6qwSwWuqsdkKKxTN4aQc4wByHAKZJf9/D4KXPQ1POUjEbnCP5LMggB0OEFNY9OTsMqg==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", + "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", "dev": true }, - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", + "dev": true + }, + "@types/yargs": { + "version": "12.0.12", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", + "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", + "dev": true + }, + "abab": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true + }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz", + "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + } + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, "ajv": { @@ -40,17 +582,10 @@ "uri-js": "^4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true, - "optional": true - }, - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, "ansi-regex": { @@ -68,6 +603,16 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, "arg": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", @@ -83,6 +628,36 @@ "sprintf-js": "~1.0.2" } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, "ascii-table": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", @@ -104,16 +679,22 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", "dev": true }, "asynckit": { @@ -122,6 +703,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -134,65 +721,112 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "babel-jest": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz", + "integrity": "sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==", "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/babel__core": "^7.1.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-preset-jest": "^24.6.0", + "chalk": "^2.4.2", + "slash": "^2.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz", + "integrity": "sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" + } + }, + "babel-plugin-jest-hoist": { + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz", + "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==", + "dev": true, + "requires": { + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-jest": { + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz", + "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==", + "dev": true, + "requires": { + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.6.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "kind-of": "^6.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "kind-of": "^6.0.0" } }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } } } }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -212,12 +846,68 @@ "concat-map": "0.0.1" } }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", "dev": true }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + } + }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -230,32 +920,50 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "dev": true, + "requires": { + "rsvp": "^4.8.4" + } + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -284,12 +992,35 @@ } } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -301,12 +1032,28 @@ "wrap-ansi": "^2.0.0" } }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -332,9 +1079,15 @@ } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -343,6 +1096,21 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -363,22 +1131,6 @@ "request": "^2.86.0" }, "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", @@ -400,6 +1152,21 @@ "which": "^1.2.9" } }, + "cssom": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", + "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", + "dev": true + }, + "cssstyle": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", + "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -409,13 +1176,28 @@ "assert-plus": "^1.0.0" } }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } } }, "decamelize": { @@ -424,14 +1206,11 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, "deep-is": { "version": "0.1.3", @@ -448,18 +1227,71 @@ "object-keys": "^1.0.12" } }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "diff-sequences": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", + "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", + "dev": true + }, "doctrine": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", @@ -484,6 +1316,15 @@ } } }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -494,12 +1335,6 @@ "safer-buffer": "^2.1.0" } }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -509,6 +1344,15 @@ "once": "^1.4.0" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -540,37 +1384,18 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, - "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" - } - }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "exec-sh": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", + "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", + "dev": true + }, "execa": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", @@ -586,24 +1411,180 @@ "strip-eof": "^1.0.0" } }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "expect": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz", + "integrity": "sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "ansi-styles": "^3.2.0", + "jest-get-type": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-regex-util": "^24.3.0" + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -616,6 +1597,38 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "^2.0.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -625,14 +1638,11 @@ "locate-path": "^3.0.0" } }, - "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - } + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -651,288 +1661,1647 @@ "mime-types": "^2.1.12" } }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, + "optional": true, "requires": { - "pump": "^3.0.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.0.tgz", + "integrity": "sha512-kCqEOOHoBcFs/2Ccuk4Xarm/KiWRSLEX9CAZF8xkJ6ZPlIoTZ8V5f7J16vYLJqDbR7KrxTJpR2lqjIEm2Qx9cQ==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", + "dev": true, + "requires": { + "handlebars": "^4.1.2" + } + }, + "jest": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", + "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==", + "dev": true, + "requires": { + "import-local": "^2.0.0", + "jest-cli": "^24.8.0" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "jest-cli": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz", + "integrity": "sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==", + "dev": true, + "requires": { + "@jest/core": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^12.0.2" + } + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "jest-changed-files": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz", + "integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "execa": "^1.0.0", + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz", + "integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^24.8.0", + "@jest/types": "^24.8.0", + "babel-jest": "^24.8.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^24.8.0", + "jest-environment-node": "^24.8.0", + "jest-get-type": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "micromatch": "^3.1.10", + "pretty-format": "^24.8.0", + "realpath-native": "^1.1.0" + } + }, + "jest-diff": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz", + "integrity": "sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.3.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" + } + }, + "jest-docblock": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz", + "integrity": "sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==", + "dev": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-each": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz", + "integrity": "sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0" + } + }, + "jest-environment-jsdom": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz", + "integrity": "sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0", + "jsdom": "^11.5.1" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "jest-environment-node": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz", + "integrity": "sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0" } }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "jest-get-type": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", + "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", "dev": true }, - "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "jest-haste-map": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.0.tgz", + "integrity": "sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ==", "dev": true, "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "@jest/types": "^24.8.0", + "anymatch": "^2.0.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", + "graceful-fs": "^4.1.15", + "invariant": "^2.2.4", + "jest-serializer": "^24.4.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", + "micromatch": "^3.1.10", + "sane": "^4.0.3", + "walker": "^1.0.7" } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "jest-jasmine2": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz", + "integrity": "sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==", "dev": true, "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "@babel/traverse": "^7.1.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^24.8.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0", + "throat": "^4.0.0" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "jest-leak-detector": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz", + "integrity": "sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==", "dev": true, "requires": { - "function-bind": "^1.1.1" + "pretty-format": "^24.8.0" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "jest-matcher-utils": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz", + "integrity": "sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - } + "chalk": "^2.0.1", + "jest-diff": "^24.8.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" } }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "jest-message-util": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz", + "integrity": "sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==", "dev": true, "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "@babel/code-frame": "^7.0.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/stack-utils": "^1.0.1", + "chalk": "^2.0.1", + "micromatch": "^3.1.10", + "slash": "^2.0.0", + "stack-utils": "^1.0.1" } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "jest-mock": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz", + "integrity": "sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "@jest/types": "^24.8.0" } }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "jest-pnp-resolver": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", "dev": true }, - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "jest-regex-util": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz", + "integrity": "sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==", "dev": true }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "jest-resolve": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz", + "integrity": "sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" + } }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true + "jest-resolve-dependencies": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz", + "integrity": "sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.8.0" + } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "jest-runner": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz", + "integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "chalk": "^2.4.2", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-config": "^24.8.0", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-leak-detector": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + } }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "jest-runtime": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz", + "integrity": "sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==", "dev": true, "requires": { - "has": "^1.0.1" + "@jest/console": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/yargs": "^12.0.2", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "strip-bom": "^3.0.0", + "yargs": "^12.0.2" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "jest-serializer": { + "version": "24.4.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz", + "integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==", "dev": true }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "jest-snapshot": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz", + "integrity": "sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "@babel/types": "^7.0.0", + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "expect": "^24.8.0", + "jest-diff": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^24.8.0", + "semver": "^5.5.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "jest-util": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz", + "integrity": "sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/fake-timers": "^24.8.0", + "@jest/source-map": "^24.3.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "callsites": "^3.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.15", + "is-ci": "^2.0.0", + "mkdirp": "^0.5.1", + "slash": "^2.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "jest-validate": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", + "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "camelcase": "^5.0.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.8.0", + "leven": "^2.1.0", + "pretty-format": "^24.8.0" + } }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true + "jest-watcher": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz", + "integrity": "sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==", + "dev": true, + "requires": { + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/yargs": "^12.0.9", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "jest-util": "^24.8.0", + "string-length": "^2.0.0" + } }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "dev": true, - "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "jest-worker": { + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", + "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", + "dev": true, + "requires": { + "merge-stream": "^1.0.1", + "supports-color": "^6.1.0" }, "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "has-flag": "^3.0.0" } } } }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -959,6 +3328,92 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "escodegen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", + "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -977,6 +3432,23 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -989,6 +3461,18 @@ "verror": "1.10.0" } }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -1004,6 +3488,18 @@ "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", "dev": true }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1014,6 +3510,18 @@ "type-check": "~0.3.2" } }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -1030,27 +3538,60 @@ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "chalk": "^2.0.1" + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "make-error": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz", - "integrity": "sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", "dev": true }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -1060,6 +3601,21 @@ "p-defer": "^1.0.0" } }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "mem": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", @@ -1071,6 +3627,36 @@ "p-is-promise": "^2.0.0" } }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, "mime-db": { "version": "1.38.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", @@ -1107,78 +3693,74 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", - "dev": true, - "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "isexe": "^2.0.0" + "is-plain-object": "^2.0.4" } } } }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "neo-async": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", @@ -1191,31 +3773,61 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true + }, + "node-notifier": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz", + "integrity": "sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^1.1.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" }, "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true + "resolve": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } } } }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "abbrev": "1" + "remove-trailing-separator": "^1.0.1" } }, "npm-run-path": { @@ -1233,28 +3845,68 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, + "nwsapi": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", + "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", + "dev": true + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "isobject": "^3.0.0" } }, "object.getownpropertydescriptors": { @@ -1267,6 +3919,15 @@ "es-abstract": "^1.5.1" } }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1325,6 +3986,15 @@ "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true }, + "p-each-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", + "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -1355,12 +4025,40 @@ "p-limit": "^2.0.0" } }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1385,11 +4083,14 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } }, "performance-now": { "version": "2.1.0", @@ -1397,38 +4098,189 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "pretty-format": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", + "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "prompts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz", + "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==", + "dev": true, + "requires": { + "kleur": "^3.0.2", + "sisteransi": "^1.0.0" + } + }, "psl": { "version": "1.1.31", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "realpath-native": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", + "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "util.promisify": "^1.0.0" } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "request": { @@ -1459,6 +4311,26 @@ "uuid": "^3.3.2" } }, + "request-promise-core": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", + "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, + "request-promise-native": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", + "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", + "dev": true, + "requires": { + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1477,30 +4349,218 @@ "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.12.3.tgz", + "integrity": "sha512-ueWhPijWN+GaPgD3l77hXih/gcDXmYph6sWeQegwBYtaqAE834e8u+MC2wT6FKIUsz1DBOyOXAQXUZB+rjWDoQ==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "@types/node": "^12.0.2", + "acorn": "^6.1.1" + }, + "dependencies": { + "@types/node": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", + "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", + "dev": true + } + } + }, + "rollup-plugin-dts": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-0.15.1.tgz", + "integrity": "sha512-MFO8pMI9GI57sYOIeYUCzQmTZgATEma9616rAaEaTwZxPo9MVC7NkgOMyBrUyjULSoScdYo+3C0+sOq60rL5RQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0" + } + }, + "rollup-plugin-uglify": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.2.tgz", + "integrity": "sha512-qwz2Tryspn5QGtPUowq5oumKSxANKdrnfz7C0jm4lKxvRDsNe/hSGsB9FntUul7UeC4TsZEWKErVgE1qWSO0gw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "jest-worker": "^24.0.0", + "serialize-javascript": "^1.6.1", + "uglify-js": "^3.4.9" + } + }, + "rollup-plugin-uglify-es": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-uglify-es/-/rollup-plugin-uglify-es-0.0.1.tgz", + "integrity": "sha1-5FZE8raFpZq9uTY0ByB6A6e1qbc=", + "dev": true, + "requires": { + "uglify-es": "3.0.3" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": ">= 1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "uglify-es": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.0.3.tgz", + "integrity": "sha1-Y8yEqpRos0lzpIh3h8ZMAaiodXY=", + "dev": true, + "requires": { + "commander": "~2.9.0", + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0" + } + } + } + }, + "rsvp": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz", + "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==", + "dev": true + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "sane": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "dev": true, + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, + "serialize-javascript": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", + "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -1516,20 +4576,240 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "sisteransi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz", + "integrity": "sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, - "optional": true, "requires": { - "amdefine": ">=0.0.4" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -1555,6 +4835,49 @@ "tweetnacl": "~0.14.0" } }, + "stack-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", + "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -1565,6 +4888,15 @@ "strip-ansi": "^4.0.0" } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -1574,25 +4906,100 @@ "ansi-regex": "^3.0.0" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + } + }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "dev": true + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", "dev": true }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "has-flag": "^1.0.0" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -1613,10 +5020,42 @@ } } }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "ts-jest": { + "version": "24.0.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz", + "integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "buffer-from": "1.x", + "fast-json-stable-stringify": "2.x", + "json5": "2.x", + "make-error": "1.x", + "mkdirp": "0.x", + "resolve": "1.x", + "semver": "^5.5", + "yargs-parser": "10.x" + } + }, "ts-node": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.0.3.tgz", - "integrity": "sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz", + "integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==", "dev": true, "requires": { "arg": "^4.1.0", @@ -1624,30 +5063,6 @@ "make-error": "^1.1.1", "source-map-support": "^0.5.6", "yn": "^3.0.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", - "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "yn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.0.0.tgz", - "integrity": "sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q==", - "dev": true - } } }, "tslib": { @@ -1657,18 +5072,18 @@ "dev": true }, "tslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", - "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", + "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.0", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "resolve": "^1.3.2", @@ -1677,26 +5092,10 @@ "tsutils": "^2.29.0" }, "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1774,16 +5173,10 @@ "prelude-ls": "~1.1.2" } }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", + "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", "dev": true }, "uglify-js": { @@ -1791,7 +5184,6 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.11.tgz", "integrity": "sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg==", "dev": true, - "optional": true, "requires": { "commander": "~2.20.0", "source-map": "~0.6.1" @@ -1801,15 +5193,95 @@ "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true + "dev": true }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, - "optional": true + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true } } }, @@ -1822,12 +5294,50 @@ "punycode": "^2.1.0" } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -1839,6 +5349,56 @@ "extsprintf": "^1.2.0" } }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", @@ -1854,15 +5414,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -1922,123 +5473,60 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "write-file-atomic": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", + "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", "dev": true, "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "async-limiter": "~1.0.0" } }, - "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", "dev": true, "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "camelcase": "^4.1.0" }, "dependencies": { - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } + }, + "yn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", + "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", + "dev": true } } } diff --git a/package.json b/package.json index 75ec2fd..823d137 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,15 @@ "name": "maxrects-packer", "version": "2.0.3", "description": "A max rectangle 2d bin packer for packing glyphs or images into multiple sprite-sheet/atlas", - "main": "lib/maxrects_packer.js", - "types": "lib/maxrects_packer.d.ts", + "main": "dist/maxrects-packer.js", + "module": "dist/maxrects-packer.mjs", + "types": "dist/maxrects-packer.d.ts", "scripts": { - "build": "tsc", - "test": "mocha --reporter spec", - "cover": "node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- -R spec --timeout 30000 test/*" + "clean": "rimraf ./lib && rimraf ./dist", + "build": "tsc && rollup -c rollup.config.ts", + "build:clean": "npm run clean && npm run build", + "test": "jest", + "cover": "jest --coverage" }, "repository": { "type": "git", @@ -28,18 +31,22 @@ }, "homepage": "https://github.com/soimy/maxrects-packer#readme", "devDependencies": { - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.6", - "@types/node": "^11.11.3", + "@types/jest": "^24.0.13", + "@types/node": "^12.0.2", "ascii-table": "0.0.9", - "chai": "^4.2.0", "coveralls": "^3.0.3", - "istanbul": "^0.4.5", - "mocha": "^6.1.4", - "ts-node": "^8.0.3", - "tslint": "^5.14.0", + "jest": "^24.8.0", + "rimraf": "^2.6.3", + "rollup": "^1.12.3", + "rollup-plugin-dts": "^0.15.1", + "rollup-plugin-uglify": "^6.0.2", + "rollup-plugin-uglify-es": "0.0.1", + "ts-jest": "^24.0.2", + "ts-node": "^8.1.0", + "tslib": "^1.9.3", + "tslint": "^5.16.0", "tslint-config-standard": "^8.0.1", - "typescript": "^3.3.3333" + "typescript": "^3.4.5" }, "dependencies": {} } diff --git a/rollup.config.ts b/rollup.config.ts new file mode 100644 index 0000000..9a3d492 --- /dev/null +++ b/rollup.config.ts @@ -0,0 +1,29 @@ +import { ts, dts } from "rollup-plugin-dts"; +import uglify from "rollup-plugin-uglify-es"; + +const config = [ + { + input: "./src/index.ts", + // transpiled typescript in umd and es format + output: [ + { file: "dist/maxrects-packer.js", name: "MaxRectsPacker", format: "umd", sourcemap: true }, + { file: "dist/maxrects-packer.mjs", format: "es", sourcemap: true } + ], + plugins: [ ts() ] + }, + { + input: "./src/index.ts", + // uglified transpiled typescript in commonjs + output: [ + { file: "dist/maxrects-packer.min.js", format: "cjs", sourcemap: false } + ], + plugins: [ uglify(), ts() ] + }, + { + input: "./src/index.ts", + // bundled `.d.ts` file + output: [{ file: "dist/maxrects-packer.d.ts", format: "es" }], + plugins: [ dts() ] + } +]; +export default config; diff --git a/src/abstract_bin.ts b/src/abstract-bin.ts similarity index 76% rename from src/abstract_bin.ts rename to src/abstract-bin.ts index bd29582..edcd084 100644 --- a/src/abstract_bin.ts +++ b/src/abstract-bin.ts @@ -1,5 +1,5 @@ -import { IRectangle } from "./geom/Rectangle"; -import { IOption } from "./maxrects_packer"; +import { IRectangle, Rectangle } from "./geom/Rectangle"; +import { IOption } from "./maxrects-packer"; export interface IBin { width: number; @@ -19,5 +19,6 @@ export abstract class Bin implements IBin { public freeRects!: IRectangle[]; public rects!: IRectangle[]; public options!: IOption; + public abstract add (rect: IRectangle): IRectangle | undefined; public abstract add (width: number, height: number, data: any): IRectangle | undefined; } diff --git a/src/geom/Rectangle.ts b/src/geom/Rectangle.ts index 65e5ab2..8428c51 100644 --- a/src/geom/Rectangle.ts +++ b/src/geom/Rectangle.ts @@ -1,14 +1,20 @@ export interface IRectangle { - x: number; - y: number; width: number; height: number; + x: number; + y: number; [propName: string]: any; } export class Rectangle implements IRectangle { public data: any; - constructor (public x: number = 0, public y: number = 0, public width: number = 0, public height: number = 0, public rot: boolean = false) { + public oversized: boolean = false; + constructor ( + public width: number = 0, + public height: number = 0, + public x: number = 0, + public y: number = 0, + public rot: boolean = false) { this.data = {}; } public static Collide (first: Rectangle, second: Rectangle) { return first.collide(second); } @@ -17,8 +23,12 @@ export class Rectangle implements IRectangle { public area (): number { return this.width * this.height; } public collide (rect: Rectangle): boolean { - return !(rect.x >= this.x + this.width || rect.x + rect.width <= this.x || - rect.y >= this.y + this.height || rect.y + rect.height <= this.y); + return ( + rect.x < this.x + this.width && + rect.x + rect.width > this.x && + rect.y < this.y + this.height && + rect.y + rect.height > this.y + ); } public contain (rect: Rectangle): boolean { diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..195a958 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,5 @@ +export { Rectangle, IRectangle } from "./geom/Rectangle"; +export { MaxRectsPacker, IOption } from "./maxrects-packer"; +export { Bin } from "./abstract-bin"; +export { MaxRectsBin } from "./maxrects-bin"; +export { OversizedElementBin } from "./oversized-element-bin"; diff --git a/src/maxrects_bin.ts b/src/maxrects-bin.ts similarity index 72% rename from src/maxrects_bin.ts rename to src/maxrects-bin.ts index 5899bcb..170d158 100644 --- a/src/maxrects_bin.ts +++ b/src/maxrects-bin.ts @@ -1,12 +1,12 @@ -import { EDGE_MAX_VALUE, IOption } from "./maxrects_packer"; +import { EDGE_MAX_VALUE, IOption } from "./maxrects-packer"; import { Rectangle, IRectangle } from "./geom/Rectangle"; -import { Bin } from "./abstract_bin"; +import { Bin } from "./abstract-bin"; -export class MaxRectsBin extends Bin { +export class MaxRectsBin extends Bin { public width: number; public height: number; public freeRects: Rectangle[] = []; - public rects: Rectangle[] = []; + public rects: IRectangle[] = []; private verticalExpand: boolean = false; private stage: Rectangle; @@ -19,11 +19,28 @@ export class MaxRectsBin extends Bin { super(); this.width = this.options.smart ? 0 : maxWidth; this.height = this.options.smart ? 0 : maxHeight; - this.freeRects.push(new Rectangle(0, 0, this.maxWidth + this.padding, this.maxHeight + this.padding)); - this.stage = new Rectangle(0, 0, this.width, this.height); + this.freeRects.push(new Rectangle(this.maxWidth + this.padding, this.maxHeight + this.padding)); + this.stage = new Rectangle(this.width, this.height); } - public add (width: number, height: number, data: any): Rectangle | undefined { + public add (rect: T): T | undefined; + public add (width: number, height: number, data: any): Rectangle | undefined; + public add (...args: any[]): any { + let width: number; + let height: number; + let data: any; + let rect: IRectangle | undefined; + if (args.length === 1) { + if (typeof args[0] !== 'object') throw new Error("MacrectsBin.add(): Wrong parameters"); + rect = args[0] as T; + width = rect.width; + height = rect.height; + } else { + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + } + let node: Rectangle | undefined = this.findNode(width + this.padding, height + this.padding); if (node) { this.updateBinSize(node); @@ -39,24 +56,30 @@ export class MaxRectsBin extends Bin { } this.pruneFreeList(); this.verticalExpand = this.width > this.height ? true : false; - let rect: Rectangle = new Rectangle(node.x, node.y, width, height, node.rot); - rect.data = data; + if (!rect) { + rect = new Rectangle(width, height, node.x, node.y, node.rot); + rect.data = data; + } else { + rect.x = node.x; + rect.y = node.y; + rect.rot = node.rot; + } this.rects.push(rect); return rect; } else if (!this.verticalExpand) { - if (this.updateBinSize(new Rectangle(this.width + this.padding, 0, width + this.padding, height + this.padding)) - || this.updateBinSize(new Rectangle(0, this.height + this.padding, width + this.padding, height + this.padding))) { - return this.add(width, height, data); + if (this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, this.width + this.padding, 0)) + || this.updateBinSize(new Rectangle(width + this.padding, height + this.padding, 0, this.height + this.padding))) { + return rect ? this.add(rect as T) : this.add(width, height, data); } } else { if (this.updateBinSize(new Rectangle( - 0, this.height + this.padding, - width + this.padding, height + this.padding + width + this.padding, height + this.padding, + 0, this.height + this.padding )) || this.updateBinSize(new Rectangle( - this.width + this.padding, 0, - width + this.padding, height + this.padding + width + this.padding, height + this.padding, + this.width + this.padding, 0 ))) { - return this.add(width, height, data); + return rect ? this.add(rect as T) : this.add(width, height, data); } } return undefined; @@ -72,7 +95,7 @@ export class MaxRectsBin extends Bin { if (r.width >= width && r.height >= height) { areaFit = r.width * r.height - width * height; if (areaFit < score) { - bestNode = new Rectangle(r.x, r.y, width, height); + bestNode = new Rectangle(width, height, r.x, r.y); score = areaFit; } } @@ -81,7 +104,7 @@ export class MaxRectsBin extends Bin { if (r.width >= height && r.height >= width) { areaFit = r.width * r.height - height * width; if (areaFit < score) { - bestNode = new Rectangle(r.x, r.y, height, width, true); // Rotated node + bestNode = new Rectangle(height, width, r.x, r.y, true); // Rotated node score = areaFit; } } @@ -97,16 +120,16 @@ export class MaxRectsBin extends Bin { if (usedNode.x < freeRect.x + freeRect.width && usedNode.x + usedNode.width > freeRect.x) { // New node at the top side of the used node if (usedNode.y > freeRect.y && usedNode.y < freeRect.y + freeRect.height) { - let newNode: Rectangle = new Rectangle(freeRect.x, freeRect.y, freeRect.width, usedNode.y - freeRect.y); + let newNode: Rectangle = new Rectangle(freeRect.width, usedNode.y - freeRect.y, freeRect.x, freeRect.y); this.freeRects.push(newNode); } // New node at the bottom side of the used node if (usedNode.y + usedNode.height < freeRect.y + freeRect.height) { let newNode = new Rectangle( - freeRect.x, - usedNode.y + usedNode.height, freeRect.width, - freeRect.y + freeRect.height - (usedNode.y + usedNode.height) + freeRect.y + freeRect.height - (usedNode.y + usedNode.height), + freeRect.x, + usedNode.y + usedNode.height ); this.freeRects.push(newNode); } @@ -117,16 +140,16 @@ export class MaxRectsBin extends Bin { usedNode.y + usedNode.height > freeRect.y) { // New node at the left side of the used node. if (usedNode.x > freeRect.x && usedNode.x < freeRect.x + freeRect.width) { - let newNode = new Rectangle(freeRect.x, freeRect.y, usedNode.x - freeRect.x, freeRect.height); + let newNode = new Rectangle(usedNode.x - freeRect.x, freeRect.height, freeRect.x, freeRect.y); this.freeRects.push(newNode); } // New node at the right side of the used node. if (usedNode.x + usedNode.width < freeRect.x + freeRect.width) { let newNode = new Rectangle( - usedNode.x + usedNode.width, - freeRect.y, freeRect.x + freeRect.width - (usedNode.x + usedNode.width), - freeRect.height + freeRect.height, + usedNode.x + usedNode.width, + freeRect.y ); this.freeRects.push(newNode); } @@ -191,8 +214,8 @@ export class MaxRectsBin extends Bin { freeRect.height = height - freeRect.y; } }, this); - this.freeRects.push(new Rectangle(this.width + this.padding, 0, width - this.width - this.padding, height)); - this.freeRects.push(new Rectangle(0, this.height + this.padding, width, height - this.height - this.padding)); + this.freeRects.push(new Rectangle(width - this.width - this.padding, height, this.width + this.padding, 0)); + this.freeRects.push(new Rectangle(width, height - this.height - this.padding, 0, this.height + this.padding)); this.freeRects.forEach((freeRect, index) => { if (freeRect.width <= 0 || freeRect.height <= 0) { this.freeRects.splice(index, 1); diff --git a/src/maxrects_packer.ts b/src/maxrects-packer.ts similarity index 59% rename from src/maxrects_packer.ts rename to src/maxrects-packer.ts index b43b85a..9739dfd 100644 --- a/src/maxrects_packer.ts +++ b/src/maxrects-packer.ts @@ -1,7 +1,7 @@ import { Rectangle, IRectangle } from "./geom/Rectangle"; -import { MaxRectsBin } from "./maxrects_bin"; -import { OversizedElementBin } from "./oversized_element_bin"; -import { Bin, IBin } from "./abstract_bin"; +import { MaxRectsBin } from "./maxrects-bin"; +import { OversizedElementBin } from "./oversized-element-bin"; +import { Bin, IBin } from "./abstract-bin"; export const EDGE_MAX_VALUE: number = 4096; export const EDGE_MIN_VALUE: number = 128; @@ -21,7 +21,7 @@ export interface IOption { allowRotation?: boolean; } -export class MaxRectsPacker { +export class MaxRectsPacker { public bins: Bin[]; /** @@ -48,15 +48,44 @@ export class MaxRectsPacker { * @param {*} data custom data object * @memberof MaxRectsPacker */ - public add (width: number, height: number, data: any) { - if (width > this.width || height > this.height) { - this.bins.push(new OversizedElementBin(width, height, data)); + public add (width: number, height: number, data: any): IRectangle; + /** + * Add a bin/rectangle object extends IRectangle to packer + * @template T Generic type extends IRectangle interface + * @param {T} rect the rect object add to the packer bin + * @memberof MaxRectsPacker + */ + public add (rect: T): T; + public add (...args: any[]): any { + let width: number; + let height: number; + let data: any; + if (args.length === 1) { + if (typeof args[0] !== 'object') throw new Error("MacrectsPacker.add(): Wrong parameters"); + const rect: T = args[0]; + if (rect.width > this.width || rect.height > this.height) { + this.bins.push(new OversizedElementBin(rect)); + } else { + let added = this.bins.find(bin => bin.add(rect) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(rect); + this.bins.push(bin); + } + } } else { - let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); - if (!added) { - let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); - bin.add(width, height, data); - this.bins.push(bin); + width = args[0]; + height = args[1]; + data = args.length > 2 ? args[2] : null; + if (width > this.width || height > this.height) { + this.bins.push(new OversizedElementBin(width, height, data)); + } else { + let added = this.bins.find(bin => bin.add(width, height, data) !== undefined); + if (!added) { + let bin = new MaxRectsBin(this.width, this.height, this.padding, this.options); + bin.add(width, height, data); + this.bins.push(bin); + } } } } @@ -67,8 +96,8 @@ export class MaxRectsPacker { * @param {IRectangle[]} rects Array of bin/rectangles * @memberof MaxRectsPacker */ - public addArray (rects: IRectangle[]) { - this.sort(rects).forEach(r => this.add(r.width, r.height, r.data)); + public addArray (rects: T[]) { + this.sort(rects).forEach(rect => this.add(rect)); } /** @@ -76,15 +105,15 @@ export class MaxRectsPacker { * @param {MaxRectsBin[]} bins MaxRectsBin objects * @memberof MaxRectsPacker */ - public load (bins: IBin[]) { + public load (bins: Bin[]) { bins.forEach((bin, index) => { if (bin.maxWidth > this.width || bin.maxHeight > this.height) { this.bins.push(new OversizedElementBin(bin.width, bin.height, {})); } else { - let newBin: MaxRectsBin = new MaxRectsBin(this.width, this.height, this.padding, bin.options); + let newBin = new MaxRectsBin(this.width, this.height, this.padding, bin.options); newBin.freeRects.splice(0); bin.freeRects.forEach((r, i) => { - newBin.freeRects.push(new Rectangle(r.x, r.y, r.width, r.height)); + newBin.freeRects.push(new Rectangle(r.width, r.height, r.x, r.y)); }); newBin.width = bin.width; newBin.height = bin.height; @@ -122,7 +151,7 @@ export class MaxRectsPacker { return saveBins; } - private sort (rects: IRectangle[]) { + private sort (rects: T[]) { return rects.slice().sort((a, b) => Math.max(b.width, b.height) - Math.max(a.width, a.height)); } } diff --git a/src/oversized-element-bin.ts b/src/oversized-element-bin.ts new file mode 100644 index 0000000..2a4305e --- /dev/null +++ b/src/oversized-element-bin.ts @@ -0,0 +1,43 @@ +import { IRectangle, Rectangle } from "./geom/Rectangle"; +import { IOption } from "./maxrects-packer"; +import { Bin } from "./abstract-bin"; + +export class OversizedElementBin extends Bin { + public width: number; + public height: number; + public data: any; + public maxWidth: number; + public maxHeight: number; + public options: IOption; + public rects: T[] = []; + public freeRects: IRectangle[]; + + constructor (rect: T); + constructor (width: number, height: number, data: any); + constructor (...args: any[]) { + super(); + if (args.length === 1) { + if (typeof args[0] !== 'object') throw new Error("OversizedElementBin: Wrong parameters"); + const rect = args[0]; + this.rects = [rect]; + this.width = rect.width; + this.height = rect.height; + this.data = rect.data; + rect.oversized = true; + } else { + this.width = args[0]; + this.height = args[1]; + this.data = args.length > 2 ? args[2] : null; + const rect: any = new Rectangle(this.width, this.height); + rect.oversized = true; + rect.data = this.data; + this.rects.push(rect); + } + this.freeRects = []; + this.maxWidth = this.width; + this.maxHeight = this.height; + this.options = { smart: false, pot: false, square: false }; + } + + add () { return undefined; } +} diff --git a/src/oversized_element_bin.ts b/src/oversized_element_bin.ts deleted file mode 100644 index adea548..0000000 --- a/src/oversized_element_bin.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IRectangle } from "./geom/Rectangle"; -import { IOption } from "./maxrects_packer"; -import { Bin } from "./abstract_bin"; - -export class OversizedElementBin extends Bin { - public maxWidth: number; - public maxHeight: number; - public options: IOption; - public rects: IRectangle[]; - public freeRects: IRectangle[]; - - constructor (public width: number, public height: number, public data: any) { - super(); - this.rects = [{ - x: 0, - y: 0, - width: this.width, - height: this.height, - data: data, - oversized: true - }]; - this.freeRects = []; - this.maxWidth = width; - this.maxHeight = height; - this.options = { smart: false, pot: false, square: false }; - } - - add () { return undefined; } -} diff --git a/test/efficiency.spec.js b/test/efficiency.spec.js index fad21f7..92866ea 100644 --- a/test/efficiency.spec.js +++ b/test/efficiency.spec.js @@ -1,63 +1,55 @@ "use strict"; -let MaxRectsPacker = require("../lib/maxrects_packer").MaxRectsPacker; -let expect = require("chai").expect; +let MaxRectsPacker = require("../dist/maxrects-packer").MaxRectsPacker; let AsciiTable = require("ascii-table") const SCENARIOS = require("./scenarios.json"); -describe("Efficiency", () => { - let rectSizeSum; - before(() => { - rectSizeSum = SCENARIOS.map(scenario => { - return scenario.reduce((memo, rect) => memo + rect.width * rect.height, 0); - }); - }); +let rectSizeSum = SCENARIOS.map(scenario => { + return scenario.reduce((memo, rect) => memo + rect.width * rect.height, 0); +}); - it("test", () => { - const CANDIDATES = [ - {name: "1024x2048:0", factory: () => new MaxRectsPacker(1024, 2048, 0)}, - {name: "1024x2048:1", factory: () => new MaxRectsPacker(1024, 2048, 1)}, - {name: "1024x2048:1:Rot", factory: () => new MaxRectsPacker(1024, 2048, 1, { smart: true, pot: true, square: true, allowRotation: true})}, - {name: "1024x1024:0", factory: () => new MaxRectsPacker(1024, 1024, 0)}, - {name: "1024x1024:1", factory: () => new MaxRectsPacker(1024, 1024, 1)}, - {name: "1024x1024:1:Rot", factory: () => new MaxRectsPacker(1024, 1024, 1, { smart: true, pot: true, square: true, allowRotation: true})}, - {name: "2048:2048:1", factory: () => new MaxRectsPacker(2048, 2048, 1)}, - {name: "2048:2048:1:Rot", factory: () => new MaxRectsPacker(2048, 2048, 1, { smart: true, pot: true, square: true, allowRotation: true})} - ]; - - - let heading = ["#", "size"].concat(CANDIDATES.map(c => c.name)); - let results = CANDIDATES.map(candidate => meassureEfficiency(candidate.factory)); - let rows = SCENARIOS.map((scenario, i) => { - return [i, rectSizeSum[i]].concat(results.map(resultCandidate => { - let result = resultCandidate[i]; - return `${toPercent(result.efficieny)} (${result.bins} bins)`; - })); - }).concat([["sum", ""].concat(results.map(result => { - let usedSize = result.reduce((memo, data) => memo + data.usedSize, 0); - let rectSize = result.reduce((memo, data) => memo + data.rectSize, 0); - return toPercent(rectSize / usedSize); - }))]); - - - console.log(new AsciiTable({ heading, rows }).toString()); - }); +test('Efficiency', () => { + const CANDIDATES = [ + {name: "1024x2048:0", factory: () => new MaxRectsPacker(1024, 2048, 0)}, + {name: "1024x2048:1", factory: () => new MaxRectsPacker(1024, 2048, 1)}, + {name: "1024x2048:1:Rot", factory: () => new MaxRectsPacker(1024, 2048, 1, { smart: true, pot: true, square: true, allowRotation: true})}, + {name: "1024x1024:0", factory: () => new MaxRectsPacker(1024, 1024, 0)}, + {name: "1024x1024:1", factory: () => new MaxRectsPacker(1024, 1024, 1)}, + {name: "1024x1024:1:Rot", factory: () => new MaxRectsPacker(1024, 1024, 1, { smart: true, pot: true, square: true, allowRotation: true})}, + {name: "2048:2048:1", factory: () => new MaxRectsPacker(2048, 2048, 1)}, + {name: "2048:2048:1:Rot", factory: () => new MaxRectsPacker(2048, 2048, 1, { smart: true, pot: true, square: true, allowRotation: true})} + ]; + let heading = ["#", "size"].concat(CANDIDATES.map(c => c.name)); + let results = CANDIDATES.map(candidate => meassureEfficiency(candidate.factory)); + let rows = SCENARIOS.map((scenario, i) => { + return [i, rectSizeSum[i]].concat(results.map(resultCandidate => { + let result = resultCandidate[i]; + return `${toPercent(result.efficieny)} (${result.bins} bins)`; + })); + }).concat([["sum", ""].concat(results.map(result => { + let usedSize = result.reduce((memo, data) => memo + data.usedSize, 0); + let rectSize = result.reduce((memo, data) => memo + data.rectSize, 0); + return toPercent(rectSize / usedSize); + }))]); + + console.log(new AsciiTable({ heading, rows }).toString()); - function meassureEfficiency(factory) { - return SCENARIOS.map((scenario, i) => { - let packer = factory(); - packer.addArray(scenario); - - let bins = packer.bins.length; - let rectSize = rectSizeSum[i]; - let usedSize = packer.bins.reduce((memo, bin) => memo + bin.width * bin.height, 0); - let efficieny = rectSize / usedSize; - return {bins, rectSize, usedSize, efficieny}; - }); - } - - function toPercent(input) { - return Math.round(input * 1000) / 10 + "%"; - } }); + +function meassureEfficiency (factory) { + return SCENARIOS.map((scenario, i) => { + let packer = factory(); + packer.addArray(scenario); + + let bins = packer.bins.length; + let rectSize = rectSizeSum[i]; + let usedSize = packer.bins.reduce((memo, bin) => memo + bin.width * bin.height, 0); + let efficieny = rectSize / usedSize; + return {bins, rectSize, usedSize, efficieny}; + }); +} + +function toPercent (input) { + return Math.round(input * 1000) / 10 + "%"; +} diff --git a/test/generictype.spec.js b/test/generictype.spec.js new file mode 100644 index 0000000..2e3c4fe --- /dev/null +++ b/test/generictype.spec.js @@ -0,0 +1,56 @@ +let MaxRectsPacker = require('../dist/maxrects-packer').MaxRectsPacker; +let Rectangle = require('../dist/maxrects-packer').Rectangle; + +class Block extends Rectangle { + constructor (width = 0, height = 0, x = 0, y = 0, rot = false) { + super(); + this.color = 0xffffffff; // Extended attribution + } + getColor() { // Extended method + return this.color + } +} + +let packer; +beforeEach(() => { + packer = new MaxRectsPacker(1024, 1024, 0); +}); + +test('generic type extends Rectangle class', () => { + let blocks = []; + blocks.push(new Block(512, 512)); + blocks.push(new Block(512, 512)); + blocks.push(new Block(512, 512)); + let colors = [0x000000ff, 0xff0000ff]; + colors.forEach((color, i) => { + blocks[i].color = color; + }); + + packer.addArray(blocks); + expect(packer.bins.length).toBe(1); + expect(packer.bins[0].rects.length).toBe(blocks.length); + expect(packer.bins[0].rects[0].x).toBe(0); + expect(packer.bins[0].rects[0].y).toBe(0); + expect(packer.bins[0].rects[0].color).toBe(colors[0]); + expect(packer.bins[0].rects[0].getColor()).toBe(colors[0]); + expect(packer.bins[0].rects[2].color).toBe(0xffffffff); +}); + +test('anonymous class with width, height', () => { + let blocks = []; + blocks.push({width: 512, height: 512}); + blocks.push({width: 512, height: 512}); + blocks.push({width: 512, height: 512}); + let colors = [0x000000ff, 0xff0000ff]; + colors.forEach((color, i) => { + blocks[i].color = color; + }); + + packer.addArray(blocks); + expect(packer.bins.length).toBe(1); + expect(packer.bins[0].rects.length).toBe(blocks.length); + expect(packer.bins[0].rects[0].x).toBe(0); + expect(packer.bins[0].rects[0].y).toBe(0); + expect(packer.bins[0].rects[0].color).toBe(colors[0]); + expect(packer.bins[0].rects[2].color).toBeUndefined(); +}); \ No newline at end of file diff --git a/test/maxrects-bin.spec.js b/test/maxrects-bin.spec.js new file mode 100644 index 0000000..6871527 --- /dev/null +++ b/test/maxrects-bin.spec.js @@ -0,0 +1,160 @@ +"use strict"; + +let MaxRectsBin = require("../dist/maxrects-packer").MaxRectsBin; +let Rectangle = require("../dist/maxrects-packer").Rectangle; + +const EDGE_MAX_VALUE = 4096; +const EDGE_MIN_VALUE = 128; +const opt = { + smart: true, + pot: true, + square: false, + allowRotation: false +} + +let bin; + +beforeEach(() => { + bin = new MaxRectsBin(1024, 1024, 0, opt); +}); + +describe("no padding", () => { + + test("is initially empty", () => { + expect(bin.width).toBe(0); + expect(bin.height).toBe(0); + }) + + test("adds rects correctly", () => { + let position = bin.add(200, 100, {}); + expect(position.x).toBe(0); + expect(position.y).toBe(0); + }); + + test("updates size correctly", () => { + let position = bin.add(200, 100, {}); + expect(bin.width).toBe(256); + expect(bin.height).toBe(128); + }); + + test("stores data correctly", () => { + let position = bin.add(200, 100, {foo: "bar"}); + expect(bin.rects[0].data.foo).toBe("bar"); + }); + + test("fits squares correctly", () => { + let i = 0; + while(bin.add(100, 100, {number: i})) { + // circuit breaker + if (i++ === 1000) { + break; + } + } + expect(i).toBe(100); + expect(bin.rects.length).toBe(100); + expect(bin.width).toBe(1024); + expect(bin.height).toBe(1024); + + bin.rects.forEach((rect, i) => { + expect(rect.data.number).toBe(i); + }) + }); + + test("monkey testing", () => { + let rects = []; + while (true) { + let width = Math.floor(Math.random() * 200); + let height = Math.floor(Math.random() * 200); + let rect = new Rectangle(width, height); + + let position = bin.add(rect); + if (position) { + expect(position.width).toBe(width); + expect(position.height).toBe(height); + rects.push(position); + } else { + break; + } + } + + expect(bin.width).toBeLessThanOrEqual(1024); + expect(bin.height).toBeLessThanOrEqual(1024); + + rects.forEach(rect1 => { + // Make sure rects are not overlapping + rects.forEach(rect2 => { + if (rect1 !== rect2) { + expect(rect1.collide(rect2)).toBe(false, "intersection detected: " + JSON.stringify(rect1) + " " + JSON.stringify(rect2)); + } + }); + + // Make sure no rect is outside bounds + expect(rect1.x + rect1.width).toBeLessThanOrEqual(bin.width); + expect(rect1.y + rect1.height).toBeLessThanOrEqual(bin.height); + }); + }); +}) + +describe("padding", () => { + beforeEach(() => { + bin = new MaxRectsBin(1024, 1024, 4, opt); + }); + + test("is initially empty", () => { + expect(bin.width).toBe(0); + expect(bin.height).toBe(0); + }) + + test("handles padding correctly", () => { + bin.add(512, 512, {}); + bin.add(508, 512, {}); + bin.add(512, 508, {}); + expect(bin.width).toBe(1024); + expect(bin.height).toBe(1024); + expect(bin.rects.length).toBe(3); + }); + + test("adds rects with sizes close to the max", () => { + expect(bin.add(1024, 1024)).toBeDefined(); + expect(bin.rects.length).toBe(1); + }); + + test("monkey testing", () => { + bin = new MaxRectsBin(1024, 1024, 40); + let rects = []; + while (true) { + let width = Math.floor(Math.random() * 200); + let height = Math.floor(Math.random() * 200); + let rect = new Rectangle(width, height); + + let position = bin.add(rect); + if (position) { + expect(position.width).toBe(width); + expect(position.height).toBe(height); + rects.push(position); + } else { + break; + } + } + + expect(bin.width).toBeLessThanOrEqual(1024); + expect(bin.height).toBeLessThanOrEqual(1024); + + rects.forEach(rect1 => { + // Make sure rects are not overlapping + rects.forEach(rect2 => { + if (rect1 !== rect2) { + try { + expect(rect1.collide(rect2)).toBe(false); + } catch (e) { + throw new Error("intersection detected: " + JSON.stringify(rect1) + " " + JSON.stringify(rect2)); + } + } + }); + + // Make sure no rect is outside bounds + expect(rect1.x + rect1.width).toBeLessThanOrEqual(bin.width); + expect(rect1.y + rect1.height).toBeLessThanOrEqual(bin.height); + }); + }); +}); diff --git a/test/maxrects-packer.spec.js b/test/maxrects-packer.spec.js new file mode 100644 index 0000000..1c45e8e --- /dev/null +++ b/test/maxrects-packer.spec.js @@ -0,0 +1,115 @@ +"use strict"; + +let MaxRectsPacker = require("../dist/maxrects-packer").MaxRectsPacker; + +const opt = { + smart: true, + pot: false, + square: false +} + +let packer; +beforeEach(() => { + packer = new MaxRectsPacker(1024, 1024, 0, opt); +}); + +describe("#add", () => { + test("adds first element correctly", () => { + packer.add(1000, 1000, {number: 1}); + expect(packer.bins[0].rects[0].data.number).toBe(1); + }); + + test("creates additional bin if element doesn't fit in existing bin", () => { + packer.add(1000, 1000, {number: 1}); + packer.add(1000, 1000, {number: 2}); + expect(packer.bins.length).toBe(2); + expect(packer.bins[1].rects[0].data.number).toBe(2); + }); + + test("adds to existing bins if possible", () => { + packer.add(1000, 1000, {number: 1}); + packer.add(1000, 1000, {number: 2}); + packer.add(10, 10, {number: 3}); + packer.add(10, 10, {number: 4}); + expect(packer.bins.length).toBe(2); + }); + + test("allows oversized elements to be added", () => { + packer.add(1000, 1000, {number: 1}); + packer.add(2000, 2000, {number: 2}); + expect(packer.bins.length).toBe(2); + expect(packer.bins[1].rects[0].width).toBe(2000); + expect(packer.bins[1].rects[0].oversized).toBe(true); + }); +}); + +describe("#sort", () => { + test("does not mutate input array", () => { + let input = [ + {width: 1, height: 1}, + {width: 2, height: 2} + ]; + packer.sort(input); + expect(input[0].width).toBe(1); + }); + + test("works correctly", () => { + let input = [ + {width: 1, height: 1}, + {width: 3, height: 1}, + {width: 2, height: 2} + ]; + let output = packer.sort(input); + expect(output[0].width).toBe(3); + expect(output[1].width).toBe(2); + expect(output[2].width).toBe(1); + }); +}); + +describe("#addArray", () => { + test("adds multiple elements to bins", () => { + let input = [ + {width: 1000, height: 1000, data: {number: 1}}, + {width: 1000, height: 1000, data: {number: 2}} + ]; + packer.addArray(input); + expect(packer.bins.length).toBe(2); + }); + + test("adds the big rects first", () => { + let input = [ + {width: 600, height: 20, data: {number: 1}}, + {width: 600, height: 20, data: {number: 2}}, + {width: 1000, height: 1000, data: {number: 3}}, + {width: 1000, height: 1000, data: {number: 4}} + ]; + packer.addArray(input); + expect(packer.bins.length).toBe(2); + }); +}); + +describe("#save & load", () => { + test("Load old bins and continue packing", () => { + let input = [ + {width: 512, height: 512, data: {number: 1}}, + {width: 512, height: 512, data: {number: 2}}, + {width: 512, height: 512, data: {number: 3}}, + {width: 512, height: 512, data: {number: 4}}, + ]; + packer.add(input[0].width, input[0].height, input[0].data); + expect(packer.bins.length).toBe(1); + let bins = packer.save(); + expect(bins[0].freeRects.length).toBe(0); + packer.load(bins); + packer.addArray(input); + expect(packer.bins.length).toBe(2); + }); +}); + +test("passes padding through", () => { + packer = new MaxRectsPacker(1024, 1024, 4, opt); + packer.add(500, 500, {number: 1}); + packer.add(500, 500, {number: 1}); + packer.add(500, 500, {number: 1}); + expect(packer.bins[0].width).toBe(1004); +}); diff --git a/test/maxrects_bin.spec.js b/test/maxrects_bin.spec.js deleted file mode 100644 index db9d1f1..0000000 --- a/test/maxrects_bin.spec.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; - -let MaxRectBin = require("../lib/maxrects_bin").MaxRectsBin; -let expect = require("chai").expect; - -const EDGE_MAX_VALUE = 4096; -const EDGE_MIN_VALUE = 128; -const opt = { - smart: true, - pot: true, - square: false, - allowRotation: false -} - -describe("MaxRectBin", () => { - let bin; - - context("no padding", () => { - beforeEach(() => { - bin = new MaxRectBin(1024, 1024, 0, opt); - }); - - it("is initially empty", () => { - expect(bin.width).to.equal(0); - expect(bin.height).to.equal(0); - }) - - it("adds rects correctly", () => { - let position = bin.add(200, 100, {}); - expect(position.x).to.equal(0); - expect(position.y).to.equal(0); - }); - - it("updates size correctly", () => { - let position = bin.add(200, 100, {}); - expect(bin.width).to.equal(256); - expect(bin.height).to.equal(128); - }); - - it("stores data correctly", () => { - let position = bin.add(200, 100, {foo: "bar"}); - expect(bin.rects[0].data.foo).to.equal("bar"); - }); - - it("fits squares correctly", () => { - let i = 0; - while(bin.add(100, 100, {number: i})) { - // circuit breaker - if (i++ === 1000) { - break; - } - } - expect(i).to.equal(100); - expect(bin.rects.length).to.equal(100); - expect(bin.width).to.equal(1024); - expect(bin.height).to.equal(1024); - - bin.rects.forEach((rect, i) => { - expect(rect.data.number).to.equal(i); - }) - }); - - it("monkey testing", () => { - let rects = []; - while (true) { - let width = Math.floor(Math.random() * 200); - let height = Math.floor(Math.random() * 200); - - let position = bin.add(width, height); - if (position) { - expect(position.width).to.equal(width); - expect(position.height).to.equal(height); - rects.push(position); - } else { - break; - } - } - - expect(bin.width).to.not.be.above(1024); - expect(bin.height).to.not.be.above(1024); - - rects.forEach(rect1 => { - // Make sure rects are not overlapping - rects.forEach(rect2 => { - if (rect1 !== rect2) { - let intersect = - (rect1.x < rect2.x + rect2.width && - rect2.x < rect1.x + rect1.width && - rect1.y < rect2.y + rect2.height && - rect2.y < rect1.y + rect1.height); - expect(intersect).to.equal(false, "intersection detected: " + JSON.stringify(rect1) + " " + JSON.stringify(rect2)); - } - }); - - // Make sure no rect is outside bounds - expect(rect1.x + rect1.width).to.not.be.above(bin.width); - expect(rect1.y + rect1.height).to.not.be.above(bin.height); - }); - }); - }) - - context("padding", () => { - beforeEach(() => { - bin = new MaxRectBin(1024, 1024, 4, opt); - }); - - it("is initially empty", () => { - expect(bin.width).to.equal(0); - expect(bin.height).to.equal(0); - }) - - it("handles padding correctly", () => { - bin.add(512, 512, {}); - bin.add(508, 512, {}); - bin.add(512, 508, {}); - expect(bin.width).to.equal(1024); - expect(bin.height).to.equal(1024); - expect(bin.rects.length).to.equal(3); - }); - - it("adds rects with sizes close to the max", () => { - expect(bin.add(1024, 1024)).to.not.equal(undefined); - expect(bin.rects.length).to.equal(1); - }); - - it("monkey testing", () => { - bin = new MaxRectBin(1024, 1024, 40); - let rects = []; - while (true) { - let width = Math.floor(Math.random() * 200); - let height = Math.floor(Math.random() * 200); - - let position = bin.add(width, height); - if (position) { - expect(position.width).to.equal(width); - expect(position.height).to.equal(height); - rects.push(position); - } else { - break; - } - } - - expect(bin.width).to.not.be.above(1024); - expect(bin.height).to.not.be.above(1024); - - rects.forEach(rect1 => { - // Make sure rects are not overlapping - rects.forEach(rect2 => { - if (rect1 !== rect2) { - let intersect = - (rect1.x < rect2.x + rect2.width && - rect2.x < rect1.x + rect1.width && - rect1.y < rect2.y + rect2.height && - rect2.y < rect1.y + rect1.height); - expect(intersect).to.equal(false, "intersection detected: " + JSON.stringify(rect1) + " " + JSON.stringify(rect2)); - } - }); - - // Make sure no rect is outside bounds - expect(rect1.x + rect1.width).to.not.be.above(bin.width); - expect(rect1.y + rect1.height).to.not.be.above(bin.height); - }); - }); - }); -}); diff --git a/test/maxrects_packer.spec.js b/test/maxrects_packer.spec.js deleted file mode 100644 index ba2dc0d..0000000 --- a/test/maxrects_packer.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; - -let MaxRectsPacker = require("../lib/maxrects_packer").MaxRectsPacker; -let expect = require("chai").expect; - -const opt = { - smart: true, - pot: false, - square: false -} - -describe("MaxRectsPacker", () => { - let packer; - beforeEach(() => { - packer = new MaxRectsPacker(1024, 1024, 0, opt); - }); - - context("#add", () => { - it("adds first element correctly", () => { - packer.add(1000, 1000, {number: 1}); - expect(packer.bins[0].rects[0].data.number).to.equal(1); - }); - - it("creates additional bin if element doesn't fit in existing bin", () => { - packer.add(1000, 1000, {number: 1}); - packer.add(1000, 1000, {number: 2}); - expect(packer.bins.length).to.equal(2); - expect(packer.bins[1].rects[0].data.number).to.equal(2); - }); - - it("adds to existing bins if possible", () => { - packer.add(1000, 1000, {number: 1}); - packer.add(1000, 1000, {number: 2}); - packer.add(10, 10, {number: 3}); - packer.add(10, 10, {number: 4}); - expect(packer.bins.length).to.equal(2); - }); - - it("allows oversized elements to be added", () => { - packer.add(1000, 1000, {number: 1}); - packer.add(2000, 2000, {number: 2}); - expect(packer.bins.length).to.equal(2); - expect(packer.bins[1].rects[0].width).to.equal(2000); - expect(packer.bins[1].rects[0].oversized).to.equal(true); - }); - }); - - context("#sort", () => { - it("does not mutate input array", () => { - let input = [ - {width: 1, height: 1}, - {width: 2, height: 2} - ]; - packer.sort(input); - expect(input[0].width).to.equal(1); - }); - - it("works correctly", () => { - let input = [ - {width: 1, height: 1}, - {width: 3, height: 1}, - {width: 2, height: 2} - ]; - let output = packer.sort(input); - expect(output[0].width).to.equal(3); - expect(output[1].width).to.equal(2); - expect(output[2].width).to.equal(1); - }); - }); - - context("#addArray", () => { - it("adds multiple elements to bins", () => { - let input = [ - {width: 1000, height: 1000, data: {number: 1}}, - {width: 1000, height: 1000, data: {number: 2}} - ]; - packer.addArray(input); - expect(packer.bins.length).to.equal(2); - }); - - it("adds the big rects first", () => { - let input = [ - {width: 600, height: 20, data: {number: 1}}, - {width: 600, height: 20, data: {number: 2}}, - {width: 1000, height: 1000, data: {number: 3}}, - {width: 1000, height: 1000, data: {number: 4}} - ]; - packer.addArray(input); - expect(packer.bins.length).to.equal(2); - }); - }); - - context("#save & load", () => { - it("Load old bins and continue packing", () => { - let input = [ - {width: 512, height: 512, data: {number: 1}}, - {width: 512, height: 512, data: {number: 2}}, - {width: 512, height: 512, data: {number: 3}}, - {width: 512, height: 512, data: {number: 4}}, - ]; - packer.add(input[0].width, input[0].height, input[0].data); - expect(packer.bins.length).to.equal(1); - let bins = packer.save(); - expect(bins[0].freeRects.length).to.equal(0); - packer.load(bins); - packer.addArray(input); - expect(packer.bins.length).to.equal(2); - }); - }); - - it("passes padding through", () => { - packer = new MaxRectsPacker(1024, 1024, 4, opt); - packer.add(500, 500, {number: 1}); - packer.add(500, 500, {number: 1}); - packer.add(500, 500, {number: 1}); - expect(packer.bins[0].width).to.equal(1004); - }); -}); diff --git a/test/oversized-element-bin.spec.js b/test/oversized-element-bin.spec.js new file mode 100644 index 0000000..82ea9e7 --- /dev/null +++ b/test/oversized-element-bin.spec.js @@ -0,0 +1,38 @@ +"use strict"; + +let OversizedElementBin = require("../dist/maxrects-packer").OversizedElementBin; +let Rectangle = require("../dist/maxrects-packer").Rectangle; + +const oversizedRect = new Rectangle(2000, 2000); +oversizedRect.data = {foo: "bar"}; + +describe("OversizedElementBin", () => { + test("stores data correctly", () => { + let bin = new OversizedElementBin(2000, 2000, {foo: "bar"}); + expect(bin.width).toBe(2000); + expect(bin.height).toBe(2000); + expect(bin.rects[0].x).toBe(0); + expect(bin.rects[0].y).toBe(0); + expect(bin.rects[0].width).toBe(2000); + expect(bin.rects[0].height).toBe(2000); + expect(bin.rects[0].data.foo).toBe("bar"); + expect(bin.rects[0].oversized).toBeTruthy(); + }); + + test("stores data correctly via generic type", () => { + let bin = new OversizedElementBin(oversizedRect); + expect(bin.width).toBe(2000); + expect(bin.height).toBe(2000); + expect(bin.rects[0].x).toBe(0); + expect(bin.rects[0].y).toBe(0); + expect(bin.rects[0].width).toBe(2000); + expect(bin.rects[0].height).toBe(2000); + expect(bin.rects[0].data.foo).toBe("bar"); + expect(bin.rects[0].oversized).toBeTruthy(); + }); + + test("#add returns undefined", () => { + let bin = new OversizedElementBin(2000, 2000, {foo: "bar"}); + expect(bin.add(1, 1, {})).toBeUndefined(); + }); +}); diff --git a/test/oversized_element_bin.spec.js b/test/oversized_element_bin.spec.js deleted file mode 100644 index fe22247..0000000 --- a/test/oversized_element_bin.spec.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -let OversizedElementBin = require("../lib/oversized_element_bin").OversizedElementBin; -let expect = require("chai").expect; - -describe("OversizedElementBin", () => { - it("stores data correctly", () => { - let bin = new OversizedElementBin(2000, 2000, {foo: "bar"}); - expect(bin.width).to.equal(2000); - expect(bin.height).to.equal(2000); - expect(bin.rects[0].x).to.equal(0); - expect(bin.rects[0].y).to.equal(0); - expect(bin.rects[0].width).to.equal(2000); - expect(bin.rects[0].height).to.equal(2000); - expect(bin.rects[0].data.foo).to.equal("bar"); - expect(bin.rects[0].oversized).to.equal(true); - }); - - it("#add returns undefined", () => { - let bin = new OversizedElementBin(2000, 2000, {foo: "bar"}); - expect(bin.add(1, 1, {})).to.equal(undefined); - }); -}); diff --git a/tsconfig.json b/tsconfig.json index 4691309..0207410 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,14 +2,15 @@ "compilerOptions": { /* Basic Options */ "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "esModuleInterop": true, - "lib": ["es6"], /* Specify library files to be included in the compilation: */ + "lib": ["es6"], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declarationDir": "./lib/types", + "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "./lib", /* Redirect output structure to the directory. */ "typeRoots": [ @@ -31,7 +32,7 @@ /* Strict Type-Checking Options */ "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -44,7 +45,7 @@ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */