remove ramda dependency
This commit is contained in:
parent
28d84cbbcf
commit
982c60c7f5
3 changed files with 5 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue