fdsfd
This commit is contained in:
parent
628618df89
commit
e031240dff
3749 changed files with 1120848 additions and 1 deletions
45
node_modules/lodash/deburr.js
generated
vendored
Normal file
45
node_modules/lodash/deburr.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
var deburrLetter = require('./_deburrLetter'),
|
||||
toString = require('./toString');
|
||||
|
||||
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
||||
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
||||
|
||||
/** Used to compose unicode character classes. */
|
||||
var rsComboMarksRange = '\\u0300-\\u036f',
|
||||
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
||||
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
||||
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
||||
|
||||
/** Used to compose unicode capture groups. */
|
||||
var 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).
|
||||
*/
|
||||
var reComboMark = RegExp(rsCombo, 'g');
|
||||
|
||||
/**
|
||||
* Deburrs `string` by converting
|
||||
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
||||
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
||||
* letters to basic Latin letters and removing
|
||||
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to deburr.
|
||||
* @returns {string} Returns the deburred string.
|
||||
* @example
|
||||
*
|
||||
* _.deburr('déjà vu');
|
||||
* // => 'deja vu'
|
||||
*/
|
||||
function deburr(string) {
|
||||
string = toString(string);
|
||||
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
|
||||
}
|
||||
|
||||
module.exports = deburr;
|
Loading…
Add table
Add a link
Reference in a new issue