mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-18 01:44:36 +08:00
导入功能调整
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* 快速导入同一目录下的所有脚本
|
||||
*/
|
||||
*/
|
||||
|
||||
const importAll = context => {
|
||||
const map = {}
|
||||
for (const key of context.keys()) {
|
||||
const keyArr = key.split('/')
|
||||
keyArr.shift()
|
||||
map[keyArr.join('.').replace(/\.js$/g, '')] = context(key)
|
||||
map[keyArr.join('.').replace(/\.\w+$/g, '')] = context(key)
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
export default importAll
|
||||
export default importAll
|
||||
Reference in New Issue
Block a user