mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
sort logs
This commit is contained in:
parent
a8a8b65e4c
commit
a6ac20e777
5
scripts/package-lock.json
generated
5
scripts/package-lock.json
generated
|
@ -938,6 +938,11 @@
|
|||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.sortby": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
|
||||
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
"dependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"bignumber.js": "^9.0.0",
|
||||
"dotenv": "^8.0.0"
|
||||
"dotenv": "^8.0.0",
|
||||
"lodash.sortby": "^4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^5.16.0",
|
||||
|
|
|
@ -2,6 +2,7 @@ const fs = require('fs')
|
|||
const path = require('path')
|
||||
const axios = require('axios')
|
||||
const BigNumber = require('bignumber.js')
|
||||
const sortBy = require('lodash.sortby')
|
||||
|
||||
require('dotenv').config()
|
||||
|
||||
|
@ -37,11 +38,12 @@ function paddedLog (...args) {
|
|||
console.log(output)
|
||||
}
|
||||
|
||||
function tableLog (array) {
|
||||
function tableLog (chains) {
|
||||
chains = sortBy(chains, ['chainId'])
|
||||
console.log('\n')
|
||||
paddedLog('Name', 'Chain', 'ChainId', 'NetworkId')
|
||||
console.log('\n')
|
||||
array.map(json =>
|
||||
chains.map(json =>
|
||||
paddedLog(json.name, json.chain, json.chainId, json.networkId)
|
||||
)
|
||||
console.log('\n')
|
||||
|
|
Loading…
Reference in New Issue
Block a user