From b1fa3218f8452dfae3a51ea017a51e0b72a0a8d9 Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Tue, 25 Jul 2017 16:43:50 -0400 Subject: [PATCH 01/11] Allow for optional scope arg in functions leading to substituteScopeSearch --- .vscode/settings.json | 3 + lib/TreeSearch.js | 26 +- lib/simplifyExpression/stepThrough.js | 13 +- .../substituteScopeSearch/index.js | 21 + lib/solveEquation/index.js | 4 +- lib/solveEquation/stepThrough.js | 20 +- .../substituteScopeSearch.test.js | 10 + yarn.lock | 951 ++++++++++++++++++ 8 files changed, 1020 insertions(+), 28 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 lib/simplifyExpression/substituteScopeSearch/index.js create mode 100644 test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js create mode 100644 yarn.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..20af2f68 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +// Place your settings in this file to overwrite default and user settings. +{ +} \ No newline at end of file diff --git a/lib/TreeSearch.js b/lib/TreeSearch.js index ad2423a6..506cecaf 100644 --- a/lib/TreeSearch.js +++ b/lib/TreeSearch.js @@ -5,35 +5,39 @@ const TreeSearch = {}; // Returns a function that performs a preorder search on the tree for the given // simplification function TreeSearch.preOrder = function(simplificationFunction) { - return function (node) { - return search(simplificationFunction, node, true); + return function (node, scope={}) { + return search(simplificationFunction, node, true, scope); }; }; // Returns a function that performs a postorder search on the tree for the given // simplification function TreeSearch.postOrder = function(simplificationFunction) { - return function (node) { - return search(simplificationFunction, node, false); + return function (node, scope={}) { + return search(simplificationFunction, node, false, scope); }; }; // A helper function for performing a tree search with a function -function search(simplificationFunction, node, preOrder) { +function search(simplificationFunction, node, preOrder, scope={}) { let status; if (preOrder) { - status = simplificationFunction(node); + status = simplificationFunction(node, scope); if (status.hasChanged()) { return status; } } - if (Node.Type.isConstant(node) || Node.Type.isSymbol(node)) { + if (Node.Type.isConstant(node)) { + return Node.Status.noChange(node); + } + // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? + else if (Node.Type.isSymbol(node)) { return Node.Status.noChange(node); } else if (Node.Type.isUnaryMinus(node)) { - status = search(simplificationFunction, node.args[0], preOrder); + status = search(simplificationFunction, node.args[0], preOrder, scope); if (status.hasChanged()) { return Node.Status.childChanged(node, status); } @@ -41,14 +45,14 @@ function search(simplificationFunction, node, preOrder) { else if (Node.Type.isOperator(node) || Node.Type.isFunction(node)) { for (let i = 0; i < node.args.length; i++) { const child = node.args[i]; - const childNodeStatus = search(simplificationFunction, child, preOrder); + const childNodeStatus = search(simplificationFunction, child, preOrder, scope); if (childNodeStatus.hasChanged()) { return Node.Status.childChanged(node, childNodeStatus, i); } } } else if (Node.Type.isParenthesis(node)) { - status = search(simplificationFunction, node.content, preOrder); + status = search(simplificationFunction, node.content, preOrder, scope); if (status.hasChanged()) { return Node.Status.childChanged(node, status); } @@ -58,7 +62,7 @@ function search(simplificationFunction, node, preOrder) { } if (!preOrder) { - return simplificationFunction(node); + return simplificationFunction(node, scope); } else { return Node.Status.noChange(node); diff --git a/lib/simplifyExpression/stepThrough.js b/lib/simplifyExpression/stepThrough.js index 00fc70b7..51c26eca 100644 --- a/lib/simplifyExpression/stepThrough.js +++ b/lib/simplifyExpression/stepThrough.js @@ -11,6 +11,7 @@ const divisionSearch = require('./divisionSearch'); const fractionsSearch = require('./fractionsSearch'); const functionsSearch = require('./functionsSearch'); const multiplyFractionsSearch = require('./multiplyFractionsSearch'); +const substituteScopeSearch = require('./substituteScopeSearch'); const clone = require('../util/clone'); const flattenOperands = require('../util/flattenOperands'); @@ -19,7 +20,7 @@ const removeUnnecessaryParens = require('../util/removeUnnecessaryParens'); // Given a mathjs expression node, steps through simplifying the expression. // Returns a list of details about each step. -function stepThrough(node, debug=false) { +function stepThrough(node, debug=false, scope={}) { if (debug) { // eslint-disable-next-line console.log('\n\nSimplifying: ' + print(node, false, true)); @@ -37,7 +38,7 @@ function stepThrough(node, debug=false) { let iters = 0; // Now, step through the math expression until nothing changes - nodeStatus = step(node); + nodeStatus = step(node, scope); while (nodeStatus.hasChanged()) { if (debug) { logSteps(nodeStatus); @@ -45,7 +46,7 @@ function stepThrough(node, debug=false) { steps.push(removeUnnecessaryParensInStep(nodeStatus)); node = Status.resetChangeGroups(nodeStatus.newNode); - nodeStatus = step(node); + nodeStatus = step(node, scope); if (iters++ === MAX_STEP_COUNT) { // eslint-disable-next-line @@ -60,7 +61,7 @@ function stepThrough(node, debug=false) { // Given a mathjs expression node, performs a single step to simplify the // expression. Returns a Node.Status object. -function step(node) { +function step(node, scope={}) { let nodeStatus; node = flattenOperands(node); @@ -69,6 +70,8 @@ function step(node) { const simplificationTreeSearches = [ // Basic simplifications that we always try first e.g. (...)^0 => 1 basicsSearch, + // Substitute in-scope values for their respective symbols. + substituteScopeSearch, // Simplify any division chains so there's at most one division operation. // e.g. 2/x/6 -> 2/(x*6) e.g. 2/(x/6) => 2 * 6/x divisionSearch, @@ -91,7 +94,7 @@ function step(node) { ]; for (let i = 0; i < simplificationTreeSearches.length; i++) { - nodeStatus = simplificationTreeSearches[i](node); + nodeStatus = simplificationTreeSearches[i](node, scope); // Always update node, since there might be changes that didn't count as // a step. Remove unnecessary parens, in case one a step results in more // parens than needed. diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js new file mode 100644 index 00000000..d167e8b4 --- /dev/null +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -0,0 +1,21 @@ +//const ChangeTypes = require('../../ChangeTypes'); +const Node = require('../../node'); +const TreeSearch = require('../../TreeSearch'); + +// Searches through the tree, prioritizing deeper nodes, and substitutes +// in-scope values for their respective expressions on a symbol node if possible. +// Returns a Node.Status object. +const search = TreeSearch.postOrder(scopeSubstitution); + +function scopeSubstitution(node, scope) { + // eslint-disable-next-line + console.log(scope); + if (Node.Type.isSymbol(node)) { + return Node.Status.noChange(node); + } + else { + return Node.Status.noChange(node); + } +} + +module.exports = search; \ No newline at end of file diff --git a/lib/solveEquation/index.js b/lib/solveEquation/index.js index c990bcd8..fdff7c24 100644 --- a/lib/solveEquation/index.js +++ b/lib/solveEquation/index.js @@ -2,7 +2,7 @@ const math = require('mathjs'); const stepThrough = require('./stepThrough'); -function solveEquationString(equationString, debug=false) { +function solveEquationString(equationString, debug=false, scope={}) { const comparators = ['<=', '>=', '=', '<', '>']; for (let i = 0; i < comparators.length; i++) { @@ -27,7 +27,7 @@ function solveEquationString(equationString, debug=false) { return []; } if (leftNode && rightNode) { - return stepThrough(leftNode, rightNode, comparator, debug); + return stepThrough(leftNode, rightNode, comparator, debug, scope); } } diff --git a/lib/solveEquation/stepThrough.js b/lib/solveEquation/stepThrough.js index 96761074..50608274 100644 --- a/lib/solveEquation/stepThrough.js +++ b/lib/solveEquation/stepThrough.js @@ -23,8 +23,8 @@ const COMPARATOR_TO_FUNCTION = { // the solution. Possible solutions include: // - solving for a variable (e.g. 'x=3' for '3x=4+5') // - the result of comparing values (e.g. 'true' for 3 = 3, 'false' for 3 < 2) -function stepThrough(leftNode, rightNode, comparator, debug=false) { - let equation = new Equation(leftNode, rightNode, comparator); +function stepThrough(leftNode, rightNode, comparator, debug=false, scope={}) { + let equation = new Equation(leftNode, rightNode, comparator, scope); if (debug) { // eslint-disable-next-line @@ -40,7 +40,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false) { const symbolSet = Symbols.getSymbolsInEquation(equation); if (symbolSet.size === 0) { - return solveConstantEquation(equation, debug); + return solveConstantEquation(equation, debug, [], scope); } const symbolName = symbolSet.values().next().value; @@ -68,7 +68,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false) { // Step through the math equation until nothing changes do { - steps = addSimplificationSteps(steps, equation, debug); + steps = addSimplificationSteps(steps, equation, debug, scope); if (steps.length > 0) { const lastStep = steps[steps.length - 1]; @@ -81,7 +81,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false) { // at this point, the symbols might have cancelled out. if (Symbols.getSymbolsInEquation(equation).size === 0) { - return solveConstantEquation(equation, debug, steps); + return solveConstantEquation(equation, debug, steps, scope); } // The left side of the equation is either factored or simplified. @@ -237,14 +237,14 @@ function getSolutionsAndSymbol (equation) { // Given an equation of constants, will simplify both sides, returning // the steps and the result of the equation e.g. 'True' or 'False' -function solveConstantEquation(equation, debug, steps=[]) { +function solveConstantEquation(equation, debug, steps=[], scope={}) { const compareFunction = COMPARATOR_TO_FUNCTION[equation.comparator]; if (!compareFunction) { throw Error('Unexpected comparator'); } - steps = addSimplificationSteps(steps, equation, true, debug); + steps = addSimplificationSteps(steps, equation, debug, scope); if (steps.length > 0) { const lastStep = steps[steps.length - 1]; equation = Equation.createEquationFromString( @@ -307,7 +307,7 @@ function step(equation, symbolName) { } // Simplifies the equation and returns the simplification steps -function addSimplificationSteps(steps, equation, debug=false) { +function addSimplificationSteps(steps, equation, debug=false, scope={}) { let oldEquation = equation.clone(); /* @@ -321,7 +321,7 @@ function addSimplificationSteps(steps, equation, debug=false) { e.g. x + 4 + 2 = 0 <- simplify the left side e.g. 0 = x^2 + 3x + 2 -> x^2 + 3x + 2 = 0 <- swap to the left side */ - const leftSimplifySteps = simplifyExpressionNode(equation.leftNode, false); + const leftSimplifySteps = simplifyExpressionNode(equation.leftNode, false, scope); const simplifiedLeftNode = leftSimplifySteps.length !== 0 ? leftSimplifySteps.slice(-1)[0].newNode : equation.leftNode; @@ -369,7 +369,7 @@ function addSimplificationSteps(steps, equation, debug=false) { // (ie the "before" of the before and after) for simplifying the right side. oldEquation = equation.clone(); - const rightSteps = simplifyExpressionNode(equation.rightNode, false); + const rightSteps = simplifyExpressionNode(equation.rightNode, false, scope); const rightSubSteps = []; for (let i = 0; i < rightSteps.length; i++) { diff --git a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js new file mode 100644 index 00000000..dcda54a9 --- /dev/null +++ b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js @@ -0,0 +1,10 @@ +const solveEquation = require('../../../lib/solveEquation'); + +const scope = { + x: 10, + foo: 20, + bar: 'foo + x', + baz: 'bar^2' +}; + +solveEquation('2x + 3x = 35', false, scope); \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..b55264f4 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,951 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" + +ajv-keywords@^1.0.0: + 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.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +babel-code-frame@^6.16.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +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 "^1.0.0" + concat-map "0.0.1" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +commander@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06" + +commander@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" + +complex.js@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/complex.js/-/complex.js-2.0.1.tgz#ea90c7a05aeceaf3a376d2c0f6a78421727d6879" + +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.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +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.1.1: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decimal.js@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-7.1.1.tgz#1adcad7d70d7a91c426d756f1eb6566c3be6cbcf" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +diff@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" + +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" + +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.24" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.24.tgz#a55877c9924bc0c8d9bd3c2cbe17495ac1709b14" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" + +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" + +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-config-google@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.7.1.tgz#5598f8498e9e078420f34b80495b8d959f651fb2" + +eslint-plugin-sort-requires@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sort-requires/-/eslint-plugin-sort-requires-2.1.0.tgz#3efad948dc83798219e809f54067c40e55444861" + +eslint@^3.10.2: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + 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" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + 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" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" + dependencies: + acorn "^5.0.1" + acorn-jsx "^3.0.0" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +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.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.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" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +fraction.js@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.0.0.tgz#73974e2f8b51ef709536d624cc90782e2bb61274" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +glob@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467" + dependencies: + graceful-fs "~2.0.0" + inherits "2" + minimatch "~0.2.11" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: + 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.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.14.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" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +graceful-fs@~2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0" + +growl@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.8.1.tgz#4b2dec8d907e93db336624dcec0183502f8c9428" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +ignore@^3.2.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-my-json-valid@^2.10.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-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" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +jade@0.26.3: + version "0.26.3" + resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c" + dependencies: + commander "0.6.1" + mkdirp "0.3.0" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.5.1: + version "3.9.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-stable-stringify@^1.0.0, 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: + jsonify "~0.0.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash@^4.0.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +mathjs@3.11.2: + version "3.11.2" + resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-3.11.2.tgz#d2ca723d7e9254cc58d1421a5a61d8cfac8ff642" + dependencies: + complex.js "2.0.1" + decimal.js "7.1.1" + fraction.js "4.0.0" + seed-random "2.2.0" + tiny-emitter "1.0.2" + typed-function "0.10.5" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@~0.2.11: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@2.4.5: + version "2.4.5" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.4.5.tgz#151768dd2875eb51bc8295e9800026e9f2bb398f" + dependencies: + commander "2.3.0" + debug "2.2.0" + diff "1.4.0" + escape-string-regexp "1.0.2" + glob "3.2.3" + growl "1.8.1" + jade "0.26.3" + mkdirp "0.5.1" + supports-color "1.2.0" + +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" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +once@^1.3.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" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +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: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +readable-stream@^2.2.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~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" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@^1.1.6: + 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" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +rimraf@^2.2.8: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +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.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +seed-random@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54" + +shelljs@^0.7.5: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^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" + +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@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tiny-emitter@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-1.0.2.tgz#8e49470d3f55f89e247210368a6bb9fb51aa1601" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typed-function@0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-0.10.5.tgz#2e0f18abd065219fab694a446a65c6d1981832c0" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +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" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xtend@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 9ed6e864ff16b2bf1464411728679cea800ddae5 Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Tue, 25 Jul 2017 21:27:40 -0400 Subject: [PATCH 02/11] Failed implementation attempt --- lib/ChangeTypes.js | 5 +++++ lib/simplifyExpression/index.js | 4 ++-- .../substituteScopeSearch/index.js | 16 ++++++++++++---- .../substituteScopeSearch.test.js | 4 ++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/lib/ChangeTypes.js b/lib/ChangeTypes.js index 8476ab8b..9bfb65fc 100644 --- a/lib/ChangeTypes.js +++ b/lib/ChangeTypes.js @@ -3,6 +3,11 @@ module.exports = { NO_CHANGE: 'NO_CHANGE', + // SUBSTITUTION + + // e.g., given scope = { foo: 10 }, foo ^ 2 -> 10 ^ 2 + SUBSTITUTE_SCOPE_SYMBOL: 'SUBSTITUTE_SCOPE_SYMBOL', + // ARITHMETIC // e.g. 2 + 2 -> 4 or 2 * 2 -> 4 diff --git a/lib/simplifyExpression/index.js b/lib/simplifyExpression/index.js index ab919afb..d1d1ec80 100644 --- a/lib/simplifyExpression/index.js +++ b/lib/simplifyExpression/index.js @@ -1,7 +1,7 @@ const math = require('mathjs'); const stepThrough = require('./stepThrough'); -function simplifyExpressionString(expressionString, debug=false) { +function simplifyExpressionString(expressionString, debug=false, scope={}) { let exprNode; try { exprNode = math.parse(expressionString); @@ -10,7 +10,7 @@ function simplifyExpressionString(expressionString, debug=false) { return []; } if (exprNode) { - return stepThrough(exprNode, debug); + return stepThrough(exprNode, debug, scope); } return []; } diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js index d167e8b4..05426c66 100644 --- a/lib/simplifyExpression/substituteScopeSearch/index.js +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -1,5 +1,6 @@ -//const ChangeTypes = require('../../ChangeTypes'); +const math = require('mathjs'); const Node = require('../../node'); +const simplifyExpressionNode = require('../stepThrough'); const TreeSearch = require('../../TreeSearch'); // Searches through the tree, prioritizing deeper nodes, and substitutes @@ -8,10 +9,17 @@ const TreeSearch = require('../../TreeSearch'); const search = TreeSearch.postOrder(scopeSubstitution); function scopeSubstitution(node, scope) { - // eslint-disable-next-line - console.log(scope); if (Node.Type.isSymbol(node)) { - return Node.Status.noChange(node); + // iterate over scope, substituting any match with its respective value + // until there are no more matches. + const symbolName = node.name; + for (var symbol in scope) { + const exprNode = math.parse(scope[symbol]); + if (symbol === symbolName) { + simplifyExpressionNode(exprNode, false, scope); + break; + } + } } else { return Node.Status.noChange(node); diff --git a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js index dcda54a9..e8cc1b50 100644 --- a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js +++ b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js @@ -1,4 +1,4 @@ -const solveEquation = require('../../../lib/solveEquation'); +const simplifyExpression = require('../../../lib/simplifyExpression'); const scope = { x: 10, @@ -7,4 +7,4 @@ const scope = { baz: 'bar^2' }; -solveEquation('2x + 3x = 35', false, scope); \ No newline at end of file +simplifyExpression('2x + bar', false, scope); \ No newline at end of file From 9e225bde009a601cc8601d6ae8611ae76cc4084f Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Wed, 26 Jul 2017 09:25:13 -0400 Subject: [PATCH 03/11] First pass at pseudo-code for substitution --- lib/TreeSearch.js | 1 + lib/substitute.js | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 lib/substitute.js diff --git a/lib/TreeSearch.js b/lib/TreeSearch.js index 506cecaf..ca03fb34 100644 --- a/lib/TreeSearch.js +++ b/lib/TreeSearch.js @@ -34,6 +34,7 @@ function search(simplificationFunction, node, preOrder, scope={}) { } // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? else if (Node.Type.isSymbol(node)) { + // SUBSTITUTE return Node.Status.noChange(node); } else if (Node.Type.isUnaryMinus(node)) { diff --git a/lib/substitute.js b/lib/substitute.js new file mode 100644 index 00000000..2f2ee896 --- /dev/null +++ b/lib/substitute.js @@ -0,0 +1,7 @@ +// Create NodeScope = {} +// Create scopeSteps = {} +// For each symbol in scope: +// - steps = simplifyExpression(scope[symbol]) (returning steps) +// - if steps = [] then there was an error or no simplification possible +// - scopeSteps[symbol] = steps +// - NodeScope[symbol] = steps[steps.length].newNode \ No newline at end of file From c62a82d2af05994b625e44d1b253024d52c3bc6f Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Wed, 26 Jul 2017 15:14:34 -0400 Subject: [PATCH 04/11] SolveEquation and SimplifyExpression accept optional scope. New ChangeType of SUBSTITUTE_SCOPE_SYMBOL. --- example.js | 21 ++++++++++ lib/Substitute.js | 16 ++++++++ lib/TreeSearch.js | 3 +- lib/node/Status.js | 11 ++++++ lib/simplifyExpression/index.js | 4 +- lib/simplifyExpression/stepThrough.js | 3 +- .../substituteScopeSearch/index.js | 39 +++++++++++++------ lib/solveEquation/index.js | 5 ++- lib/substitute.js | 7 ---- subsExample.js | 32 +++++++++++++++ 10 files changed, 117 insertions(+), 24 deletions(-) create mode 100644 example.js create mode 100644 lib/Substitute.js delete mode 100644 lib/substitute.js create mode 100644 subsExample.js diff --git a/example.js b/example.js new file mode 100644 index 00000000..62d262d0 --- /dev/null +++ b/example.js @@ -0,0 +1,21 @@ +const solveEquation = require('./lib/solveEquation'); + +const scope = { + baz: '(bar^2)', + x: 10, + bar: '(foo + x)', + foo: 20, +}; + +const steps = solveEquation('2y = baz - x^2', false, scope); + +steps.forEach(step => { + // eslint-disable-next-line + console.log('before change: ' + step.oldEquation.print()); // before change: 2 x + 2 x + x + x + // eslint-disable-next-line + console.log('change: ' + step.changeType); // change: ADD_POLYNOMIAL_TERMS + // eslint-disable-next-line + console.log('after change: ' + step.newEquation.print()); // after change: 6 x + // eslint-disable-next-line + console.log('# of substeps: ' + step.substeps.length + '\n'); // # of substeps: 3 +}); \ No newline at end of file diff --git a/lib/Substitute.js b/lib/Substitute.js new file mode 100644 index 00000000..3d8290c0 --- /dev/null +++ b/lib/Substitute.js @@ -0,0 +1,16 @@ +function substituteScope(scope) { + const newScope = Object.assign({}, scope); + + for (var symbol in newScope) { + const targetVal = newScope[symbol].toString(); + for (var sym in newScope) { + const valStr = newScope[sym].toString(); + const replaced = valStr.replace(symbol, targetVal); + newScope[sym] = replaced; + } + } + + return newScope; +} + +module.exports = substituteScope; \ No newline at end of file diff --git a/lib/TreeSearch.js b/lib/TreeSearch.js index ca03fb34..eb5ef68a 100644 --- a/lib/TreeSearch.js +++ b/lib/TreeSearch.js @@ -34,8 +34,7 @@ function search(simplificationFunction, node, preOrder, scope={}) { } // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? else if (Node.Type.isSymbol(node)) { - // SUBSTITUTE - return Node.Status.noChange(node); + return simplificationFunction(node, scope); } else if (Node.Type.isUnaryMinus(node)) { status = search(simplificationFunction, node.args[0], preOrder, scope); diff --git a/lib/node/Status.js b/lib/node/Status.js index cc4440e5..09eab50c 100644 --- a/lib/node/Status.js +++ b/lib/node/Status.js @@ -116,6 +116,17 @@ Status.childChanged = function(node, childStatus, childArgIndex=null) { return step; }); } + else if (Type.isSymbol(node)) { + substeps = updateSubsteps(substeps, (step) => { + const oldNode = clone(node); + const newNode = clone(node); + oldNode.args[0] = step.oldNode; + newNode.args[0] = step.newNode; + step.oldNode = oldNode; + step.newNode = newNode; + return step; + }); + } else { throw Error('Unexpected node type: ' + node.type); } diff --git a/lib/simplifyExpression/index.js b/lib/simplifyExpression/index.js index d1d1ec80..6966b294 100644 --- a/lib/simplifyExpression/index.js +++ b/lib/simplifyExpression/index.js @@ -1,7 +1,9 @@ const math = require('mathjs'); const stepThrough = require('./stepThrough'); +const Substitute = require('../Substitute'); function simplifyExpressionString(expressionString, debug=false, scope={}) { + const newScope = Substitute(scope); let exprNode; try { exprNode = math.parse(expressionString); @@ -10,7 +12,7 @@ function simplifyExpressionString(expressionString, debug=false, scope={}) { return []; } if (exprNode) { - return stepThrough(exprNode, debug, scope); + return stepThrough(exprNode, debug, newScope); } return []; } diff --git a/lib/simplifyExpression/stepThrough.js b/lib/simplifyExpression/stepThrough.js index 51c26eca..38a4fb60 100644 --- a/lib/simplifyExpression/stepThrough.js +++ b/lib/simplifyExpression/stepThrough.js @@ -70,7 +70,8 @@ function step(node, scope={}) { const simplificationTreeSearches = [ // Basic simplifications that we always try first e.g. (...)^0 => 1 basicsSearch, - // Substitute in-scope values for their respective symbols. + // Substitute symbols present in the optional scope object with + // their respective expressions. substituteScopeSearch, // Simplify any division chains so there's at most one division operation. // e.g. 2/x/6 -> 2/(x*6) e.g. 2/(x/6) => 2 * 6/x diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js index 05426c66..17ffd956 100644 --- a/lib/simplifyExpression/substituteScopeSearch/index.js +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -1,6 +1,5 @@ -const math = require('mathjs'); +const ChangeTypes = require('../../ChangeTypes'); const Node = require('../../node'); -const simplifyExpressionNode = require('../stepThrough'); const TreeSearch = require('../../TreeSearch'); // Searches through the tree, prioritizing deeper nodes, and substitutes @@ -10,15 +9,33 @@ const search = TreeSearch.postOrder(scopeSubstitution); function scopeSubstitution(node, scope) { if (Node.Type.isSymbol(node)) { - // iterate over scope, substituting any match with its respective value - // until there are no more matches. - const symbolName = node.name; - for (var symbol in scope) { - const exprNode = math.parse(scope[symbol]); - if (symbol === symbolName) { - simplifyExpressionNode(exprNode, false, scope); - break; - } + return substituteAndSimplifySymbols(node, scope); + } + else { + return Node.Status.noChange(node); + } +} + +// SUBSTITUTES +// Returns a Node.Status object with substeps +function substituteAndSimplifySymbols(node, scope) { + if (!Node.Type.isSymbol(node)) { + return Node.Status.noChange(node); + } + + const symbolName = node.name; + if (scope.hasOwnProperty(symbolName)) { + const simplifyExpression = require('../../simplifyExpression'); + const substeps = simplifyExpression(scope[symbolName]); + if (substeps.length === 0) { + const newNode = Node.Creator.constant(Number(scope[symbolName])); + return Node.Status.nodeChanged( + ChangeTypes.SUBSTITUTE_SCOPE_SYMBOL, node, newNode); + } + else { + const newNode = substeps.slice(-1)[0].newNode; + return Node.Status.nodeChanged( + ChangeTypes.SUBSTITUTE_SCOPE_SYMBOL, node, newNode, false, substeps); } } else { diff --git a/lib/solveEquation/index.js b/lib/solveEquation/index.js index fdff7c24..7442719f 100644 --- a/lib/solveEquation/index.js +++ b/lib/solveEquation/index.js @@ -1,8 +1,9 @@ const math = require('mathjs'); - const stepThrough = require('./stepThrough'); +const Substitute = require('../Substitute'); function solveEquationString(equationString, debug=false, scope={}) { + const newScope = Substitute(scope); const comparators = ['<=', '>=', '=', '<', '>']; for (let i = 0; i < comparators.length; i++) { @@ -27,7 +28,7 @@ function solveEquationString(equationString, debug=false, scope={}) { return []; } if (leftNode && rightNode) { - return stepThrough(leftNode, rightNode, comparator, debug, scope); + return stepThrough(leftNode, rightNode, comparator, debug, newScope); } } diff --git a/lib/substitute.js b/lib/substitute.js deleted file mode 100644 index 2f2ee896..00000000 --- a/lib/substitute.js +++ /dev/null @@ -1,7 +0,0 @@ -// Create NodeScope = {} -// Create scopeSteps = {} -// For each symbol in scope: -// - steps = simplifyExpression(scope[symbol]) (returning steps) -// - if steps = [] then there was an error or no simplification possible -// - scopeSteps[symbol] = steps -// - NodeScope[symbol] = steps[steps.length].newNode \ No newline at end of file diff --git a/subsExample.js b/subsExample.js new file mode 100644 index 00000000..9e237134 --- /dev/null +++ b/subsExample.js @@ -0,0 +1,32 @@ +const math = require('mathjs'); + +const scope = { + baz: '(bar^2)', + x: 10, + bar: '(foo + x)', + foo: 20, +}; + +function substituteScope(scope) { + const newScope = Object.assign({}, scope); + + for (var symbol in newScope) { + const targetVal = newScope[symbol].toString(); + for (var sym in newScope) { + const valStr = newScope[sym].toString(); + const replaced = valStr.replace(symbol, targetVal); + newScope[sym] = replaced; + } + } + + return newScope; +} + +// eslint-disable-next-line +console.log(substituteScope(scope)); + +const newScope = substituteScope(scope); +for (var symbol in newScope) { + // eslint-disable-next-line + console.log(math.eval(newScope[symbol])); +} \ No newline at end of file From 1219478ca223a871c3b1673488c751214c789e09 Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Wed, 26 Jul 2017 15:26:15 -0400 Subject: [PATCH 05/11] Add equation unit test for substitution of symbols --- example.js | 21 --------------------- test/solveEquation/solveEquation.test.js | 8 +++++--- 2 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 example.js diff --git a/example.js b/example.js deleted file mode 100644 index 62d262d0..00000000 --- a/example.js +++ /dev/null @@ -1,21 +0,0 @@ -const solveEquation = require('./lib/solveEquation'); - -const scope = { - baz: '(bar^2)', - x: 10, - bar: '(foo + x)', - foo: 20, -}; - -const steps = solveEquation('2y = baz - x^2', false, scope); - -steps.forEach(step => { - // eslint-disable-next-line - console.log('before change: ' + step.oldEquation.print()); // before change: 2 x + 2 x + x + x - // eslint-disable-next-line - console.log('change: ' + step.changeType); // change: ADD_POLYNOMIAL_TERMS - // eslint-disable-next-line - console.log('after change: ' + step.newEquation.print()); // after change: 6 x - // eslint-disable-next-line - console.log('# of substeps: ' + step.substeps.length + '\n'); // # of substeps: 3 -}); \ No newline at end of file diff --git a/test/solveEquation/solveEquation.test.js b/test/solveEquation/solveEquation.test.js index 6788e603..446982cc 100644 --- a/test/solveEquation/solveEquation.test.js +++ b/test/solveEquation/solveEquation.test.js @@ -5,8 +5,8 @@ const solveEquation = require('../../lib/solveEquation'); const NO_STEPS = 'no-steps'; -function testSolve(equationString, outputStr, debug=false) { - const steps = solveEquation(equationString, debug); +function testSolve(equationString, outputStr, debug=false, scope={}) { + const steps = solveEquation(equationString, debug, scope); let lastStep; if (steps.length === 0) { lastStep = NO_STEPS; @@ -96,6 +96,8 @@ describe('solveEquation for =', function () { ['2/(1 + 1 + 4x) = 1/3', 'x = 1'], ['(3 + x) / (x^2 + 3) = 1', 'x = [0, 1]'], ['6/x + 8/(2x) = 10', 'x = 1'], + // Use of nested scope (i.e., baz depends on bar) + ['2y = baz - x^2', 'y = 400', false, {baz: '(bar^2)', x: 10, bar: '(foo + x)', foo: 20 }] // TODO: fix these cases, fail because lack of factoring support, for complex #s, // for taking the sqrt of both sides, etc // ['(x + y) (y + 2) = 0', 'y = -y'], @@ -111,7 +113,7 @@ describe('solveEquation for =', function () { // this gives us 6.3995 when it should actually be 6.4 :( // ['x - 3.4= ( x - 2.5)/( 1.3)', 'x = 6.4'] ]; - tests.forEach(t => testSolve(t[0], t[1], t[2])); + tests.forEach(t => testSolve(t[0], t[1], t[2], t[3])); }); describe('solveEquation for non = comparators', function() { From 633522fe75fe6446dd5d42099defe4a10fd8e9ef Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Wed, 26 Jul 2017 15:27:22 -0400 Subject: [PATCH 06/11] Remove leftover example file --- subsExample.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 subsExample.js diff --git a/subsExample.js b/subsExample.js deleted file mode 100644 index 9e237134..00000000 --- a/subsExample.js +++ /dev/null @@ -1,32 +0,0 @@ -const math = require('mathjs'); - -const scope = { - baz: '(bar^2)', - x: 10, - bar: '(foo + x)', - foo: 20, -}; - -function substituteScope(scope) { - const newScope = Object.assign({}, scope); - - for (var symbol in newScope) { - const targetVal = newScope[symbol].toString(); - for (var sym in newScope) { - const valStr = newScope[sym].toString(); - const replaced = valStr.replace(symbol, targetVal); - newScope[sym] = replaced; - } - } - - return newScope; -} - -// eslint-disable-next-line -console.log(substituteScope(scope)); - -const newScope = substituteScope(scope); -for (var symbol in newScope) { - // eslint-disable-next-line - console.log(math.eval(newScope[symbol])); -} \ No newline at end of file From 6effc8bc3f8f79538377735d36d5ff0e979ee7fb Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Thu, 27 Jul 2017 07:29:42 -0400 Subject: [PATCH 07/11] Revise gitignore, remove some unused code --- .gitignore | 2 ++ lib/node/Status.js | 11 ----------- lib/simplifyExpression/substituteScopeSearch/index.js | 1 + .../substituteScopeSearch.test.js | 10 ---------- 4 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js diff --git a/.gitignore b/.gitignore index 6a48e0fb..fd273e3e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ node_modules *.log .DS_Store .idea +yarn.lock +./.vscode \ No newline at end of file diff --git a/lib/node/Status.js b/lib/node/Status.js index 09eab50c..cc4440e5 100644 --- a/lib/node/Status.js +++ b/lib/node/Status.js @@ -116,17 +116,6 @@ Status.childChanged = function(node, childStatus, childArgIndex=null) { return step; }); } - else if (Type.isSymbol(node)) { - substeps = updateSubsteps(substeps, (step) => { - const oldNode = clone(node); - const newNode = clone(node); - oldNode.args[0] = step.oldNode; - newNode.args[0] = step.newNode; - step.oldNode = oldNode; - step.newNode = newNode; - return step; - }); - } else { throw Error('Unexpected node type: ' + node.type); } diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js index 17ffd956..54fa403f 100644 --- a/lib/simplifyExpression/substituteScopeSearch/index.js +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -25,6 +25,7 @@ function substituteAndSimplifySymbols(node, scope) { const symbolName = node.name; if (scope.hasOwnProperty(symbolName)) { + // when declared at top, kept getting TypeError: ___ is not a function const simplifyExpression = require('../../simplifyExpression'); const substeps = simplifyExpression(scope[symbolName]); if (substeps.length === 0) { diff --git a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js deleted file mode 100644 index e8cc1b50..00000000 --- a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const simplifyExpression = require('../../../lib/simplifyExpression'); - -const scope = { - x: 10, - foo: 20, - bar: 'foo + x', - baz: 'bar^2' -}; - -simplifyExpression('2x + bar', false, scope); \ No newline at end of file From b382470b0721a7a0ff8b6d10cf789d3251332998 Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Thu, 27 Jul 2017 07:37:30 -0400 Subject: [PATCH 08/11] Revised gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fd273e3e..68cd68de 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ node_modules *.log .DS_Store .idea -yarn.lock -./.vscode \ No newline at end of file +settings.json +.vscode/ \ No newline at end of file From de2fa8e88b9be4c7d73b9d3acc6c944e8aedaf74 Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Thu, 27 Jul 2017 07:41:05 -0400 Subject: [PATCH 09/11] Delete .vscode folder --- .gitignore | 4 +--- .vscode/settings.json | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 68cd68de..4031d39a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,4 @@ node_modules *.log .DS_Store -.idea -settings.json -.vscode/ \ No newline at end of file +.idea \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 20af2f68..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ -} \ No newline at end of file From 921585d782a98c7034c00910da22fecc0f8669fa Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Fri, 4 Aug 2017 12:19:57 -0400 Subject: [PATCH 10/11] End of line sequence revisions --- .gitignore | 8 +- lib/TreeSearch.js | 9 +- .../substituteScopeSearch/index.js | 9 +- test/solveEquation/solveEquation.test.js | 15 +- yarn.lock | 1902 ++++++++--------- 5 files changed, 982 insertions(+), 961 deletions(-) diff --git a/.gitignore b/.gitignore index 4031d39a..44cf3bbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -*swp -node_modules -*.log -.DS_Store +*swp +node_modules +*.log +.DS_Store .idea \ No newline at end of file diff --git a/lib/TreeSearch.js b/lib/TreeSearch.js index eb5ef68a..c6dc6f36 100644 --- a/lib/TreeSearch.js +++ b/lib/TreeSearch.js @@ -32,16 +32,17 @@ function search(simplificationFunction, node, preOrder, scope={}) { if (Node.Type.isConstant(node)) { return Node.Status.noChange(node); } - // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? - else if (Node.Type.isSymbol(node)) { - return simplificationFunction(node, scope); - } + // Moved isUnaryMinus check above Symbol check to address symbol nested inside unaryminus else if (Node.Type.isUnaryMinus(node)) { status = search(simplificationFunction, node.args[0], preOrder, scope); if (status.hasChanged()) { return Node.Status.childChanged(node, status); } } + // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? + else if (Node.Type.isSymbol(node)) { + return simplificationFunction(node, scope); + } else if (Node.Type.isOperator(node) || Node.Type.isFunction(node)) { for (let i = 0; i < node.args.length; i++) { const child = node.args[i]; diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js index 54fa403f..bb9a236c 100644 --- a/lib/simplifyExpression/substituteScopeSearch/index.js +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -23,7 +23,14 @@ function substituteAndSimplifySymbols(node, scope) { return Node.Status.noChange(node); } - const symbolName = node.name; + let symbolName; + if (node.type === 'SymbolNode') { + symbolName = node.name; + } + else if (Node.Type.isUnaryMinus(node)) { + symbolName = node.args[0].name; + } + if (scope.hasOwnProperty(symbolName)) { // when declared at top, kept getting TypeError: ___ is not a function const simplifyExpression = require('../../simplifyExpression'); diff --git a/test/solveEquation/solveEquation.test.js b/test/solveEquation/solveEquation.test.js index 446982cc..21dfc8f1 100644 --- a/test/solveEquation/solveEquation.test.js +++ b/test/solveEquation/solveEquation.test.js @@ -97,7 +97,20 @@ describe('solveEquation for =', function () { ['(3 + x) / (x^2 + 3) = 1', 'x = [0, 1]'], ['6/x + 8/(2x) = 10', 'x = 1'], // Use of nested scope (i.e., baz depends on bar) - ['2y = baz - x^2', 'y = 400', false, {baz: '(bar^2)', x: 10, bar: '(foo + x)', foo: 20 }] + ['2y = baz - x^2', 'y = 400', false, {baz: '(bar^2)', x: 10, bar: '(foo + x)', foo: 20 }], + // Symbol nested inside UnaryMinus node type + ['y = GrossVal * (1 - (FeePct + CCPct)) - TransferFee', 'y = 11471675.7525', false, + { + CCPct: 0.015, + FeePct: 0.05, + GrossVal: 'TotalSales * Margin * Multiple', + Margin: 0.15, + Multiple: 10, + PreTaxNetVal: 'GrossVal * (1 - (FeePct + CCPct)) - TransferFee', + TotalSales: 8239341, + TransferFee: 84000, + } + ] // TODO: fix these cases, fail because lack of factoring support, for complex #s, // for taking the sqrt of both sides, etc // ['(x + y) (y + 2) = 0', 'y = -y'], diff --git a/yarn.lock b/yarn.lock index b55264f4..300d5f31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,951 +1,951 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" - -ajv-keywords@^1.0.0: - 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.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -babel-code-frame@^6.16.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -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 "^1.0.0" - concat-map "0.0.1" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - dependencies: - restore-cursor "^1.0.1" - -cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -commander@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06" - -commander@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" - -complex.js@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/complex.js/-/complex.js-2.0.1.tgz#ea90c7a05aeceaf3a376d2c0f6a78421727d6879" - -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.5.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - -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.1.1: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - -decimal.js@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-7.1.1.tgz#1adcad7d70d7a91c426d756f1eb6566c3be6cbcf" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -diff@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" - -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" - -es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.24" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.24.tgz#a55877c9924bc0c8d9bd3c2cbe17495ac1709b14" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-symbol "^3.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -escape-string-regexp@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" - -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" - -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-config-google@^0.7.0: - version "0.7.1" - resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.7.1.tgz#5598f8498e9e078420f34b80495b8d959f651fb2" - -eslint-plugin-sort-requires@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-sort-requires/-/eslint-plugin-sort-requires-2.1.0.tgz#3efad948dc83798219e809f54067c40e55444861" - -eslint@^3.10.2: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" - dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" - doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" - 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" - imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" - levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" - 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" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" - -espree@^3.4.0: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" - dependencies: - acorn "^5.0.1" - acorn-jsx "^3.0.0" - -esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -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.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" - dependencies: - estraverse "^4.1.0" - object-assign "^4.0.1" - -estraverse@^4.0.0, estraverse@^4.1.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" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -flat-cache@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -fraction.js@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.0.0.tgz#73974e2f8b51ef709536d624cc90782e2bb61274" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -glob@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467" - dependencies: - graceful-fs "~2.0.0" - inherits "2" - minimatch "~0.2.11" - -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: - 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.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.14.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" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -graceful-fs@~2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0" - -growl@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.8.1.tgz#4b2dec8d907e93db336624dcec0183502f8c9428" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -ignore@^3.2.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" - dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - figures "^1.3.5" - lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - -interpret@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-my-json-valid@^2.10.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-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" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" - dependencies: - path-is-inside "^1.0.1" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-resolvable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" - dependencies: - tryit "^1.0.1" - -isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -jade@0.26.3: - version "0.26.3" - resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c" - dependencies: - commander "0.6.1" - mkdirp "0.3.0" - -js-tokens@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - -js-yaml@^3.5.1: - version "3.9.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-stable-stringify@^1.0.0, 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: - jsonify "~0.0.0" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lodash@^4.0.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -lru-cache@2: - version "2.7.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" - -mathjs@3.11.2: - version "3.11.2" - resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-3.11.2.tgz#d2ca723d7e9254cc58d1421a5a61d8cfac8ff642" - dependencies: - complex.js "2.0.1" - decimal.js "7.1.1" - fraction.js "4.0.0" - seed-random "2.2.0" - tiny-emitter "1.0.2" - typed-function "0.10.5" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimatch@~0.2.11: - version "0.2.14" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" - dependencies: - lru-cache "2" - sigmund "~1.0.0" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" - -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -mocha@2.4.5: - version "2.4.5" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.4.5.tgz#151768dd2875eb51bc8295e9800026e9f2bb398f" - dependencies: - commander "2.3.0" - debug "2.2.0" - diff "1.4.0" - escape-string-regexp "1.0.2" - glob "3.2.3" - growl "1.8.1" - jade "0.26.3" - mkdirp "0.5.1" - supports-color "1.2.0" - -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" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -once@^1.3.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" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -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: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - -readable-stream@^2.2.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - safe-buffer "~5.1.1" - string_decoder "~1.0.3" - util-deprecate "~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" - -require-uncached@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - -resolve@^1.1.6: - 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" - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -rimraf@^2.2.8: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" - dependencies: - glob "^7.0.5" - -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" - dependencies: - once "^1.3.0" - -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.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - -seed-random@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54" - -shelljs@^0.7.5: - version "0.7.8" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -sigmund@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^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" - -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@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -tiny-emitter@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-1.0.2.tgz#8e49470d3f55f89e247210368a6bb9fb51aa1601" - -tryit@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typed-function@0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-0.10.5.tgz#2e0f18abd065219fab694a446a65c6d1981832c0" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -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" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" + +ajv-keywords@^1.0.0: + 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.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +babel-code-frame@^6.16.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +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 "^1.0.0" + concat-map "0.0.1" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +commander@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06" + +commander@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" + +complex.js@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/complex.js/-/complex.js-2.0.1.tgz#ea90c7a05aeceaf3a376d2c0f6a78421727d6879" + +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.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +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.1.1: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decimal.js@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-7.1.1.tgz#1adcad7d70d7a91c426d756f1eb6566c3be6cbcf" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +diff@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" + +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" + +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.24" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.24.tgz#a55877c9924bc0c8d9bd3c2cbe17495ac1709b14" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" + +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" + +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-config-google@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.7.1.tgz#5598f8498e9e078420f34b80495b8d959f651fb2" + +eslint-plugin-sort-requires@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sort-requires/-/eslint-plugin-sort-requires-2.1.0.tgz#3efad948dc83798219e809f54067c40e55444861" + +eslint@^3.10.2: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + 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" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + 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" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" + dependencies: + acorn "^5.0.1" + acorn-jsx "^3.0.0" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +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.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.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" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +fraction.js@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.0.0.tgz#73974e2f8b51ef709536d624cc90782e2bb61274" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +glob@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467" + dependencies: + graceful-fs "~2.0.0" + inherits "2" + minimatch "~0.2.11" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: + 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.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.14.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" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +graceful-fs@~2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0" + +growl@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.8.1.tgz#4b2dec8d907e93db336624dcec0183502f8c9428" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +ignore@^3.2.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-my-json-valid@^2.10.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-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" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +jade@0.26.3: + version "0.26.3" + resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c" + dependencies: + commander "0.6.1" + mkdirp "0.3.0" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.5.1: + version "3.9.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-stable-stringify@^1.0.0, 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: + jsonify "~0.0.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash@^4.0.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +mathjs@3.11.2: + version "3.11.2" + resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-3.11.2.tgz#d2ca723d7e9254cc58d1421a5a61d8cfac8ff642" + dependencies: + complex.js "2.0.1" + decimal.js "7.1.1" + fraction.js "4.0.0" + seed-random "2.2.0" + tiny-emitter "1.0.2" + typed-function "0.10.5" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@~0.2.11: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@2.4.5: + version "2.4.5" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.4.5.tgz#151768dd2875eb51bc8295e9800026e9f2bb398f" + dependencies: + commander "2.3.0" + debug "2.2.0" + diff "1.4.0" + escape-string-regexp "1.0.2" + glob "3.2.3" + growl "1.8.1" + jade "0.26.3" + mkdirp "0.5.1" + supports-color "1.2.0" + +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" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +once@^1.3.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" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +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: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +readable-stream@^2.2.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~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" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@^1.1.6: + 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" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +rimraf@^2.2.8: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +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.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +seed-random@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54" + +shelljs@^0.7.5: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^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" + +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@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tiny-emitter@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-1.0.2.tgz#8e49470d3f55f89e247210368a6bb9fb51aa1601" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typed-function@0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-0.10.5.tgz#2e0f18abd065219fab694a446a65c6d1981832c0" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +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" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xtend@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From c18ba6c57bc6651ec37c179a761d4c51e52f2f4e Mon Sep 17 00:00:00 2001 From: Ephs05msm Date: Thu, 10 Aug 2017 18:06:01 -0400 Subject: [PATCH 11/11] Make debug last arg in simplify and solve, replace 'scope' arg with options, add documentation, begin breaking out substituteScope tests --- .gitignore | 2 +- lib/Substitute.js | 16 ------ lib/TreeSearch.js | 28 +++++----- lib/simplifyExpression/index.js | 11 ++-- lib/simplifyExpression/stepThrough.js | 11 ++-- .../substituteScopeSearch/index.js | 16 ++++-- lib/solveEquation/index.js | 12 +++-- lib/solveEquation/stepThrough.js | 20 ++++---- lib/substituteScope.js | 24 +++++++++ .../substituteScopeSearch.test.js | 51 +++++++++++++++++++ test/solveEquation/solveEquation.test.js | 21 ++------ 11 files changed, 136 insertions(+), 76 deletions(-) delete mode 100644 lib/Substitute.js create mode 100644 lib/substituteScope.js create mode 100644 test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js diff --git a/.gitignore b/.gitignore index 44cf3bbd..2c8c5dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules *.log .DS_Store -.idea \ No newline at end of file +.idea diff --git a/lib/Substitute.js b/lib/Substitute.js deleted file mode 100644 index 3d8290c0..00000000 --- a/lib/Substitute.js +++ /dev/null @@ -1,16 +0,0 @@ -function substituteScope(scope) { - const newScope = Object.assign({}, scope); - - for (var symbol in newScope) { - const targetVal = newScope[symbol].toString(); - for (var sym in newScope) { - const valStr = newScope[sym].toString(); - const replaced = valStr.replace(symbol, targetVal); - newScope[sym] = replaced; - } - } - - return newScope; -} - -module.exports = substituteScope; \ No newline at end of file diff --git a/lib/TreeSearch.js b/lib/TreeSearch.js index c6dc6f36..cf05d18a 100644 --- a/lib/TreeSearch.js +++ b/lib/TreeSearch.js @@ -5,25 +5,25 @@ const TreeSearch = {}; // Returns a function that performs a preorder search on the tree for the given // simplification function TreeSearch.preOrder = function(simplificationFunction) { - return function (node, scope={}) { - return search(simplificationFunction, node, true, scope); + return function (node, options={}) { + return search(simplificationFunction, node, true, options); }; }; // Returns a function that performs a postorder search on the tree for the given // simplification function TreeSearch.postOrder = function(simplificationFunction) { - return function (node, scope={}) { - return search(simplificationFunction, node, false, scope); + return function (node, options={}) { + return search(simplificationFunction, node, false, options); }; }; // A helper function for performing a tree search with a function -function search(simplificationFunction, node, preOrder, scope={}) { +function search(simplificationFunction, node, preOrder, options={}) { let status; if (preOrder) { - status = simplificationFunction(node, scope); + status = simplificationFunction(node, options); if (status.hasChanged()) { return status; } @@ -32,28 +32,30 @@ function search(simplificationFunction, node, preOrder, scope={}) { if (Node.Type.isConstant(node)) { return Node.Status.noChange(node); } - // Moved isUnaryMinus check above Symbol check to address symbol nested inside unaryminus + // Check isUnaryMinus before Symbol because symbols nested inside unaryMinus + // (e.g., 2x - symbol) need to be subtracted from the expression. Checking + // symbol first causes the symbol to be added. else if (Node.Type.isUnaryMinus(node)) { - status = search(simplificationFunction, node.args[0], preOrder, scope); + status = search(simplificationFunction, node.args[0], preOrder, options); if (status.hasChanged()) { return Node.Status.childChanged(node, status); } } - // Break out isSymbol test and add a changeType for SUBSTITUTE_SYMBOL? + // symbols can be simplified through variable substitution else if (Node.Type.isSymbol(node)) { - return simplificationFunction(node, scope); + return simplificationFunction(node, options); } else if (Node.Type.isOperator(node) || Node.Type.isFunction(node)) { for (let i = 0; i < node.args.length; i++) { const child = node.args[i]; - const childNodeStatus = search(simplificationFunction, child, preOrder, scope); + const childNodeStatus = search(simplificationFunction, child, preOrder, options); if (childNodeStatus.hasChanged()) { return Node.Status.childChanged(node, childNodeStatus, i); } } } else if (Node.Type.isParenthesis(node)) { - status = search(simplificationFunction, node.content, preOrder, scope); + status = search(simplificationFunction, node.content, preOrder, options); if (status.hasChanged()) { return Node.Status.childChanged(node, status); } @@ -63,7 +65,7 @@ function search(simplificationFunction, node, preOrder, scope={}) { } if (!preOrder) { - return simplificationFunction(node, scope); + return simplificationFunction(node, options); } else { return Node.Status.noChange(node); diff --git a/lib/simplifyExpression/index.js b/lib/simplifyExpression/index.js index 6966b294..efe3cdb0 100644 --- a/lib/simplifyExpression/index.js +++ b/lib/simplifyExpression/index.js @@ -1,9 +1,12 @@ const math = require('mathjs'); const stepThrough = require('./stepThrough'); -const Substitute = require('../Substitute'); +const Substitute = require('../substituteScope'); + +function simplifyExpressionString(expressionString, options={}, debug=false) { + const newOptions = Object.assign({}, options); + const newScope = Substitute(options.scope); + newOptions.scope = newScope; -function simplifyExpressionString(expressionString, debug=false, scope={}) { - const newScope = Substitute(scope); let exprNode; try { exprNode = math.parse(expressionString); @@ -12,7 +15,7 @@ function simplifyExpressionString(expressionString, debug=false, scope={}) { return []; } if (exprNode) { - return stepThrough(exprNode, debug, newScope); + return stepThrough(exprNode, newOptions, debug); } return []; } diff --git a/lib/simplifyExpression/stepThrough.js b/lib/simplifyExpression/stepThrough.js index a1a0807e..176f1b2f 100644 --- a/lib/simplifyExpression/stepThrough.js +++ b/lib/simplifyExpression/stepThrough.js @@ -20,7 +20,7 @@ const removeUnnecessaryParens = require('../util/removeUnnecessaryParens'); // Given a mathjs expression node, steps through simplifying the expression. // Returns a list of details about each step. -function stepThrough(node, debug=false, scope={}) { +function stepThrough(node, options={}, debug=false) { if (debug) { // eslint-disable-next-line console.log('\n\nSimplifying: ' + print.ascii(node, false, true)); @@ -38,7 +38,7 @@ function stepThrough(node, debug=false, scope={}) { let iters = 0; // Now, step through the math expression until nothing changes - nodeStatus = step(node, scope); + nodeStatus = step(node, options); while (nodeStatus.hasChanged()) { if (debug) { logSteps(nodeStatus); @@ -46,7 +46,7 @@ function stepThrough(node, debug=false, scope={}) { steps.push(removeUnnecessaryParensInStep(nodeStatus)); node = Status.resetChangeGroups(nodeStatus.newNode); - nodeStatus = step(node, scope); + nodeStatus = step(node, options); if (iters++ === MAX_STEP_COUNT) { // eslint-disable-next-line @@ -61,7 +61,7 @@ function stepThrough(node, debug=false, scope={}) { // Given a mathjs expression node, performs a single step to simplify the // expression. Returns a Node.Status object. -function step(node, scope={}) { +function step(node, options={}) { let nodeStatus; node = flattenOperands(node); @@ -72,6 +72,7 @@ function step(node, scope={}) { basicsSearch, // Substitute symbols present in the optional scope object with // their respective expressions. + // e.g., given options: { scope: { x: 10, y: 20 } }, x + y => 10 + 20 substituteScopeSearch, // Simplify any division chains so there's at most one division operation. // e.g. 2/x/6 -> 2/(x*6) e.g. 2/(x/6) => 2 * 6/x @@ -95,7 +96,7 @@ function step(node, scope={}) { ]; for (let i = 0; i < simplificationTreeSearches.length; i++) { - nodeStatus = simplificationTreeSearches[i](node, scope); + nodeStatus = simplificationTreeSearches[i](node, options); // Always update node, since there might be changes that didn't count as // a step. Remove unnecessary parens, in case one a step results in more // parens than needed. diff --git a/lib/simplifyExpression/substituteScopeSearch/index.js b/lib/simplifyExpression/substituteScopeSearch/index.js index bb9a236c..b736ca23 100644 --- a/lib/simplifyExpression/substituteScopeSearch/index.js +++ b/lib/simplifyExpression/substituteScopeSearch/index.js @@ -7,9 +7,9 @@ const TreeSearch = require('../../TreeSearch'); // Returns a Node.Status object. const search = TreeSearch.postOrder(scopeSubstitution); -function scopeSubstitution(node, scope) { +function scopeSubstitution(node, options={}) { if (Node.Type.isSymbol(node)) { - return substituteAndSimplifySymbols(node, scope); + return substituteAndSimplifySymbols(node, options); } else { return Node.Status.noChange(node); @@ -18,7 +18,11 @@ function scopeSubstitution(node, scope) { // SUBSTITUTES // Returns a Node.Status object with substeps -function substituteAndSimplifySymbols(node, scope) { +function substituteAndSimplifySymbols(node, options={}) { + if (!options.hasOwnProperty('scope')) { + return Node.Status.noChange(node); + } + if (!Node.Type.isSymbol(node)) { return Node.Status.noChange(node); } @@ -31,8 +35,10 @@ function substituteAndSimplifySymbols(node, scope) { symbolName = node.args[0].name; } + const scope = options.scope; if (scope.hasOwnProperty(symbolName)) { - // when declared at top, kept getting TypeError: ___ is not a function + // when declared at top, kept getting + // TypeError: is not a function const simplifyExpression = require('../../simplifyExpression'); const substeps = simplifyExpression(scope[symbolName]); if (substeps.length === 0) { @@ -51,4 +57,4 @@ function substituteAndSimplifySymbols(node, scope) { } } -module.exports = search; \ No newline at end of file +module.exports = search; diff --git a/lib/solveEquation/index.js b/lib/solveEquation/index.js index 7442719f..a486388a 100644 --- a/lib/solveEquation/index.js +++ b/lib/solveEquation/index.js @@ -1,9 +1,12 @@ const math = require('mathjs'); const stepThrough = require('./stepThrough'); -const Substitute = require('../Substitute'); +const Substitute = require('../substituteScope'); + +function solveEquationString(equationString, options={}, debug=false) { + const newOptions = Object.assign({}, options); + const newScope = Substitute(options.scope); + newOptions.scope = newScope; -function solveEquationString(equationString, debug=false, scope={}) { - const newScope = Substitute(scope); const comparators = ['<=', '>=', '=', '<', '>']; for (let i = 0; i < comparators.length; i++) { @@ -28,7 +31,8 @@ function solveEquationString(equationString, debug=false, scope={}) { return []; } if (leftNode && rightNode) { - return stepThrough(leftNode, rightNode, comparator, debug, newScope); + return stepThrough(leftNode, rightNode, + comparator, newOptions, debug); } } diff --git a/lib/solveEquation/stepThrough.js b/lib/solveEquation/stepThrough.js index 1c25aba4..42d4bac2 100644 --- a/lib/solveEquation/stepThrough.js +++ b/lib/solveEquation/stepThrough.js @@ -23,8 +23,8 @@ const COMPARATOR_TO_FUNCTION = { // the solution. Possible solutions include: // - solving for a variable (e.g. 'x=3' for '3x=4+5') // - the result of comparing values (e.g. 'true' for 3 = 3, 'false' for 3 < 2) -function stepThrough(leftNode, rightNode, comparator, debug=false, scope={}) { - let equation = new Equation(leftNode, rightNode, comparator, scope); +function stepThrough(leftNode, rightNode, comparator, options={}, debug=false) { + let equation = new Equation(leftNode, rightNode, comparator); if (debug) { // eslint-disable-next-line @@ -40,7 +40,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false, scope={}) { const symbolSet = Symbols.getSymbolsInEquation(equation); if (symbolSet.size === 0) { - return solveConstantEquation(equation, debug, [], scope); + return solveConstantEquation(equation, debug, [], options); } const symbolName = symbolSet.values().next().value; @@ -68,7 +68,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false, scope={}) { // Step through the math equation until nothing changes do { - steps = addSimplificationSteps(steps, equation, debug, scope); + steps = addSimplificationSteps(steps, equation, options, debug); if (steps.length > 0) { const lastStep = steps[steps.length - 1]; @@ -81,7 +81,7 @@ function stepThrough(leftNode, rightNode, comparator, debug=false, scope={}) { // at this point, the symbols might have cancelled out. if (Symbols.getSymbolsInEquation(equation).size === 0) { - return solveConstantEquation(equation, debug, steps, scope); + return solveConstantEquation(equation, debug, steps, options); } // The left side of the equation is either factored or simplified. @@ -237,14 +237,14 @@ function getSolutionsAndSymbol (equation) { // Given an equation of constants, will simplify both sides, returning // the steps and the result of the equation e.g. 'True' or 'False' -function solveConstantEquation(equation, debug, steps=[], scope={}) { +function solveConstantEquation(equation, debug, steps=[], options={}) { const compareFunction = COMPARATOR_TO_FUNCTION[equation.comparator]; if (!compareFunction) { throw Error('Unexpected comparator'); } - steps = addSimplificationSteps(steps, equation, debug, scope); + steps = addSimplificationSteps(steps, equation, options, debug); if (steps.length > 0) { const lastStep = steps[steps.length - 1]; equation = Equation.createEquationFromString( @@ -307,7 +307,7 @@ function step(equation, symbolName) { } // Simplifies the equation and returns the simplification steps -function addSimplificationSteps(steps, equation, debug=false, scope={}) { +function addSimplificationSteps(steps, equation, options={}, debug=false) { let oldEquation = equation.clone(); /* @@ -321,7 +321,7 @@ function addSimplificationSteps(steps, equation, debug=false, scope={}) { e.g. x + 4 + 2 = 0 <- simplify the left side e.g. 0 = x^2 + 3x + 2 -> x^2 + 3x + 2 = 0 <- swap to the left side */ - const leftSimplifySteps = simplifyExpressionNode(equation.leftNode, false, scope); + const leftSimplifySteps = simplifyExpressionNode(equation.leftNode, options, false); const simplifiedLeftNode = leftSimplifySteps.length !== 0 ? leftSimplifySteps.slice(-1)[0].newNode : equation.leftNode; @@ -369,7 +369,7 @@ function addSimplificationSteps(steps, equation, debug=false, scope={}) { // (ie the "before" of the before and after) for simplifying the right side. oldEquation = equation.clone(); - const rightSteps = simplifyExpressionNode(equation.rightNode, false, scope); + const rightSteps = simplifyExpressionNode(equation.rightNode, options, false); const rightSubSteps = []; for (let i = 0; i < rightSteps.length; i++) { diff --git a/lib/substituteScope.js b/lib/substituteScope.js new file mode 100644 index 00000000..4c333c0e --- /dev/null +++ b/lib/substituteScope.js @@ -0,0 +1,24 @@ +function substituteScope(scope) { + // create a copy of the provided scope + const newScope = Object.assign({}, scope); + + // iterate over symbols + for (var symbol in newScope) { + // store the symbol's current value in a variable + const targetVal = newScope[symbol].toString(); + // iterate through scope (again) + for (var sym in newScope) { + // extract the value of a symbol as a string + const valStr = newScope[sym].toString(); + // within the stored value, replace symbol (from the outer loop) + // with its respective value + const replaced = valStr.replace(symbol, targetVal); + // store the substituted value in the new scope under the same symbol + newScope[sym] = replaced; + } + } + + return newScope; +} + +module.exports = substituteScope; diff --git a/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js new file mode 100644 index 00000000..df38ae4b --- /dev/null +++ b/test/simplifyExpression/substituteScopeSearch/substituteScopeSearch.test.js @@ -0,0 +1,51 @@ +const assert = require('assert'); +const solveEquation = require('../../../lib/solveEquation'); +const NO_STEPS = 'no-steps'; + +function testSolve(equationString, options={}, outputStr, debug=false) { + const steps = solveEquation(equationString, options, debug); + let lastStep; + if (steps.length === 0) { + lastStep = NO_STEPS; + } + else { + lastStep = steps[steps.length -1].newEquation.ascii(); + } + it(equationString + ' -> ' + outputStr, (done) => { + assert.equal(lastStep, outputStr); + done(); + }); +} + +describe('solveEquation when scope is present', function () { + const tests = [ + // Use of nested scope (i.e., baz depends on bar) + ['2y = baz - x^2', { scope: + { baz: '(bar^2)', + x: 10, + bar: '(foo + x)', + foo: 20 + }}, + 'y = 400' + ], + // Symbol nested inside UnaryMinus node type + ['y = GrossVal * (1 - (FeePct + CCPct)) - TransferFee', + { scope: + { + CCPct: 0.015, + FeePct: 0.05, + GrossVal: 'TotalSales * Margin * Multiple', + Margin: 0.15, + Multiple: 10, + PreTaxNetVal: 'GrossVal * (1 - (FeePct + CCPct)) - TransferFee', + TotalSales: 8239341, + TransferFee: 84000, // when TreeSearch checks Symbol before + // unaryMinus, this test failed with TransferFee being added + // instead of subtracted. + } + }, + 'y = 11471675.7525' + ] + ]; + tests.forEach(t => testSolve(t[0], t[1], t[2], t[3])); +}); diff --git a/test/solveEquation/solveEquation.test.js b/test/solveEquation/solveEquation.test.js index 878ca93f..96216830 100644 --- a/test/solveEquation/solveEquation.test.js +++ b/test/solveEquation/solveEquation.test.js @@ -5,8 +5,8 @@ const solveEquation = require('../../lib/solveEquation'); const NO_STEPS = 'no-steps'; -function testSolve(equationString, outputStr, debug=false, scope={}) { - const steps = solveEquation(equationString, debug, scope); +function testSolve(equationString, outputStr, debug=false) { + const steps = solveEquation(equationString, debug); let lastStep; if (steps.length === 0) { lastStep = NO_STEPS; @@ -95,21 +95,6 @@ describe('solveEquation for =', function () { ['2/(1 + 1 + 4x) = 1/3', 'x = 1'], ['(3 + x) / (x^2 + 3) = 1', 'x = [0, 1]'], ['6/x + 8/(2x) = 10', 'x = 1'], - // Use of nested scope (i.e., baz depends on bar) - ['2y = baz - x^2', 'y = 400', false, {baz: '(bar^2)', x: 10, bar: '(foo + x)', foo: 20 }], - // Symbol nested inside UnaryMinus node type - ['y = GrossVal * (1 - (FeePct + CCPct)) - TransferFee', 'y = 11471675.7525', false, - { - CCPct: 0.015, - FeePct: 0.05, - GrossVal: 'TotalSales * Margin * Multiple', - Margin: 0.15, - Multiple: 10, - PreTaxNetVal: 'GrossVal * (1 - (FeePct + CCPct)) - TransferFee', - TotalSales: 8239341, - TransferFee: 84000, - } - ] // TODO: fix these cases, fail because lack of factoring support, for complex #s, // for taking the sqrt of both sides, etc // ['(x + y) (y + 2) = 0', 'y = -y'], @@ -125,7 +110,7 @@ describe('solveEquation for =', function () { // this gives us 6.3995 when it should actually be 6.4 :( // ['x - 3.4= ( x - 2.5)/( 1.3)', 'x = 6.4'] ]; - tests.forEach(t => testSolve(t[0], t[1], t[2], t[3])); + tests.forEach(t => testSolve(t[0], t[1], t[2])); }); describe('solveEquation for non = comparators', function() {