feat: add option to exclude directories from index.js (#50)
* Add option to exclude directories from index.js * Update readDirectory.js * Update writeIndexCli.js * Update readDirectory.js * Update README
This commit is contained in:
committed by
Gajus Kuizinas
parent
1efd1c6c7b
commit
6aac149a8b
@@ -78,7 +78,8 @@ export default (directoryPath, options = {}) => {
|
||||
|
||||
const {
|
||||
extensions = ['js'],
|
||||
config = {}
|
||||
config = {},
|
||||
ignoreDirectories = false
|
||||
} = options;
|
||||
|
||||
let children;
|
||||
@@ -111,7 +112,7 @@ export default (directoryPath, options = {}) => {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isDirectory && !hasIndex(absolutePath)) {
|
||||
if (isDirectory && (!hasIndex(absolutePath) || ignoreDirectories)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user