From 982c60c7f59fb2e275672228bcf5ac5fd2d6a999 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Sun, 11 Mar 2018 19:37:27 +0000 Subject: [PATCH] remove ramda dependency --- lib/route-helpers.js | 9 +++++---- package.json | 1 - tools/currencies.js | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/route-helpers.js b/lib/route-helpers.js index d008fac6..eff676d6 100644 --- a/lib/route-helpers.js +++ b/lib/route-helpers.js @@ -1,5 +1,4 @@ const _ = require('lodash/fp') -const R = require('ramda') const db = require('./db') const dbm = require('./postgresql_interface') @@ -57,11 +56,13 @@ function fetchPhoneTx (phone) { return db.any(sql, values) .then(_.map(toCashOutTx)) .then(txs => { - const confirmedTxs = txs.filter(tx => R.contains(tx.status, ['instant', 'confirmed'])) + const confirmedTxs = txs.filter(tx => _.includes(tx.status, ['instant', 'confirmed'])) if (confirmedTxs.length > 0) { - const maxTx = R.reduce((acc, val) => { + const reducer = (acc, val) => { return !acc || val.cryptoAtoms.gt(acc.cryptoAtoms) ? val : acc - }, null, confirmedTxs) + } + + const maxTx = _.reduce(reducer, null, confirmedTxs) return maxTx } diff --git a/package.json b/package.json index 6b0584c0..ef2e5390 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "pify": "^3.0.0", "pretty-ms": "^2.1.0", "promise-sequential": "^1.1.1", - "ramda": "^0.22.1", "serve-static": "^1.12.4", "socket.io": "^2.0.3", "socket.io-client": "^2.0.3", diff --git a/tools/currencies.js b/tools/currencies.js index 9acf407d..9afb2d68 100644 --- a/tools/currencies.js +++ b/tools/currencies.js @@ -1,7 +1,6 @@ // Pull latest from: http://www.currency-iso.org/en/home/tables/table-a1.html // Convert to JSON at: http://www.csvjson.com/csv2json -const R = require('ramda') const currencies = require('../currencies.json') function goodCurrency (currency) {