diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js new file mode 100644 index 0000000000..3602a18f78 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:normalize + * @fileoverview Normalize an identifier. + */ + +'use strict'; + +/* Dependencies. */ +var collapseWhiteSpace = require('collapse-white-space'); + +/* Expose. */ +module.exports = normalize; + +/** + * Normalize an identifier. Collapses multiple white space + * characters into a single space, and removes casing. + * + * @example + * normalizeIdentifier('FOO\t bar'); // 'foo bar' + * + * @param {string} value - Content to normalize. + * @return {string} - Normalized content. + */ +function normalize(value) { + return collapseWhiteSpace(value).toLowerCase(); +} |