Skip to content

Commit

Permalink
Update: Remove lodash dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
chico authored and phated committed Dec 28, 2018
1 parent 8b04f40 commit 44a5063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/findup-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var path = require('path');

// External libs.
var glob = require('glob');
var _ = require('lodash');

// Search for a filename in the given directory or all parent directories.
module.exports = function(patterns, options) {
Expand All @@ -28,9 +27,13 @@ module.exports = function(patterns, options) {
var files, lastpath;
do {
// Search for files matching patterns.
files = _(patterns).map(function(pattern) {
files = patterns.map(function(pattern) {
return glob.sync(pattern, globOptions);
}).flatten().uniq().value();
}).reduce(function(a, b) {
return a.concat(b);
}).filter(function(entry, index, arr) {
return index === arr.indexOf(entry);
});
// Return file if found.
if (files.length > 0) {
return path.resolve(path.join(globOptions.cwd, files[0]));
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"test": "grunt nodeunit"
},
"dependencies": {
"glob": "~3.2.9",
"lodash": "~2.4.1"
"glob": "~3.2.9"
},
"devDependencies": {
"grunt": "~0.4.4",
Expand Down

0 comments on commit 44a5063

Please sign in to comment.