Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Feb 1, 2020
1 parent 4e219aa commit e0e2e8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
22 changes: 9 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ var sfxEED = /^(.+?)eed$/
var sfxS = /^.+?[^s]s$/
var sfxSsesOrIes = /^.+?(ss|i)es$/
var sfxMultiConsonantLike = /([^aeiouylsz])\1$/
var step2 = new RegExp(
'^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$'
)
var step2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/
var step3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/
var step4 = new RegExp(
'^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$'
)
var step4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/

// Stem `value`.
// eslint-disable-next-line complexity
Expand All @@ -88,23 +84,23 @@ function stemmer(value) {
value.charCodeAt(0) === 121 // Lowercase Y
) {
firstCharacterWasLowerCaseY = true
value = 'Y' + value.substr(1)
value = 'Y' + value.slice(1)
}

// Step 1a.
if (sfxSsesOrIes.test(value)) {
// Remove last two characters.
value = value.substr(0, value.length - 2)
value = value.slice(0, value.length - 2)
} else if (sfxS.test(value)) {
// Remove last character.
value = value.substr(0, value.length - 1)
value = value.slice(0, value.length - 1)
}

// Step 1b.
if ((match = sfxEED.exec(value))) {
if (gt0.test(match[1])) {
// Remove last character.
value = value.substr(0, value.length - 1)
value = value.slice(0, value.length - 1)
}
} else if ((match = sfxEdOrIng.exec(value)) && vowelInStem.test(match[1])) {
value = match[1]
Expand All @@ -114,7 +110,7 @@ function stemmer(value) {
value += 'e'
} else if (sfxMultiConsonantLike.test(value)) {
// Remove last character.
value = value.substr(0, value.length - 1)
value = value.slice(0, value.length - 1)
} else if (consonantLike.test(value)) {
// Append `e`.
value += 'e'
Expand Down Expand Up @@ -156,12 +152,12 @@ function stemmer(value) {
}

if (sfxLl.test(value) && gt1.test(value)) {
value = value.substr(0, value.length - 1)
value = value.slice(0, value.length - 1)
}

// Turn initial `Y` back to `y`.
if (firstCharacterWasLowerCaseY) {
value = 'y' + value.substr(1)
value = 'y' + value.slice(1)
}

return value
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
"dependencies": {},
"devDependencies": {
"browserify": "^16.0.0",
"esmangle": "^1.0.0",
"execa": "^1.0.0",
"nyc": "^14.0.0",
"nyc": "^15.0.0",
"prettier": "^1.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^5.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.0.0",
"xo": "^0.24.0"
"xo": "^0.25.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
Expand Down Expand Up @@ -67,6 +66,9 @@
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"unicorn/prefer-includes": "off"
},
"ignores": [
"stemmer.js"
]
Expand Down

0 comments on commit e0e2e8f

Please sign in to comment.