Skip to content

Commit

Permalink
Make into map from array
Browse files Browse the repository at this point in the history
  • Loading branch information
danfinlay committed Sep 4, 2020
1 parent 6dfe06f commit 8f49a90
Show file tree
Hide file tree
Showing 5 changed files with 9,946 additions and 30,296 deletions.
4 changes: 2 additions & 2 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash

rm ./output.txt
rm ./index.js
curl https://raw.githubusercontent.com/satoshilabs/slips/master/slip-0044.md >> slip44.md
node generate/parse.js >> output.txt
node generate/parse.js >> index.js
8 changes: 4 additions & 4 deletions generate/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const slip44Path = path.join(__dirname, '..', 'slip44.md');
const slip44 = fs.readFileSync(slip44Path).toString();

const lines = slip44.split('\n');
const entries = [];
const entries = {};

let started = false;
let ended = false;
Expand All @@ -29,10 +29,10 @@ for (let i = 0; i < lines.length; i++) {
// This is just a name, no link
name = coin;
}
entries.push({
entries[index] = {
index, hex, symbol, name, link,
})
}
}
}

console.log(JSON.stringify(entries,null,2))
console.log('module.exports = ' + JSON.stringify(entries,null,2))
Loading

0 comments on commit 8f49a90

Please sign in to comment.