Skip to content

Commit

Permalink
Remove lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Mar 15, 2020
1 parent aa9c51d commit d522d6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var nspell = require('nspell')
var visit = require('unist-util-visit')
var toString = require('nlcst-to-string')
var isLiteral = require('nlcst-is-literal')
var includes = require('lodash.includes')
var quote = require('quotation')

module.exports = spell
Expand Down Expand Up @@ -36,7 +35,7 @@ function spell(options) {
ignoreLiteral: literal === null || literal === undefined ? true : literal,
ignoreDigits: digits === null || digits === undefined ? true : digits,
normalizeApostrophes: apos === null || apos === undefined ? true : apos,
ignore: settings.ignore,
ignore: settings.ignore || [],
max: settings.max || max,
count: 0,
cache: {},
Expand Down Expand Up @@ -191,6 +190,8 @@ function all(tree, file, config) {

// Check if a word is irrelevant.
function irrelevant(word) {
return includes(ignore, word) || (ignoreDigits && digitsOnly.test(word))
return (
ignore.indexOf(word) !== -1 || (ignoreDigits && digitsOnly.test(word))
)
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"index.js"
],
"dependencies": {
"lodash.includes": "^4.2.0",
"nlcst-is-literal": "^1.0.0",
"nlcst-to-string": "^2.0.0",
"nspell": "^2.0.0",
Expand Down Expand Up @@ -80,6 +79,7 @@
"esnext": false,
"rules": {
"unicorn/string-content": "off",
"unicorn/prefer-includes": "off",
"unicorn/prefer-type-error": "off",
"unicorn/no-new-buffer": "off"
},
Expand Down

0 comments on commit d522d6f

Please sign in to comment.