From 3dc30632755713179f345f4af024bd904c6162d0 Mon Sep 17 00:00:00 2001 From: Michaƫl Zasso Date: Fri, 22 Dec 2017 16:53:42 +0100 Subject: tools: move eslint from tools to tools/node_modules This is required because we need to add the babel-eslint dependency and it has to be able to resolve "eslint". babel-eslint is required to support future ES features such as async iterators and import.meta. Refs: https://github.com/nodejs/node/pull/17755 PR-URL: https://github.com/nodejs/node/pull/17820 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum --- .../remark-parse/lib/util/normalize.js | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js (limited to 'tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js') 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(); +} -- cgit v1.2.3