添加部首字段
This commit is contained in:
parent
e666f43224
commit
152af5ec4e
3734
data-friendly.json
3734
data-friendly.json
File diff suppressed because it is too large
Load Diff
24
update-data.js
Normal file
24
update-data.js
Normal file
@ -0,0 +1,24 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const DataFile = path.join(__dirname, './data.json')
|
||||
const DataFile2 = path.join(__dirname, './data-friendly.json')
|
||||
let data = JSON.parse(fs.readFileSync(DataFile, 'utf8'))
|
||||
|
||||
Object.keys(data).forEach(key => {
|
||||
// data[key].radical = []
|
||||
|
||||
// 保证字典 key 顺序
|
||||
data[key] = {
|
||||
"word": data[key].word,
|
||||
"pinyin": data[key].pinyin,
|
||||
"radical": [],
|
||||
"stroke": data[key].stroke,
|
||||
"type": data[key].type,
|
||||
"from": data[key].from,
|
||||
"confirm": data[key].confirm
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(DataFile, JSON.stringify(data), 'utf8')
|
||||
fs.writeFileSync(DataFile2, JSON.stringify(data, null, 4), 'utf8')
|
Loading…
Reference in New Issue
Block a user