mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Remove semicolons.
This commit is contained in:
26
deburr.js
26
deburr.js
@@ -1,23 +1,23 @@
|
||||
import deburrLetter from './.internal/deburrLetter.js';
|
||||
import toString from './toString.js';
|
||||
import deburrLetter from './.internal/deburrLetter.js'
|
||||
import toString from './toString.js'
|
||||
|
||||
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
||||
const reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
||||
const reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g
|
||||
|
||||
/** Used to compose unicode character classes. */
|
||||
const rsComboMarksRange = '\\u0300-\\u036f';
|
||||
const reComboHalfMarksRange = '\\ufe20-\\ufe2f';
|
||||
const rsComboSymbolsRange = '\\u20d0-\\u20ff';
|
||||
const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
||||
const rsComboMarksRange = '\\u0300-\\u036f'
|
||||
const reComboHalfMarksRange = '\\ufe20-\\ufe2f'
|
||||
const rsComboSymbolsRange = '\\u20d0-\\u20ff'
|
||||
const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange
|
||||
|
||||
/** Used to compose unicode capture groups. */
|
||||
const rsCombo = `[${ rsComboRange }]`;
|
||||
const rsCombo = `[${ rsComboRange }]`
|
||||
|
||||
/**
|
||||
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
||||
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
||||
*/
|
||||
const reComboMark = RegExp(rsCombo, 'g');
|
||||
const reComboMark = RegExp(rsCombo, 'g')
|
||||
|
||||
/**
|
||||
* Deburrs `string` by converting
|
||||
@@ -32,12 +32,12 @@ const reComboMark = RegExp(rsCombo, 'g');
|
||||
* @returns {string} Returns the deburred string.
|
||||
* @example
|
||||
*
|
||||
* deburr('déjà vu');
|
||||
* deburr('déjà vu')
|
||||
* // => 'deja vu'
|
||||
*/
|
||||
function deburr(string) {
|
||||
string = toString(string);
|
||||
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
|
||||
string = toString(string)
|
||||
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '')
|
||||
}
|
||||
|
||||
export default deburr;
|
||||
export default deburr
|
||||
|
||||
Reference in New Issue
Block a user