alykoshin / require-dir-all

Yet another Node.js helper to require all files in directory
MIT License
9 stars 1 forks source link

Recursive not working properly on indexes that use require-all or require-dir-all #4

Open Redsandro opened 7 years ago

Redsandro commented 7 years ago

When I want to load a tree of files and directories, and want directories to handle their own index if it exists:

index.js

module.exports = require('require-dir-all')('.', {
    recursive   : true,
    indexAsParent   : true

When a subdirectory index is using require-dir-all or require-all themselves, require-dir-all chokes and stops:

/test/node_modules/require-dir-all/node_modules/mini-deep-assign/lib/index.js:23
  for (var nextKey in source) {
           ^

RangeError: Maximum call stack size exceeded
    at _assign (/test/node_modules/require-dir-all/node_modules/mini-deep-assign/lib/index.js:23
alykoshin commented 7 years ago

Please, have a look on my replies in #3.