Skip to content

Commit 50d8ac4

Browse files
Misc: Use "lodash" package
1 parent 19a9dca commit 50d8ac4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/rules/require-dictionary-words.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@
145145
* ```
146146
*/
147147

148+
var _ = require('lodash');
148149
var assert = require('assert');
149-
var assign = require('lodash.assign');
150-
var indexOf = require('lodash.indexof');
151150

152151
// Breaks names like "fooBar" into ["foo", "bar"], etc.
153152
var reWords = (function() {
@@ -158,7 +157,7 @@ var reWords = (function() {
158157
}());
159158

160159
function hasWord(dictionary, word) {
161-
return indexOf(dictionary, word, true) > -1;
160+
return _.indexOf(dictionary, word, true) > -1;
162161
}
163162

164163
function dictionariesHaveWord(dictionaries, word) {
@@ -188,7 +187,7 @@ function checkWords(dictionaries, excluded, errors, words, start) {
188187
if (offset === 0) {
189188
location = start;
190189
} else {
191-
location = assign({}, start);
190+
location = _.assign({}, start);
192191
location.column += offset;
193192
}
194193
errors.add('Non-dictionary word "' + word + '"', location);

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
"node": ">= 0.10.0"
4141
},
4242
"dependencies": {
43-
"lodash.assign": "~3.0.0",
44-
"lodash.indexof": "~3.0.0",
43+
"lodash": "^3.7.0",
4544
"wordlist-english": "^1.1.0"
4645
},
4746
"devDependencies": {

0 commit comments

Comments
 (0)