ignore *nogit* and *nosf*; add delete_undefined(obj)
This commit is contained in:
parent
096c5a8999
commit
9ebd7945ac
6
.gitignore
vendored
6
.gitignore
vendored
@ -13,9 +13,13 @@
|
|||||||
?*.gitignore.*
|
?*.gitignore.*
|
||||||
?*.gitignore.*/
|
?*.gitignore.*/
|
||||||
*.gitomit
|
*.gitomit
|
||||||
*.gitomit/
|
|
||||||
*.gitomit.*
|
*.gitomit.*
|
||||||
|
*.gitomit/
|
||||||
*.gitomit.*/
|
*.gitomit.*/
|
||||||
|
*.nogit
|
||||||
|
*.nogit.*
|
||||||
|
*.nogit/
|
||||||
|
*.nogit.*/
|
||||||
# 保留
|
# 保留
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!.gitignore.*
|
!.gitignore.*
|
||||||
|
13
coretool.js
13
coretool.js
@ -409,6 +409,17 @@ module.exports = {
|
|||||||
// if (/^\./.test(filename)) filename = `added$filename` // path.extname('.abc') 结果为 '',所以要添加前缀
|
// if (/^\./.test(filename)) filename = `added$filename` // path.extname('.abc') 结果为 '',所以要添加前缀
|
||||||
// return path.extname(filename).toLowerCase() // openAi*Ext 是包含 . 的,所以用 path.extname
|
// return path.extname(filename).toLowerCase() // openAi*Ext 是包含 . 的,所以用 path.extname
|
||||||
|
|
||||||
}
|
},
|
||||||
|
|
||||||
|
delete_undefined (obj, { depth } = {}) {
|
||||||
|
// delete all undefined properties recursively inside an obect
|
||||||
|
Object.keys(obj).forEach(key => {
|
||||||
|
if (typeof obj[key] === 'undefined') {
|
||||||
|
delete obj[key]
|
||||||
|
} else if (typeof obj[key] === 'object') {
|
||||||
|
this.delete_undefined(obj[key])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
*.sfomit.*
|
*.sfomit.*
|
||||||
*.sfomit/
|
*.sfomit/
|
||||||
*.sfomit.*/
|
*.sfomit.*/
|
||||||
|
*.nosf
|
||||||
|
*.nosf.*
|
||||||
|
*.nosf/
|
||||||
|
*.nosf.*/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*/.DS_Store
|
*/.DS_Store
|
||||||
|
Loading…
Reference in New Issue
Block a user