-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace Diactric.js with remove-accents (#58)
Closes #57 BREAKING CHANGE: We changed the diacritics library. No API changes, but there may be some behavioral changes with diacritics.
- Loading branch information
Showing
3 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
{ | ||
"name": "match-sorter", | ||
"version": "0.0.0-semantically-released", | ||
"description": | ||
"Simple, expected, and deterministic best-match sorting of an array in JavaScript", | ||
"description": "Simple, expected, and deterministic best-match sorting of an array in JavaScript", | ||
"main": "dist/match-sorter.cjs.js", | ||
"jsnext:main": "dist/match-sorter.esm.js", | ||
"module": "dist/match-sorter.esm.js", | ||
|
@@ -19,7 +18,9 @@ | |
"setup": "npm install && npm run validate", | ||
"precommit": "kcd-scripts precommit" | ||
}, | ||
"files": ["dist"], | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [ | ||
"autocomplete", | ||
"filter list", | ||
|
@@ -29,17 +30,25 @@ | |
], | ||
"author": "Kent C. Dodds <[email protected]> (http://kentcdodds.com/)", | ||
"license": "MIT", | ||
"bundledDependencies": ["diacritic"], | ||
"bundledDependencies": [ | ||
"remove-accents" | ||
], | ||
"dependencies": { | ||
"diacritic": "0.0.2" | ||
"remove-accents": "0.4.2" | ||
}, | ||
"devDependencies": { | ||
"kcd-scripts": "^0.38.1" | ||
}, | ||
"eslintConfig": { | ||
"extends": ["./node_modules/kcd-scripts/eslint.js"] | ||
"extends": [ | ||
"./node_modules/kcd-scripts/eslint.js" | ||
] | ||
}, | ||
"eslintIgnore": ["node_modules", "coverage", "dist"], | ||
"eslintIgnore": [ | ||
"node_modules", | ||
"coverage", | ||
"dist" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kentcdodds/match-sorter.git" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* @copyright (c) 2017 Kent C. Dodds | ||
* @author Kent C. Dodds <[email protected]> | ||
*/ | ||
import diacritics from 'diacritic' | ||
import removeAccents from 'remove-accents' | ||
|
||
const rankings = { | ||
CASE_SENSITIVE_EQUAL: 9, | ||
|
@@ -366,7 +366,7 @@ function sortRankedItems(a, b) { | |
function prepareValueForComparison(value, {keepDiacritics}) { | ||
value = `${value}` // toString | ||
if (!keepDiacritics) { | ||
value = diacritics.clean(value) | ||
value = removeAccents(value) | ||
} | ||
return value | ||
} | ||
|