Add kredits-formatter and additionally format balance #108
@@ -1,6 +1,6 @@
|
||||
|
|
||||
const Record = require('./record');
|
||||
const ContributorSerializer = require('../serializers/contributor');
|
||||
const KreditsFormatter = require('../utils/kredits-formatter');
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
const formatKredits = require('../utils/format-kredits');
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
|
||||
class Contributor extends Record {
|
||||
get count () {
|
||||
@@ -11,11 +11,10 @@ class Contributor extends Record {
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
return this.functions.getContributorById(id)
|
||||
.then(data => {
|
||||
return this.ipfs.catAndMerge(data, ContributorSerializer.deserialize);
|
||||
})
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
.then(data => {
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
data.balanceInt = KreditsFormatter(data.balance);
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
return Promise.resolve(data);
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
})
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
}).then(data => {
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
data.balanceInt = formatKredits(data.balance);
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
return data;
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
});
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
}
|
||||
|
||||
filterByAccount(search) {
|
||||
|
||||
|
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
As this is not a class, but just one formatting function, I'd call the file As this is not a class, but just one formatting function, I'd call the file `format_kredits` and import it as `formatKredits()`.
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
I think the convention is a dash for filenames in JS. I think the convention is a dash for filenames in JS.
👍 `formatKredits()`
|
||||
@@ -28,7 +28,7 @@ module.exports = async function(callback) {
|
||||
c.account,
|
||||
`${c.name}`,
|
||||
c.isCore,
|
||||
ethers.utils.formatEther(c.balance),
|
||||
c.balanceInt,
|
||||
c.ipfsHash
|
||||
])
|
||||
})
|
||||
|
||||
As this is not a class, but just one formatting function, I'd call the file
format_kreditsand import it asformatKredits().As this is not a class, but just one formatting function, I'd call the file
format_kreditsand import it asformatKredits().I think the convention is a dash for filenames in JS.
👍
formatKredits()I think the convention is a dash for filenames in JS.
👍
formatKredits()