Skip to content

Commit 0a4e946

Browse files
committed
remove lodash dependency, replace with native forEach
1 parent e14c8fa commit 0a4e946

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var fs = require('fs-extra');
22
var esprima = require('esprima');
3-
var _ = require('lodash');
43
var util = require('util');
54
var stringifyObject = require("stringify-object");
65

@@ -47,7 +46,7 @@ exports.ConfigFile = function(filePath) {
4746

4847
that.type = 'empty';
4948
if (program.type === 'Program') {
50-
_.forEach(program.body, function(statement) {
49+
program.body.forEach(function(statement) {
5150

5251
if (statement.expression && statement.expression.type === 'CallExpression') {
5352
var call = statement.expression;
@@ -58,7 +57,7 @@ exports.ConfigFile = function(filePath) {
5857
return false;
5958
}
6059
} else if(statement.type === 'VariableDeclaration') {
61-
_.forEach(statement.declarations, function(declarator) {
60+
statement.declarations.forEach(function(declarator) {
6261
if (declarator.id.name === 'require') {
6362
that.type = 'var';
6463
that.readObjectExpression(declarator.init, callback);

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"dependencies": {
3232
"esprima": "~1.0.4",
33-
"lodash": "~2.0.0",
3433
"stringify-object": "~0.1.7",
3534
"fs-extra": "~0.6.4"
3635
}

0 commit comments

Comments
 (0)