1
0
Fork 0

🚧 First working macro implementation

This commit is contained in:
Joost De Cock 2018-07-21 12:54:29 +02:00
parent ae31669581
commit 4be84584c2
6 changed files with 278 additions and 257 deletions

View file

@ -2,6 +2,7 @@ import { Point } from './point'
import { Path } from './path'
import { Snippet } from './snippet'
import { Attributes } from './attributes'
import hooklib from 'hooks'
export class Part {
id: string;
@ -10,31 +11,31 @@ export class Part {
paths: { [index: string]: Path; } = {};
snippets: { [index: string]: Snippet; } = {};
attributes = new Attributes();
// Expose constructors for macros
point: Point = Point;
path: Path = Path;
[propName: string]: any;
constructor(id: string) {
this.id = id;
this.render = (id.substr(0,1) === '_') ? false : true;
this.points.origin = new Point(0,0);
for(let k in hooklib) this[k] = hooklib[k];
return this;
}
//macro(type: string, options: {}): void {
// switch(type) {
// case 'cof':
// this.points.cofFrom = options.from.shiftTowards(options.to, 10);
// this.points.cofTo = options.to.shiftTowards(options.from, 10);
// this.points.cofVia1 = options.from.rotate(-90, this.points.cofFrom);
// this.points.cofVia2 = options.to.rotate(-90, this.points.cofTo);
// this.paths.cof = new Path().move(cofFrom).line(cofVia1).line(cofVia2).line(cofTo);
// break;
// }
//}
macroRunner(args) {
console.log('arguments in macroRunner', arguments);
let self = this;
let data = args;
let method = function (key, data) {
let macro = `_macro_${key}`;
if(typeof self[macro] === 'function') {
self[macro](data);
}
}
// purge = {
// points = function(prefix: string): void {}
// paths = function(prefix: string): void {}
// }
return method;
}
}

View file

@ -40,6 +40,13 @@ export class Path {
return this;
}
/** Adds an attribute. This is here to make this call chainable in assignment */
attr(name, value): Path {
this.attributes.add(name, value);
return this;
}
/** Returns SVG pathstring for this path */
asPathstring() {
let d = '';

View file

@ -17,9 +17,10 @@ export class Pattern {
values: {[propName: string]: any} = {};
settings: {[propName: string]: any} = {mode: 'draft', units: 'metric'};
hooks: Hooks;
snippet: Snippet
path: Path
snippet: Snippet;
path: Path;
context: any
hook: any;
constructor(config: PatternConfig) {
if(!config) {
@ -29,6 +30,7 @@ export class Pattern {
throw "Could not create pattern: You should define at least one part in your pattern config";
}
this.config = config;
this.point = Point;
this.path = Path;
this.snippet = Snippet;
this.parts = {};
@ -73,6 +75,16 @@ export class Pattern {
this.hooks._hooks[hook].push(method);
}
macro(key, method): void {
let name = `_macro_${key}`;
this.on(name, method);
for(let partId in this.parts) {
let part = this.parts[partId];
part[name] = () => null;
this.hooks.attach(name, part);
}
}
loadPlugin(plugin: () => void): void {
for(let hook of this.hooks.all) {
if(typeof plugin[hook] === 'function') {

View file

@ -80,6 +80,7 @@ export function shorthand(part, context): {} {
points: part.points || {},
paths: part.paths || {},
snippets: part.snippets || {},
macro: part.macroRunner(),
final,
paperless
}

476
package-lock.json generated
View file

@ -33,7 +33,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "~2.1.18",
"mime-types": "2.1.18",
"negotiator": "0.6.1"
}
},
@ -42,8 +42,8 @@
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
"integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
"requires": {
"micromatch": "^2.1.5",
"normalize-path": "^2.0.0"
"micromatch": "2.3.11",
"normalize-path": "2.1.1"
}
},
"apache-crypt": {
@ -51,7 +51,7 @@
"resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.1.tgz",
"integrity": "sha1-1vxyqm0n2ZyVqU/RiNcx7v/6Zjw=",
"requires": {
"unix-crypt-td-js": "^1.0.0"
"unix-crypt-td-js": "1.0.0"
}
},
"apache-md5": {
@ -64,7 +64,7 @@
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
"requires": {
"arr-flatten": "^1.0.1"
"arr-flatten": "1.1.0"
}
},
"arr-flatten": {
@ -129,7 +129,7 @@
"resolved": "https://registry.npmjs.org/bezier-js/-/bezier-js-2.2.13.tgz",
"integrity": "sha512-RLQV6Jr6g7J5IDJXFYUhbwBJjuFi1JTsA2PdsVMnwbT7fQhZvEwtI7YF4k+6DEpXsRQ3o3iPj+cOaMP5DjtKsg==",
"requires": {
"live-server": "^1.2.0"
"live-server": "1.2.0"
}
},
"binary-extensions": {
@ -142,7 +142,7 @@
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
@ -151,9 +151,9 @@
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
"integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
"requires": {
"expand-range": "^1.8.1",
"preserve": "^0.2.0",
"repeat-element": "^1.1.2"
"expand-range": "1.8.2",
"preserve": "0.2.0",
"repeat-element": "1.1.2"
}
},
"browser-stdout": {
@ -174,12 +174,12 @@
"integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=",
"dev": true,
"requires": {
"assertion-error": "^1.0.1",
"check-error": "^1.0.1",
"deep-eql": "^3.0.0",
"get-func-name": "^2.0.0",
"pathval": "^1.0.0",
"type-detect": "^4.0.0"
"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.8"
}
},
"check-error": {
@ -193,15 +193,15 @@
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
"integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
"requires": {
"anymatch": "^1.3.0",
"async-each": "^1.0.0",
"fsevents": "^1.0.0",
"glob-parent": "^2.0.0",
"inherits": "^2.0.1",
"is-binary-path": "^1.0.0",
"is-glob": "^2.0.0",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.0.0"
"anymatch": "1.3.2",
"async-each": "1.0.1",
"fsevents": "1.2.4",
"glob-parent": "2.0.0",
"inherits": "2.0.3",
"is-binary-path": "1.0.1",
"is-glob": "2.0.1",
"path-is-absolute": "1.0.1",
"readdirp": "2.1.0"
}
},
"colors": {
@ -225,9 +225,9 @@
"resolved": "https://registry.npmjs.org/connect/-/connect-3.5.1.tgz",
"integrity": "sha1-bTDXpjx/FwhXprOqazY9lz3KWI4=",
"requires": {
"debug": "~2.2.0",
"debug": "2.2.0",
"finalhandler": "0.5.1",
"parseurl": "~1.3.1",
"parseurl": "1.3.2",
"utils-merge": "1.0.0"
}
},
@ -241,8 +241,8 @@
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
"requires": {
"object-assign": "^4",
"vary": "^1"
"object-assign": "4.1.1",
"vary": "1.1.2"
}
},
"debug": {
@ -259,7 +259,7 @@
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"dev": true,
"requires": {
"type-detect": "^4.0.0"
"type-detect": "4.0.8"
}
},
"depd": {
@ -314,13 +314,13 @@
"resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
"requires": {
"duplexer": "~0.1.1",
"from": "~0",
"map-stream": "~0.1.0",
"duplexer": "0.1.1",
"from": "0.1.7",
"map-stream": "0.1.0",
"pause-stream": "0.0.11",
"split": "0.3",
"stream-combiner": "~0.0.4",
"through": "~2.3.1"
"split": "0.3.3",
"stream-combiner": "0.0.4",
"through": "2.3.8"
}
},
"expand-brackets": {
@ -328,7 +328,7 @@
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
"integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
"requires": {
"is-posix-bracket": "^0.1.0"
"is-posix-bracket": "0.1.1"
}
},
"expand-range": {
@ -336,7 +336,7 @@
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"requires": {
"fill-range": "^2.1.0"
"fill-range": "2.2.4"
}
},
"extglob": {
@ -344,7 +344,7 @@
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
"integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
"requires": {
"is-extglob": "^1.0.0"
"is-extglob": "1.0.0"
}
},
"faye-websocket": {
@ -352,7 +352,7 @@
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz",
"integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=",
"requires": {
"websocket-driver": ">=0.5.1"
"websocket-driver": "0.7.0"
}
},
"filename-regex": {
@ -365,11 +365,11 @@
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
"integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
"requires": {
"is-number": "^2.1.0",
"isobject": "^2.0.0",
"randomatic": "^3.0.0",
"repeat-element": "^1.1.2",
"repeat-string": "^1.5.2"
"is-number": "2.1.0",
"isobject": "2.1.0",
"randomatic": "3.0.0",
"repeat-element": "1.1.2",
"repeat-string": "1.6.1"
}
},
"finalhandler": {
@ -377,11 +377,11 @@
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.5.1.tgz",
"integrity": "sha1-LEANjUUwk1vCMlScX6OF7Afeb80=",
"requires": {
"debug": "~2.2.0",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"statuses": "~1.3.1",
"unpipe": "~1.0.0"
"debug": "2.2.0",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"statuses": "1.3.1",
"unpipe": "1.0.0"
}
},
"for-in": {
@ -394,7 +394,7 @@
"resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
"integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
"requires": {
"for-in": "^1.0.1"
"for-in": "1.0.2"
}
},
"fresh": {
@ -419,8 +419,8 @@
"integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
"optional": true,
"requires": {
"nan": "^2.9.2",
"node-pre-gyp": "^0.10.0"
"nan": "2.10.0",
"node-pre-gyp": "0.10.0"
},
"dependencies": {
"abbrev": {
@ -442,8 +442,8 @@
"bundled": true,
"optional": true,
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
"delegates": "1.0.0",
"readable-stream": "2.3.6"
}
},
"balanced-match": {
@ -454,7 +454,7 @@
"version": "1.1.11",
"bundled": true,
"requires": {
"balanced-match": "^1.0.0",
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
@ -508,7 +508,7 @@
"bundled": true,
"optional": true,
"requires": {
"minipass": "^2.2.1"
"minipass": "2.2.4"
}
},
"fs.realpath": {
@ -521,14 +521,14 @@
"bundled": 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"
"aproba": "1.2.0",
"console-control-strings": "1.1.0",
"has-unicode": "2.0.1",
"object-assign": "4.1.1",
"signal-exit": "3.0.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wide-align": "1.1.2"
}
},
"glob": {
@ -536,12 +536,12 @@
"bundled": 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"
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"has-unicode": {
@ -554,7 +554,7 @@
"bundled": true,
"optional": true,
"requires": {
"safer-buffer": "^2.1.0"
"safer-buffer": "2.1.2"
}
},
"ignore-walk": {
@ -562,7 +562,7 @@
"bundled": true,
"optional": true,
"requires": {
"minimatch": "^3.0.4"
"minimatch": "3.0.4"
}
},
"inflight": {
@ -570,8 +570,8 @@
"bundled": true,
"optional": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
@ -587,7 +587,7 @@
"version": "1.0.0",
"bundled": true,
"requires": {
"number-is-nan": "^1.0.0"
"number-is-nan": "1.0.1"
}
},
"isarray": {
@ -599,7 +599,7 @@
"version": "3.0.4",
"bundled": true,
"requires": {
"brace-expansion": "^1.1.7"
"brace-expansion": "1.1.11"
}
},
"minimist": {
@ -610,8 +610,8 @@
"version": "2.2.4",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
"safe-buffer": "5.1.1",
"yallist": "3.0.2"
}
},
"minizlib": {
@ -619,7 +619,7 @@
"bundled": true,
"optional": true,
"requires": {
"minipass": "^2.2.1"
"minipass": "2.2.4"
}
},
"mkdirp": {
@ -639,9 +639,9 @@
"bundled": true,
"optional": true,
"requires": {
"debug": "^2.1.2",
"iconv-lite": "^0.4.4",
"sax": "^1.2.4"
"debug": "2.6.9",
"iconv-lite": "0.4.21",
"sax": "1.2.4"
}
},
"node-pre-gyp": {
@ -649,16 +649,16 @@
"bundled": true,
"optional": true,
"requires": {
"detect-libc": "^1.0.2",
"mkdirp": "^0.5.1",
"needle": "^2.2.0",
"nopt": "^4.0.1",
"npm-packlist": "^1.1.6",
"npmlog": "^4.0.2",
"rc": "^1.1.7",
"rimraf": "^2.6.1",
"semver": "^5.3.0",
"tar": "^4"
"detect-libc": "1.0.3",
"mkdirp": "0.5.1",
"needle": "2.2.0",
"nopt": "4.0.1",
"npm-packlist": "1.1.10",
"npmlog": "4.1.2",
"rc": "1.2.7",
"rimraf": "2.6.2",
"semver": "5.5.0",
"tar": "4.4.1"
}
},
"nopt": {
@ -666,8 +666,8 @@
"bundled": true,
"optional": true,
"requires": {
"abbrev": "1",
"osenv": "^0.1.4"
"abbrev": "1.1.1",
"osenv": "0.1.5"
}
},
"npm-bundled": {
@ -680,8 +680,8 @@
"bundled": true,
"optional": true,
"requires": {
"ignore-walk": "^3.0.1",
"npm-bundled": "^1.0.1"
"ignore-walk": "3.0.1",
"npm-bundled": "1.0.3"
}
},
"npmlog": {
@ -689,10 +689,10 @@
"bundled": 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"
"are-we-there-yet": "1.1.4",
"console-control-strings": "1.1.0",
"gauge": "2.7.4",
"set-blocking": "2.0.0"
}
},
"number-is-nan": {
@ -708,7 +708,7 @@
"version": "1.4.0",
"bundled": true,
"requires": {
"wrappy": "1"
"wrappy": "1.0.2"
}
},
"os-homedir": {
@ -726,8 +726,8 @@
"bundled": true,
"optional": true,
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
"os-homedir": "1.0.2",
"os-tmpdir": "1.0.2"
}
},
"path-is-absolute": {
@ -745,10 +745,10 @@
"bundled": true,
"optional": true,
"requires": {
"deep-extend": "^0.5.1",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
"deep-extend": "0.5.1",
"ini": "1.3.5",
"minimist": "1.2.0",
"strip-json-comments": "2.0.1"
},
"dependencies": {
"minimist": {
@ -763,13 +763,13 @@
"bundled": 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"
"core-util-is": "1.0.2",
"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.2"
}
},
"rimraf": {
@ -777,7 +777,7 @@
"bundled": true,
"optional": true,
"requires": {
"glob": "^7.0.5"
"glob": "7.1.2"
}
},
"safe-buffer": {
@ -813,9 +813,9 @@
"version": "1.0.2",
"bundled": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
@ -823,14 +823,14 @@
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "~5.1.0"
"safe-buffer": "5.1.1"
}
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"requires": {
"ansi-regex": "^2.0.0"
"ansi-regex": "2.1.1"
}
},
"strip-json-comments": {
@ -843,13 +843,13 @@
"bundled": true,
"optional": true,
"requires": {
"chownr": "^1.0.1",
"fs-minipass": "^1.2.5",
"minipass": "^2.2.4",
"minizlib": "^1.1.0",
"mkdirp": "^0.5.0",
"safe-buffer": "^5.1.1",
"yallist": "^3.0.2"
"chownr": "1.0.1",
"fs-minipass": "1.2.5",
"minipass": "2.2.4",
"minizlib": "1.1.0",
"mkdirp": "0.5.1",
"safe-buffer": "5.1.1",
"yallist": "3.0.2"
}
},
"util-deprecate": {
@ -862,7 +862,7 @@
"bundled": true,
"optional": true,
"requires": {
"string-width": "^1.0.2"
"string-width": "1.0.2"
}
},
"wrappy": {
@ -887,12 +887,12 @@
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"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"
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"glob-base": {
@ -900,8 +900,8 @@
"resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
"integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
"requires": {
"glob-parent": "^2.0.0",
"is-glob": "^2.0.0"
"glob-parent": "2.0.0",
"is-glob": "2.0.1"
}
},
"glob-parent": {
@ -909,7 +909,7 @@
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
"requires": {
"is-glob": "^2.0.0"
"is-glob": "2.0.1"
}
},
"graceful-fs": {
@ -945,10 +945,10 @@
"resolved": "https://registry.npmjs.org/http-auth/-/http-auth-3.1.3.tgz",
"integrity": "sha1-lFz63WZSHq+PfISRPTd9exXyTjE=",
"requires": {
"apache-crypt": "^1.1.2",
"apache-md5": "^1.0.6",
"bcryptjs": "^2.3.0",
"uuid": "^3.0.0"
"apache-crypt": "1.2.1",
"apache-md5": "1.1.2",
"bcryptjs": "2.4.3",
"uuid": "3.3.2"
}
},
"http-errors": {
@ -956,10 +956,10 @@
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
"statuses": "1.5.0"
},
"dependencies": {
"statuses": {
@ -980,8 +980,8 @@
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
@ -994,7 +994,7 @@
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
"integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
"requires": {
"binary-extensions": "^1.0.0"
"binary-extensions": "1.11.0"
}
},
"is-buffer": {
@ -1012,7 +1012,7 @@
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
"integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
"requires": {
"is-primitive": "^2.0.0"
"is-primitive": "2.0.0"
}
},
"is-extendable": {
@ -1030,7 +1030,7 @@
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"requires": {
"is-extglob": "^1.0.0"
"is-extglob": "1.0.0"
}
},
"is-number": {
@ -1038,7 +1038,7 @@
"resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
"integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
"requires": {
"kind-of": "^3.0.2"
"kind-of": "3.2.2"
}
},
"is-posix-bracket": {
@ -1074,7 +1074,7 @@
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"requires": {
"is-buffer": "^1.1.5"
"is-buffer": "1.1.6"
}
},
"live-server": {
@ -1082,19 +1082,19 @@
"resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.0.tgz",
"integrity": "sha1-RJhkS7+Bpm8Y3Y3/3vYcTBw3TKM=",
"requires": {
"chokidar": "^1.6.0",
"colors": "^1.3.0",
"connect": "3.5.x",
"cors": "^2.8.4",
"event-stream": "^3.3.4",
"faye-websocket": "0.11.x",
"http-auth": "3.1.x",
"morgan": "^1.6.1",
"object-assign": "^4.1.1",
"opn": "^5.3.0",
"proxy-middleware": "^0.15.0",
"send": "^0.16.2",
"serve-index": "^1.7.2"
"chokidar": "1.7.0",
"colors": "1.3.0",
"connect": "3.5.1",
"cors": "2.8.4",
"event-stream": "3.3.4",
"faye-websocket": "0.11.1",
"http-auth": "3.1.3",
"morgan": "1.9.0",
"object-assign": "4.1.1",
"opn": "5.3.0",
"proxy-middleware": "0.15.0",
"send": "0.16.2",
"serve-index": "1.9.1"
}
},
"make-error": {
@ -1118,19 +1118,19 @@
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"requires": {
"arr-diff": "^2.0.0",
"array-unique": "^0.2.1",
"braces": "^1.8.2",
"expand-brackets": "^0.1.4",
"extglob": "^0.3.1",
"filename-regex": "^2.0.0",
"is-extglob": "^1.0.0",
"is-glob": "^2.0.1",
"kind-of": "^3.0.2",
"normalize-path": "^2.0.1",
"object.omit": "^2.0.0",
"parse-glob": "^3.0.4",
"regex-cache": "^0.4.2"
"arr-diff": "2.0.0",
"array-unique": "0.2.1",
"braces": "1.8.5",
"expand-brackets": "0.1.5",
"extglob": "0.3.2",
"filename-regex": "2.0.1",
"is-extglob": "1.0.0",
"is-glob": "2.0.1",
"kind-of": "3.2.2",
"normalize-path": "2.1.1",
"object.omit": "2.0.1",
"parse-glob": "3.0.4",
"regex-cache": "0.4.4"
}
},
"mime": {
@ -1148,7 +1148,7 @@
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"requires": {
"mime-db": "~1.33.0"
"mime-db": "1.33.0"
}
},
"minimatch": {
@ -1156,7 +1156,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
"brace-expansion": "1.1.11"
}
},
"minimist": {
@ -1215,11 +1215,11 @@
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz",
"integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=",
"requires": {
"basic-auth": "~2.0.0",
"basic-auth": "2.0.0",
"debug": "2.6.9",
"depd": "~1.1.1",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
"depd": "1.1.2",
"on-finished": "2.3.0",
"on-headers": "1.0.1"
},
"dependencies": {
"debug": {
@ -1258,7 +1258,7 @@
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
"requires": {
"remove-trailing-separator": "^1.0.1"
"remove-trailing-separator": "1.1.0"
}
},
"object-assign": {
@ -1271,8 +1271,8 @@
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
"integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
"requires": {
"for-own": "^0.1.4",
"is-extendable": "^0.1.1"
"for-own": "0.1.5",
"is-extendable": "0.1.1"
}
},
"on-finished": {
@ -1294,7 +1294,7 @@
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
"wrappy": "1.0.2"
}
},
"opn": {
@ -1302,7 +1302,7 @@
"resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz",
"integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==",
"requires": {
"is-wsl": "^1.1.0"
"is-wsl": "1.1.0"
}
},
"parse-glob": {
@ -1310,10 +1310,10 @@
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
"requires": {
"glob-base": "^0.3.0",
"is-dotfile": "^1.0.0",
"is-extglob": "^1.0.0",
"is-glob": "^2.0.0"
"glob-base": "0.3.0",
"is-dotfile": "1.0.3",
"is-extglob": "1.0.0",
"is-glob": "2.0.1"
}
},
"parseurl": {
@ -1337,7 +1337,7 @@
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
"integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
"requires": {
"through": "~2.3"
"through": "2.3.8"
}
},
"preserve": {
@ -1360,9 +1360,9 @@
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz",
"integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==",
"requires": {
"is-number": "^4.0.0",
"kind-of": "^6.0.0",
"math-random": "^1.0.1"
"is-number": "4.0.0",
"kind-of": "6.0.2",
"math-random": "1.0.1"
},
"dependencies": {
"is-number": {
@ -1387,13 +1387,13 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"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"
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.2",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"readdirp": {
@ -1401,10 +1401,10 @@
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz",
"integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=",
"requires": {
"graceful-fs": "^4.1.2",
"minimatch": "^3.0.2",
"readable-stream": "^2.0.2",
"set-immediate-shim": "^1.0.1"
"graceful-fs": "4.1.11",
"minimatch": "3.0.4",
"readable-stream": "2.3.6",
"set-immediate-shim": "1.0.1"
}
},
"regex-cache": {
@ -1412,7 +1412,7 @@
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
"integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
"requires": {
"is-equal-shallow": "^0.1.3"
"is-equal-shallow": "0.1.3"
}
},
"remove-trailing-separator": {
@ -1441,18 +1441,18 @@
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"depd": "1.1.2",
"destroy": "1.0.4",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"http-errors": "1.6.3",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
"on-finished": "2.3.0",
"range-parser": "1.2.0",
"statuses": "1.4.0"
},
"dependencies": {
"debug": {
@ -1480,13 +1480,13 @@
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
"integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
"requires": {
"accepts": "~1.3.4",
"accepts": "1.3.5",
"batch": "0.6.1",
"debug": "2.6.9",
"escape-html": "~1.0.3",
"http-errors": "~1.6.2",
"mime-types": "~2.1.17",
"parseurl": "~1.3.2"
"escape-html": "1.0.3",
"http-errors": "1.6.3",
"mime-types": "2.1.18",
"parseurl": "1.3.2"
},
"dependencies": {
"debug": {
@ -1526,8 +1526,8 @@
"integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
"buffer-from": "1.1.0",
"source-map": "0.6.1"
}
},
"split": {
@ -1535,7 +1535,7 @@
"resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz",
"integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=",
"requires": {
"through": "2"
"through": "2.3.8"
}
},
"statuses": {
@ -1548,7 +1548,7 @@
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
"integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=",
"requires": {
"duplexer": "~0.1.1"
"duplexer": "0.1.1"
}
},
"string_decoder": {
@ -1556,7 +1556,7 @@
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
"safe-buffer": "5.1.2"
}
},
"supports-color": {
@ -1565,7 +1565,7 @@
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
"has-flag": "3.0.0"
}
},
"through": {
@ -1579,14 +1579,14 @@
"integrity": "sha512-klJsfswHP0FuOLsvBZ/zzCfUvakOSSxds78mVeK7I+qP76YWtxf16hEZsp3U+b0kIo82R5UatGFeblYMqabb2Q==",
"dev": true,
"requires": {
"arrify": "^1.0.0",
"buffer-from": "^1.1.0",
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.5.6",
"yn": "^2.0.0"
"arrify": "1.0.1",
"buffer-from": "1.1.0",
"diff": "3.5.0",
"make-error": "1.3.4",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"source-map-support": "0.5.6",
"yn": "2.0.0"
},
"dependencies": {
"minimist": {
@ -1644,8 +1644,8 @@
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
"integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=",
"requires": {
"http-parser-js": ">=0.4.0",
"websocket-extensions": ">=0.1.1"
"http-parser-js": "0.4.13",
"websocket-extensions": "0.1.3"
}
},
"websocket-extensions": {

View file

@ -7,7 +7,7 @@
"scripts": {
"test": "mocha -r ts-node/register tests/*.test.js",
"build": "tsc",
"watch": "tsc -w"
"watch": "tsc -w --sourceMap"
},
"repository": {
"type": "git",