diff --git a/lib/paths.js b/lib/paths.js index 476358e..4f0b3f5 100644 --- a/lib/paths.js +++ b/lib/paths.js @@ -82,6 +82,13 @@ exports.files = function files(dir, type, callback, options) { if (err){ return callback(err) } + + if(!res){ + res = { + dirs: [], + files: [] + } + } if(type === 'combine'){ results.files = results.files.concat(res); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ded5a44 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,160 @@ +{ + "name": "node-dir", + "version": "0.1.17", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "commander": { + "version": "0.6.1", + "resolved": "http://registry.npm.taobao.org/commander/download/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "debug": { + "version": "3.1.0", + "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "diff": { + "version": "1.0.7", + "resolved": "http://registry.npm.taobao.org/diff/download/diff-1.0.7.tgz", + "integrity": "sha1-JLuwAcSn1VIhaefKvbLCgU7ZHPQ=", + "dev": true + }, + "glob": { + "version": "3.2.3", + "resolved": "http://registry.npm.taobao.org/glob/download/glob-3.2.3.tgz", + "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", + "dev": true, + "requires": { + "graceful-fs": "2.0.3", + "inherits": "2.0.3", + "minimatch": "0.2.14" + }, + "dependencies": { + "minimatch": { + "version": "0.2.14", + "resolved": "http://registry.npm.taobao.org/minimatch/download/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "graceful-fs": { + "version": "2.0.3", + "resolved": "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-2.0.3.tgz", + "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", + "dev": true + }, + "growl": { + "version": "1.7.0", + "resolved": "http://registry.npm.taobao.org/growl/download/growl-1.7.0.tgz", + "integrity": "sha1-3i1mE20ALhErpw8/EMMc98NQsto=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "http://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "jade": { + "version": "0.26.3", + "resolved": "http://registry.npm.taobao.org/jade/download/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.3.0", + "resolved": "http://registry.npm.taobao.org/mkdirp/download/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "http://registry.npm.taobao.org/lru-cache/download/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "http://registry.npm.taobao.org/mkdirp/download/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "dev": true + }, + "mocha": { + "version": "1.13.0", + "resolved": "http://registry.npm.taobao.org/mocha/download/mocha-1.13.0.tgz", + "integrity": "sha1-jY+k4xC5TMbv6z7SauypbeqTMHw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "debug": "3.1.0", + "diff": "1.0.7", + "glob": "3.2.3", + "growl": "1.7.0", + "jade": "0.26.3", + "mkdirp": "0.3.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "should": { + "version": "2.0.2", + "resolved": "http://registry.npm.taobao.org/should/download/should-2.0.2.tgz", + "integrity": "sha1-30hGTggEql23Iyd7swqZjryKCFc=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "http://registry.npm.taobao.org/sigmund/download/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + } + } +} diff --git "a/test/fixtures/testdir5/testu\347\365es.txt" "b/test/fixtures/testdir5/testu\347\365es.txt" deleted file mode 100644 index 5dcd581..0000000 --- "a/test/fixtures/testdir5/testu\347\365es.txt" +++ /dev/null @@ -1 +0,0 @@ -bla \ No newline at end of file