From 72633d8c0fb9ca3ca58b2b92a862ffb3b85c4b56 Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Sat, 21 Mar 2020 17:22:28 +0100 Subject: [PATCH] Added everything from chapter 4 and set up ESlint --- .eslintignore | 2 + .eslintrc.js | 33 + lib/AnimManager.js | 63 ++ lib/Camera.js | 54 ++ lib/Container.js | 46 +- lib/Game.js | 50 +- lib/Rect.js | 14 +- lib/Sprite.js | 14 +- lib/SpriteSheetXML.js | 64 +- lib/Text.js | 10 +- lib/Texture.js | 8 +- lib/TileMap.js | 68 +- lib/TileMapXML.js | 34 +- lib/TileSprite.js | 12 +- lib/TileSpriteXML.js | 14 +- lib/controls/KeyControls.js | 100 +-- lib/controls/MouseControls.js | 72 +-- lib/index.js | 68 +- lib/renderer/CanvasRenderer.js | 172 ++--- lib/utilities/entity.js | 98 +-- lib/utilities/math.js | 46 +- package-lock.json | 1096 ++++++++++++++++++++++++++++++++ package.json | 5 +- 23 files changed, 1727 insertions(+), 416 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 lib/AnimManager.js create mode 100644 lib/Camera.js create mode 100644 package-lock.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..d461a57 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +projects +examples \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..d3e497d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,33 @@ +module.exports = { + "env": { + "browser": true, + "commonjs": true, + "es6": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + "indent": [ + "error", + "tab" + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file diff --git a/lib/AnimManager.js b/lib/AnimManager.js new file mode 100644 index 0000000..2335428 --- /dev/null +++ b/lib/AnimManager.js @@ -0,0 +1,63 @@ +class Anim { + constructor(frames, rate) { + this.frames = frames; + this.rate = rate; + this.reset(); + } + + update(dt) { + const { rate, frames } = this; + if ((this.curTime += dt) > rate) { + this.curFrame++; + this.frame = frames[this.curFrame % frames.length]; + this.curTime -= rate; + } + } + + reset() { + this.frame = this.frames[0]; + this.curFrame = 0; + this.curTime = 0; + } +} + +class AnimManager { + constructor(e) { + this.anims = {}; + this.running = false; + this.frameSource = e.frame || e; + this.currrent = null; + } + + add(name, frames, speed) { + this.anims[name] = new Anim(frames, speed); + return this.anims[name]; + } + + update(dt) { + const { current, anims, frameSource } = this; + if (!current) { + return; + } + const anim = anims[current]; + anim.update(dt); + + frameSource.x = anim.frame.x; + frameSource.y = anim.frame.y; + } + + play(anim) { + const { current, anims } = this; + if (anim === current ) { + return; + } + this.current = anim; + anims[anim].reset(); + } + + stop() { + this.current = null; + } +} + +module.exports = AnimManager; \ No newline at end of file diff --git a/lib/Camera.js b/lib/Camera.js new file mode 100644 index 0000000..6df36eb --- /dev/null +++ b/lib/Camera.js @@ -0,0 +1,54 @@ +const Container = require("./Container"); +const math = require("./utilities/math"); + +class Camera extends Container { + constructor(subject, viewport, worldSize = viewport) { + super(); + this.w = viewport.w; + this.h = viewport.h; + this.worldSize = worldSize; + this.setSubject(subject); + } + + setSubject(e) { + this.subject = e ? e.pos || e : this.pos; + this.offset = { x: 0, y: 0 }; + + // Center on the entity + if (e && e.w) { + this.offset.x += e.w / 2; + this.offset.y += e.h / 2; + } + if (e && e.anchor) { + this.offset.x -= e.anchor.x; + this.offset.y -= e.anchor.y; + } + this.focus(); + } + + focus() { + const { pos, w, h, worldSize, subject, offset } = this; + + const centeredX = subject.x + offset.x - w / 2; + const maxX = worldSize.w - w; + const x = -math.clamp(centeredX, 0, maxX); + + const centeredY = subject.y + offset.y - h / 2; + const maxY = worldSize.h - h; + const y = -math.clamp(centeredY, 0, maxY); + + pos.x = x; + pos.y = y; + } + + update(dt, t) { + super.update(dt, t); + + if (this.subject) { + this.focus(); + } + } +} + + +module.exports = Camera; \ No newline at end of file diff --git a/lib/Container.js b/lib/Container.js index 64357c9..0e5cd8b 100644 --- a/lib/Container.js +++ b/lib/Container.js @@ -1,30 +1,30 @@ class Container { - constructor() { - this.pos = { x: 0, y: 0 }; - this.children = []; - } + constructor() { + this.pos = { x: 0, y: 0 }; + this.children = []; + } - add(child) { - this.children.push(child); - return child; - } + add(child) { + this.children.push(child); + return child; + } - remove(child) { - this.children = this.children.filter(c => c !== child); - return child; - } + remove(child) { + this.children = this.children.filter(c => c !== child); + return child; + } - map(f) { - return this.children.map(f); - } + map(f) { + return this.children.map(f); + } - update(dt, t) { - this.children = this.children.filter(child => { - if (child.update) { - child.update(dt, t, this); - } - return child.dead ? false : true; - }); - } + update(dt, t) { + this.children = this.children.filter(child => { + if (child.update) { + child.update(dt, t, this); + } + return child.dead ? false : true; + }); + } } module.exports = Container; diff --git a/lib/Game.js b/lib/Game.js index d9d9c40..dba0729 100644 --- a/lib/Game.js +++ b/lib/Game.js @@ -1,40 +1,40 @@ var Container = require("./Container"), - CanvasRenderer = require('./renderer/CanvasRenderer') + CanvasRenderer = require("./renderer/CanvasRenderer") ; const STEP = 1 / 60; const FRAME_MAX = 5 * STEP; class Game { - constructor(w, h, pixelated, parent = "#board") { - this.w = w; - this.h = h; - this.renderer = new CanvasRenderer(w, h); - document.querySelector(parent).appendChild(this.renderer.view); + constructor(w, h, pixelated, parent = "#board") { + this.w = w; + this.h = h; + this.renderer = new CanvasRenderer(w, h); + document.querySelector(parent).appendChild(this.renderer.view); - if (pixelated) { - this.renderer.setPixelated(); - } + if (pixelated) { + this.renderer.setPixelated(); + } - this.scene = new Container(); - } + this.scene = new Container(); + } - run(gameUpdate = () => { }) { - let dt = 0; - let last = 0; - const loop = ms => { - requestAnimationFrame(loop); + run(gameUpdate = () => { }) { + let dt = 0; + let last = 0; + const loop = ms => { + requestAnimationFrame(loop); - const t = ms / 1000; - dt = Math.min(t - last, FRAME_MAX); - last = t; + const t = ms / 1000; + dt = Math.min(t - last, FRAME_MAX); + last = t; - this.scene.update(dt, t); - gameUpdate(dt, t); - this.renderer.render(this.scene); - }; - requestAnimationFrame(loop); - } + this.scene.update(dt, t); + gameUpdate(dt, t); + this.renderer.render(this.scene); + }; + requestAnimationFrame(loop); + } } module.exports = Game; \ No newline at end of file diff --git a/lib/Rect.js b/lib/Rect.js index 3fe7d8f..1a70637 100644 --- a/lib/Rect.js +++ b/lib/Rect.js @@ -1,10 +1,10 @@ class Rect { - constructor(w, h, style = { fill: "#333" }) { - this.pos = { x: 0, y: 0 }; - this.w = w; - this.h = h; - this.style = style; - } - } + constructor(w, h, style = { fill: "#333" }) { + this.pos = { x: 0, y: 0 }; + this.w = w; + this.h = h; + this.style = style; + } +} module.exports = Rect; \ No newline at end of file diff --git a/lib/Sprite.js b/lib/Sprite.js index 99a6beb..6e7d550 100644 --- a/lib/Sprite.js +++ b/lib/Sprite.js @@ -1,10 +1,10 @@ class Sprite { - constructor(texture) { - this.texture = texture; - this.pos = { x: 0, y: 0 }; - this.anchor = { x: 0, y: 0 }; - this.scale = { x: 1, y: 1 }; - this.rotation = 0; - } + constructor(texture) { + this.texture = texture; + this.pos = { x: 0, y: 0 }; + this.anchor = { x: 0, y: 0 }; + this.scale = { x: 1, y: 1 }; + this.rotation = 0; + } } module.exports = Sprite; diff --git a/lib/SpriteSheetXML.js b/lib/SpriteSheetXML.js index 8dd0887..b9c460a 100644 --- a/lib/SpriteSheetXML.js +++ b/lib/SpriteSheetXML.js @@ -1,39 +1,39 @@ class SpriteSheetXML { - constructor(url) { - this.array = []; - this.fetchXMLtoArray(url); - } + constructor(url) { + this.array = []; + this.fetchXMLtoArray(url); + } - fetchXMLtoArray(url) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.send(null); + fetchXMLtoArray(url) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.send(null); - if (xhr.status === 200) { - var children = xhr.responseXML.children[0].children; - for (let index = 0; index < children.length; index++) { - const element = children[index]; - this.array.push({ - name: element.attributes.name.nodeValue, - x: element.attributes.x.nodeValue, - y: element.attributes.y.nodeValue, - width: element.attributes.width.nodeValue, - height: element.attributes.height.nodeValue - }); - } - } else { - console.error('XML file cannot be loaded!') - } - } + if (xhr.status === 200) { + var children = xhr.responseXML.children[0].children; + for (let index = 0; index < children.length; index++) { + const element = children[index]; + this.array.push({ + name: element.attributes.name.nodeValue, + x: element.attributes.x.nodeValue, + y: element.attributes.y.nodeValue, + width: element.attributes.width.nodeValue, + height: element.attributes.height.nodeValue + }); + } + } else { + console.error("XML file cannot be loaded!"); + } + } - findIndex(attribute, value) { - for (let index = 0; index < this.array.length; index++) { - const element = this.array[index]; - if (element[attribute] == value) { - return index; - } - } - } + findIndex(attribute, value) { + for (let index = 0; index < this.array.length; index++) { + const element = this.array[index]; + if (element[attribute] == value) { + return index; + } + } + } } module.exports = SpriteSheetXML; \ No newline at end of file diff --git a/lib/Text.js b/lib/Text.js index 8533f91..ad21a8e 100644 --- a/lib/Text.js +++ b/lib/Text.js @@ -1,8 +1,8 @@ class Text { - constructor(text = "", style = {}) { - this.pos = { x: 0, y: 0 }; - this.text = text; - this.style = style; - } + constructor(text = "", style = {}) { + this.pos = { x: 0, y: 0 }; + this.text = text; + this.style = style; + } } module.exports = Text; diff --git a/lib/Texture.js b/lib/Texture.js index 6d8810d..606b2a1 100644 --- a/lib/Texture.js +++ b/lib/Texture.js @@ -1,7 +1,7 @@ class Texture { - constructor(url) { - this.img = new Image(); - this.img.src = url; - } + constructor(url) { + this.img = new Image(); + this.img.src = url; + } } module.exports = Texture; diff --git a/lib/TileMap.js b/lib/TileMap.js index 099c677..7900999 100644 --- a/lib/TileMap.js +++ b/lib/TileMap.js @@ -1,25 +1,59 @@ var Container = require("./Container"), - TileSprite = require("./TileSprite") + TileSprite = require("./TileSprite") ; class TileMap extends Container { - constructor(tiles, mapW, mapH, tileW, tileH, texture) { - super(); - this.mapW = mapW; - this.mapH = mapH; - this.tileW = tileW; - this.tileH = tileH; - this.w = mapW * tileW; - this.h = mapH * tileH; + constructor(tiles, mapW, mapH, tileW, tileH, texture) { + super(); + this.mapW = mapW; + this.mapH = mapH; + this.tileW = tileW; + this.tileH = tileH; + this.w = mapW * tileW; + this.h = mapH * tileH; - this.children = tiles.map((frame, i) => { - const s = new TileSprite(texture, tileW, tileH); - s.frame = frame; - s.pos.x = i % mapW * tileW; - s.pos.y = Math.floor(i / mapW) * tileH; - return s; - }); - } + this.children = tiles.map((frame, i) => { + const s = new TileSprite(texture, tileW, tileH); + s.frame = frame; + s.pos.x = i % mapW * tileW; + s.pos.y = Math.floor(i / mapW) * tileH; + return s; + }); + } + + pixelToMapPos(pos) { + const { tileW, tileH } = this; + return { + x: Math.floor(pos.x / tileW), + y: Math.floor(pos.y / tileH) + }; + } + + mapToPixelPos(mapPos) { + const { tileW, tileH } = this; + return { + x: mapPos.x * tileW, + y: mapPos.y * tileH + }; + } + + tileAtMapPos(mapPos) { + return this.children[mapPos.y * this.mapW + mapPos.x]; + } + + tileAtPixelPos(pos) { + return this.tileAtMapPos(this.pixelToMapPos(pos)); + } + + setFrameAtMapPos(mapPos, frame) { + const tile = this.tileAtMapPos(mapPos); + tile.frame = frame; + return tile; + } + + setFrameAtPixelPos(pos, frame) { + return this.setFrameAtMapPos(this.pixelToMapPos(pos), frame); + } } module.exports = TileMap; \ No newline at end of file diff --git a/lib/TileMapXML.js b/lib/TileMapXML.js index d140f62..ad287fa 100644 --- a/lib/TileMapXML.js +++ b/lib/TileMapXML.js @@ -1,25 +1,25 @@ var Container = require("./Container"), - TileSpriteXML = require("./TileSpriteXML") + TileSpriteXML = require("./TileSpriteXML") ; class TileMapXML extends Container { - constructor(tiles, mapW, mapH, texture, xml) { - super(texture); - this.mapW = mapW; - this.mapH = mapH; - this.tileW = xml.array[tiles[0]].width; - this.tileH = xml.array[tiles[0]].height; - this.w = mapW * this.tileW; - this.h = mapH * this.tileH; + constructor(tiles, mapW, mapH, texture, xml) { + super(texture); + this.mapW = mapW; + this.mapH = mapH; + this.tileW = xml.array[tiles[0]].width; + this.tileH = xml.array[tiles[0]].height; + this.w = mapW * this.tileW; + this.h = mapH * this.tileH; - this.children = tiles.map((frame, i) => { - const s = new TileSpriteXML(texture, xml, frame); - s.frame = frame; - s.pos.x = i % mapW * this.tileW; - s.pos.y = Math.floor(i / mapW) * this.tileH; - return s; - }); - } + this.children = tiles.map((frame, i) => { + const s = new TileSpriteXML(texture, xml, frame); + s.frame = frame; + s.pos.x = i % mapW * this.tileW; + s.pos.y = Math.floor(i / mapW) * this.tileH; + return s; + }); + } } module.exports = TileMapXML; \ No newline at end of file diff --git a/lib/TileSprite.js b/lib/TileSprite.js index 9fddcaa..5c98763 100644 --- a/lib/TileSprite.js +++ b/lib/TileSprite.js @@ -1,12 +1,12 @@ var Sprite = require("./Sprite"); class TileSprite extends Sprite { - constructor(texture, w, h) { - super(texture); - this.tileW = w; - this.tileH = h; - this.frame = { x: 0, y: 0 }; - } + constructor(texture, w, h) { + super(texture); + this.tileW = w; + this.tileH = h; + this.frame = { x: 0, y: 0 }; + } } module.exports = TileSprite; \ No newline at end of file diff --git a/lib/TileSpriteXML.js b/lib/TileSpriteXML.js index 2cc1e6e..5918171 100644 --- a/lib/TileSpriteXML.js +++ b/lib/TileSpriteXML.js @@ -1,13 +1,13 @@ var Sprite = require("./Sprite"); class TileSpriteXML extends Sprite { - constructor(texture, xml, index) { - super(texture); - var src = xml.array[index]; - this.imgPos = { x: src['x'], y: src['y'] }; - this.width = src['width']; - this.height = src['height']; - } + constructor(texture, xml, index) { + super(texture); + var src = xml.array[index]; + this.imgPos = { x: src["x"], y: src["y"] }; + this.width = src["width"]; + this.height = src["height"]; + } } module.exports = TileSpriteXML; \ No newline at end of file diff --git a/lib/controls/KeyControls.js b/lib/controls/KeyControls.js index bf8e683..d2469bb 100644 --- a/lib/controls/KeyControls.js +++ b/lib/controls/KeyControls.js @@ -1,61 +1,61 @@ class KeyControls { - constructor() { - this.keys = {}; - // Bind event handlers - document.addEventListener("keydown", e => { - if ([37, 38, 39, 40].indexOf(e.which) >= 0) { - e.preventDefault(); - } - this.keys[e.which] = true; - }, false); - document.addEventListener('keyup', e => { - this.keys[e.which] = false; - }, false); - } + constructor() { + this.keys = {}; + // Bind event handlers + document.addEventListener("keydown", e => { + if ([37, 38, 39, 40].indexOf(e.which) >= 0) { + e.preventDefault(); + } + this.keys[e.which] = true; + }, false); + document.addEventListener("keyup", e => { + this.keys[e.which] = false; + }, false); + } - get action() { - // Spacebar - return this.keys[32]; - } + get action() { + // Spacebar + return this.keys[32]; + } - get x() { - // Arrow Left or A (WASD) - if (this.keys[37] || this.keys[65]) { - return -1; - } - // Arrow Right or D (WASD) - if (this.keys[39] || this.keys[68]) { - return 1; - } - return 0; - } + get x() { + // Arrow Left or A (WASD) + if (this.keys[37] || this.keys[65]) { + return -1; + } + // Arrow Right or D (WASD) + if (this.keys[39] || this.keys[68]) { + return 1; + } + return 0; + } - get y() { - // Arrow Up or W (WASD) - if (this.keys[38] || this.keys[87]) { - return -1; - } - // Arrow Down or S (WASD) - if (this.keys[40] || this.keys[83]) { - return 1; - } - return 0; - } + get y() { + // Arrow Up or W (WASD) + if (this.keys[38] || this.keys[87]) { + return -1; + } + // Arrow Down or S (WASD) + if (this.keys[40] || this.keys[83]) { + return 1; + } + return 0; + } - key(key, value) { - if (value !== undefined) { - this.keys[key] = value; - } - return this.keys[key]; - } + key(key, value) { + if (value !== undefined) { + this.keys[key] = value; + } + return this.keys[key]; + } - reset() { - for (let key in this.keys) { - this.keys[key] = false; - } - } + reset() { + for (let key in this.keys) { + this.keys[key] = false; + } + } } diff --git a/lib/controls/MouseControls.js b/lib/controls/MouseControls.js index 7c20b36..27925eb 100644 --- a/lib/controls/MouseControls.js +++ b/lib/controls/MouseControls.js @@ -1,45 +1,45 @@ class MouseControls { - constructor(container) { - this.el = container || document.body; - // State - this.pos = { x: 0, y: 0 }; - this.isDown = false; - this.pressed = false; - this.released = false; - // Handlers - document.addEventListener('mousemove', this.move.bind(this), false); - document.addEventListener('mousedown', this.down.bind(this), false); - document.addEventListener('mouseup', this.up.bind(this), false); - } + constructor(container) { + this.el = container || document.body; + // State + this.pos = { x: 0, y: 0 }; + this.isDown = false; + this.pressed = false; + this.released = false; + // Handlers + document.addEventListener("mousemove", this.move.bind(this), false); + document.addEventListener("mousedown", this.down.bind(this), false); + document.addEventListener("mouseup", this.up.bind(this), false); + } - mousePosFromEvent({ clientX, clientY }) { - const { el, pos } = this; - const rect = el.getBoundingClientRect(); - const xr = el.width / el.clientWidth; - const yr = el.height / el.clientHeight; - pos.x = (clientX - rect.left) * xr; - pos.y = (clientY - rect.top) * yr; - } + mousePosFromEvent({ clientX, clientY }) { + const { el, pos } = this; + const rect = el.getBoundingClientRect(); + const xr = el.width / el.clientWidth; + const yr = el.height / el.clientHeight; + pos.x = (clientX - rect.left) * xr; + pos.y = (clientY - rect.top) * yr; + } - move(e) { - this.mousePosFromEvent(e); - } + move(e) { + this.mousePosFromEvent(e); + } - down(e) { - this.isDown = true; - this.pressed = true; - this.mousePosFromEvent(e); - } + down(e) { + this.isDown = true; + this.pressed = true; + this.mousePosFromEvent(e); + } - up() { - this.isDown = false; - this.released = true; - } + up() { + this.isDown = false; + this.released = true; + } - update() { - this.released = false; - this.pressed = false; - } + update() { + this.released = false; + this.pressed = false; + } } module.exports = MouseControls; diff --git a/lib/index.js b/lib/index.js index a8bf2b1..91232cb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,36 +1,40 @@ -var Container = require("./Container.js"), - CanvasRenderer = require("./renderer/CanvasRenderer.js"), - Game = require("./Game.js"), - math = require("./utilities/math.js"), - entity = require("./utilities/entity.js"), - Rect = require("./Rect.js"), - KeyControls = require("./controls/KeyControls.js"), - MouseControls = require("./controls/MouseControls.js"), - Sprite = require("./Sprite.js"), - TileMap = require("./TileMap.js"), - TileMapXML = require("./TileMapXML.js"), - TileSprite = require("./TileSprite.js"), - TileSpriteXML = require("./TileSpriteXML.js"), - Text = require("./Text.js"), - Texture = require("./Texture.js"), - SpriteSheetXML = require("./SpriteSheetXML.js") +var AnimManager = require("./AnimManager.js"), + Camera = require("./Camera.js"), + Container = require("./Container.js"), + CanvasRenderer = require("./renderer/CanvasRenderer.js"), + Game = require("./Game.js"), + math = require("./utilities/math.js"), + entity = require("./utilities/entity.js"), + Rect = require("./Rect.js"), + KeyControls = require("./controls/KeyControls.js"), + MouseControls = require("./controls/MouseControls.js"), + Sprite = require("./Sprite.js"), + TileMap = require("./TileMap.js"), + TileMapXML = require("./TileMapXML.js"), + TileSprite = require("./TileSprite.js"), + TileSpriteXML = require("./TileSpriteXML.js"), + Text = require("./Text.js"), + Texture = require("./Texture.js"), + SpriteSheetXML = require("./SpriteSheetXML.js") ; module.exports = { - CanvasRenderer, - Container, - Game, - math, - entity, - Rect, - KeyControls, - MouseControls, - Sprite, - TileMap, - TileMapXML, - TileSprite, - SpriteSheetXML, - TileSpriteXML, - Text, - Texture + AnimManager, + CanvasRenderer, + Camera, + Container, + Game, + math, + entity, + Rect, + KeyControls, + MouseControls, + Sprite, + TileMap, + TileMapXML, + TileSprite, + SpriteSheetXML, + TileSpriteXML, + Text, + Texture }; diff --git a/lib/renderer/CanvasRenderer.js b/lib/renderer/CanvasRenderer.js index 3b2ec42..eea56d5 100644 --- a/lib/renderer/CanvasRenderer.js +++ b/lib/renderer/CanvasRenderer.js @@ -1,100 +1,100 @@ class CanvasRenderer { - constructor(w, h) { - const canvas = document.createElement("canvas"); - this.w = canvas.width = w; - this.h = canvas.height = h; - this.view = canvas; - this.ctx = canvas.getContext("2d"); - this.ctx.textBaseLine = "top"; - } + constructor(w, h) { + const canvas = document.createElement("canvas"); + this.w = canvas.width = w; + this.h = canvas.height = h; + this.view = canvas; + this.ctx = canvas.getContext("2d"); + this.ctx.textBaseLine = "top"; + } - setPixelated() { - this.ctx['imageSmoothingEnabled'] = false; /* standard */ - this.ctx['mozImageSmoothingEnabled'] = false; /* Firefox */ - this.ctx['oImageSmoothingEnabled'] = false; /* Opera */ - this.ctx['webkitImageSmoothingEnabled'] = false; /* Safari */ - this.ctx['msImageSmoothingEnabled'] = false; /* IE */ - } + setPixelated() { + this.ctx["imageSmoothingEnabled"] = false; /* standard */ + this.ctx["mozImageSmoothingEnabled"] = false; /* Firefox */ + this.ctx["oImageSmoothingEnabled"] = false; /* Opera */ + this.ctx["webkitImageSmoothingEnabled"] = false; /* Safari */ + this.ctx["msImageSmoothingEnabled"] = false; /* IE */ + } - render(container, clear = true) { - const { ctx } = this; - function renderRec(container) { - // Render container children - container.children.forEach(child => { - if (child.visible == false) { - return; - } + render(container, clear = true) { + const { ctx } = this; + function renderRec(container) { + // Render container children + container.children.forEach(child => { + if (child.visible == false) { + return; + } - ctx.save(); + ctx.save(); - if (child.pos) { - ctx.translate(Math.round(child.pos.x), Math.round(child.pos.y)); - } + if (child.pos) { + ctx.translate(Math.round(child.pos.x), Math.round(child.pos.y)); + } - if (child.anchor) { - ctx.translate(child.anchor.x, child.anchor.y); - } + if (child.anchor) { + ctx.translate(child.anchor.x, child.anchor.y); + } - if (child.scale) { - ctx.scale(child.scale.x, child.scale.y); - } + if (child.scale) { + ctx.scale(child.scale.x, child.scale.y); + } - if (child.rotation) { - const px = child.pivot ? child.pivot.x : 0; - const py = child.pivot ? child.pivot.y : 0; - ctx.translate(px, py); - ctx.rotate(child.rotation); - ctx.translate(-px, -py); - } + if (child.rotation) { + const px = child.pivot ? child.pivot.x : 0; + const py = child.pivot ? child.pivot.y : 0; + ctx.translate(px, py); + ctx.rotate(child.rotation); + ctx.translate(-px, -py); + } - if (child.text) { - const { font, fill, align } = child.style; - if (font) ctx.font = font; - if (fill) ctx.fillStyle = fill; - if (align) ctx.textAlign = align; - ctx.fillText(child.text, 0, 0); - } + if (child.text) { + const { font, fill, align } = child.style; + if (font) ctx.font = font; + if (fill) ctx.fillStyle = fill; + if (align) ctx.textAlign = align; + ctx.fillText(child.text, 0, 0); + } - else if (child.texture) { - const img = child.texture.img; - if (child.tileW && child.tileH) { - ctx.drawImage( - img, - child.frame.x * child.tileW, - child.frame.y * child.tileH, - child.tileW, child.tileH, - 0, 0, - child.tileW, child.tileH - ); - } else if (child.imgPos && child.width && child.height) { - ctx.drawImage( - img, - child.imgPos.x, - child.imgPos.y, - child.width, child.height, - 0, 0, - child.width, child.height - ); - } else if (child.style && child.w && child.h) { - ctx.fillStyle = child.style.fill; - ctx.fillRect(0, 0, child.w, child.h) - } else { - ctx.drawImage(img, 0, 0); - } - } + else if (child.texture) { + const img = child.texture.img; + if (child.tileW && child.tileH) { + ctx.drawImage( + img, + child.frame.x * child.tileW, + child.frame.y * child.tileH, + child.tileW, child.tileH, + 0, 0, + child.tileW, child.tileH + ); + } else if (child.imgPos && child.width && child.height) { + ctx.drawImage( + img, + child.imgPos.x, + child.imgPos.y, + child.width, child.height, + 0, 0, + child.width, child.height + ); + } else if (child.style && child.w && child.h) { + ctx.fillStyle = child.style.fill; + ctx.fillRect(0, 0, child.w, child.h); + } else { + ctx.drawImage(img, 0, 0); + } + } - // Handle children with children - if (child.children) { - renderRec(child); - } - ctx.restore(); - }) - } - if (clear) { - ctx.clearRect(0, 0, this.w, this.h); - } - renderRec(container); - } + // Handle children with children + if (child.children) { + renderRec(child); + } + ctx.restore(); + }); + } + if (clear) { + ctx.clearRect(0, 0, this.w, this.h); + } + renderRec(container); + } } module.exports = CanvasRenderer; diff --git a/lib/utilities/entity.js b/lib/utilities/entity.js index 857f851..67c2aaa 100644 --- a/lib/utilities/entity.js +++ b/lib/utilities/entity.js @@ -1,79 +1,79 @@ -const math = require('./math'); -const Rect = require('../Rect'); +const math = require("./math"); +const Rect = require("../Rect"); function addDebug(e) { - e.children = e.children || []; - const bb = new Rect(e.w, e.h, { fill: "rgba(255, 0, 0, 0.3)" }); - e.children.push(bb); - if (e.hitBox) { - const { x, y, w, h } = e.hitBox; - const hb = new Rect(w, h, { fill: "rgba(255, 0, 0, 0.5)" }); - hb.pos.x = x; - hb.pos.y = y; - e.children.push(hb); - } - return e; + e.children = e.children || []; + const bb = new Rect(e.w, e.h, { fill: "rgba(255, 0, 0, 0.3)" }); + e.children.push(bb); + if (e.hitBox) { + const { x, y, w, h } = e.hitBox; + const hb = new Rect(w, h, { fill: "rgba(255, 0, 0, 0.5)" }); + hb.pos.x = x; + hb.pos.y = y; + e.children.push(hb); + } + return e; } function angle(a, b) { - return math.angle(center(a), center(b)); + return math.angle(center(a), center(b)); } function bounds(entity) { - const { w, h, pos, hitBox } = entity; - const hit = hitBox || { x: 0, y: 0, w, h }; - return { - x: hit.x + pos.x, - y: hit.y + pos.y, - w: hit.w - 1, - h: hit.h - 1 - }; + const { w, h, pos, hitBox } = entity; + const hit = hitBox || { x: 0, y: 0, w, h }; + return { + x: hit.x + pos.x, + y: hit.y + pos.y, + w: hit.w - 1, + h: hit.h - 1 + }; } function center(entity) { - const { pos, w, h } = entity; - return { - x: pos.x + w / 2, - y: pos.y + h / 2 - }; + const { pos, w, h } = entity; + return { + x: pos.x + w / 2, + y: pos.y + h / 2 + }; } function distance(a, b) { - return math.distance(center(a), center(b)); + return math.distance(center(a), center(b)); } function hit(e1, e2) { - const a = bounds(e1); - const b = bounds(e2); - return ( - a.x + a.w >= b.x && + const a = bounds(e1); + const b = bounds(e2); + return ( + a.x + a.w >= b.x && a.x <= b.x + b.w && a.y + a.h >= b.y && a.y <= b.y + b.h - ); + ); } function hits(entity, container, hitCallback) { - const a = bounds(entity); - container.map(e2 => { - const b = bounds(e2); - if ( - a.x + a.w >= b.x && + const a = bounds(entity); + container.map(e2 => { + const b = bounds(e2); + if ( + a.x + a.w >= b.x && a.x <= b.x + b.w && a.y + a.h >= b.y && a.y <= b.y + b.h - ) { - hitCallback(e2); - } - }); + ) { + hitCallback(e2); + } + }); } module.exports = { - addDebug, - angle, - bounds, - center, - distance, - hit, - hits + addDebug, + angle, + bounds, + center, + distance, + hit, + hits }; \ No newline at end of file diff --git a/lib/utilities/math.js b/lib/utilities/math.js index dbcbdd3..8ad6659 100644 --- a/lib/utilities/math.js +++ b/lib/utilities/math.js @@ -1,26 +1,48 @@ +function angle(a, b) { + const dx = a.x - b.x; + const dy = a.y - b.y; + const angle = Math.atan2(dy, dx); + + return angle; +} + +function clamp(x, min, max) { + return Math.max(min, Math.min(x, max)); +} + +function distance (a, b) { + const dx = a.x - b.x; + const dy = a.y - b.y; + + return Math.sqrt(dx * dx + dy * dy); +} + function rand(min, max) { - return Math.floor(randf(min, max)); + return Math.floor(randf(min, max)); } function randf(min, max) { - if (max == null) { - max = min || 1; - min = 0; - } - return Math.random() * (max - min) + min; + if (max == null) { + max = min || 1; + min = 0; + } + return Math.random() * (max - min) + min; } function randOneFrom(items) { - return items[rand(items.length)]; + return items[rand(items.length)]; } function randOneIn(max = 2) { - return rand(0, max) === 0; + return rand(0, max) === 0; } module.exports = { - rand, - randf, - randOneFrom, - randOneIn + angle, + clamp, + distance, + rand, + randf, + randOneFrom, + randOneIn }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0ba4957 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1096 @@ +{ + "name": "asdf-games", + "version": "1.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", + "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "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 + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "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" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "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 + }, + "esquery": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", + "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.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.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "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 + }, + "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 + }, + "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" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "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 + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "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 + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "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 + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "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" + } + }, + "run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "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 + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "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 + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.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" + }, + "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-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "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 + }, + "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 + }, + "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" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + } + } +} diff --git a/package.json b/package.json index e9ddea9..54f06d5 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,8 @@ "name": "Arne van Iterson", "url": "https://gitea.arnweb.nl/arne/" }, - "license": "ISC" + "license": "ISC", + "devDependencies": { + "eslint": "^6.8.0" + } }