Commit 8ecdc265 authored by Noah Zinsmeister's avatar Noah Zinsmeister

finally fix node@10?

parent dd94c2c4
......@@ -33,6 +33,9 @@
"tiny-invariant": "^1.0.6",
"toformat": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"prettier": {
"printWidth": 120,
"semi": false,
......
......@@ -14,7 +14,7 @@ export class Route {
invariant(exchanges.length > 0, `${exchanges} does not consist of at least 1 exchange.`)
// validate conditions that must be true of a Route
const chainIds = exchanges.map(exchange => exchange.pair.map(token => token.chainId)).flat()
const chainIds = exchanges.map(exchange => exchange.pair[0].chainId) // a sufficent check since exchanges are valid
chainIds.forEach((chainId, _, array) => invariant(chainId === array[0], `${chainIds} are not all equal.`))
const path = [input]
exchanges.forEach((exchange, i) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment