mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Bump to v3.6.0.
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
import baseToString from '../internal/baseToString';
|
||||
import deburrLetter from '../internal/deburrLetter';
|
||||
|
||||
/**
|
||||
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
||||
*/
|
||||
var reComboMarks = /[\u0300-\u036f\ufe20-\ufe23]/g;
|
||||
|
||||
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
|
||||
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
|
||||
|
||||
/**
|
||||
* Deburrs `string` by converting latin-1 supplementary letters to basic latin letters.
|
||||
* See [Wikipedia](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
||||
* for more details.
|
||||
* Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
||||
* to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -21,7 +25,7 @@ var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
|
||||
*/
|
||||
function deburr(string) {
|
||||
string = baseToString(string);
|
||||
return string && string.replace(reLatin1, deburrLetter);
|
||||
return string && string.replace(reLatin1, deburrLetter).replace(reComboMarks, '');
|
||||
}
|
||||
|
||||
export default deburr;
|
||||
|
||||
Reference in New Issue
Block a user