From 3ff424b7eaa34f566c3c7d6dbb0b3005ffe4a093 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 21:26:29 -0400 Subject: [PATCH 01/20] toTex function --- lib/toTex.js | 93 ++++++++++++++++++++++++++++++++++++++++++++++ test/toTex_test.js | 20 ++++++++++ 2 files changed, 113 insertions(+) create mode 100644 lib/toTex.js create mode 100644 test/toTex_test.js diff --git a/lib/toTex.js b/lib/toTex.js new file mode 100644 index 0000000..f0be994 --- /dev/null +++ b/lib/toTex.js @@ -0,0 +1,93 @@ +/** + * toTex - return a string representation of the nodes in LaTeX + */ + +const isNeg = (node) => { + return node.type === 'Operation' && node.op === 'neg'; +}; + +const isAdd = (node) => { + return node.type === 'Operation' && node.op === 'add'; +}; + +const isMul = (node) => { + return node.type === 'Operation' && node.op === '*' && node.args.length > 1; +}; + +function toTexOperation(node, parent){ + let result; + + switch(node.op){ + case 'add': + //e.g a + (-a) => a - a + result = toTex(node.args[0], node); + for (let i = 1; i < node.args.length; i++){ + const arg = node.args[i]; + if (isNeg(arg) && arg.wasMinus){ + result += ` - ${toTex(arg.args[0], node)}`; + } else { + result += ` + ${toTex(arg, node)}`; + } + } + return parent ? `\left(${result}\right)` : result; + case 'neg': + return `-${toTex(node.args[0], node)}`; + case 'pos': + return `+${toTex(node.args[0], node)}`; + case 'pn': + throw new Error(`we don't handle 'pn' operations yet`); + case 'np': + throw new Error(`we don't handle 'np' operations yet`); + case 'mul': + if (node.implicit) { + //e.g 2 x + return node.args.map(arg => toTex(arg, node)).join(` `); + } else { + //e.g 2 * x + return node.args.map(arg => toTex(arg, node)).join(` \ast `); // ast for asterisk and \time for x + } + case 'div': + result = ''; + result += '\frac'; + //add parentheses when numerator or denominator has multiple terms + //e.g latex fractions: \frac{a}{b} => a/b + result += `{${toTex(node.args[1], node)}}`; + return result; + case 'pow': + // + return `${toTex(node.args[0], node)}^{${toTex(node.args[1], node)}}`; + case 'fact': + throw new Error(`we don't handle 'fact' operations yet`); + default: + throw new Error('unrecognized operation'); + } +} + +export default function toTex(node, parent = null){ + switch(node.type){ + // regular non-leaf nodes + case 'Relation': + // e.g a = b or ax^3 + bx^2 + cx + d = 0 + return node.args.map(arg => toTex(arg, node)).join(` ${node.rel} `); + case 'Operation': + return toTexOperation(node, parent); + case 'Function': + // e.g f(x, y, z) + return `${node.fn}(${node.args.map(arg => toTex(arg, node)).join(', ')})`; + + //leaf nodes + case 'Identifier': + return node.name; + case 'Number': + return node.value; + + //irregular node-leaf nodes + case 'Brackets': + //e.g [[2,3], [3,4]] + return `\lbrack${toTex(node.content, node)}\rbrack`; + + default: + console.log(node); // eslint-disable-line no-console + throw new Error('unrecognized node'); + } +} diff --git a/test/toTex_test.js b/test/toTex_test.js new file mode 100644 index 0000000..8b18a24 --- /dev/null +++ b/test/toTex_test.js @@ -0,0 +1,20 @@ +import assert from 'assert' + +import parse from '../lib/parse' +import toTex from '../lib/toTex.js' + +describe("toTex", () => { + it("handles wasMinus correctly", () => { + assert.equal(toTex(parse('1 - 2')), '1 - 2'); + assert.equal(toTex(parse('1 - -2')), '1 - -2'); + assert.equal(toTex(parse('a - b')), 'a - b'); + assert.equal(toTex(parse('a + -b')), 'a + -b'); + }); + + // TODO(kevinb) enable these tests after updating division parsing behavior + it.skip("handles fractions correctly", () => { + assert.equal(toTex(parse('1/2/3')), '1 / 2 / 3'); + assert.equal(parse('1*2/3'), '1 * (2 / 3)'); + // assert.equal(toTex(parser.parse('(1*2)/3')), '(1 * 2) / 3'); + }); +}); From 9eaf0baf637796758c988376045f5b3b057b1baf Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 21:49:05 -0400 Subject: [PATCH 02/20] fixed toTex function --- test/toTex_test.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/toTex_test.js b/test/toTex_test.js index 8b18a24..062a7d5 100644 --- a/test/toTex_test.js +++ b/test/toTex_test.js @@ -5,16 +5,23 @@ import toTex from '../lib/toTex.js' describe("toTex", () => { it("handles wasMinus correctly", () => { - assert.equal(toTex(parse('1 - 2')), '1 - 2'); + // arithmetic + assert.equal(toTex(parse('1 + -2')), '1 + -2'); assert.equal(toTex(parse('1 - -2')), '1 - -2'); assert.equal(toTex(parse('a - b')), 'a - b'); assert.equal(toTex(parse('a + -b')), 'a + -b'); + assert.equal(toTex(parse('1 * 2')), '1 ast 2'); + // implicit multiplication + assert.equal(toTex(parse('x * 2x')), 'x ast 2 x'); + assert.equal(toTex(parse('-3')), '-3'); + // brackets + //assert.equal(toTex(parse('[2 , 3]')), ''); }); - // TODO(kevinb) enable these tests after updating division parsing behavior - it.skip("handles fractions correctly", () => { - assert.equal(toTex(parse('1/2/3')), '1 / 2 / 3'); - assert.equal(parse('1*2/3'), '1 * (2 / 3)'); - // assert.equal(toTex(parser.parse('(1*2)/3')), '(1 * 2) / 3'); + it("handles fractions correctly", () => { + assert.equal(toTex(parse('1/2')), '\\frac{1}{2}'); + assert.equal(toTex(parse('1/2/3')), '\\frac{\\frac{1}{2}}{3}'); + assert.equal(toTex(parse('x/2')), '\\frac{x}{2}'); + assert.equal(toTex(parse('(x+2)/(x+3)')), '\\frac{\\left(x + 2\\right)}{\\left(x + 3\\right)}'); }); }); From b1ea3d34822f39ee8f41c248f2e5627a3dcb9dff Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 22:40:40 -0400 Subject: [PATCH 03/20] forgot a piece --- lib/toTex.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/toTex.js b/lib/toTex.js index f0be994..1b0ef0e 100644 --- a/lib/toTex.js +++ b/lib/toTex.js @@ -29,7 +29,7 @@ function toTexOperation(node, parent){ result += ` + ${toTex(arg, node)}`; } } - return parent ? `\left(${result}\right)` : result; + return parent ? `\\left(${result}\\right)` : result; case 'neg': return `-${toTex(node.args[0], node)}`; case 'pos': @@ -48,10 +48,11 @@ function toTexOperation(node, parent){ } case 'div': result = ''; - result += '\frac'; + result += '\\frac'; //add parentheses when numerator or denominator has multiple terms //e.g latex fractions: \frac{a}{b} => a/b - result += `{${toTex(node.args[1], node)}}`; + result += `{${toTex(node.args[0], node)}}`; + result += `{${toTex(node.args[1], node)}}`; return result; case 'pow': // From 2ec76c649e973ff37b720268fcacbf135150a31b Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 22:59:36 -0400 Subject: [PATCH 04/20] fixed --- test/toTex_test.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/toTex_test.js b/test/toTex_test.js index 062a7d5..b46dd09 100644 --- a/test/toTex_test.js +++ b/test/toTex_test.js @@ -4,24 +4,24 @@ import parse from '../lib/parse' import toTex from '../lib/toTex.js' describe("toTex", () => { - it("handles wasMinus correctly", () => { - // arithmetic - assert.equal(toTex(parse('1 + -2')), '1 + -2'); - assert.equal(toTex(parse('1 - -2')), '1 - -2'); - assert.equal(toTex(parse('a - b')), 'a - b'); - assert.equal(toTex(parse('a + -b')), 'a + -b'); - assert.equal(toTex(parse('1 * 2')), '1 ast 2'); - // implicit multiplication - assert.equal(toTex(parse('x * 2x')), 'x ast 2 x'); - assert.equal(toTex(parse('-3')), '-3'); - // brackets - //assert.equal(toTex(parse('[2 , 3]')), ''); - }); + it("handles wasMinus correctly", () => { + // arithmetic + assert.equal(toTex(parse('1 + -2')), '1 + -2'); + assert.equal(toTex(parse('1 - -2')), '1 - -2'); + assert.equal(toTex(parse('a - b')), 'a - b'); + assert.equal(toTex(parse('a + -b')), 'a + -b'); + assert.equal(toTex(parse('1 * 2')), '1 ast 2'); + // implicit multiplication + assert.equal(toTex(parse('x * 2x')), 'x ast 2 x'); + assert.equal(toTex(parse('-3')), '-3'); + // brackets + //assert.equal(toTex(parse('[2 , 3]')), ''); + }); - it("handles fractions correctly", () => { - assert.equal(toTex(parse('1/2')), '\\frac{1}{2}'); - assert.equal(toTex(parse('1/2/3')), '\\frac{\\frac{1}{2}}{3}'); - assert.equal(toTex(parse('x/2')), '\\frac{x}{2}'); - assert.equal(toTex(parse('(x+2)/(x+3)')), '\\frac{\\left(x + 2\\right)}{\\left(x + 3\\right)}'); - }); + it("handles fractions correctly", () => { + assert.equal(toTex(parse('1/2')), '\\frac{1}{2}'); + assert.equal(toTex(parse('1/2/3')), '\\frac{\\frac{1}{2}}{3}'); + assert.equal(toTex(parse('x/2')), '\\frac{x}{2}'); + assert.equal(toTex(parse('(x+2)/(x+3)')), '\\frac{\\left(x + 2\\right)}{\\left(x + 3\\right)}'); + }); }); From 1583865ec1c1c379b38691f86e18bfb03993bfb9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 22:59:44 -0400 Subject: [PATCH 05/20] fixed --- lib/toTex.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/toTex.js b/lib/toTex.js index 1b0ef0e..9e68b8e 100644 --- a/lib/toTex.js +++ b/lib/toTex.js @@ -1,6 +1,6 @@ /** - * toTex - return a string representation of the nodes in LaTeX - */ + * toTex - return a string representation of the nodes in LaTeX + */ const isNeg = (node) => { return node.type === 'Operation' && node.op === 'neg'; @@ -10,10 +10,6 @@ const isAdd = (node) => { return node.type === 'Operation' && node.op === 'add'; }; -const isMul = (node) => { - return node.type === 'Operation' && node.op === '*' && node.args.length > 1; -}; - function toTexOperation(node, parent){ let result; @@ -44,7 +40,7 @@ function toTexOperation(node, parent){ return node.args.map(arg => toTex(arg, node)).join(` `); } else { //e.g 2 * x - return node.args.map(arg => toTex(arg, node)).join(` \ast `); // ast for asterisk and \time for x + return node.args.map(arg => toTex(arg, node)).join(` \times `); } case 'div': result = ''; From 5102e25d80df5dcf29fa8b18156f13475d08c9a1 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 23:02:17 -0400 Subject: [PATCH 06/20] times --- lib/toTex.js | 2 +- test/toTex_test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/toTex.js b/lib/toTex.js index 9e68b8e..945099d 100644 --- a/lib/toTex.js +++ b/lib/toTex.js @@ -40,7 +40,7 @@ function toTexOperation(node, parent){ return node.args.map(arg => toTex(arg, node)).join(` `); } else { //e.g 2 * x - return node.args.map(arg => toTex(arg, node)).join(` \times `); + return node.args.map(arg => toTex(arg, node)).join(` \\times `); } case 'div': result = ''; diff --git a/test/toTex_test.js b/test/toTex_test.js index b46dd09..3d8d313 100644 --- a/test/toTex_test.js +++ b/test/toTex_test.js @@ -10,9 +10,9 @@ describe("toTex", () => { assert.equal(toTex(parse('1 - -2')), '1 - -2'); assert.equal(toTex(parse('a - b')), 'a - b'); assert.equal(toTex(parse('a + -b')), 'a + -b'); - assert.equal(toTex(parse('1 * 2')), '1 ast 2'); + assert.equal(toTex(parse('1 * 2')), '1 \\times 2'); // implicit multiplication - assert.equal(toTex(parse('x * 2x')), 'x ast 2 x'); + assert.equal(toTex(parse('x * 2x')), 'x \\times 2 x'); assert.equal(toTex(parse('-3')), '-3'); // brackets //assert.equal(toTex(parse('[2 , 3]')), ''); From d144dc5d42c359a3929c65d064c869a488db7446 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 29 Apr 2017 23:05:32 -0400 Subject: [PATCH 07/20] equations case --- test/toTex_test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/toTex_test.js b/test/toTex_test.js index 3d8d313..ba841c0 100644 --- a/test/toTex_test.js +++ b/test/toTex_test.js @@ -24,4 +24,10 @@ describe("toTex", () => { assert.equal(toTex(parse('x/2')), '\\frac{x}{2}'); assert.equal(toTex(parse('(x+2)/(x+3)')), '\\frac{\\left(x + 2\\right)}{\\left(x + 3\\right)}'); }); + + it("handles equations correctly", () => { + assert.equal(toTex(parse('x = 5/2')), 'x = \\frac{5}{2}'); + assert.equal(toTex(parse('x = 3 * (2/x)')), 'x = 3 \\times \\frac{2}{x}'); + assert.equal(toTex(parse('3 + x = 3/x')), '\\left(3 + x\\right) = \\frac{3}{x}'); + }); }); From 1ff204ac533793d89e58803699556f4a33ca6e38 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 18:00:33 -0400 Subject: [PATCH 08/20] fixed print --- lib/print.js | 141 ++++++++++++++++++++++++++------------------- test/print_test.js | 66 ++++++++++++++++----- 2 files changed, 134 insertions(+), 73 deletions(-) diff --git a/lib/print.js b/lib/print.js index 3a3d4b1..f00e94b 100644 --- a/lib/print.js +++ b/lib/print.js @@ -3,78 +3,107 @@ */ const isNeg = (node) => { - return node.type === 'Operation' && node.op === 'neg'; + return node.type === 'Apply' && node.op === 'neg'; } const isAdd = (node) => { - return node.type === 'Operation' && node.op === 'add'; + return node.type === 'Apply' && node.op === 'add'; } const isMul = (node) => { - return node.type === 'Operation' && node.op === '*' && node.args.length > 1; + return node.type === 'Apply' && node.op === 'mul'; } -function printOperation(node, parent) { - let result; +const isDiv = (node) => { + return node.type === 'Apply' && node.op === 'div'; +} - switch (node.op) { - case 'add': - result = print(node.args[0], node); - for (let i = 1; i < node.args.length; i++) { - const arg = node.args[i]; - if (isNeg(arg) && arg.wasMinus) { - result += ` - ${print(arg.args[0], node)}`; - } else { - result += ` + ${print(arg, node)}`; - } - } - return parent ? `(${result})` : result; - case 'neg': - return `-${print(node.args[0], node)}`; - case 'pos': - return `+${print(node.args[0], node)}`; - case 'pn': - throw new Error(`we don't handle 'pn' operations yet`); - case 'np': - throw new Error(`we don't handle 'np' operations yet`); - case 'mul': - if (node.implicit) { - return node.args.map(arg => print(arg, node)).join(` `); +const relationIdentifierMap = { + 'eq': '=', + 'lt': '<', + 'le': '<=', + 'gt': '>', + 'ge': '>=', + 'ne': '!=', +} + +const printApply = (node, parent) => { + const {op, args} = node; + + if (op === 'add') { + let result = print(args[0], node); + for (let i = 1; i < args.length; i++) { + const arg = args[i]; + if (isNeg(arg) && arg.wasMinus) { + result += ` - ${print(arg.args[0], node)}`; } else { - return node.args.map(arg => print(arg, node)).join(` * `); + result += ` + ${print(arg, node)}`; } - case 'div': - result = ''; - if (isAdd(node.args[0]) || isMul(node.args[0])) { - result += `(${print(node.args[0], node)})`; - } else { - result += print(node.args[0], node); + } + return parent ? `(${result})` : result; + } else if (op === 'mul') { + if (node.implicit) { + return args.map(arg => print(arg, node)).join(` `); + } else { + return args.map(arg => print(arg, node)).join(` * `); + } + } else if (op === 'div') { + let result = ''; + if (isMul(args[0])) { + result += `(${print(args[0], node)})`; + } else { + result += print(args[0], node); + } + result += ' / '; + if (isMul(args[1]) || isDiv(args[1])) { + result += `(${print(args[1], node)})`; + } else { + result += print(args[1], node); + } + return result; + } else if (op === 'pow') { + const exponent = node.args[1]; + let bool = false; + // check if exponent has multiple terms and if the exponent + // contains a div/mul operation + // e.g x^((x + 1)/(2 + 2)) + if (exponent.args){ + if (exponent.op == 'div' || exponent.op == 'mul'){ + bool = true; } - result += ' / '; - if (isAdd(node.args[1]) || isMul(node.args[1])) { - result += `(${print(node.args[1], node)})`; - } else { - result += print(node.args[1], node); - } - return result; - case 'pow': - return `${print(node.args[0], node)}^${print(node.args[1], node)}`; - case 'fact': - throw new Error(`we don't handle 'fact' operations yet`); - default: - throw new Error('unrecognized operation'); + } + if (bool) { + return `${print(args[0], node)}^(${print(args[1], node)})`; + } else { + return `${print(args[0], node)}^${print(args[1], node)}`; + } + } else if (op === 'neg') { + return `-${print(args[0], node)}`; + } else if (op === 'pos') { + return `+${print(args[0], node)}`; + } else if (op === 'pn') { + throw new Error(`we don't handle 'pn' operations yet`); + } else if (op === 'np') { + throw new Error(`we don't handle 'np' operations yet`); + } else if (op === 'fact') { + throw new Error(`we don't handle 'fact' operations yet`); + } else if (op in relationIdentifierMap) { + const symbol = relationIdentifierMap[op]; + return args.map(arg => print(arg, node)).join(` ${symbol} `); + } else { + return `${op}(${args.map(arg => print(arg, node)).join(', ')})`; } } export default function print(node, parent = null) { switch (node.type) { // regular non-leaf nodes - case 'Relation': - return node.args.map(arg => print(arg, node)).join(` ${node.rel} `); - case 'Operation': - return printOperation(node, parent); - case 'Function': - return `${node.fn}(${node.args.map(arg => print(arg, node)).join(', ')})`; + case 'Apply': + return printApply(node, parent); + + // irregular non-leaf nodes + case 'Parentheses': + return `(${print(node.body, node)})`; // leaf nodes case 'Identifier': @@ -82,10 +111,6 @@ export default function print(node, parent = null) { case 'Number': return node.value; - // irregular non-leaf nodes - case 'Brackets': - return `(${print(node.content, node)})`; - default: console.log(node); // eslint-disable-line no-console throw new Error('unrecognized node'); diff --git a/test/print_test.js b/test/print_test.js index 2e6b038..d52334c 100644 --- a/test/print_test.js +++ b/test/print_test.js @@ -4,18 +4,54 @@ import parse from '../lib/parse' import print from '../lib/print' describe("print", () => { - it("handles wasMinus correctly", () => { - assert.equal(print(parse('1 + -2')), '1 + -2'); - assert.equal(print(parse('1 - 2')), '1 - 2'); - assert.equal(print(parse('1 - -2')), '1 - -2'); - assert.equal(print(parse('a - b')), 'a - b'); - assert.equal(print(parse('a + -b')), 'a + -b'); - }); - - // TODO(kevinb) enable these tests after updating division parsing behavior - it.skip("handles fractions correctly", () => { - assert.equal(print(parse('1/2/3')), '1 / 2 / 3'); - assert.equal(parse('1*2/3'), '1 * (2 / 3)'); - // assert.equal(print(parser.parse('(1*2)/3')), '(1 * 2) / 3'); - }); -}); + it("wasMinus", () => { + const tests = [ + '1 + -2', + '1 - 2', + '1 - -2', + 'a - b', + 'a + -b', + ] + + tests.forEach(test => assert.equal(print(parse(test)), test)) + }) + + it("relations", () => { + const tests = [ + 'a = b', + 'a > b', + 'a >= b', + 'a < b', + 'a <= b', + 'a != b', + ] + + tests.forEach(test => assert.equal(print(parse(test)), test)) + }) + + it("handles fractions correctly", () => { + const tests = [ + ['(x + 1) / 1', '(x + 1) / 1'], + ['1/2/3', '1 / 2 / 3'], // (1/2) / 3 + ['1*2/3', '1 * 2 / 3'], // 1 * (2/3) + ['(1*2)/3', '(1 * 2) / 3'], + ['a/(b/c)', 'a / (b / c)'], + ] + + tests.forEach(test => assert.equal(print(parse(test[0])), test[1])) + }) + + it("handles exponents correctly", () => { + const tests = [ + ['x^2', 'x^2'], + ['x^((x + 1)/(2 * 2))', 'x^((x + 1) / (2 * 2))'], + ['x^(y + 1)', 'x^(y + 1)'], + ['x^(x / 2)','x^(x / 2)'], + ['x^(x / (x + 2))', 'x^(x / (x + 2))'], + ['x^(x + x + (x + y))', 'x^(x + x + (x + y))'], + ['(y+1)^((x + 1) + 2)', '(y + 1)^((x + 1) + 2)'] + ] + + tests.forEach(test => assert.equal(print(parse(test[0])),test[1])) + }) +}) From b460f6f8b5720defe7cf590ea08d19f893f1c6cc Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 22:42:29 -0400 Subject: [PATCH 09/20] linter and print --- lib/print.js | 5 +---- package.json | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/print.js b/lib/print.js index f00e94b..db8dad1 100644 --- a/lib/print.js +++ b/lib/print.js @@ -64,11 +64,8 @@ const printApply = (node, parent) => { } else if (op === 'pow') { const exponent = node.args[1]; let bool = false; - // check if exponent has multiple terms and if the exponent - // contains a div/mul operation - // e.g x^((x + 1)/(2 + 2)) if (exponent.args){ - if (exponent.op == 'div' || exponent.op == 'mul'){ + if (isMul(exponent) || isDiv(exponent)){ bool = true; } } diff --git a/package.json b/package.json index 6d3829b..26f792c 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,8 @@ "babel-plugin-transform-object-rest-spread": "^6.22.0", "babel-preset-es2015": "^6.22.0", "eslint": "^3.15.0", + "eslint-config-google": "^0.7.0", + "eslint-plugin-sort-requires": "^2.1.0", "eslint-plugin-flowtype": "^2.30.0", "flow-bin": "^0.38.0", "mocha": "^3.2.0", From 142ab422d94f5ffa34691e566bdf3b6824af7543 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 22:55:23 -0400 Subject: [PATCH 10/20] fixed --- .eslintrc | 18 ------------------ lib/print.js | 4 ++-- package.json | 4 ---- script/git-hooks/pre-commit.sh | 4 ++++ 4 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 .eslintrc create mode 100644 script/git-hooks/pre-commit.sh diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 10553e4..0000000 --- a/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": [ - "eslint:recommended", - "plugin:flowtype/recommended" - ], - "plugins": [ - "flowtype" - ], - "rules": { - "no-constant-condition": 0 - }, - "env": { - "browser": true, - "es6": true, - "node": true, - "mocha": true - } -} \ No newline at end of file diff --git a/lib/print.js b/lib/print.js index db8dad1..db52b41 100644 --- a/lib/print.js +++ b/lib/print.js @@ -64,8 +64,8 @@ const printApply = (node, parent) => { } else if (op === 'pow') { const exponent = node.args[1]; let bool = false; - if (exponent.args){ - if (isMul(exponent) || isDiv(exponent)){ + if (exponent.args) { + if (isMul(exponent) || isDiv(exponent)) { bool = true; } } diff --git a/package.json b/package.json index 26f792c..2813372 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,6 @@ "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.22.0", "babel-preset-es2015": "^6.22.0", - "eslint": "^3.15.0", - "eslint-config-google": "^0.7.0", - "eslint-plugin-sort-requires": "^2.1.0", - "eslint-plugin-flowtype": "^2.30.0", "flow-bin": "^0.38.0", "mocha": "^3.2.0", "webpack": "^2.2.1" diff --git a/script/git-hooks/pre-commit.sh b/script/git-hooks/pre-commit.sh new file mode 100644 index 0000000..0c56671 --- /dev/null +++ b/script/git-hooks/pre-commit.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +npm test && +npm run lint From 348a9b1e2e458303128476311928d9381118d607 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 22:56:46 -0400 Subject: [PATCH 11/20] removed script file --- script/git-hooks/pre-commit.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 script/git-hooks/pre-commit.sh diff --git a/script/git-hooks/pre-commit.sh b/script/git-hooks/pre-commit.sh deleted file mode 100644 index 0c56671..0000000 --- a/script/git-hooks/pre-commit.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -npm test && -npm run lint From 0714ca16b50ac9e3135d9e6764d676a6114a41f9 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 23:29:24 -0400 Subject: [PATCH 12/20] added eslintrc --- .eslintrc | 18 ++++++++++++++++++ test/print_test.js | 5 ++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..11bce1d --- /dev/null +++ b/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": [ + "eslint:recommended", + "plugin:flowtype/recommended" + ], + "plugins": [ + "flowtype" + ], + "rules": { + "no-constant-condition": 0 + }, + "env": { + "browser": true, + "es6": true, + "node": true, + "mocha": true + } +} diff --git a/test/print_test.js b/test/print_test.js index d52334c..5a4c90b 100644 --- a/test/print_test.js +++ b/test/print_test.js @@ -44,14 +44,13 @@ describe("print", () => { it("handles exponents correctly", () => { const tests = [ ['x^2', 'x^2'], - ['x^((x + 1)/(2 * 2))', 'x^((x + 1) / (2 * 2))'], - ['x^(y + 1)', 'x^(y + 1)'], ['x^(x / 2)','x^(x / 2)'], + ['x^(y + 1)', 'x^(y + 1)'], ['x^(x / (x + 2))', 'x^(x / (x + 2))'], + ['x^((x + 1)/(2 * 2))', 'x^((x + 1) / (2 * 2))'], ['x^(x + x + (x + y))', 'x^(x + x + (x + y))'], ['(y+1)^((x + 1) + 2)', '(y + 1)^((x + 1) + 2)'] ] - tests.forEach(test => assert.equal(print(parse(test[0])),test[1])) }) }) From 419714ce2471dfb4f4ee70dad4e4a4cac77aef50 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 23:52:00 -0400 Subject: [PATCH 13/20] reverted package.json --- package.json | 2 ++ test/parser_test.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2813372..6d3829b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.22.0", "babel-preset-es2015": "^6.22.0", + "eslint": "^3.15.0", + "eslint-plugin-flowtype": "^2.30.0", "flow-bin": "^0.38.0", "mocha": "^3.2.0", "webpack": "^2.2.1" diff --git a/test/parser_test.js b/test/parser_test.js index 6926512..9a1f442 100644 --- a/test/parser_test.js +++ b/test/parser_test.js @@ -115,14 +115,14 @@ describe("Parser.parse", () => { // TODO: re-enable after changing parser to not produce a System (or eqns) // node. We should only be produce such a node for the following: // x + 2 = y, 3x - 5 = 2y, 2y - x = 10 - // suite("relations (n-ary)", [ - // 'a = b = c', + suite("relations (n-ary)", [ + 'a = b = c', // 'a > b > c', // 'a >= b >= c', // 'a < b < c', // 'a <= b <= c', // 'a != b != c', - // ]) + ]) }); // TODO: add tests verify different ways of writing the same thing, e.g. From f8fb1610175b46093f88d93a63e518dc57f62404 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 5 May 2017 23:55:02 -0400 Subject: [PATCH 14/20] oops --- test/parser_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parser_test.js b/test/parser_test.js index 9a1f442..6926512 100644 --- a/test/parser_test.js +++ b/test/parser_test.js @@ -115,14 +115,14 @@ describe("Parser.parse", () => { // TODO: re-enable after changing parser to not produce a System (or eqns) // node. We should only be produce such a node for the following: // x + 2 = y, 3x - 5 = 2y, 2y - x = 10 - suite("relations (n-ary)", [ - 'a = b = c', + // suite("relations (n-ary)", [ + // 'a = b = c', // 'a > b > c', // 'a >= b >= c', // 'a < b < c', // 'a <= b <= c', // 'a != b != c', - ]) + // ]) }); // TODO: add tests verify different ways of writing the same thing, e.g. From 7abb2a3df13c98a706e4996d22818437c08d6223 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 9 Jun 2017 17:33:47 -0400 Subject: [PATCH 15/20] merging --- test/print_test.js | 56 ---------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 test/print_test.js diff --git a/test/print_test.js b/test/print_test.js deleted file mode 100644 index 5a4c90b..0000000 --- a/test/print_test.js +++ /dev/null @@ -1,56 +0,0 @@ -import assert from 'assert' - -import parse from '../lib/parse' -import print from '../lib/print' - -describe("print", () => { - it("wasMinus", () => { - const tests = [ - '1 + -2', - '1 - 2', - '1 - -2', - 'a - b', - 'a + -b', - ] - - tests.forEach(test => assert.equal(print(parse(test)), test)) - }) - - it("relations", () => { - const tests = [ - 'a = b', - 'a > b', - 'a >= b', - 'a < b', - 'a <= b', - 'a != b', - ] - - tests.forEach(test => assert.equal(print(parse(test)), test)) - }) - - it("handles fractions correctly", () => { - const tests = [ - ['(x + 1) / 1', '(x + 1) / 1'], - ['1/2/3', '1 / 2 / 3'], // (1/2) / 3 - ['1*2/3', '1 * 2 / 3'], // 1 * (2/3) - ['(1*2)/3', '(1 * 2) / 3'], - ['a/(b/c)', 'a / (b / c)'], - ] - - tests.forEach(test => assert.equal(print(parse(test[0])), test[1])) - }) - - it("handles exponents correctly", () => { - const tests = [ - ['x^2', 'x^2'], - ['x^(x / 2)','x^(x / 2)'], - ['x^(y + 1)', 'x^(y + 1)'], - ['x^(x / (x + 2))', 'x^(x / (x + 2))'], - ['x^((x + 1)/(2 * 2))', 'x^((x + 1) / (2 * 2))'], - ['x^(x + x + (x + y))', 'x^(x + x + (x + y))'], - ['(y+1)^((x + 1) + 2)', '(y + 1)^((x + 1) + 2)'] - ] - tests.forEach(test => assert.equal(print(parse(test[0])),test[1])) - }) -}) From 2ac95731d3f96bbbc8db892444a477cc66f0dffd Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 16 Jun 2017 23:01:59 -0400 Subject: [PATCH 16/20] working on derivatives --- .../__snapshots__/parser.test.js.snap | 2489 ----------------- lib/__test__/parser.test.js | 12 +- lib/__test__/{print.test.js => print} | 15 + lib/__test__/{toTex.test.js => toTex} | 0 lib/parse.js | 38 +- lib/print.js | 4 +- lib/yarn.lock | 4 + package.json | 12 +- yarn.lock | 1652 ++++++----- 9 files changed, 885 insertions(+), 3341 deletions(-) delete mode 100644 lib/__test__/__snapshots__/parser.test.js.snap rename lib/__test__/{print.test.js => print} (93%) rename lib/__test__/{toTex.test.js => toTex} (100%) create mode 100644 lib/yarn.lock diff --git a/lib/__test__/__snapshots__/parser.test.js.snap b/lib/__test__/__snapshots__/parser.test.js.snap deleted file mode 100644 index 686c87e..0000000 --- a/lib/__test__/__snapshots__/parser.test.js.snap +++ /dev/null @@ -1,2489 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Parser.parse abs ||a - b| - |b - c|| 1`] = ` -{ - "type": "Apply", - "op": "abs", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Apply", - "op": "abs", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - } - ] - } - ] - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "abs", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "c" - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse abs |a - b| 1`] = ` -{ - "type": "Apply", - "op": "abs", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse addition/subtraction 1 - -2 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse addition/subtraction 1 - 2 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse addition/subtraction a + -b - c 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse addition/subtraction a + b + c 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse addition/subtraction a - b - -c 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "c" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse addition/subtraction a - b - c 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse division (a*b)/(c*d) 1`] = ` -{ - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - } - ] -} -`; - -exports[`Parser.parse division 2(x+1)/4 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "1", - "type": "Number" - } - ] - }, - { - "value": "4", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse division 2x/4 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "4", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse division a b c/d 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - } - ] -} -`; - -exports[`Parser.parse division a*b*c/d 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - } - ] -} -`; - -exports[`Parser.parse division a/b*c/d 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - } - ] -} -`; - -exports[`Parser.parse division a/b/c 1`] = ` -{ - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse division a^2/b^2 1`] = ` -{ - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "value": "2", - "type": "Number" - } - ] - }, - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "value": "2", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse ellipsis #a_0#x + ... + #a_n#x 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Placeholder", - "subscript": { - "value": "0", - "type": "Number" - }, - "name": "a" - }, - { - "type": "Placeholder", - "name": "x" - } - ] - }, - { - "type": "Ellipsis" - }, - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Placeholder", - "subscript": { - "type": "Identifier", - "name": "n" - }, - "name": "a" - }, - { - "type": "Placeholder", - "name": "x" - } - ] - } - ] -} -`; - -exports[`Parser.parse ellipsis 1 * ... * n 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "type": "Ellipsis" - }, - { - "type": "Identifier", - "name": "n" - } - ] -} -`; - -exports[`Parser.parse ellipsis 1, 2, ..., n 1`] = ` -{ - "type": "Sequence", - "items": [ - { - "value": "1", - "type": "Number" - }, - { - "value": "2", - "type": "Number" - }, - { - "type": "Ellipsis" - }, - { - "type": "Identifier", - "name": "n" - } - ] -} -`; - -exports[`Parser.parse ellipsis a + ... + z 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Ellipsis" - }, - { - "type": "Identifier", - "name": "z" - } - ] -} -`; - -exports[`Parser.parse factorial (2 * n)! 1`] = ` -{ - "type": "Apply", - "op": "fact", - "args": [ - { - "type": "Apply", - "op": "mul", - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Identifier", - "name": "n" - } - ] - } - ] -} -`; - -exports[`Parser.parse factorial (5^2)! 1`] = ` -{ - "type": "Apply", - "op": "fact", - "args": [ - { - "type": "Apply", - "op": "pow", - "args": [ - { - "value": "5", - "type": "Number" - }, - { - "value": "2", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse factorial 2 * n! 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Apply", - "op": "fact", - "args": [ - { - "type": "Identifier", - "name": "n" - } - ] - } - ] -} -`; - -exports[`Parser.parse factorial 5! 1`] = ` -{ - "type": "Apply", - "op": "fact", - "args": [ - { - "value": "5", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse factorial 5!^2 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Apply", - "op": "fact", - "args": [ - { - "value": "5", - "type": "Number" - } - ] - }, - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse factorial x! 1`] = ` -{ - "type": "Apply", - "op": "fact", - "args": [ - { - "type": "Identifier", - "name": "x" - } - ] -} -`; - -exports[`Parser.parse factorial x^2! 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "type": "Apply", - "op": "fact", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse functions f(a+b) 1`] = ` -{ - "type": "Apply", - "op": { - "type": "Identifier", - "name": "f" - }, - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - } - ] -} -`; - -exports[`Parser.parse functions f(a,b) 1`] = ` -{ - "type": "Apply", - "op": { - "type": "Identifier", - "name": "f" - }, - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse functions f(f(a)) 1`] = ` -{ - "type": "Apply", - "op": { - "type": "Identifier", - "name": "f" - }, - "args": [ - { - "type": "Apply", - "op": { - "type": "Identifier", - "name": "f" - }, - "args": [ - { - "type": "Identifier", - "name": "a" - } - ] - } - ] -} -`; - -exports[`Parser.parse multiplication (a)(b)(c) 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "a" - } - }, - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "b" - } - }, - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "c" - } - } - ] -} -`; - -exports[`Parser.parse multiplication (a)b(c) 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "a" - } - }, - { - "type": "Apply", - "op": { - "type": "Identifier", - "name": "b" - }, - "args": [ - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse multiplication a b * b * b c 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse multiplication a b c 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse multiplication a*b c 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse multiplication a*b*c 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(-27, 3) 1`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "27", - "type": "Number" - } - ] - }, - { - "value": "3", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(8, 3) 1`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "value": "8", - "type": "Number" - }, - { - "value": "3", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(x) 1`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(x) 2`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(x, 2) 1`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse nthRoot nthRoot(x, 3) 1`] = ` -{ - "type": "Apply", - "op": "nthRoot", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "3", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse parentheses ((1 + 2)) 1`] = ` -{ - "type": "Parentheses", - "body": { - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "add", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "value": "2", - "type": "Number" - } - ] - } - } -} -`; - -exports[`Parser.parse parentheses ((a * b)) 1`] = ` -{ - "type": "Parentheses", - "body": { - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - } - } -} -`; - -exports[`Parser.parse parentheses (1 + 2) 1`] = ` -{ - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "add", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "value": "2", - "type": "Number" - } - ] - } -} -`; - -exports[`Parser.parse parentheses (a * b) 1`] = ` -{ - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - } -} -`; - -exports[`Parser.parse parentheses (a)(b) 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "a" - } - }, - { - "type": "Parentheses", - "body": { - "type": "Identifier", - "name": "b" - } - } - ] -} -`; - -exports[`Parser.parse parentheses (x + y) - (a + b) 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "type": "Identifier", - "name": "y" - } - ] - } - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse parentheses 5 + ((3 * 6)) 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "value": "5", - "type": "Number" - }, - { - "type": "Parentheses", - "body": { - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "mul", - "args": [ - { - "value": "3", - "type": "Number" - }, - { - "value": "6", - "type": "Number" - } - ] - } - } - } - ] -} -`; - -exports[`Parser.parse parentheses 5 + (3 * 6) 1`] = ` -{ - "type": "Apply", - "op": "add", - "args": [ - { - "value": "5", - "type": "Number" - }, - { - "type": "Parentheses", - "body": { - "type": "Apply", - "op": "mul", - "args": [ - { - "value": "3", - "type": "Number" - }, - { - "value": "6", - "type": "Number" - } - ] - } - } - ] -} -`; - -exports[`Parser.parse parentheses a * (b + c) 1`] = ` -{ - "type": "Apply", - "op": "mul", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse placeholders #a #b / #c 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Placeholder", - "name": "a" - }, - { - "type": "Apply", - "op": "div", - "args": [ - { - "type": "Placeholder", - "name": "b" - }, - { - "type": "Placeholder", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse placeholders #a #f(#x) 1`] = ` -{ - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "type": "Placeholder", - "name": "a" - }, - { - "type": "Apply", - "op": { - "type": "Placeholder", - "name": "f" - }, - "args": [ - { - "type": "Placeholder", - "name": "x" - } - ] - } - ] -} -`; - -exports[`Parser.parse placeholders #a 1`] = ` -{ - "type": "Placeholder", - "name": "a" -} -`; - -exports[`Parser.parse placeholders #eval(#a + #b) 1`] = ` -{ - "type": "Apply", - "op": { - "type": "Placeholder", - "name": "eval" - }, - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Placeholder", - "name": "a" - }, - { - "type": "Placeholder", - "name": "b" - } - ] - } - ] -} -`; - -exports[`Parser.parse placeholders #f(#x) 1`] = ` -{ - "type": "Apply", - "op": { - "type": "Placeholder", - "name": "f" - }, - "args": [ - { - "type": "Placeholder", - "name": "x" - } - ] -} -`; - -exports[`Parser.parse powers (-2)^x 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - }, - { - "type": "Identifier", - "name": "x" - } - ] -} -`; - -exports[`Parser.parse powers -1^-2 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "pow", - "args": [ - { - "value": "1", - "type": "Number" - }, - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse powers -a^-b 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "b" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse powers a^-1.23 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "1.23", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse powers a^b^c 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] - } - ] -} -`; - -exports[`Parser.parse relations (binary) a != b 1`] = ` -{ - "type": "Apply", - "op": "ne", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (binary) a < b 1`] = ` -{ - "type": "Apply", - "op": "lt", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (binary) a <= b 1`] = ` -{ - "type": "Apply", - "op": "le", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (binary) a = b 1`] = ` -{ - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (binary) a > b 1`] = ` -{ - "type": "Apply", - "op": "gt", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (binary) a >= b 1`] = ` -{ - "type": "Apply", - "op": "ge", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a != b != c 1`] = ` -{ - "type": "Apply", - "op": "ne", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a + b != c + d != e + f 1`] = ` -{ - "type": "Apply", - "op": "ne", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "e" - }, - { - "type": "Identifier", - "name": "f" - } - ] - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a + b = c + d = e + f 1`] = ` -{ - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "e" - }, - { - "type": "Identifier", - "name": "f" - } - ] - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a + b > c + d > e + f 1`] = ` -{ - "type": "Apply", - "op": "gt", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "e" - }, - { - "type": "Identifier", - "name": "f" - } - ] - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a = b = c 1`] = ` -{ - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse relations (n-ary) a > b > c 1`] = ` -{ - "type": "Apply", - "op": "gt", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] -} -`; - -exports[`Parser.parse sequences 1, 1, 2, 3, 5 1`] = ` -{ - "type": "Sequence", - "items": [ - { - "value": "1", - "type": "Number" - }, - { - "value": "1", - "type": "Number" - }, - { - "value": "2", - "type": "Number" - }, - { - "value": "3", - "type": "Number" - }, - { - "value": "5", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse sequences a, a^3, a^5 1`] = ` -{ - "type": "Sequence", - "items": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "value": "3", - "type": "Number" - } - ] - }, - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "value": "5", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse sequences r_1, r_2, r_3 1`] = ` -{ - "type": "Sequence", - "items": [ - { - "type": "Identifier", - "subscript": { - "value": "1", - "type": "Number" - }, - "name": "r" - }, - { - "type": "Identifier", - "subscript": { - "value": "2", - "type": "Number" - }, - "name": "r" - }, - { - "type": "Identifier", - "subscript": { - "value": "3", - "type": "Number" - }, - "name": "r" - } - ] -} -`; - -exports[`Parser.parse sequences x, x + 1, x + 3 1`] = ` -{ - "type": "Sequence", - "items": [ - { - "type": "Identifier", - "name": "x" - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "1", - "type": "Number" - } - ] - }, - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "3", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse subscripts #a_0 1`] = ` -{ - "type": "Placeholder", - "subscript": { - "value": "0", - "type": "Number" - }, - "name": "a" -} -`; - -exports[`Parser.parse subscripts a_0 1`] = ` -{ - "type": "Identifier", - "subscript": { - "value": "0", - "type": "Number" - }, - "name": "a" -} -`; - -exports[`Parser.parse subscripts a_0^2 1`] = ` -{ - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "subscript": { - "value": "0", - "type": "Number" - }, - "name": "a" - }, - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse subscripts a_123 1`] = ` -{ - "type": "Identifier", - "subscript": { - "value": "123", - "type": "Number" - }, - "name": "a" -} -`; - -exports[`Parser.parse subscripts a_n 1`] = ` -{ - "type": "Identifier", - "subscript": { - "type": "Identifier", - "name": "n" - }, - "name": "a" -} -`; - -exports[`Parser.parse subscripts a_xyz 1`] = ` -{ - "type": "Identifier", - "subscript": { - "type": "Identifier", - "name": "xyz" - }, - "name": "a" -} -`; - -exports[`Parser.parse systems of equations a = b, b = c, c = d 1`] = ` -{ - "type": "System", - "relations": [ - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Identifier", - "name": "a" - }, - { - "type": "Identifier", - "name": "b" - } - ] - }, - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Identifier", - "name": "b" - }, - { - "type": "Identifier", - "name": "c" - } - ] - }, - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Identifier", - "name": "c" - }, - { - "type": "Identifier", - "name": "d" - } - ] - } - ] -} -`; - -exports[`Parser.parse systems of equations x + 1 = 2, x^2 + 2x + 1 = 0 1`] = ` -{ - "type": "System", - "relations": [ - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "1", - "type": "Number" - } - ] - }, - { - "value": "2", - "type": "Number" - } - ] - }, - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Apply", - "op": "pow", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "2", - "type": "Number" - } - ] - }, - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Identifier", - "name": "x" - } - ] - }, - { - "value": "1", - "type": "Number" - } - ] - }, - { - "value": "0", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse systems of equations x + 2 = y, 3x - 5 = 2y 1`] = ` -{ - "type": "System", - "relations": [ - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Identifier", - "name": "x" - }, - { - "value": "2", - "type": "Number" - } - ] - }, - { - "type": "Identifier", - "name": "y" - } - ] - }, - { - "type": "Apply", - "op": "eq", - "args": [ - { - "type": "Apply", - "op": "add", - "args": [ - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "value": "3", - "type": "Number" - }, - { - "type": "Identifier", - "name": "x" - } - ] - }, - { - "wasMinus": true, - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "5", - "type": "Number" - } - ] - } - ] - }, - { - "type": "Apply", - "op": "mul", - "implicit": true, - "args": [ - { - "value": "2", - "type": "Number" - }, - { - "type": "Identifier", - "name": "y" - } - ] - } - ] - } - ] -} -`; - -exports[`Parser.parse unary operators +2 1`] = ` -{ - "type": "Apply", - "op": "pos", - "args": [ - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse unary operators +a 1`] = ` -{ - "type": "Apply", - "op": "pos", - "args": [ - { - "type": "Identifier", - "name": "a" - } - ] -} -`; - -exports[`Parser.parse unary operators --2 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] - } - ] -} -`; - -exports[`Parser.parse unary operators --a 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "a" - } - ] - } - ] -} -`; - -exports[`Parser.parse unary operators -2 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "value": "2", - "type": "Number" - } - ] -} -`; - -exports[`Parser.parse unary operators -a 1`] = ` -{ - "type": "Apply", - "op": "neg", - "args": [ - { - "type": "Identifier", - "name": "a" - } - ] -} -`; diff --git a/lib/__test__/parser.test.js b/lib/__test__/parser.test.js index f364e58..9396c12 100644 --- a/lib/__test__/parser.test.js +++ b/lib/__test__/parser.test.js @@ -39,6 +39,7 @@ suite.only = (name, cases) => { } describe("Parser.parse", () => { + /* it('should fail with invalid tokens', () => { assert.throws(() => parse('a ; b')); assert.throws(() => parse('; a b')); @@ -194,11 +195,12 @@ describe("Parser.parse", () => { '2 * n!', '(2 * n)!', ]) - - suite('nthRoot', [ - 'nthRoot(x)', - 'nthRoot(x, 3)', - 'nthRoot(8, 3)', + */ + suite('derivatives', [ + `f'`, + //`f''`, + //'dy/dx', + //'d/dx x^2', ]) }) diff --git a/lib/__test__/print.test.js b/lib/__test__/print similarity index 93% rename from lib/__test__/print.test.js rename to lib/__test__/print index a4e7c9a..b9ae7e4 100644 --- a/lib/__test__/print.test.js +++ b/lib/__test__/print @@ -158,6 +158,7 @@ describe("print", () => { ['nthRoot(x)', 'nthRoot(x, 2)'], ['nthRoot(x, 3)', 'nthRoot(x, 3)'], ['nthRoot(8, 3)', 'nthRoot(8, 3)'], + ['nthRoot(x^2, 4)', 'nthRoot(x^2, 4)'], ] tests.forEach(t => @@ -180,4 +181,18 @@ describe("print", () => { it(t, () => assert.equal(print(parse(t)), t)) ) }) + + describe('abs', () => { + const tests = [ + '|-1|', + '|x|', + '|x + 1|', + '|x| - |y|', + '||x| - |y||', + ] + + tests.forEach(t => + it(t, () => assert.equal(print(parse(t)), t)) + ) + }) }) diff --git a/lib/__test__/toTex.test.js b/lib/__test__/toTex similarity index 100% rename from lib/__test__/toTex.test.js rename to lib/__test__/toTex diff --git a/lib/parse.js b/lib/parse.js index 5817593..23d9480 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -24,7 +24,15 @@ function isNumberToken(token) { } const tokenPattern = - /\.\.\.|[a-zA-Z][a-zA-Z0-9]*|<=|>=|!=|[\<\>\!\=\(\)\+\-\/\*\^\<\>|\,\#\_]|\d*\.\d+|\d+\.\d*|\d+/; + /\.\.\.|[a-zA-Z][a-zA-Z0-9]*|<=|>=|!=|[\'\<\>\!\=\(\)\+\-\/\*\^\<\>|\,\#\_]|\d*\.\d+|\d+\.\d*|\d+/; + +// matches either dx or d to a power +const derivativeNumeratorPattern = + /d[a-zA-Z]{1}|d[\^]\d+/; + +// match groups of dx's +const derivativeDenominatorPattern = + /(d[a-zA-Z])+/; const relationTokenMap = { '=': 'eq', @@ -282,6 +290,10 @@ class Parser { numerator = this.factor(); + const regex = new RegExp(tokenPattern, 'g'); + + //if() + while (true) { const token = this.currentToken(); @@ -334,11 +346,31 @@ class Parser { if (matches(token, '#') || isIdentifierToken(token)) { const node = this.identifierOrPlaceholder() - - if (matches(this.currentToken(), '(')) { + + if (node.name === 'f') { + let order = 0 + while(matches(this.currentToken(), `'`)) { + token = this.consume(`'`); + order++; + } + if (matches(this.currentToken(), '(')) { + this.consume('(') + const args = this.argumentList(); + token = this.consume(')') + if (args.length > 1) { + throw new Error (`f' takes only 1 arg`) + } else { + base = build.apply({type: 'Apply', op: 'diff', args: ['f', order]}, args) + } + } else { + base = build.apply('diff', ['f'].concat(Array(order).fill('_'))) + addParens = false + } + } else if (matches(this.currentToken(), '(')) { this.consume('('); const args = this.argumentList(); token = this.consume(')'); + // nthRoot if (node.name === 'nthRoot') { if (args.length < 1 || args.length > 2) { throw new Error('nthRoot takes 1 or 2 args') diff --git a/lib/print.js b/lib/print.js index 3857816..e37e6aa 100644 --- a/lib/print.js +++ b/lib/print.js @@ -74,8 +74,10 @@ const printApply = (node, parent) => { } else { return `${print(args[0], node)}!`; } - } else if (op === `nthRoot`) { + } else if (op === 'nthRoot') { return `nthRoot(${args.map(arg => print(arg, node)).join(', ')})`; + } else if (op === 'abs') { + return `|${print(args[0])}|` } else if (op in relationIdentifierMap) { const symbol = relationIdentifierMap[op]; return args.map(arg => print(arg, node)).join(` ${symbol} `); diff --git a/lib/yarn.lock b/lib/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/lib/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/package.json b/package.json index 5ba0b65..fe0fce4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "math-parser", - "version": "0.10.3", + "version": "0.10.4", "description": "Parse math strings to an AST suitable for symbolic manipulation.", "main": "dist/math-parser.js", "scripts": { @@ -8,6 +8,7 @@ "test": "jest" }, "jest": { + "setupTestFrameworkScriptFile": "/node_modules/babel-polyfill/dist/polyfill.js", "transform": { "^.+\\.jsx?$": "babel-jest" } @@ -25,19 +26,20 @@ "devDependencies": { "babel-core": "^6.22.1", "babel-eslint": "^7.1.1", - "babel-loader": "^6.2.10", + "babel-loader": "^7.0.0", "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.22.0", + "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.22.0", - "eslint": "^3.15.0", + "eslint": "^4.0.0", "eslint-plugin-flowtype": "^2.30.0", - "flow-bin": "^0.38.0", + "flow-bin": "^0.48.0", "jest": "^20.0.3", "json-stable-stringify": "^1.0.1", "webpack": "^2.2.1" }, "dependencies": { - "math-nodes": "^0.1.2", + "math-nodes": "^0.1.6", "math-traverse": "^0.2.1" } } diff --git a/yarn.lock b/yarn.lock index e729de8..f92e814 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,12 +7,12 @@ abab@^1.0.3: resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" abbrev@1: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" acorn-dynamic-import@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.1.tgz#23f671eb6e650dab277fef477c321b1178a8cca2" + version "2.0.2" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" dependencies: acorn "^4.0.3" @@ -28,25 +28,25 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" acorn@^4.0.3, acorn@^4.0.4: - version "4.0.8" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.8.tgz#f41e52020ce78118a3c68ed0e9215eb8fc68b5b1" + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +acorn@^5.0.0, acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0: - version "4.11.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6" +ajv@^4.7.0, ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -63,10 +63,14 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: +ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -76,8 +80,8 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" ansi-styles@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750" dependencies: color-convert "^1.0.0" @@ -95,15 +99,15 @@ append-transform@^0.4.0: default-require-extensions "^1.0.0" aproba@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" + version "1.1.2" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" are-we-there-yet@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" dependencies: delegates "^1.0.0" - readable-stream "^2.0.0 || ^1.1.13" + readable-stream "^2.0.6" argparse@^1.0.7: version "1.0.9" @@ -118,8 +122,8 @@ arr-diff@^2.0.0: arr-flatten "^1.0.1" arr-flatten@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" array-equal@^1.0.0: version "1.0.0" @@ -155,14 +159,14 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" @@ -178,15 +182,11 @@ async@^1.4.0: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.2, async@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.1.4.tgz#2d2160c7788032e4dd6cbe2502f1f9a2c8f6cde4" + version "2.4.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" dependencies: lodash "^4.14.0" -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -196,10 +196,10 @@ aws-sign2@~0.6.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" aws4@^1.2.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -207,20 +207,20 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.0, babel-core@^6.22.0, babel-core@^6.22.1: - version "6.22.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.22.1.tgz#9c5fd658ba1772d28d721f6d25d968fc7ae21648" +babel-core@^6.0.0, babel-core@^6.22.1, babel-core@^6.24.1: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.25.0.tgz#7dd42b0463c742e9d5296deb3ec67a9322dad729" dependencies: babel-code-frame "^6.22.0" - babel-generator "^6.22.0" - babel-helpers "^6.22.0" - babel-messages "^6.22.0" - babel-register "^6.22.0" + babel-generator "^6.25.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.1" - babel-types "^6.22.0" - babylon "^6.11.0" + babel-template "^6.25.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" convert-source-map "^1.1.0" debug "^2.1.1" json5 "^0.5.0" @@ -232,101 +232,101 @@ babel-core@^6.0.0, babel-core@^6.22.0, babel-core@^6.22.1: source-map "^0.5.0" babel-eslint@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" + version "7.2.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" dependencies: - babel-code-frame "^6.16.0" - babel-traverse "^6.15.0" - babel-types "^6.15.0" - babylon "^6.13.0" - lodash.pickby "^4.6.0" + babel-code-frame "^6.22.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.17.0" -babel-generator@^6.18.0, babel-generator@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.22.0.tgz#d642bf4961911a8adc7c692b0c9297f325cda805" +babel-generator@^6.18.0, babel-generator@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" dependencies: - babel-messages "^6.22.0" + babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.25.0" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" source-map "^0.5.0" + trim-right "^1.0.1" -babel-helper-call-delegate@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" dependencies: - babel-helper-hoist-variables "^6.22.0" + babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helper-define-map@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.22.0.tgz#9544e9502b2d6dfe7d00ff60e82bd5a7a89e95b7" +babel-helper-define-map@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz#7a9747f258d8947d32d515f6aa1c7bd02204a080" dependencies: - babel-helper-function-name "^6.22.0" + babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" lodash "^4.2.0" -babel-helper-function-name@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.22.0.tgz#51f1bdc4bb89b15f57a9b249f33d742816dcbefc" +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" dependencies: - babel-helper-get-function-arity "^6.22.0" + babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helper-get-function-arity@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-helper-hoist-variables@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-helper-optimise-call-expression@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.22.0.tgz#f8d5d4b40a6e2605a6a7f9d537b581bea3756d15" +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-helper-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" +babel-helper-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz#d36e22fab1008d79d88648e32116868128456ce8" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" lodash "^4.2.0" -babel-helper-replace-supers@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.22.0.tgz#1fcee2270657548908c34db16bcc345f9850cf42" +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" dependencies: - babel-helper-optimise-call-expression "^6.22.0" - babel-messages "^6.22.0" + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helpers@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.22.0.tgz#d275f55f2252b8101bff07bc0c556deda657392c" +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" dependencies: babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" babel-jest@^20.0.3: version "20.0.3" @@ -336,18 +336,17 @@ babel-jest@^20.0.3: babel-plugin-istanbul "^4.0.0" babel-preset-jest "^20.0.3" -babel-loader@^6.2.10: - version "6.2.10" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-6.2.10.tgz#adefc2b242320cd5d15e65b31cea0e8b1b02d4b0" +babel-loader@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.0.0.tgz#2e43a66bee1fff4470533d0402c8a4532fafbaf7" dependencies: find-cache-dir "^0.1.1" - loader-utils "^0.2.11" + loader-utils "^1.0.2" mkdirp "^0.5.1" - object-assign "^4.0.1" -babel-messages@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.22.0.tgz#36066a214f1217e4ed4164867669ecb39e3ea575" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: babel-runtime "^6.22.0" @@ -358,12 +357,12 @@ babel-plugin-check-es2015-constants@^6.22.0: babel-runtime "^6.22.0" babel-plugin-istanbul@^4.0.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + version "4.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.4.tgz#18dde84bf3ce329fddf3f4103fae921456d8e587" dependencies: find-up "^2.1.0" - istanbul-lib-instrument "^1.7.1" - test-exclude "^4.1.0" + istanbul-lib-instrument "^1.7.2" + test-exclude "^4.1.1" babel-plugin-jest-hoist@^20.0.3: version "20.0.3" @@ -389,63 +388,63 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.22.0.tgz#00d6e3a0bebdcfe7536b9d653b44a9141e63e47e" +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576" dependencies: babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" lodash "^4.2.0" -babel-plugin-transform-es2015-classes@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.22.0.tgz#54d44998fd823d9dca15292324161c331c1b6f14" +babel-plugin-transform-es2015-classes@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" dependencies: - babel-helper-define-map "^6.22.0" - babel-helper-function-name "^6.22.0" - babel-helper-optimise-call-expression "^6.22.0" - babel-helper-replace-supers "^6.22.0" - babel-messages "^6.22.0" + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" dependencies: babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" babel-plugin-transform-es2015-destructuring@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.22.0.tgz#8e0af2f885a0b2cf999d47c4c1dd23ce88cfa4c6" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-for-of@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.22.0.tgz#180467ad63aeea592a1caeee4bf1c8b3e2616265" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" dependencies: - babel-helper-function-name "^6.22.0" + babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" @@ -453,63 +452,63 @@ babel-plugin-transform-es2015-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz#bf69cd34889a41c33d90dfb740e0091ccff52f21" +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-commonjs@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.22.0.tgz#6ca04e22b8e214fb50169730657e7a07dc941145" +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" dependencies: - babel-plugin-transform-strict-mode "^6.22.0" + babel-plugin-transform-strict-mode "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" -babel-plugin-transform-es2015-modules-systemjs@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.22.0.tgz#810cd0cd025a08383b84236b92c6e31f88e644ad" +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" dependencies: - babel-helper-hoist-variables "^6.22.0" + babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.22.0.tgz#60d0ba3bd23258719c64391d9bf492d648dc0fae" +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" dependencies: - babel-helper-replace-supers "^6.22.0" + babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.22.0.tgz#57076069232019094f27da8c68bb7162fe208dbb" +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" dependencies: - babel-helper-call-delegate "^6.22.0" - babel-helper-get-function-arity "^6.22.0" + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" @@ -517,13 +516,13 @@ babel-plugin-transform-es2015-spread@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" dependencies: - babel-helper-regex "^6.22.0" + babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" @@ -532,16 +531,16 @@ babel-plugin-transform-es2015-template-literals@^6.22.0: babel-runtime "^6.22.0" babel-plugin-transform-es2015-typeof-symbol@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.22.0.tgz#87faf2336d3b6a97f68c4d906b0cd0edeae676e1" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" dependencies: - babel-helper-regex "^6.22.0" + babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" regexpu-core "^2.0.0" @@ -553,53 +552,61 @@ babel-plugin-transform-flow-strip-types@^6.22.0: babel-runtime "^6.22.0" babel-plugin-transform-object-rest-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.22.0.tgz#1d419b55e68d2e4f64a5ff3373bd67d73c8e83bc" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" +babel-plugin-transform-regenerator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418" dependencies: - regenerator-transform "0.9.8" + regenerator-transform "0.9.11" -babel-plugin-transform-strict-mode@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c" +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" babel-preset-es2015@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835" + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.22.0" - babel-plugin-transform-es2015-classes "^6.22.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" - babel-plugin-transform-es2015-modules-systemjs "^6.22.0" - babel-plugin-transform-es2015-modules-umd "^6.22.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.22.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" babel-plugin-transform-es2015-template-literals "^6.22.0" babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" babel-preset-jest@^20.0.3: version "20.0.3" @@ -607,11 +614,11 @@ babel-preset-jest@^20.0.3: dependencies: babel-plugin-jest-hoist "^20.0.3" -babel-register@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.22.0.tgz#a61dd83975f9ca4a9e7d6eff3059494cd5ea4c63" +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" dependencies: - babel-core "^6.22.0" + babel-core "^6.24.1" babel-runtime "^6.22.0" core-js "^2.4.0" home-or-tmp "^2.0.0" @@ -620,52 +627,52 @@ babel-register@^6.22.0: source-map-support "^0.4.2" babel-runtime@^6.18.0, babel-runtime@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.22.0.tgz#1cf8b4ac67c77a4ddb0db2ae1f74de52ac4ca611" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.16.0, babel-template@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.22.0.tgz#403d110905a4626b317a2a1fcb8f3b73204b2edb" +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" dependencies: babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" - babylon "^6.11.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" lodash "^4.2.0" -babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.22.1: - version "6.22.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.22.1.tgz#3b95cd6b7427d6f1f757704908f2fc9748a5f59f" +babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" dependencies: babel-code-frame "^6.22.0" - babel-messages "^6.22.0" + babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.22.0" - babylon "^6.15.0" + babel-types "^6.25.0" + babylon "^6.17.2" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.22.0.tgz#2a447e8d0ea25d2512409e4175479fd78cc8b1db" +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" dependencies: babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" +babylon@^6.13.0, babylon@^6.17.0, babylon@^6.17.2: + version "6.17.3" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.3.tgz#1327d709950b558f204e5352587fd0290f8d8e48" -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" base64-js@^1.0.2: version "1.2.0" @@ -701,11 +708,11 @@ boom@2.x.x: dependencies: hoek "2.x.x" -brace-expansion@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: - balanced-match "^0.4.1" + balanced-match "^1.0.0" concat-map "0.0.1" braces@^1.8.2: @@ -717,8 +724,8 @@ braces@^1.8.2: repeat-element "^1.1.2" brorand@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" browser-resolve@^1.11.2: version "1.11.2" @@ -760,8 +767,8 @@ browserify-rsa@^4.0.0: randombytes "^2.0.1" browserify-sign@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" dependencies: bn.js "^4.1.1" browserify-rsa "^4.0.0" @@ -789,10 +796,6 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - buffer-xor@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -835,9 +838,9 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" center-align@^0.1.1: version "0.1.3" @@ -857,8 +860,8 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: supports-color "^2.0.0" chokidar@^1.4.3: - version "1.6.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -875,7 +878,7 @@ ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" -cipher-base@^1.0.0, cipher-base@^1.0.1: +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" dependencies: @@ -885,11 +888,11 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" dependencies: - restore-cursor "^1.0.1" + restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.1.0" @@ -935,12 +938,6 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -949,7 +946,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.6: +concat-stream@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -975,11 +972,7 @@ content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" -convert-source-map@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" - -convert-source-map@^1.4.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -998,21 +991,25 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" -create-hash@^1.1.0, create-hash@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" +create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" dependencies: cipher-base "^1.0.1" inherits "^2.0.1" - ripemd160 "^1.0.0" - sha.js "^2.3.6" + ripemd160 "^2.0.0" + sha.js "^2.4.0" -create-hmac@^1.1.0, create-hmac@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.6" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" dependencies: + cipher-base "^1.0.3" create-hash "^1.1.0" inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" cryptiles@2.x.x: version "2.0.5" @@ -1045,12 +1042,6 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -d@^0.1.1, d@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" - dependencies: - es5-ext "~0.10.2" - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1061,13 +1052,7 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@^2.1.1, debug@^2.2.0, debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - -debug@^2.6.3: +debug@^2.1.1, debug@^2.2.0, debug@^2.6.3, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -1078,8 +1063,8 @@ decamelize@^1.0.0, decamelize@^1.1.1: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" deep-extend@~0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" deep-is@~0.1.3: version "0.1.3" @@ -1136,9 +1121,9 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -1154,13 +1139,16 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" elliptic@^6.0.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" + version "6.4.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" dependencies: bn.js "^4.4.0" brorand "^1.0.1" hash.js "^1.0.0" + hmac-drbg "^1.0.0" inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" emojis-list@^2.0.0: version "2.1.0" @@ -1182,63 +1170,11 @@ enhanced-resolve@^3.0.0: prr "~0.0.0" error-ex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.12" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" - dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" - -es6-map@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-set "~0.1.3" - es6-symbol "~3.1.0" - event-emitter "~0.3.4" - -es6-set@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-symbol "3" - event-emitter "~0.3.4" - -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - -es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" - dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" - escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1254,71 +1190,77 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-plugin-flowtype@^2.30.0: - version "2.30.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.0.tgz#3054a265f9c8afe3046c3d41b72d32a736f9b4ae" + version "2.34.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" dependencies: lodash "^4.15.0" -eslint@^3.15.0: - version "3.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.15.0.tgz#bdcc6a6c5ffe08160e7b93c066695362a91e30f2" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.0.0.tgz#7277c01437fdf41dccd168d5aa0e49b75ca1f260" dependencies: - babel-code-frame "^6.16.0" + babel-code-frame "^6.22.0" chalk "^1.1.3" - concat-stream "^1.4.6" - debug "^2.1.1" - doctrine "^1.2.2" - escope "^3.6.0" - espree "^3.4.0" + concat-stream "^1.6.0" + debug "^2.6.8" + doctrine "^2.0.0" + eslint-scope "^3.7.1" + espree "^3.4.3" + esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" + glob "^7.1.2" + globals "^9.17.0" + ignore "^3.3.3" imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" + inquirer "^3.0.6" + is-my-json-valid "^2.16.0" is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" + js-yaml "^3.8.4" + json-stable-stringify "^1.0.1" levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" + lodash "^4.17.4" + mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" + path-is-inside "^1.0.2" + pluralize "^4.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" strip-json-comments "~2.0.1" - table "^3.7.8" + table "^4.0.1" text-table "~0.2.0" - user-home "^2.0.0" -espree@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" +espree@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: - acorn "4.0.4" + acorn "^5.0.1" acorn-jsx "^3.0.0" -esprima@^2.6.0, esprima@^2.7.1: +esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" @@ -1330,7 +1272,7 @@ estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1342,13 +1284,6 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" - dependencies: - d "~0.1.1" - es5-ext "~0.10.7" - events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" @@ -1365,10 +1300,6 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1382,8 +1313,16 @@ expand-range@^1.8.1: fill-range "^2.1.0" extend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +external-editor@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" + dependencies: + iconv-lite "^0.4.17" + jschardet "^1.4.2" + tmp "^0.0.31" extglob@^0.3.1: version "0.3.2" @@ -1411,12 +1350,11 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" dependencies: escape-string-regexp "^1.0.5" - object-assign "^4.1.0" file-entry-cache@^2.0.0: version "2.0.0" @@ -1426,8 +1364,8 @@ file-entry-cache@^2.0.0: object-assign "^4.0.1" filename-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" fileset@^2.0.2: version "2.0.3" @@ -1476,27 +1414,27 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.38.0: - version "0.38.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.38.0.tgz#3ae096d401c969cc8b5798253fb82381e2d0237a" +flow-bin@^0.48.0: + version "0.48.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.48.0.tgz#72d075143524358db8901525e3c784dc13a7c7ee" -for-in@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - for-in "^0.1.5" + for-in "^1.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" form-data@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" dependencies: asynckit "^0.4.0" combined-stream "^1.0.5" @@ -1507,13 +1445,13 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" fsevents@^1.0.0: - version "1.0.17" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.17.tgz#8537f3f12272678765b4fd6528c0f1f66f8f4558" + version "1.1.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" dependencies: nan "^2.3.0" - node-pre-gyp "^0.6.29" + node-pre-gyp "^0.6.36" -fstream-ignore@~1.0.5: +fstream-ignore@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" dependencies: @@ -1521,18 +1459,18 @@ fstream-ignore@~1.0.5: inherits "2" minimatch "^3.0.0" -fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" mkdirp ">=0.5 0" rimraf "2" -gauge@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -1541,7 +1479,6 @@ gauge@~2.7.1: signal-exit "^3.0.0" string-width "^1.0.1" strip-ansi "^3.0.1" - supports-color "^0.2.0" wide-align "^1.1.0" generate-function@^2.0.0: @@ -1559,8 +1496,8 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" getpass@^0.1.1: - version "0.1.6" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" @@ -1577,20 +1514,20 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.2" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0, globals@^9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" +globals@^9.0.0, globals@^9.17.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" globby@^5.0.0: version "5.0.0" @@ -1607,10 +1544,6 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -1625,14 +1558,16 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" + ajv "^4.9.1" + har-schema "^1.0.5" has-ansi@^2.0.0: version "2.0.0" @@ -1648,7 +1583,13 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" -hash.js@^1.0.0: +hash-base@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" + dependencies: + inherits "^2.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" dependencies: @@ -1663,6 +1604,14 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" @@ -1675,8 +1624,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" html-encoding-sniffer@^1.0.1: version "1.0.1" @@ -1700,13 +1649,17 @@ iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" +iconv-lite@^0.4.17: + version "0.4.18" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" + ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" -ignore@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.2.tgz#1c51e1ef53bab6ddc15db4d9ac4ec139eceb3410" +ignore@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" imurmurhash@^0.1.4: version "0.1.4" @@ -1735,27 +1688,28 @@ ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" +inquirer@^3.0.6: + version "3.1.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.0.tgz#e05400d48b94937c2d3caa7038663ba9189aab01" dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" + ansi-escapes "^2.0.0" chalk "^1.0.0" - cli-cursor "^1.0.1" + cli-cursor "^2.1.0" cli-width "^2.0.0" - figures "^1.3.5" + external-editor "^2.0.4" + figures "^2.0.0" lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.0.0" strip-ansi "^3.0.0" through "^2.3.6" interpret@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" invariant@^2.2.0: version "2.2.2" @@ -1777,9 +1731,9 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.0.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" is-builtin-module@^1.0.0: version "1.0.0" @@ -1794,8 +1748,8 @@ is-ci@^1.0.10: ci-info "^1.0.0" is-dotfile@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" is-equal-shallow@^0.1.3: version "0.1.3" @@ -1833,21 +1787,27 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: - version "2.15.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" +is-my-json-valid@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" jsonpointer "^4.0.0" xtend "^4.0.0" -is-number@^2.0.2, is-number@^2.1.0: +is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -1866,12 +1826,16 @@ is-path-inside@^1.0.0: is-posix-bracket@^0.1.0: version "0.1.1" - resolved "http://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" @@ -1909,65 +1873,65 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" istanbul-api@^1.1.1: - version "1.1.8" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + version "1.1.9" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.9.tgz#2827920d380d4286d857d57a2968a841db8a7ec8" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.0" - istanbul-lib-hook "^1.0.6" - istanbul-lib-instrument "^1.7.1" - istanbul-lib-report "^1.1.0" - istanbul-lib-source-maps "^1.2.0" - istanbul-reports "^1.1.0" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.0.7" + istanbul-lib-instrument "^1.7.2" + istanbul-lib-report "^1.1.1" + istanbul-lib-source-maps "^1.2.1" + istanbul-reports "^1.1.1" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" -istanbul-lib-hook@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" +istanbul-lib-hook@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" semver "^5.3.0" -istanbul-lib-report@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" +istanbul-lib-report@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" dependencies: - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" dependencies: debug "^2.6.3" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" +istanbul-reports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" dependencies: handlebars "^4.0.3" @@ -1975,9 +1939,9 @@ jest-changed-files@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" -jest-cli@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.3.tgz#fe88ddbb7a9f3a16d0ed55339a0a2424f7f0d361" +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" @@ -1989,15 +1953,15 @@ jest-cli@^20.0.3: istanbul-lib-instrument "^1.4.2" istanbul-lib-source-maps "^1.1.0" jest-changed-files "^20.0.3" - jest-config "^20.0.3" + jest-config "^20.0.4" jest-docblock "^20.0.3" jest-environment-jsdom "^20.0.3" - jest-haste-map "^20.0.3" - jest-jasmine2 "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" jest-message-util "^20.0.3" jest-regex-util "^20.0.3" jest-resolve-dependencies "^20.0.3" - jest-runtime "^20.0.3" + jest-runtime "^20.0.4" jest-snapshot "^20.0.3" jest-util "^20.0.3" micromatch "^2.3.11" @@ -2010,18 +1974,18 @@ jest-cli@^20.0.3: worker-farm "^1.3.1" yargs "^7.0.2" -jest-config@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.3.tgz#a934f27eea764915801cdda26f6f8eec2ac79266" +jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" dependencies: chalk "^1.1.3" glob "^7.1.1" jest-environment-jsdom "^20.0.3" jest-environment-node "^20.0.3" - jest-jasmine2 "^20.0.3" + jest-jasmine2 "^20.0.4" jest-matcher-utils "^20.0.3" jest-regex-util "^20.0.3" - jest-resolve "^20.0.3" + jest-resolve "^20.0.4" jest-validate "^20.0.3" pretty-format "^20.0.3" @@ -2053,9 +2017,9 @@ jest-environment-node@^20.0.3: jest-mock "^20.0.3" jest-util "^20.0.3" -jest-haste-map@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.3.tgz#6377d537eaf34eb5f75121a691cae3fde82ba971" +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" @@ -2064,9 +2028,9 @@ jest-haste-map@^20.0.3: sane "~1.6.0" worker-farm "^1.3.1" -jest-jasmine2@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.3.tgz#18c4e9d029da7ed1ae727c55300064d1a0542974" +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" dependencies: chalk "^1.1.3" graceful-fs "^4.1.11" @@ -2116,17 +2080,17 @@ jest-resolve-dependencies@^20.0.3: dependencies: jest-regex-util "^20.0.3" -jest-resolve@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.3.tgz#375307aa40f78532d40ff8b17d5300b1519f8dd4" +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" dependencies: browser-resolve "^1.11.2" is-builtin-module "^1.0.0" resolve "^1.3.2" -jest-runtime@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.3.tgz#dddd22bbc429e26e6a96d1acd46ca55714b09252" +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" dependencies: babel-core "^6.0.0" babel-jest "^20.0.3" @@ -2134,10 +2098,10 @@ jest-runtime@^20.0.3: chalk "^1.1.3" convert-source-map "^1.4.0" graceful-fs "^4.1.11" - jest-config "^20.0.3" - jest-haste-map "^20.0.3" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" jest-regex-util "^20.0.3" - jest-resolve "^20.0.3" + jest-resolve "^20.0.4" jest-util "^20.0.3" json-stable-stringify "^1.0.1" micromatch "^2.3.11" @@ -2177,31 +2141,29 @@ jest-validate@^20.0.3: pretty-format "^20.0.3" jest@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.3.tgz#e4fd054c4f1170a116a00761da4cfdb73f1cdc33" - dependencies: - jest-cli "^20.0.3" - -jodid25519@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" dependencies: - jsbn "~0.1.0" + jest-cli "^20.0.4" js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.5.1, js-yaml@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" +js-yaml@^3.7.0, js-yaml@^3.8.4: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" - esprima "^2.6.0" + esprima "^3.1.1" jsbn@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jschardet@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" jsdom@^9.12.0: version "9.12.0" @@ -2243,7 +2205,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -2253,7 +2215,7 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json5@^0.5.0: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2266,18 +2228,25 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" dependencies: + assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" kind-of@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" dependencies: - is-buffer "^1.0.2" + is-buffer "^1.1.5" lazy-cache@^1.0.3: version "1.0.4" @@ -2314,15 +2283,23 @@ loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" -loader-utils@^0.2.11, loader-utils@^0.2.16: - version "0.2.16" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d" +loader-utils@^0.2.16: + version "0.2.17" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" dependencies: big.js "^3.1.3" emojis-list "^2.0.0" json5 "^0.5.0" object-assign "^4.0.1" +loader-utils@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -2330,11 +2307,7 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2354,13 +2327,13 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -math-nodes@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/math-nodes/-/math-nodes-0.1.2.tgz#7d86bfd460a9d8506fa23378adc64b8c25bd1d4f" +math-nodes@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/math-nodes/-/math-nodes-0.1.6.tgz#ac38eba233d24c7d3094a0e99035054e55058167" math-traverse@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/math-traverse/-/math-traverse-0.2.1.tgz#164c7aeedc22e01087502ec4aa62f68a218544ed" + version "0.2.2" + resolved "https://registry.yarnpkg.com/math-traverse/-/math-traverse-0.2.2.tgz#f3ad3483cc62429249d4deda4da8a336f6877adf" memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" @@ -2398,25 +2371,33 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@~1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.14" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" dependencies: - mime-db "~1.26.0" + mime-db "~1.27.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" minimalistic-assert@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8, minimist@~0.0.1: version "0.0.8" @@ -2426,27 +2407,23 @@ minimist@^1.1.1, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" nan@^2.3.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" + version "2.6.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" natural-compare@^1.4.0: version "1.4.0" @@ -2493,29 +2470,30 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -node-pre-gyp@^0.6.29: - version "0.6.33" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" +node-pre-gyp@^0.6.36: + version "0.6.36" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" dependencies: - mkdirp "~0.5.1" - nopt "~3.0.6" - npmlog "^4.0.1" - rc "~1.1.6" - request "^2.79.0" - rimraf "~2.5.4" - semver "~5.3.0" - tar "~2.2.1" - tar-pack "~3.3.0" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" -nopt@~3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" dependencies: abbrev "1" + osenv "^0.1.4" normalize-package-data@^2.3.2: - version "2.3.5" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -2523,16 +2501,18 @@ normalize-package-data@^2.3.2: validate-npm-package-license "^3.0.1" normalize-path@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" -npmlog@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" +npmlog@^4.0.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5" dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" - gauge "~2.7.1" + gauge "~2.7.3" set-blocking "~2.0.0" number-is-nan@^1.0.0: @@ -2540,8 +2520,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.3.9" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" + version "1.4.0" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" oauth-sign@~0.8.1: version "0.8.2" @@ -2558,21 +2538,17 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@^1.3.0, once@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - -once@^1.4.0: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" optimist@^0.6.1: version "0.6.1" @@ -2606,10 +2582,17 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -2629,8 +2612,8 @@ pako@~0.2.0: resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" parse-asn1@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -2675,7 +2658,7 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -2692,10 +2675,18 @@ path-type@^1.0.0: pinkie-promise "^2.0.0" pbkdf2@^3.0.3: - version "3.0.9" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" + version "3.0.12" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.12.tgz#be36785c5067ea48d806ff923288c5f750b6b8a2" dependencies: - create-hmac "^1.1.2" + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" pify@^2.0.0, pify@^2.3.0: version "2.3.0" @@ -2717,9 +2708,9 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +pluralize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" prelude-ls@~1.1.2: version "1.1.2" @@ -2745,12 +2736,12 @@ process-nextick-args@~1.0.6: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" process@^0.11.0: - version "0.11.9" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" prr@~0.0.0: version "0.0.0" @@ -2774,9 +2765,9 @@ punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@~6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" querystring-es3@^0.2.0: version "0.2.1" @@ -2787,24 +2778,26 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" randomatic@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" dependencies: - is-number "^2.0.2" - kind-of "^3.0.2" + is-number "^3.0.0" + kind-of "^4.0.0" randombytes@^2.0.0, randombytes@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" + version "2.0.5" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" + dependencies: + safe-buffer "^5.1.0" -rc@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" +rc@^1.1.7: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" dependencies: deep-extend "~0.4.0" ini "~1.3.0" minimist "^1.2.0" - strip-json-comments "~1.0.4" + strip-json-comments "~2.0.1" read-pkg-up@^1.0.1: version "1.0.1" @@ -2821,28 +2814,16 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0, readable-stream@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2, readable-stream@^2.2.6: + version "2.2.11" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.11.tgz#0796b31f8d7688007ff0b93a8088d34aa17c0f72" dependencies: - buffer-shims "^1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" process-nextick-args "~1.0.6" - string_decoder "~0.10.x" + safe-buffer "~5.0.1" + string_decoder "~1.0.0" util-deprecate "~1.0.1" readdirp@^2.0.0: @@ -2854,31 +2835,17 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" regenerator-runtime@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" -regenerator-transform@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c" +regenerator-transform@0.9.11: + version "0.9.11" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -2886,7 +2853,7 @@ regenerator-transform@0.9.8: regex-cache@^0.4.2: version "0.4.3" - resolved "http://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" dependencies: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" @@ -2909,6 +2876,10 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" +remove-trailing-separator@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -2923,18 +2894,18 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" +request@^2.79.0, request@^2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: aws-sign2 "~0.6.0" aws4 "^1.2.1" - caseless "~0.11.0" + caseless "~0.12.0" combined-stream "~1.0.5" extend "~3.0.0" forever-agent "~0.6.1" form-data "~2.1.1" - har-validator "~2.0.6" + har-validator "~4.2.1" hawk "~3.1.3" http-signature "~1.1.0" is-typedarray "~1.0.0" @@ -2942,10 +2913,12 @@ request@^2.79.0: json-stringify-safe "~5.0.1" mime-types "~2.1.7" oauth-sign "~0.8.1" - qs "~6.3.0" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" stringstream "~0.0.4" tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" + tunnel-agent "^0.6.0" uuid "^3.0.0" require-directory@^2.1.1: @@ -2956,7 +2929,7 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -require-uncached@^1.0.2: +require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" dependencies: @@ -2971,22 +2944,18 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" - resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: path-parse "^1.0.5" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" + onetime "^2.0.0" + signal-exit "^3.0.2" right-align@^0.1.1: version "0.1.3" @@ -2994,31 +2963,42 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" -rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" dependencies: - glob "^7.0.5" + hash-base "^2.0.0" + inherits "^2.0.1" -ripemd160@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" dependencies: - once "^1.3.0" + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +safe-buffer@^5.0.1, safe-buffer@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + +safe-buffer@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223" sane@~1.6.0: version "1.6.0" @@ -3036,7 +3016,7 @@ sax@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@~5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3052,25 +3032,17 @@ setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" -sha.js@^2.3.6: +sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.8" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" dependencies: inherits "^2.0.1" -shelljs@^0.7.5: - version "0.7.6" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - shellwords@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3088,15 +3060,15 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -source-list-map@~0.1.7: - version "0.1.8" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" +source-list-map@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1" source-map-support@^0.4.2: - version "0.4.11" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" dependencies: - source-map "^0.5.3" + source-map "^0.5.6" source-map@^0.4.4: version "0.4.4" @@ -3104,7 +3076,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -3133,8 +3105,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -3143,7 +3115,6 @@ sshpk@^1.7.0: optionalDependencies: bcrypt-pbkdf "^1.0.0" ecc-jsbn "~0.1.1" - jodid25519 "^1.0.0" jsbn "~0.1.0" tweetnacl "~0.14.0" @@ -3155,12 +3126,12 @@ stream-browserify@^2.0.1: readable-stream "^2.0.2" stream-http@^2.3.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.6.3.tgz#4c3ddbf9635968ea2cfd4e48d43de5def2625ac3" + version "2.7.2" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.1.0" + readable-stream "^2.2.6" to-arraybuffer "^1.0.0" xtend "^4.0.0" @@ -3185,10 +3156,16 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@^0.10.25, string_decoder@~0.10.x: +string_decoder@^0.10.25: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.2.tgz#b29e1f4e1125fa97a10382b8a533737b7491e179" + dependencies: + safe-buffer "~5.0.1" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3199,7 +3176,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@3.0.0, strip-bom@^3.0.0: +strip-bom@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -3209,25 +3186,17 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" -strip-json-comments@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" supports-color@^3.1.0, supports-color@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: has-flag "^1.0.0" @@ -3235,9 +3204,9 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" +table@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435" dependencies: ajv "^4.7.0" ajv-keywords "^1.0.0" @@ -3250,20 +3219,20 @@ tapable@^0.2.5, tapable@~0.2.5: version "0.2.6" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.6.tgz#206be8e188860b514425375e6f1ae89bfb01fd8d" -tar-pack@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" - dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" - -tar@~2.2.1: +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -3271,9 +3240,9 @@ tar@~2.2.1: fstream "^1.0.2" inherits "2" -test-exclude@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -3286,8 +3255,8 @@ text-table@~0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" throat@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" + version "3.2.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" through@^2.3.6: version "2.3.8" @@ -3299,6 +3268,12 @@ timers-browserify@^2.0.2: dependencies: setimmediate "^1.0.4" +tmp@^0.0.31: + version "0.0.31" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" + dependencies: + os-tmpdir "~1.0.1" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -3308,8 +3283,8 @@ to-arraybuffer@^1.0.0: resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" to-fast-properties@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" @@ -3321,6 +3296,10 @@ tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" @@ -3329,9 +3308,11 @@ tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" @@ -3347,20 +3328,20 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -uglify-js@^2.6, uglify-js@^2.7.5: - version "2.7.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" +uglify-js@^2.6, uglify-js@^2.8.27: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" dependencies: - async "~0.2.6" source-map "~0.5.1" - uglify-to-browserify "~1.0.0" yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uid-number@~0.0.6: +uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" @@ -3371,12 +3352,6 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -3388,8 +3363,8 @@ util@0.10.3, util@^0.10.3: inherits "2.0.1" uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" validate-npm-package-license@^3.0.1: version "3.0.1" @@ -3420,9 +3395,9 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" -watchpack@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.2.0.tgz#15d4620f1e7471f13fcb551d5c030d2c3eb42dbb" +watchpack@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.3.1.tgz#7d8693907b28ce6013e7f3610aa2a1acf07dad87" dependencies: async "^2.1.2" chokidar "^1.4.3" @@ -3436,18 +3411,18 @@ webidl-conversions@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" -webpack-sources@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.4.tgz#ccc2c817e08e5fa393239412690bb481821393cd" +webpack-sources@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb" dependencies: - source-list-map "~0.1.7" + source-list-map "^1.1.1" source-map "~0.5.3" webpack@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.2.1.tgz#7bb1d72ae2087dd1a4af526afec15eed17dda475" + version "2.6.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.1.tgz#2e0457f0abb1ac5df3ab106c69c672f236785f07" dependencies: - acorn "^4.0.4" + acorn "^5.0.0" acorn-dynamic-import "^2.0.0" ajv "^4.7.0" ajv-keywords "^1.1.1" @@ -3455,6 +3430,7 @@ webpack@^2.2.1: enhanced-resolve "^3.0.0" interpret "^1.0.0" json-loader "^0.5.4" + json5 "^0.5.1" loader-runner "^2.3.0" loader-utils "^0.2.16" memory-fs "~0.4.1" @@ -3463,9 +3439,9 @@ webpack@^2.2.1: source-map "^0.5.3" supports-color "^3.1.0" tapable "~0.2.5" - uglify-js "^2.7.5" - watchpack "^1.2.0" - webpack-sources "^0.1.4" + uglify-js "^2.8.27" + watchpack "^1.3.1" + webpack-sources "^0.2.3" yargs "^6.0.0" whatwg-encoding@^1.0.1: @@ -3492,10 +3468,10 @@ which@^1.2.12: isexe "^2.0.0" wide-align@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" dependencies: - string-width "^1.0.1" + string-width "^1.0.2" window-size@0.1.0: version "0.1.0" From e80ee0128977ea114e2680a4322885bad2311ddc Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 16 Jun 2017 23:02:37 -0400 Subject: [PATCH 17/20] working on derivatives --- .../__snapshots__/parser.test.js.snap | 2268 +++++++++++++++++ lib/__test__/parser.test.js | 3 +- 2 files changed, 2269 insertions(+), 2 deletions(-) create mode 100644 lib/__test__/__snapshots__/parser.test.js.snap diff --git a/lib/__test__/__snapshots__/parser.test.js.snap b/lib/__test__/__snapshots__/parser.test.js.snap new file mode 100644 index 0000000..1616ee7 --- /dev/null +++ b/lib/__test__/__snapshots__/parser.test.js.snap @@ -0,0 +1,2268 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Parser.parse abs ||a - b| - |b - c|| 1`] = ` +{ + "type": "Apply", + "op": "abs", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Apply", + "op": "abs", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + } + ] + } + ] + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "abs", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse abs |a - b| 1`] = ` +{ + "type": "Apply", + "op": "abs", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse addition/subtraction 1 - -2 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse addition/subtraction 1 - 2 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse addition/subtraction a + -b - c 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse addition/subtraction a + b + c 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse addition/subtraction a - b - -c 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "c" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse addition/subtraction a - b - c 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse division (a*b)/(c*d) 1`] = ` +{ + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + } + ] +} +`; + +exports[`Parser.parse division 2(x+1)/4 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "1", + "type": "Number" + } + ] + }, + { + "value": "4", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse division 2x/4 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "4", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse division a b c/d 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + } + ] +} +`; + +exports[`Parser.parse division a*b*c/d 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + } + ] +} +`; + +exports[`Parser.parse division a/b*c/d 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + } + ] +} +`; + +exports[`Parser.parse division a/b/c 1`] = ` +{ + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse division a^2/b^2 1`] = ` +{ + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "value": "2", + "type": "Number" + } + ] + }, + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "value": "2", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse ellipsis #a_0#x + ... + #a_n#x 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Placeholder", + "subscript": { + "value": "0", + "type": "Number" + }, + "name": "a" + }, + { + "type": "Placeholder", + "name": "x" + } + ] + }, + { + "type": "Ellipsis" + }, + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Placeholder", + "subscript": { + "type": "Identifier", + "name": "n" + }, + "name": "a" + }, + { + "type": "Placeholder", + "name": "x" + } + ] + } + ] +} +`; + +exports[`Parser.parse ellipsis 1 * ... * n 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "type": "Ellipsis" + }, + { + "type": "Identifier", + "name": "n" + } + ] +} +`; + +exports[`Parser.parse ellipsis 1, 2, ..., n 1`] = ` +{ + "type": "Sequence", + "items": [ + { + "value": "1", + "type": "Number" + }, + { + "value": "2", + "type": "Number" + }, + { + "type": "Ellipsis" + }, + { + "type": "Identifier", + "name": "n" + } + ] +} +`; + +exports[`Parser.parse ellipsis a + ... + z 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Ellipsis" + }, + { + "type": "Identifier", + "name": "z" + } + ] +} +`; + +exports[`Parser.parse factorial (2 * n)! 1`] = ` +{ + "type": "Apply", + "op": "fact", + "args": [ + { + "type": "Apply", + "op": "mul", + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Identifier", + "name": "n" + } + ] + } + ] +} +`; + +exports[`Parser.parse factorial (5^2)! 1`] = ` +{ + "type": "Apply", + "op": "fact", + "args": [ + { + "type": "Apply", + "op": "pow", + "args": [ + { + "value": "5", + "type": "Number" + }, + { + "value": "2", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse factorial 2 * n! 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Apply", + "op": "fact", + "args": [ + { + "type": "Identifier", + "name": "n" + } + ] + } + ] +} +`; + +exports[`Parser.parse factorial 5! 1`] = ` +{ + "type": "Apply", + "op": "fact", + "args": [ + { + "value": "5", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse factorial 5!^2 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Apply", + "op": "fact", + "args": [ + { + "value": "5", + "type": "Number" + } + ] + }, + { + "value": "2", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse factorial x! 1`] = ` +{ + "type": "Apply", + "op": "fact", + "args": [ + { + "type": "Identifier", + "name": "x" + } + ] +} +`; + +exports[`Parser.parse factorial x^2! 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Apply", + "op": "fact", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse functions f(a+b) 1`] = ` +{ + "type": "Apply", + "op": { + "type": "Apply", + "op": "diff", + "args": [ + "f", + 0 + ] + }, + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } + ] +} +`; + +exports[`Parser.parse functions f(f(a)) 1`] = ` +{ + "type": "Apply", + "op": { + "type": "Apply", + "op": "diff", + "args": [ + "f", + 0 + ] + }, + "args": [ + { + "type": "Apply", + "op": { + "type": "Apply", + "op": "diff", + "args": [ + "f", + 0 + ] + }, + "args": [ + { + "type": "Identifier", + "name": "a" + } + ] + } + ] +} +`; + +exports[`Parser.parse multiplication (a)(b)(c) 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "a" + } + }, + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "b" + } + }, + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "c" + } + } + ] +} +`; + +exports[`Parser.parse multiplication (a)b(c) 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "a" + } + }, + { + "type": "Apply", + "op": { + "type": "Identifier", + "name": "b" + }, + "args": [ + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse multiplication a b * b * b c 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse multiplication a b c 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse multiplication a*b c 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse multiplication a*b*c 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse nthRoot nthRoot(-27, 3) 1`] = ` +{ + "type": "Apply", + "op": "nthRoot", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "27", + "type": "Number" + } + ] + }, + { + "value": "3", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse nthRoot nthRoot(x, 2) 1`] = ` +{ + "type": "Apply", + "op": "nthRoot", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "2", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse parentheses ((1 + 2)) 1`] = ` +{ + "type": "Parentheses", + "body": { + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "add", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "value": "2", + "type": "Number" + } + ] + } + } +} +`; + +exports[`Parser.parse parentheses ((a * b)) 1`] = ` +{ + "type": "Parentheses", + "body": { + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } + } +} +`; + +exports[`Parser.parse parentheses (1 + 2) 1`] = ` +{ + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "add", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "value": "2", + "type": "Number" + } + ] + } +} +`; + +exports[`Parser.parse parentheses (a * b) 1`] = ` +{ + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } +} +`; + +exports[`Parser.parse parentheses (a)(b) 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "a" + } + }, + { + "type": "Parentheses", + "body": { + "type": "Identifier", + "name": "b" + } + } + ] +} +`; + +exports[`Parser.parse parentheses (x + y) - (a + b) 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Identifier", + "name": "y" + } + ] + } + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse parentheses 5 + ((3 * 6)) 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "value": "5", + "type": "Number" + }, + { + "type": "Parentheses", + "body": { + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "mul", + "args": [ + { + "value": "3", + "type": "Number" + }, + { + "value": "6", + "type": "Number" + } + ] + } + } + } + ] +} +`; + +exports[`Parser.parse parentheses 5 + (3 * 6) 1`] = ` +{ + "type": "Apply", + "op": "add", + "args": [ + { + "value": "5", + "type": "Number" + }, + { + "type": "Parentheses", + "body": { + "type": "Apply", + "op": "mul", + "args": [ + { + "value": "3", + "type": "Number" + }, + { + "value": "6", + "type": "Number" + } + ] + } + } + ] +} +`; + +exports[`Parser.parse parentheses a * (b + c) 1`] = ` +{ + "type": "Apply", + "op": "mul", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse placeholders #a #b / #c 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Placeholder", + "name": "a" + }, + { + "type": "Apply", + "op": "div", + "args": [ + { + "type": "Placeholder", + "name": "b" + }, + { + "type": "Placeholder", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse placeholders #a #f(#x) 1`] = ` +{ + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "type": "Placeholder", + "name": "a" + }, + { + "type": "Apply", + "op": { + "type": "Apply", + "op": "diff", + "args": [ + "f", + 0 + ] + }, + "args": [ + { + "type": "Placeholder", + "name": "x" + } + ] + } + ] +} +`; + +exports[`Parser.parse placeholders #a 1`] = ` +{ + "type": "Placeholder", + "name": "a" +} +`; + +exports[`Parser.parse placeholders #eval(#a + #b) 1`] = ` +{ + "type": "Apply", + "op": { + "type": "Placeholder", + "name": "eval" + }, + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Placeholder", + "name": "a" + }, + { + "type": "Placeholder", + "name": "b" + } + ] + } + ] +} +`; + +exports[`Parser.parse placeholders #f(#x) 1`] = ` +{ + "type": "Apply", + "op": { + "type": "Apply", + "op": "diff", + "args": [ + "f", + 0 + ] + }, + "args": [ + { + "type": "Placeholder", + "name": "x" + } + ] +} +`; + +exports[`Parser.parse powers (-2)^x 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + }, + { + "type": "Identifier", + "name": "x" + } + ] +} +`; + +exports[`Parser.parse powers -1^-2 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "pow", + "args": [ + { + "value": "1", + "type": "Number" + }, + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse powers -a^-b 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "b" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse powers a^-1.23 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "1.23", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse powers a^b^c 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] + } + ] +} +`; + +exports[`Parser.parse relations (binary) a != b 1`] = ` +{ + "type": "Apply", + "op": "ne", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (binary) a < b 1`] = ` +{ + "type": "Apply", + "op": "lt", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (binary) a <= b 1`] = ` +{ + "type": "Apply", + "op": "le", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (binary) a = b 1`] = ` +{ + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (binary) a > b 1`] = ` +{ + "type": "Apply", + "op": "gt", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (binary) a >= b 1`] = ` +{ + "type": "Apply", + "op": "ge", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + +exports[`Parser.parse relations (n-ary) a != b != c 1`] = ` +{ + "type": "Apply", + "op": "ne", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse relations (n-ary) a = b = c 1`] = ` +{ + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse relations (n-ary) a > b > c 1`] = ` +{ + "type": "Apply", + "op": "gt", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] +} +`; + +exports[`Parser.parse sequences 1, 1, 2, 3, 5 1`] = ` +{ + "type": "Sequence", + "items": [ + { + "value": "1", + "type": "Number" + }, + { + "value": "1", + "type": "Number" + }, + { + "value": "2", + "type": "Number" + }, + { + "value": "3", + "type": "Number" + }, + { + "value": "5", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse sequences a, a^3, a^5 1`] = ` +{ + "type": "Sequence", + "items": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "value": "3", + "type": "Number" + } + ] + }, + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "value": "5", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse sequences r_1, r_2, r_3 1`] = ` +{ + "type": "Sequence", + "items": [ + { + "type": "Identifier", + "subscript": { + "value": "1", + "type": "Number" + }, + "name": "r" + }, + { + "type": "Identifier", + "subscript": { + "value": "2", + "type": "Number" + }, + "name": "r" + }, + { + "type": "Identifier", + "subscript": { + "value": "3", + "type": "Number" + }, + "name": "r" + } + ] +} +`; + +exports[`Parser.parse sequences x, x + 1, x + 3 1`] = ` +{ + "type": "Sequence", + "items": [ + { + "type": "Identifier", + "name": "x" + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "1", + "type": "Number" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "3", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse subscripts #a_0 1`] = ` +{ + "type": "Placeholder", + "subscript": { + "value": "0", + "type": "Number" + }, + "name": "a" +} +`; + +exports[`Parser.parse subscripts a_0 1`] = ` +{ + "type": "Identifier", + "subscript": { + "value": "0", + "type": "Number" + }, + "name": "a" +} +`; + +exports[`Parser.parse subscripts a_0^2 1`] = ` +{ + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "subscript": { + "value": "0", + "type": "Number" + }, + "name": "a" + }, + { + "value": "2", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse subscripts a_123 1`] = ` +{ + "type": "Identifier", + "subscript": { + "value": "123", + "type": "Number" + }, + "name": "a" +} +`; + +exports[`Parser.parse subscripts a_n 1`] = ` +{ + "type": "Identifier", + "subscript": { + "type": "Identifier", + "name": "n" + }, + "name": "a" +} +`; + +exports[`Parser.parse subscripts a_xyz 1`] = ` +{ + "type": "Identifier", + "subscript": { + "type": "Identifier", + "name": "xyz" + }, + "name": "a" +} +`; + +exports[`Parser.parse systems of equations a = b, b = c, c = d 1`] = ` +{ + "type": "System", + "relations": [ + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Identifier", + "name": "b" + }, + { + "type": "Identifier", + "name": "c" + } + ] + }, + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + } + ] +} +`; + +exports[`Parser.parse systems of equations x + 1 = 2, x^2 + 2x + 1 = 0 1`] = ` +{ + "type": "System", + "relations": [ + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "1", + "type": "Number" + } + ] + }, + { + "value": "2", + "type": "Number" + } + ] + }, + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Apply", + "op": "pow", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "2", + "type": "Number" + } + ] + }, + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Identifier", + "name": "x" + } + ] + }, + { + "value": "1", + "type": "Number" + } + ] + }, + { + "value": "0", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse systems of equations x + 2 = y, 3x - 5 = 2y 1`] = ` +{ + "type": "System", + "relations": [ + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "x" + }, + { + "value": "2", + "type": "Number" + } + ] + }, + { + "type": "Identifier", + "name": "y" + } + ] + }, + { + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "value": "3", + "type": "Number" + }, + { + "type": "Identifier", + "name": "x" + } + ] + }, + { + "wasMinus": true, + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "5", + "type": "Number" + } + ] + } + ] + }, + { + "type": "Apply", + "op": "mul", + "implicit": true, + "args": [ + { + "value": "2", + "type": "Number" + }, + { + "type": "Identifier", + "name": "y" + } + ] + } + ] + } + ] +} +`; + +exports[`Parser.parse unary operators +2 1`] = ` +{ + "type": "Apply", + "op": "pos", + "args": [ + { + "value": "2", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse unary operators +a 1`] = ` +{ + "type": "Apply", + "op": "pos", + "args": [ + { + "type": "Identifier", + "name": "a" + } + ] +} +`; + +exports[`Parser.parse unary operators --2 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] + } + ] +} +`; + +exports[`Parser.parse unary operators --a 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "a" + } + ] + } + ] +} +`; + +exports[`Parser.parse unary operators -2 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "value": "2", + "type": "Number" + } + ] +} +`; + +exports[`Parser.parse unary operators -a 1`] = ` +{ + "type": "Apply", + "op": "neg", + "args": [ + { + "type": "Identifier", + "name": "a" + } + ] +} +`; diff --git a/lib/__test__/parser.test.js b/lib/__test__/parser.test.js index 9396c12..3ad3dea 100644 --- a/lib/__test__/parser.test.js +++ b/lib/__test__/parser.test.js @@ -39,7 +39,6 @@ suite.only = (name, cases) => { } describe("Parser.parse", () => { - /* it('should fail with invalid tokens', () => { assert.throws(() => parse('a ; b')); assert.throws(() => parse('; a b')); @@ -195,7 +194,7 @@ describe("Parser.parse", () => { '2 * n!', '(2 * n)!', ]) - */ + suite('derivatives', [ `f'`, //`f''`, From 4942982b941ae4fb44739a88aa1ca1760db316f8 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 16 Jun 2017 23:05:12 -0400 Subject: [PATCH 18/20] changed files back --- lib/__test__/{print => print.test.js} | 0 lib/__test__/{toTex => toTex.test.js} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lib/__test__/{print => print.test.js} (100%) rename lib/__test__/{toTex => toTex.test.js} (100%) diff --git a/lib/__test__/print b/lib/__test__/print.test.js similarity index 100% rename from lib/__test__/print rename to lib/__test__/print.test.js diff --git a/lib/__test__/toTex b/lib/__test__/toTex.test.js similarity index 100% rename from lib/__test__/toTex rename to lib/__test__/toTex.test.js From f14b01a69faccdfd9c07434a27db394a668a1743 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 16 Jun 2017 23:10:14 -0400 Subject: [PATCH 19/20] minor fix --- .../__snapshots__/parser.test.js.snap | 213 +++++++++++++++--- lib/parse.js | 2 +- 2 files changed, 184 insertions(+), 31 deletions(-) diff --git a/lib/__test__/__snapshots__/parser.test.js.snap b/lib/__test__/__snapshots__/parser.test.js.snap index 1616ee7..3390ec9 100644 --- a/lib/__test__/__snapshots__/parser.test.js.snap +++ b/lib/__test__/__snapshots__/parser.test.js.snap @@ -816,12 +816,8 @@ exports[`Parser.parse functions f(a+b) 1`] = ` { "type": "Apply", "op": { - "type": "Apply", - "op": "diff", - "args": [ - "f", - 0 - ] + "type": "Identifier", + "name": "f" }, "args": [ { @@ -842,27 +838,39 @@ exports[`Parser.parse functions f(a+b) 1`] = ` } `; +exports[`Parser.parse functions f(a,b) 1`] = ` +{ + "type": "Apply", + "op": { + "type": "Identifier", + "name": "f" + }, + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] +} +`; + exports[`Parser.parse functions f(f(a)) 1`] = ` { "type": "Apply", "op": { - "type": "Apply", - "op": "diff", - "args": [ - "f", - 0 - ] + "type": "Identifier", + "name": "f" }, "args": [ { "type": "Apply", "op": { - "type": "Apply", - "op": "diff", - "args": [ - "f", - 0 - ] + "type": "Identifier", + "name": "f" }, "args": [ { @@ -1378,12 +1386,8 @@ exports[`Parser.parse placeholders #a #f(#x) 1`] = ` { "type": "Apply", "op": { - "type": "Apply", - "op": "diff", - "args": [ - "f", - 0 - ] + "type": "Placeholder", + "name": "f" }, "args": [ { @@ -1433,12 +1437,8 @@ exports[`Parser.parse placeholders #f(#x) 1`] = ` { "type": "Apply", "op": { - "type": "Apply", - "op": "diff", - "args": [ - "f", - 0 - ] + "type": "Placeholder", + "name": "f" }, "args": [ { @@ -1703,6 +1703,159 @@ exports[`Parser.parse relations (n-ary) a != b != c 1`] = ` } `; +exports[`Parser.parse relations (n-ary) a + b != c + d != e + f 1`] = ` +{ + "type": "Apply", + "op": "ne", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "e" + }, + { + "type": "Identifier", + "name": "f" + } + ] + } + ] +} +`; + +exports[`Parser.parse relations (n-ary) a + b = c + d = e + f 1`] = ` +{ + "type": "Apply", + "op": "eq", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "e" + }, + { + "type": "Identifier", + "name": "f" + } + ] + } + ] +} +`; + +exports[`Parser.parse relations (n-ary) a + b > c + d > e + f 1`] = ` +{ + "type": "Apply", + "op": "gt", + "args": [ + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "a" + }, + { + "type": "Identifier", + "name": "b" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "c" + }, + { + "type": "Identifier", + "name": "d" + } + ] + }, + { + "type": "Apply", + "op": "add", + "args": [ + { + "type": "Identifier", + "name": "e" + }, + { + "type": "Identifier", + "name": "f" + } + ] + } + ] +} +`; + exports[`Parser.parse relations (n-ary) a = b = c 1`] = ` { "type": "Apply", diff --git a/lib/parse.js b/lib/parse.js index 23d9480..32a9821 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -347,7 +347,7 @@ class Parser { if (matches(token, '#') || isIdentifierToken(token)) { const node = this.identifierOrPlaceholder() - if (node.name === 'f') { + if (node.name === 'f' && matches(this.currentToken(), `'`)) { let order = 0 while(matches(this.currentToken(), `'`)) { token = this.consume(`'`); From 64cb9b405585f313a4efc6cd526f1585d55a84bd Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 17 Jun 2017 13:59:20 -0400 Subject: [PATCH 20/20] leibniz notations, doesn't work --- lib/__test__/parser.test.js | 4 +-- lib/parse.js | 63 ++++++++++++++++++++++++++++--------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/lib/__test__/parser.test.js b/lib/__test__/parser.test.js index a765a47..d11d00e 100644 --- a/lib/__test__/parser.test.js +++ b/lib/__test__/parser.test.js @@ -200,8 +200,8 @@ describe("Parser.parse", () => { //`f'`, //`f''`, //'dy/dx', - 'dy/dx(x^2)', - //'d^2/dxdy', + //'d/dx(x^2)' + //'d^2/dxdy(x^2+y^2)', ]) }) diff --git a/lib/parse.js b/lib/parse.js index e19b2eb..9889251 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -29,7 +29,7 @@ const tokenPattern = // matches either dx or d to a power const derivativeNumeratorPattern = - /d[a-zA-Z]{1}|d[\^]\d+/; + /d|d[a-zA-Z]{1}/; // match groups of dx's const derivativeDenominatorPattern = @@ -347,6 +347,7 @@ class Parser { const r2 = new RegExp(derivativeDenominatorPattern); // Lagrange notation + // e.g. f', f'', f'(x) if (node.name === 'f' && matches(this.currentToken(), `'`)) { let order = 0 while(matches(this.currentToken(), `'`)) { @@ -368,26 +369,60 @@ class Parser { } } // Leibniz notation (single diff) - else if (node.name.match(r1) != null) { + // e.g. dy/dx + else if (node.name.match(r1) != null && matches(this.currentToken(), '/')) { const firstVar = node.name.charAt(1) + this.consume('/') + + // check if denom is correct + token = this.currentToken() + + if (token.value.match(r2) != null) { + const secondVar = token.value.charAt(1) + console.log(secondVar) + this.consume(token.value) + + if (matches(this.currentToken() , '(')) { + this.consume('(') + const args = this.argumentList() + token = this.consume(')') + // d/dx (x^2) + base = build.apply('diff', [args[0], secondVar]) + } else { + // dy/dx + base = build.apply('diff', [firstVar, secondVar]) + } + } + } + // Leibniz notation (n-ary diff) + // e.g. d^2/dxdy(x^2 + y^2) + else if (node.name.match(r1) != null && matches(this.currentToken(), '^')){ + this.consume('^') + token = this.currentToken() + const order = token.value + this.consume(token.value) if (matches(this.currentToken(), '/')) { this.consume('/') - // check if denom is correct - token = this.currentToken() - if (token.value.match(r2) != null) { - const secondVar = token.value.charAt(1) - this.consume(token.value) - if (matches(this.currentToken() , '(')) { - this.consume('(') - const args = this.argumentList() - token = this.consume(')') - base = build.apply('diff', [firstVar, secondVar]) - } + const denom = this.currentToken().value + const variables = denom.split('d').slice(1) + this.consume(denom) + + if (matches(this.currentToken() , '(')) { + this.consume('(') + const args = this.argumentList() + token = this.consume(')') + + base = build.apply('diff', [args, variables]) + } else { + throw new Error('derivative expects an arg') } + } else { + base = node } + } // nthRoot - else if (matches(this.currentToken(), '(')) { + if (matches(this.currentToken(), '(')) { this.consume('('); const args = this.argumentList(); token = this.consume(')');