Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function loadMDD (mddpath) {
// TODO change mdd file path
if (!fs.existsSync(mddpath) || !mddpath.endsWith('.mdd')) {
console.log('bgworker mdd file path not exist return')
return
}
// const mddpath = path.join(__static, 'dicts/oale8.mdd')
console.log(mddpath)
console.log(JSMdict)
MDDDict.jsmdict = new JSMdict(mddpath)
MDDDict.loaded = true
console.log('mdd loaded...')
}
loadDict ({commit, state, getters}) {
if (!state.dict.inited) {
console.log('loading...')
const cssPath = path.join(__static, './style/CollinsEC.css')
const styleContent = fs.readFileSync(cssPath, 'utf8')
commit(INIT_DICT_CSS, styleContent, cssPath)
return new Mdict(state.dict.path).build()
} else {
console.log('dict loaded...')
}
},
search ({commit, state, getters}, word) {