diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/lodash/string/deburr.js')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/lodash/string/deburr.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/lodash/string/deburr.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/lodash/string/deburr.js new file mode 100644 index 00000000..0bd03e62 --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/lodash/string/deburr.js @@ -0,0 +1,29 @@ +var baseToString = require('../internal/baseToString'), + deburrLetter = require('../internal/deburrLetter'); + +/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ +var reComboMark = /[\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](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 _ + * @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 = baseToString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; |