Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
Remove lodash dependency (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
zertosh authored and hzoo committed Mar 23, 2017
1 parent eb05812 commit f1cee0f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
30 changes: 17 additions & 13 deletions index.js
@@ -1,5 +1,4 @@
var babylonToEspree = require("./babylon-to-espree");
var pick = require("lodash").pickBy;
var Module = require("module");
var path = require("path");
var parse = require("babylon").parse;
Expand Down Expand Up @@ -100,18 +99,23 @@ function monkeypatch() {
}

// iterate through part of t.VISITOR_KEYS
var visitorKeysMap = pick(t.VISITOR_KEYS, (k) => {
return t.FLIPPED_ALIAS_KEYS.Flow.concat([
"ArrayPattern",
"ClassDeclaration",
"ClassExpression",
"FunctionDeclaration",
"FunctionExpression",
"Identifier",
"ObjectPattern",
"RestElement"
]).indexOf(k) === -1;
});
var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([
"ArrayPattern",
"ClassDeclaration",
"ClassExpression",
"FunctionDeclaration",
"FunctionExpression",
"Identifier",
"ObjectPattern",
"RestElement"
]);
var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) {
var value = t.VISITOR_KEYS[key];
if (flowFlippedAliasKeys.indexOf(value) === -1) {
acc[key] = value;
}
return acc;
}, {});

var propertyTypes = {
// loops
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -15,8 +15,7 @@
"babel-code-frame": "^6.22.0",
"babel-traverse": "^6.23.1",
"babel-types": "^6.23.0",
"babylon": "^6.16.1",
"lodash": "^4.17.4"
"babylon": "^6.16.1"
},
"scripts": {
"test": "npm run lint && npm run test-only",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -694,7 +694,7 @@ lodash.pickby@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"

lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

Expand Down

0 comments on commit f1cee0f

Please sign in to comment.