aboutsummaryrefslogtreecommitdiffstats
path: root/development/genStates.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-01 09:22:16 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-01 09:22:16 +0800
commite55938ed15428b452224f2d731c1e7ad141869d4 (patch)
tree7f267bf875e1bd714896cde8ae7244c601eb5d4a /development/genStates.js
parent9a8ede22106c3f59d014be4905a078711180d30c (diff)
downloadtangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar.gz
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar.bz2
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar.lz
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar.xz
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.tar.zst
tangerine-wallet-browser-e55938ed15428b452224f2d731c1e7ad141869d4.zip
First simple version of ui mocker
Diffstat (limited to 'development/genStates.js')
-rw-r--r--development/genStates.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/development/genStates.js b/development/genStates.js
new file mode 100644
index 000000000..39a672ee0
--- /dev/null
+++ b/development/genStates.js
@@ -0,0 +1,18 @@
+const fs = require('fs')
+const path = require('path')
+
+const statesPath = path.join(__dirname, 'states')
+const stateNames = fs.readdirSync(statesPath)
+
+const states = stateNames.reduce((result, stateFileName) => {
+ const statePath = path.join(__dirname, 'states', stateFileName)
+ const stateFile = fs.readFileSync(statePath).toString()
+ const state = JSON.parse(stateFile)
+ result[stateFileName.split('.')[0].replace(/-/g, ' ', 'g')] = state
+ return result
+}, {})
+
+const result = `module.exports = ${JSON.stringify(states)}`
+
+const statesJsonPath = path.join(__dirname, 'states.js')
+fs.writeFileSync(statesJsonPath, result)