Sha256: a22efcd7a6547339e49a8575a6e17da867b0fe31d30ecf2fdfa6ce8dc1c140d1

Contents?: true

Size: 1.06 KB

Versions: 153

Compression:

Stored size: 1.06 KB

Contents

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;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/contents/node_modules/lodash/string/deburr.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/string/deburr.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/string/deburr.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/string/deburr.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/string/deburr.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/string/deburr.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/string/deburr.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/string/deburr.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/string/deburr.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/string/deburr.js