mirror of
https://github.com/embarklabs/cryptocurrency-icons.git
synced 2025-01-12 10:34:42 +00:00
Make the manifest contain name of the coins (#185)
This commit is contained in:
parent
59c6ccdaa8
commit
8b1e8a966b
1537
manifest.json
1537
manifest.json
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -39,5 +39,13 @@
|
|||||||
"erc20-tokens",
|
"erc20-tokens",
|
||||||
"erc20",
|
"erc20",
|
||||||
"erc721"
|
"erc721"
|
||||||
]
|
],
|
||||||
|
"scripts": {
|
||||||
|
"manifest": "node scripts/manifest.js",
|
||||||
|
"precommit": "npm run manifest"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"alpha-sort": "^2.0.1",
|
||||||
|
"coinlist": "^2.0.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
20
scripts/manifest.js
Normal file
20
scripts/manifest.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const manifest = require('../manifest.json');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const coins = require('coinlist');
|
||||||
|
const alphaSort = require('alpha-sort');
|
||||||
|
|
||||||
|
const icons = manifest.map(icon => {
|
||||||
|
const id = typeof icon === 'string' ? icon : icon.symbol;
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: coins.get(id, 'name') || id,
|
||||||
|
symbol: id.toUpperCase(),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
icons.sort((a, b) => {
|
||||||
|
return alphaSort.asc(a.symbol, b.symbol);
|
||||||
|
});
|
||||||
|
|
||||||
|
fs.writeFileSync(path.resolve(__dirname, '../manifest.json'), JSON.stringify(icons, null, 4));
|
Loading…
x
Reference in New Issue
Block a user