Skip to content

Commit

Permalink
Remove lodash dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiSG committed Jun 24, 2016
2 parents d216bb4 + 7ae41da commit 63c1ac8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
var _ = require('lodash');
var index = {};

var data = require('./codes-postaux.json');

var index = _.groupBy(data, 'codePostal');
require('./codes-postaux.json').forEach(function (entry) {
if (!(entry.codePostal in index)) {
index[entry.codePostal] = [];
}
index[entry.codePostal].push(entry);
});

exports.find = function(postalCode) {
return index[postalCode] || [];
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codes-postaux",
"version": "1.0.2",
"version": "1.0.3",
"description": "French postal codes API for Node.js",
"repository": {
"type": "git",
Expand All @@ -25,7 +25,6 @@
"postinstall": "node postinstall.js"
},
"dependencies": {
"lodash": "^4.13.1"
},
"devDependencies": {
"JSONStream": "^1.1.2",
Expand Down

0 comments on commit 63c1ac8

Please sign in to comment.