diff --git a/.eslintrc.js b/.eslintrc.js index 6d7afd31fae5ee..ec9cc81a45785e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,11 +53,6 @@ module.exports = { overrides: [ { files: [ - 'doc/api/esm.md', - 'doc/api/module.md', - 'doc/api/modules.md', - 'doc/api/packages.md', - 'doc/api/wasi.md', 'test/es-module/test-esm-type-flag.js', 'test/es-module/test-esm-type-flag-alias.js', '*.mjs', @@ -67,9 +62,24 @@ module.exports = { }, { files: ['**/*.md'], - parserOptions: { ecmaFeatures: { impliedStrict: true } }, + processor: 'markdown/markdown', + }, + { + files: ['**/*.md/*.js:cjs', '**/*.md/*.js'], + parserOptions: { + sourceType: 'script', + ecmaFeatures: { impliedStrict: true } + }, rules: { strict: 'off' }, }, + { + files: [ + '**/*.md/*.js:esm', + 'doc/api/esm.md/*.js', + 'doc/api/packages.md/*.js', + ], + parserOptions: { sourceType: 'module' }, + }, ], rules: { // ESLint built-in rules diff --git a/Makefile b/Makefile index aa3eb1567d447e..7387772c9c5ce3 100644 --- a/Makefile +++ b/Makefile @@ -1204,7 +1204,7 @@ lint-md: lint-js-doc | tools/.mdlintstamp LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \ - --report-unused-disable-directives --ext=$(EXTENSIONS) $(LINT_JS_TARGETS) + --report-unused-disable-directives $(LINT_JS_TARGETS) run-lint-js-fix = $(run-lint-js) --fix .PHONY: lint-js-fix @@ -1215,8 +1215,7 @@ lint-js-fix: .PHONY: lint-js-doc # Note that on the CI `lint-js-ci` is run instead. # Lints the JavaScript code with eslint. -lint-js lint-js-fix: EXTENSIONS=.js,.mjs,.md -lint-js-doc: EXTENSIONS=.md +lint-js-doc: LINT_JS_TARGETS=doc lint-js lint-js-doc: @if [ "$(shell $(node_use_openssl))" != "true" ]; then \ echo "Skipping $@ (no crypto)"; \ diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 5c02be9f3613a4..94d7dede6429d6 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2647,7 +2647,6 @@ buf.writeFloatBE(0xcafebabe, 0); console.log(buf); // Prints: - ``` ### `buf.writeFloatLE(value[, offset])` @@ -2856,7 +2855,6 @@ buf.writeIntBE(0x1234567890ab, 0, 6); console.log(buf); // Prints: - ``` ### `buf.writeIntLE(value, offset, byteLength)` diff --git a/doc/api/module.md b/doc/api/module.md index 983f0a5969fcc9..f34b21b4c171e7 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -29,13 +29,13 @@ if a module is maintained by a third party or not. `module` in this context isn't the same object that's provided by the [module wrapper][]. To access it, require the `Module` module: -```js +```js esm // module.mjs // In an ECMAScript module import { builtinModules as builtin } from 'module'; ``` -```js +```js cjs // module.cjs // In a CommonJS module const builtin = require('module').builtinModules; @@ -51,7 +51,7 @@ added: v12.2.0 string. * Returns: {require} Require function -```js +```js esm import { createRequire } from 'module'; const require = createRequire(import.meta.url); @@ -134,13 +134,13 @@ To enable source map parsing, Node.js must be run with the flag [`--enable-source-maps`][], or with code coverage enabled by setting [`NODE_V8_COVERAGE=dir`][]. -```js +```js esm // module.mjs // In an ECMAScript module import { findSourceMap, SourceMap } from 'module'; ``` -```js +```js cjs // module.cjs // In a CommonJS module const { findSourceMap, SourceMap } = require('module'); diff --git a/doc/api/stream.md b/doc/api/stream.md index 1d6b811c655fd5..678840a671871a 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2055,7 +2055,6 @@ const myWritable = new Writable({ }); // Later, abort the operation closing the stream controller.abort(); - ``` #### `writable._construct(callback)` + + + +```js +alert('Hello, world!'); +``` +```` + +Each code block in a file is linted separately, so configuration comments apply only to the code block that immediately follows. + +````markdown +Assuming `no-alert` is enabled in `.eslintrc`, the first code block will have no error from `no-alert`: + + + + +```js +alert("Hello, world!"); +``` + +But the next code block will have an error from `no-alert`: + + + +```js +alert("Hello, world!"); +``` +```` + +### Skipping Blocks + +Sometimes it can be useful to have code blocks marked with `js` even though they don't contain valid JavaScript syntax, such as commented JSON blobs that need `js` syntax highlighting. +Standard `eslint-disable` comments only silence rule reporting, but ESLint still reports any syntax errors it finds. +In cases where a code block should not even be parsed, insert a non-standard `` comment before the block, and this plugin will hide the following block from ESLint. +Neither rule nor syntax errors will be reported. + +````markdown +There are comments in this JSON, so we use `js` syntax for better +highlighting. Skip the block to prevent warnings about invalid syntax. + + + +```js +{ + // This code block is hidden from ESLint. + "hello": "world" +} +``` + +```js +console.log("This code block is linted normally."); +``` +```` + +## Editor Integrations + +### VSCode + +[`vscode-eslint`](https://github.com/microsoft/vscode-eslint) has built-in support for the Markdown processor. + +### Atom + +The [`linter-eslint`](https://atom.io/packages/linter-eslint) package allows for linting within the [Atom IDE](https://atom.io/). + +In order to see `eslint-plugin-markdown` work its magic within Markdown code blocks in your Atom editor, you can go to `linter-eslint`'s settings and within "List of scopes to run ESLint on...", add the cursor scope "source.gfm". + +However, this reports a problem when viewing Markdown which does not have configuration, so you may wish to use the cursor scope "source.embedded.js", but note that `eslint-plugin-markdown` configuration comments and skip directives won't work in this context. + +## Contributing + +```sh +$ git clone https://github.com/eslint/eslint-plugin-markdown.git +$ cd eslint-plugin-markdown +$ npm install +$ npm test +``` + +This project follows the [ESLint contribution guidelines](http://eslint.org/docs/developer-guide/contributing/). diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/index.js b/tools/node_modules/eslint-plugin-markdown/index.js similarity index 51% rename from tools/node_modules/eslint/node_modules/eslint-plugin-markdown/index.js rename to tools/node_modules/eslint-plugin-markdown/index.js index 59fbcd08d8a277..1638f11ee3c12b 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/index.js +++ b/tools/node_modules/eslint-plugin-markdown/index.js @@ -5,6 +5,4 @@ "use strict"; -// https://github.com/mysticatea/eslint-plugin-node/issues/193 -// eslint-disable-next-line node/no-unpublished-require module.exports = require("./lib"); diff --git a/tools/node_modules/eslint-plugin-markdown/lib/index.js b/tools/node_modules/eslint-plugin-markdown/lib/index.js new file mode 100644 index 00000000000000..d66a7ddda6f6c2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/lib/index.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Enables the processor for Markdown file extensions. + * @author Brandon Mills + */ + +"use strict"; + +const processor = require("./processor"); + +module.exports = { + configs: { + recommended: { + plugins: ["markdown"], + overrides: [ + { + files: ["*.md"], + processor: "markdown/markdown" + }, + { + files: ["**/*.md/**"], + parserOptions: { + ecmaFeatures: { + + // Adding a "use strict" directive at the top of + // every code block is tedious and distracting, so + // opt into strict mode parsing without the + // directive. + impliedStrict: true + } + }, + rules: { + + // The Markdown parser automatically trims trailing + // newlines from code blocks. + "eol-last": "off", + + // In code snippets and examples, these rules are often + // counterproductive to clarity and brevity. + "no-undef": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + "padded-blocks": "off", + + // Adding a "use strict" directive at the top of every + // code block is tedious and distracting. The config + // opts into strict mode parsing without the directive. + strict: "off", + + // The processor will not receive a Unicode Byte Order + // Mark from the Markdown parser. + "unicode-bom": "off" + } + } + ] + } + }, + processors: { + markdown: processor + } +}; diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js b/tools/node_modules/eslint-plugin-markdown/lib/processor.js similarity index 93% rename from tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js rename to tools/node_modules/eslint-plugin-markdown/lib/processor.js index 594efc8049d2d4..34a75de62796cd 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/processor.js +++ b/tools/node_modules/eslint-plugin-markdown/lib/processor.js @@ -5,11 +5,9 @@ "use strict"; -const assign = require("object-assign"); const unified = require("unified"); const remarkParse = require("remark-parse"); -const SUPPORTED_SYNTAXES = ["js", "javascript", "node", "jsx"]; const UNSATISFIABLE_RULES = [ "eol-last", // The Markdown parser strips trailing newlines in code fences "unicode-bom" // Code blocks will begin in the middle of Markdown files @@ -47,7 +45,7 @@ function traverse(node, callbacks, parent) { function getComment(html) { const commentStart = ""; - const regex = /^(eslint\b|global\s)/; + const regex = /^(eslint\b|global\s)/u; if ( html.slice(0, commentStart.length) !== commentStart || @@ -67,7 +65,7 @@ function getComment(html) { // Before a code block, blockquote characters (`>`) are also considered // "whitespace". -const leadingWhitespaceRegex = /^[>\s]*/; +const leadingWhitespaceRegex = /^[>\s]*/u; /** * Gets the offset for the first column of the node's first line in the @@ -116,7 +114,6 @@ function getIndentText(text, node) { * suffix of the corresponding line in the Markdown code block. There are no * differences within the line, so the mapping need only provide the offset * delta at the beginning of each line. - * * @param {string} text The text of the file. * @param {ASTNode} node A Markdown code block AST node. * @param {comments} comments List of configuration comment strings that will be @@ -224,7 +221,7 @@ function preprocess(text) { code(node, parent) { const comments = []; - if (node.lang && SUPPORTED_SYNTAXES.indexOf(node.lang.split(" ")[0].toLowerCase()) >= 0) { + if (node.lang) { let index = parent.children.indexOf(node) - 1; let previousNode = parent.children[index]; @@ -244,20 +241,24 @@ function preprocess(text) { previousNode = parent.children[index]; } - blocks.push(assign({}, node, { + blocks.push({ + ...node, baseIndentText: getIndentText(text, node), comments, rangeMap: getBlockRangeMap(text, node, comments) - })); + }); } } }); - return blocks.map(block => [ - ...block.comments, - block.value, - "" - ].join("\n")); + return blocks.map((block, index) => ({ + filename: `${index}.${block.lang}${block.meta ? `:${block.meta}` : ""}`, + text: [ + ...block.comments, + block.value, + "" + ].join("\n") + })); } /** @@ -278,7 +279,6 @@ function adjustBlock(block) { return function adjustMessage(message) { const lineInCode = message.line - leadingCommentLines; - const endLine = message.endLine - leadingCommentLines; if (lineInCode < 1) { return null; @@ -286,10 +286,13 @@ function adjustBlock(block) { const out = { line: lineInCode + blockStart, - endLine: endLine ? endLine + blockStart : endLine, - column: message.column + block.position.indent[lineInCode - 1] - 1 + column: message.column + block.baseIndentText.length }; + if (Number.isInteger(message.endLine)) { + out.endLine = message.endLine - leadingCommentLines + blockStart; + } + const adjustedFix = {}; if (message.fix) { @@ -308,11 +311,11 @@ function adjustBlock(block) { // Apply the mapping delta for this range. return range + block.rangeMap[i - 1].md; }), - text: message.fix.text.replace(/\n/g, `\n${block.baseIndentText}`) + text: message.fix.text.replace(/\n/gu, `\n${block.baseIndentText}`) }; } - return assign({}, message, out, adjustedFix); + return { ...message, ...out, ...adjustedFix }; }; } diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/LICENSE new file mode 100644 index 00000000000000..4b1ad51b2f0efc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md new file mode 100644 index 00000000000000..5c0a337afcdefa --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/mdast` + +# Summary +This package contains type definitions for Mdast (https://github.com/syntax-tree/mdast). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast + +Additional Details + * Last updated: Sat, 07 Sep 2019 00:45:19 GMT + * Dependencies: @types/unist + * Global values: none + +# Credits +These definitions were written by Jun Lu . diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json new file mode 100644 index 00000000000000..23e52f45be668e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json @@ -0,0 +1,26 @@ +{ + "name": "@types/mdast", + "version": "3.0.3", + "description": "TypeScript definitions for Mdast", + "license": "MIT", + "contributors": [ + { + "name": "Jun Lu", + "url": "https://github.com/lujun2", + "githubUsername": "lujun2" + } + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/mdast" + }, + "scripts": {}, + "dependencies": { + "@types/unist": "*" + }, + "typesPublisherContentHash": "14d7fdbd7f31ef3975bd5e967ada84235c102b1be369cba397ced8b95ebe4e57", + "typeScriptVersion": "3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/LICENSE new file mode 100644 index 00000000000000..4b1ad51b2f0efc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/README.md new file mode 100644 index 00000000000000..a15402a4524206 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for non-npm package Unist ( https://github.com/syntax-tree/unist ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist + +Additional Details + * Last updated: Thu, 14 Feb 2019 18:10:46 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by bizen241 , Jun Lu , Hernan Rajchert , Titus Wormer , Junyoung Choi . diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/package.json new file mode 100644 index 00000000000000..78fa62811fa768 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/unist/package.json @@ -0,0 +1,43 @@ +{ + "name": "@types/unist", + "version": "2.0.3", + "description": "TypeScript definitions for non-npm package Unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "url": "https://github.com/bizen241", + "githubUsername": "bizen241" + }, + { + "name": "Jun Lu", + "url": "https://github.com/lujun2", + "githubUsername": "lujun2" + }, + { + "name": "Hernan Rajchert", + "url": "https://github.com/hrajchert", + "githubUsername": "hrajchert" + }, + { + "name": "Titus Wormer", + "url": "https://github.com/wooorm", + "githubUsername": "wooorm" + }, + { + "name": "Junyoung Choi", + "url": "https://github.com/rokt33r", + "githubUsername": "rokt33r" + } + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "555fe20f164ccded02a3f69d8b45c8c9d2ec6fd53844a7c7858a3001c281bc9b", + "typeScriptVersion": "3.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/bail/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/bail/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/bail/index.js diff --git a/tools/node_modules/eslint/node_modules/bail/license b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/license similarity index 100% rename from tools/node_modules/eslint/node_modules/bail/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/bail/license diff --git a/tools/node_modules/eslint/node_modules/bail/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/bail/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json index 1544ac972fde04..8f8539d32b89b6 100644 --- a/tools/node_modules/eslint/node_modules/bail/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/package.json @@ -1,23 +1,29 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/bail/issues" + "name": "bail", + "version": "1.0.5", + "description": "Throw a given error", + "license": "MIT", + "keywords": [ + "fail", + "bail", + "throw", + "callback", + "error" + ], + "repository": "wooorm/bail", + "bugs": "https://github.com/wooorm/bail/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": {}, - "deprecated": false, - "description": "Throw a given error", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -28,28 +34,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/bail#readme", - "keywords": [ - "fail", - "bail", - "throw", - "callback", - "error" - ], - "license": "MIT", - "name": "bail", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify index.js -s bail -o bail.js", + "build-mangle": "browserify index.js -s bail -p tinyify -o bail.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -59,30 +51,22 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/bail.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js -s bail -o bail.js", - "build-mangle": "browserify index.js -s bail -p tinyify -o bail.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.5", "xo": { "prettier": true, "esnext": false, "ignores": [ "bail.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/bail/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/bail/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/bail/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/bail/readme.md diff --git a/tools/node_modules/eslint/node_modules/character-entities-legacy/index.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/index.json similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities-legacy/index.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/index.json diff --git a/tools/node_modules/eslint/node_modules/character-entities-legacy/license b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/license similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities-legacy/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/license diff --git a/tools/node_modules/eslint/node_modules/character-entities-legacy/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/character-entities-legacy/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json index 701c76396e0c2f..e532b8714df3e8 100644 --- a/tools/node_modules/eslint/node_modules/character-entities-legacy/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/package.json @@ -1,23 +1,32 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/character-entities-legacy/issues" + "name": "character-entities-legacy", + "version": "1.1.4", + "description": "HTML legacy character entity information", + "license": "MIT", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "repository": "wooorm/character-entities-legacy", + "bugs": "https://github.com/wooorm/character-entities-legacy/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "main": "index.json", + "files": [ + "index.json" ], "dependencies": {}, - "deprecated": false, - "description": "HTML legacy character entity information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -29,26 +38,15 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.json" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "scripts": { + "generate": "node build", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify index.json -s characterEntitiesLegacy -o character-entities-legacy.js", + "build-mangle": "browserify index.json -s characterEntitiesLegacy -p tinyify -o character-entities-legacy.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test": "npm run generate && npm run format && npm run build && npm run test-api" }, - "homepage": "https://github.com/wooorm/character-entities-legacy#readme", - "keywords": [ - "html", - "entity", - "entities", - "character", - "reference", - "name", - "replacement" - ], - "license": "MIT", - "main": "index.json", - "name": "character-entities-legacy", "prettier": { "tabWidth": 2, "useTabs": false, @@ -57,30 +55,16 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/character-entities-legacy.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.json -s characterEntitiesLegacy -o character-entities-legacy.js", - "build-mangle": "browserify index.json -s characterEntitiesLegacy -p tinyify -o character-entities-legacy.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "generate": "node build", - "test": "npm run generate && npm run format && npm run build && npm run test-api", - "test-api": "node test" - }, - "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-entities-legacy.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/character-entities-legacy/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities-legacy/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy/readme.md diff --git a/tools/node_modules/eslint/node_modules/character-entities/index.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/index.json similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities/index.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/index.json diff --git a/tools/node_modules/eslint/node_modules/character-entities/license b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/license similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/license diff --git a/tools/node_modules/eslint/node_modules/character-entities/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/character-entities/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json index 62ea9531be971e..e1151d249e23dd 100644 --- a/tools/node_modules/eslint/node_modules/character-entities/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/package.json @@ -1,23 +1,32 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/character-entities/issues" + "name": "character-entities", + "version": "1.2.4", + "description": "HTML character entity information", + "license": "MIT", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "repository": "wooorm/character-entities", + "bugs": "https://github.com/wooorm/character-entities/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "main": "index.json", + "files": [ + "index.json" ], "dependencies": {}, - "deprecated": false, - "description": "HTML character entity information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -29,26 +38,16 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.json" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "scripts": { + "generate": "node build", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify index.json -s characterEntities -o character-entities.js", + "build-mangle": "browserify index.json -s characterEntities -p tinyify -o character-entities.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "lint": "xo", + "test-api": "node test", + "test": "npm run generate && npm run format && npm run build && npm run test-api" }, - "homepage": "https://github.com/wooorm/character-entities#readme", - "keywords": [ - "html", - "entity", - "entities", - "character", - "reference", - "name", - "replacement" - ], - "license": "MIT", - "main": "index.json", - "name": "character-entities", "prettier": { "tabWidth": 2, "useTabs": false, @@ -57,31 +56,16 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/character-entities.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.json -s characterEntities -o character-entities.js", - "build-mangle": "browserify index.json -s characterEntities -p tinyify -o character-entities.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "generate": "node build", - "lint": "xo", - "test": "npm run generate && npm run format && npm run build && npm run test-api", - "test-api": "node test" - }, - "version": "1.2.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-entities.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/character-entities/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/character-entities/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-entities/readme.md diff --git a/tools/node_modules/eslint/node_modules/character-reference-invalid/index.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/index.json similarity index 100% rename from tools/node_modules/eslint/node_modules/character-reference-invalid/index.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/index.json diff --git a/tools/node_modules/eslint/node_modules/character-reference-invalid/license b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/license similarity index 100% rename from tools/node_modules/eslint/node_modules/character-reference-invalid/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/license diff --git a/tools/node_modules/eslint/node_modules/character-reference-invalid/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json similarity index 73% rename from tools/node_modules/eslint/node_modules/character-reference-invalid/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json index 52c4e1361f7c8e..069dc4b2b53901 100644 --- a/tools/node_modules/eslint/node_modules/character-reference-invalid/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/package.json @@ -1,23 +1,33 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/character-reference-invalid/issues" + "name": "character-reference-invalid", + "version": "1.1.4", + "description": "HTML invalid numeric character reference information", + "license": "MIT", + "keywords": [ + "html", + "entity", + "numeric", + "character", + "reference", + "replacement", + "invalid", + "name" + ], + "repository": "wooorm/character-reference-invalid", + "bugs": "https://github.com/wooorm/character-reference-invalid/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "main": "index.json", + "files": [ + "index.json" ], "dependencies": {}, - "deprecated": false, - "description": "HTML invalid numeric character reference information", "devDependencies": { "bail": "^1.0.0", "browserify": "^16.0.0", @@ -32,27 +42,15 @@ "unified": "^8.0.0", "xo": "^0.25.0" }, - "files": [ - "index.json" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "scripts": { + "generate": "node build", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify index.json -s characterReferenceInvalid -o character-reference-invalid.js", + "build-mangle": "browserify index.json -s characterReferenceInvalid -p tinyify -o character-reference-invalid.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test": "npm run generate && npm run format && npm run build && npm run test-api" }, - "homepage": "https://github.com/wooorm/character-reference-invalid#readme", - "keywords": [ - "html", - "entity", - "numeric", - "character", - "reference", - "replacement", - "invalid", - "name" - ], - "license": "MIT", - "main": "index.json", - "name": "character-reference-invalid", "prettier": { "tabWidth": 2, "useTabs": false, @@ -61,30 +59,16 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/character-reference-invalid.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.json -s characterReferenceInvalid -o character-reference-invalid.js", - "build-mangle": "browserify index.json -s characterReferenceInvalid -p tinyify -o character-reference-invalid.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "generate": "node build", - "test": "npm run generate && npm run format && npm run build && npm run test-api", - "test-api": "node test" - }, - "version": "1.1.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "character-reference-invalid.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/character-reference-invalid/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/character-reference-invalid/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid/readme.md diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/LICENSE new file mode 100644 index 00000000000000..658c933d28255e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/README.md new file mode 100644 index 00000000000000..88dae35d9fc958 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/README.md @@ -0,0 +1,455 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/package.json new file mode 100644 index 00000000000000..da809d2b8d28b2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/package.json @@ -0,0 +1,59 @@ +{ + "name": "debug", + "version": "4.3.1", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne ", + "Josh Junon " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "2.1.2" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/browser.js b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/browser.js new file mode 100644 index 00000000000000..cd0fc35d1ee11e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/browser.js @@ -0,0 +1,269 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/common.js b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/common.js new file mode 100644 index 00000000000000..392a8e005a063a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/common.js @@ -0,0 +1,261 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/index.js new file mode 100644 index 00000000000000..bf4c57f259df2e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/node.js b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/node.js new file mode 100644 index 00000000000000..79bc085cb0230c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; diff --git a/tools/node_modules/eslint/node_modules/extend/.jscs.json b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/.jscs.json similarity index 100% rename from tools/node_modules/eslint/node_modules/extend/.jscs.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/extend/.jscs.json diff --git a/tools/node_modules/eslint/node_modules/extend/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/extend/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/extend/LICENSE diff --git a/tools/node_modules/eslint/node_modules/extend/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/extend/README.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/extend/README.md diff --git a/tools/node_modules/eslint/node_modules/extend/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/extend/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/extend/index.js diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json new file mode 100644 index 00000000000000..85279f78054e5c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/extend/package.json @@ -0,0 +1,42 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.2", + "description": "Port of jQuery.extend for node.js and the browser", + "main": "index", + "scripts": { + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "npm run coverage-quiet", + "tests-only": "node test", + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "lint": "npm run jscs && npm run eslint", + "jscs": "jscs *.js */*.js", + "eslint": "eslint *.js */*.js" + }, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository": { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": {}, + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.19.1", + "jscs": "^3.0.7", + "tape": "^4.9.1" + }, + "license": "MIT" +} diff --git a/tools/node_modules/eslint/node_modules/is-alphabetical/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphabetical/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/index.js diff --git a/tools/node_modules/eslint/node_modules/is-alphabetical/license b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphabetical/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/license diff --git a/tools/node_modules/eslint/node_modules/is-alphabetical/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/is-alphabetical/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json index 312a56e6e0add2..c7764f2a09e8c8 100644 --- a/tools/node_modules/eslint/node_modules/is-alphabetical/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/package.json @@ -1,23 +1,29 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-alphabetical/issues" + "name": "is-alphabetical", + "version": "1.0.4", + "description": "Check if a character is alphabetical", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical" + ], + "repository": "wooorm/is-alphabetical", + "bugs": "https://github.com/wooorm/is-alphabetical/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": {}, - "deprecated": false, - "description": "Check if a character is alphabetical", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -28,28 +34,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-alphabetical#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "alphabetical" - ], - "license": "MIT", - "name": "is-alphabetical", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", + "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -59,25 +51,6 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-alphabetical.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", - "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", "xo": { "prettier": true, "esnext": false, @@ -87,5 +60,16 @@ "ignores": [ "is-alphabetical.js" ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/is-alphabetical/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphabetical/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphabetical/readme.md diff --git a/tools/node_modules/eslint/node_modules/is-alphanumerical/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphanumerical/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/index.js diff --git a/tools/node_modules/eslint/node_modules/is-alphanumerical/license b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphanumerical/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/license diff --git a/tools/node_modules/eslint/node_modules/is-alphanumerical/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json similarity index 72% rename from tools/node_modules/eslint/node_modules/is-alphanumerical/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json index 09c2212afe3978..edaa31e66f0ea1 100644 --- a/tools/node_modules/eslint/node_modules/is-alphanumerical/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/package.json @@ -1,26 +1,34 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-alphanumerical/issues" + "name": "is-alphanumerical", + "version": "1.0.4", + "description": "Check if a character is alphanumerical", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical", + "numerical", + "alphanumerical" + ], + "repository": "wooorm/is-alphanumerical", + "bugs": "https://github.com/wooorm/is-alphanumerical/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" }, - "deprecated": false, - "description": "Check if a character is alphanumerical", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -31,30 +39,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-alphanumerical#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "alphabetical", - "numerical", - "alphanumerical" - ], - "license": "MIT", - "name": "is-alphanumerical", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", + "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -64,30 +56,22 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-alphanumerical.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", - "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-alphanumerical.js" ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/is-alphanumerical/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-alphanumerical/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical/readme.md diff --git a/tools/node_modules/eslint/node_modules/is-buffer/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/is-buffer/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/LICENSE diff --git a/tools/node_modules/eslint/node_modules/is-buffer/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-buffer/README.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/README.md diff --git a/tools/node_modules/eslint/node_modules/is-buffer/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-buffer/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/index.js diff --git a/tools/node_modules/eslint/node_modules/is-buffer/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json similarity index 88% rename from tools/node_modules/eslint/node_modules/is-buffer/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json index ccde4062936080..ea12137a63cf0f 100644 --- a/tools/node_modules/eslint/node_modules/is-buffer/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-buffer/package.json @@ -1,4 +1,7 @@ { + "name": "is-buffer", + "description": "Determine if an object is a Buffer", + "version": "1.1.6", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", @@ -7,16 +10,12 @@ "bugs": { "url": "https://github.com/feross/is-buffer/issues" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Determine if an object is a Buffer", "devDependencies": { "standard": "*", "tape": "^4.0.0", "zuul": "^3.0.0" }, - "homepage": "https://github.com/feross/is-buffer#readme", "keywords": [ "buffer", "buffers", @@ -36,7 +35,6 @@ ], "license": "MIT", "main": "index.js", - "name": "is-buffer", "repository": { "type": "git", "url": "git://github.com/feross/is-buffer.git" @@ -49,6 +47,5 @@ }, "testling": { "files": "test/*.js" - }, - "version": "1.1.6" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/is-decimal/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-decimal/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/index.js diff --git a/tools/node_modules/eslint/node_modules/is-decimal/license b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-decimal/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/license diff --git a/tools/node_modules/eslint/node_modules/is-decimal/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/is-decimal/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json index 9c9d45e06dc51d..5589c2a4f1f1b7 100644 --- a/tools/node_modules/eslint/node_modules/is-decimal/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/package.json @@ -1,23 +1,29 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-decimal/issues" + "name": "is-decimal", + "version": "1.0.4", + "description": "Check if a character is decimal", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "decimal" + ], + "repository": "wooorm/is-decimal", + "bugs": "https://github.com/wooorm/is-decimal/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": {}, - "deprecated": false, - "description": "Check if a character is decimal", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -28,28 +34,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-decimal#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "decimal" - ], - "license": "MIT", - "name": "is-decimal", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify . -s isDecimal -o is-decimal.js", + "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -59,30 +51,22 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-decimal.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s isDecimal -o is-decimal.js", - "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-decimal.js" ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/is-decimal/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-decimal/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-decimal/readme.md diff --git a/tools/node_modules/eslint/node_modules/is-hexadecimal/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-hexadecimal/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/index.js diff --git a/tools/node_modules/eslint/node_modules/is-hexadecimal/license b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-hexadecimal/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/license diff --git a/tools/node_modules/eslint/node_modules/is-hexadecimal/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/is-hexadecimal/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json index acd830adc42206..b8741fe102945a 100644 --- a/tools/node_modules/eslint/node_modules/is-hexadecimal/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/package.json @@ -1,23 +1,29 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-hexadecimal/issues" + "name": "is-hexadecimal", + "version": "1.0.4", + "description": "Check if a character is hexadecimal", + "license": "MIT", + "keywords": [ + "string", + "character", + "char", + "code", + "hexadecimal" + ], + "repository": "wooorm/is-hexadecimal", + "bugs": "https://github.com/wooorm/is-hexadecimal/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": {}, - "deprecated": false, - "description": "Check if a character is hexadecimal", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -28,28 +34,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-hexadecimal#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "hexadecimal" - ], - "license": "MIT", - "name": "is-hexadecimal", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify . -s isHexadecimal -o is-hexadecimal.js", + "build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -59,30 +51,22 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-hexadecimal.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s isHexadecimal -o is-hexadecimal.js", - "build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", "xo": { "prettier": true, "esnext": false, "ignores": [ "is-hexadecimal.js" ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/is-hexadecimal/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-hexadecimal/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal/readme.md diff --git a/tools/node_modules/eslint/node_modules/is-plain-obj/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/is-plain-obj/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/index.js diff --git a/tools/node_modules/eslint/node_modules/is-plain-obj/license b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-plain-obj/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/license diff --git a/tools/node_modules/eslint/node_modules/is-plain-obj/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json similarity index 60% rename from tools/node_modules/eslint/node_modules/is-plain-obj/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json index 64475946dac06c..d331f6e8169900 100644 --- a/tools/node_modules/eslint/node_modules/is-plain-obj/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/package.json @@ -1,25 +1,23 @@ { + "name": "is-plain-obj", + "version": "1.1.0", + "description": "Check if a value is a plain object", + "license": "MIT", + "repository": "sindresorhus/is-plain-obj", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/is-plain-obj/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a value is a plain object", - "devDependencies": { - "ava": "0.0.4" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "node test.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/is-plain-obj#readme", "keywords": [ "obj", "object", @@ -32,14 +30,7 @@ "pure", "simple" ], - "license": "MIT", - "name": "is-plain-obj", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-plain-obj.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.1.0" -} \ No newline at end of file + "devDependencies": { + "ava": "0.0.4" + } +} diff --git a/tools/node_modules/eslint/node_modules/is-plain-obj/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/is-plain-obj/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/is-plain-obj/readme.md diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/dist/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/dist/index.js new file mode 100644 index 00000000000000..c34f023f456fa7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/dist/index.js @@ -0,0 +1,823 @@ +'use strict' + +module.exports = fromMarkdown + +// These three are compiled away in the `dist/` + +var toString = require('mdast-util-to-string') +var assign = require('micromark/dist/constant/assign') +var own = require('micromark/dist/constant/has-own-property') +var normalizeIdentifier = require('micromark/dist/util/normalize-identifier') +var safeFromInt = require('micromark/dist/util/safe-from-int') +var parser = require('micromark/dist/parse') +var preprocessor = require('micromark/dist/preprocess') +var postprocess = require('micromark/dist/postprocess') +var decode = require('parse-entities/decode-entity') +var stringifyPosition = require('unist-util-stringify-position') + +function fromMarkdown(value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding + encoding = undefined + } + + return compiler(options)( + postprocess( + parser(options).document().write(preprocessor()(value, encoding, true)) + ) + ) +} + +// Note this compiler only understand complete buffering, not streaming. +function compiler(options) { + var settings = options || {} + var config = configure( + { + transforms: [], + canContainEols: [ + 'emphasis', + 'fragment', + 'heading', + 'paragraph', + 'strong' + ], + + enter: { + autolink: opener(link), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading), + blockQuote: opener(blockQuote), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: opener(codeFlow, buffer), + codeText: opener(codeText, buffer), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition), + definitionDestinationString: buffer, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: opener(emphasis), + hardBreakEscape: opener(hardBreak), + hardBreakTrailing: opener(hardBreak), + htmlFlow: opener(html, buffer), + htmlFlowData: onenterdata, + htmlText: opener(html, buffer), + htmlTextData: onenterdata, + image: opener(image), + label: buffer, + link: opener(link), + listItem: opener(listItem), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list, onenterlistordered), + listUnordered: opener(list), + paragraph: opener(paragraph), + reference: onenterreference, + referenceString: buffer, + resourceDestinationString: buffer, + resourceTitleString: buffer, + setextHeading: opener(heading), + strong: opener(strong), + thematicBreak: opener(thematicBreak) + }, + + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }, + + settings.mdastExtensions || [] + ) + + var data = {} + + return compile + + function compile(events) { + var tree = {type: 'root', children: []} + var stack = [tree] + var tokenStack = [] + var listStack = [] + var index = -1 + var handler + var listStart + + var context = { + stack: stack, + tokenStack: tokenStack, + config: config, + enter: enter, + exit: exit, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + } + + while (++index < events.length) { + // We preprocess lists to add `listItem` tokens, and to infer whether + // items the list itself are spread out. + if ( + events[index][1].type === 'listOrdered' || + events[index][1].type === 'listUnordered' + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + listStart = listStack.pop(index) + index = prepareList(events, listStart, index) + } + } + } + + index = -1 + + while (++index < events.length) { + handler = config[events[index][0]] + + if (own.call(handler, events[index][1].type)) { + handler[events[index][1].type].call( + assign({sliceSerialize: events[index][2].sliceSerialize}, context), + events[index][1] + ) + } + } + + if (tokenStack.length) { + throw new Error( + 'Cannot close document, a token (`' + + tokenStack[tokenStack.length - 1].type + + '`, ' + + stringifyPosition({ + start: tokenStack[tokenStack.length - 1].start, + end: tokenStack[tokenStack.length - 1].end + }) + + ') is still open' + ) + } + + // Figure out `root` position. + tree.position = { + start: point( + events.length ? events[0][1].start : {line: 1, column: 1, offset: 0} + ), + + end: point( + events.length + ? events[events.length - 2][1].end + : {line: 1, column: 1, offset: 0} + ) + } + + index = -1 + while (++index < config.transforms.length) { + tree = config.transforms[index](tree) || tree + } + + return tree + } + + function prepareList(events, start, length) { + var index = start - 1 + var containerBalance = -1 + var listSpread = false + var listItem + var tailIndex + var lineIndex + var tailEvent + var event + var firstBlankLineIndex + var atMarker + + while (++index <= length) { + event = events[index] + + if ( + event[1].type === 'listUnordered' || + event[1].type === 'listOrdered' || + event[1].type === 'blockQuote' + ) { + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + + atMarker = undefined + } else if (event[1].type === 'lineEndingBlank') { + if (event[0] === 'enter') { + if ( + listItem && + !atMarker && + !containerBalance && + !firstBlankLineIndex + ) { + firstBlankLineIndex = index + } + + atMarker = undefined + } + } else if ( + event[1].type === 'linePrefix' || + event[1].type === 'listItemValue' || + event[1].type === 'listItemMarker' || + event[1].type === 'listItemPrefix' || + event[1].type === 'listItemPrefixWhitespace' + ) { + // Empty. + } else { + atMarker = undefined + } + + if ( + (!containerBalance && + event[0] === 'enter' && + event[1].type === 'listItemPrefix') || + (containerBalance === -1 && + event[0] === 'exit' && + (event[1].type === 'listUnordered' || + event[1].type === 'listOrdered')) + ) { + if (listItem) { + tailIndex = index + lineIndex = undefined + + while (tailIndex--) { + tailEvent = events[tailIndex] + + if ( + tailEvent[1].type === 'lineEnding' || + tailEvent[1].type === 'lineEndingBlank' + ) { + if (tailEvent[0] === 'exit') continue + + if (lineIndex) { + events[lineIndex][1].type = 'lineEndingBlank' + listSpread = true + } + + tailEvent[1].type = 'lineEnding' + lineIndex = tailIndex + } else if ( + tailEvent[1].type === 'linePrefix' || + tailEvent[1].type === 'blockQuotePrefix' || + tailEvent[1].type === 'blockQuotePrefixWhitespace' || + tailEvent[1].type === 'blockQuoteMarker' || + tailEvent[1].type === 'listItemIndent' + ) { + // Empty + } else { + break + } + } + + if ( + firstBlankLineIndex && + (!lineIndex || firstBlankLineIndex < lineIndex) + ) { + listItem._spread = true + } + + // Fix position. + listItem.end = point( + lineIndex ? events[lineIndex][1].start : event[1].end + ) + + events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]) + index++ + length++ + } + + // Create a new list item. + if (event[1].type === 'listItemPrefix') { + listItem = { + type: 'listItem', + _spread: false, + start: point(event[1].start) + } + + events.splice(index, 0, ['enter', listItem, event[2]]) + index++ + length++ + firstBlankLineIndex = undefined + atMarker = true + } + } + } + + events[start][1]._spread = listSpread + return length + } + + function setData(key, value) { + data[key] = value + } + + function getData(key) { + return data[key] + } + + function point(d) { + return {line: d.line, column: d.column, offset: d.offset} + } + + function opener(create, and) { + return open + + function open(token) { + enter.call(this, create(token), token) + if (and) and.call(this, token) + } + } + + function buffer() { + this.stack.push({type: 'fragment', children: []}) + } + + function enter(node, token) { + this.stack[this.stack.length - 1].children.push(node) + this.stack.push(node) + this.tokenStack.push(token) + node.position = {start: point(token.start)} + return node + } + + function closer(and) { + return close + + function close(token) { + if (and) and.call(this, token) + exit.call(this, token) + } + } + + function exit(token) { + var node = this.stack.pop() + var open = this.tokenStack.pop() + + if (!open) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({start: token.start, end: token.end}) + + '): it’s not open' + ) + } else if (open.type !== token.type) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({start: token.start, end: token.end}) + + '): a different token (`' + + open.type + + '`, ' + + stringifyPosition({start: open.start, end: open.end}) + + ') is open' + ) + } + + node.position.end = point(token.end) + return node + } + + function resume() { + return toString(this.stack.pop()) + } + + // + // Handlers. + // + + function onenterlistordered() { + setData('expectingFirstListItemValue', true) + } + + function onenterlistitemvalue(token) { + if (getData('expectingFirstListItemValue')) { + this.stack[this.stack.length - 2].start = parseInt( + this.sliceSerialize(token), + 10 + ) + + setData('expectingFirstListItemValue') + } + } + + function onexitcodefencedfenceinfo() { + var data = this.resume() + this.stack[this.stack.length - 1].lang = data + } + + function onexitcodefencedfencemeta() { + var data = this.resume() + this.stack[this.stack.length - 1].meta = data + } + + function onexitcodefencedfence() { + // Exit if this is the closing fence. + if (getData('flowCodeInside')) return + this.buffer() + setData('flowCodeInside', true) + } + + function onexitcodefenced() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data.replace( + /^(\r?\n|\r)|(\r?\n|\r)$/g, + '' + ) + + setData('flowCodeInside') + } + + function onexitcodeindented() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitdefinitionlabelstring(token) { + // Discard label, use the source content instead. + var label = this.resume() + this.stack[this.stack.length - 1].label = label + this.stack[this.stack.length - 1].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + } + + function onexitdefinitiontitlestring() { + var data = this.resume() + this.stack[this.stack.length - 1].title = data + } + + function onexitdefinitiondestinationstring() { + var data = this.resume() + this.stack[this.stack.length - 1].url = data + } + + function onexitatxheadingsequence(token) { + if (!this.stack[this.stack.length - 1].depth) { + this.stack[this.stack.length - 1].depth = this.sliceSerialize( + token + ).length + } + } + + function onexitsetextheadingtext() { + setData('setextHeadingSlurpLineEnding', true) + } + + function onexitsetextheadinglinesequence(token) { + this.stack[this.stack.length - 1].depth = + this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2 + } + + function onexitsetextheading() { + setData('setextHeadingSlurpLineEnding') + } + + function onenterdata(token) { + var siblings = this.stack[this.stack.length - 1].children + var tail = siblings[siblings.length - 1] + + if (!tail || tail.type !== 'text') { + // Add a new text node. + tail = text() + tail.position = {start: point(token.start)} + this.stack[this.stack.length - 1].children.push(tail) + } + + this.stack.push(tail) + } + + function onexitdata(token) { + var tail = this.stack.pop() + tail.value += this.sliceSerialize(token) + tail.position.end = point(token.end) + } + + function onexitlineending(token) { + var context = this.stack[this.stack.length - 1] + + // If we’re at a hard break, include the line ending in there. + if (getData('atHardBreak')) { + context.children[context.children.length - 1].position.end = point( + token.end + ) + + setData('atHardBreak') + return + } + + if ( + !getData('setextHeadingSlurpLineEnding') && + config.canContainEols.indexOf(context.type) > -1 + ) { + onenterdata.call(this, token) + onexitdata.call(this, token) + } + } + + function onexithardbreak() { + setData('atHardBreak', true) + } + + function onexithtmlflow() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexithtmltext() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitcodetext() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitlink() { + var context = this.stack[this.stack.length - 1] + + // To do: clean. + if (getData('inReference')) { + context.type += 'Reference' + context.referenceType = getData('referenceType') || 'shortcut' + delete context.url + delete context.title + } else { + delete context.identifier + delete context.label + delete context.referenceType + } + + setData('referenceType') + } + + function onexitimage() { + var context = this.stack[this.stack.length - 1] + + // To do: clean. + if (getData('inReference')) { + context.type += 'Reference' + context.referenceType = getData('referenceType') || 'shortcut' + delete context.url + delete context.title + } else { + delete context.identifier + delete context.label + delete context.referenceType + } + + setData('referenceType') + } + + function onexitlabeltext(token) { + this.stack[this.stack.length - 2].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + } + + function onexitlabel() { + var fragment = this.stack[this.stack.length - 1] + var value = this.resume() + + this.stack[this.stack.length - 1].label = value + + // Assume a reference. + setData('inReference', true) + + if (this.stack[this.stack.length - 1].type === 'link') { + this.stack[this.stack.length - 1].children = fragment.children + } else { + this.stack[this.stack.length - 1].alt = value + } + } + + function onexitresourcedestinationstring() { + var data = this.resume() + this.stack[this.stack.length - 1].url = data + } + + function onexitresourcetitlestring() { + var data = this.resume() + this.stack[this.stack.length - 1].title = data + } + + function onexitresource() { + setData('inReference') + } + + function onenterreference() { + setData('referenceType', 'collapsed') + } + + function onexitreferencestring(token) { + var label = this.resume() + this.stack[this.stack.length - 1].label = label + this.stack[this.stack.length - 1].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + setData('referenceType', 'full') + } + + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type) + } + + function onexitcharacterreferencevalue(token) { + var data = this.sliceSerialize(token) + var type = getData('characterReferenceType') + var value + var tail + + if (type) { + value = safeFromInt( + data, + type === 'characterReferenceMarkerNumeric' ? 10 : 16 + ) + + setData('characterReferenceType') + } else { + value = decode(data) + } + + tail = this.stack.pop() + tail.value += value + tail.position.end = point(token.end) + } + + function onexitautolinkprotocol(token) { + onexitdata.call(this, token) + this.stack[this.stack.length - 1].url = this.sliceSerialize(token) + } + + function onexitautolinkemail(token) { + onexitdata.call(this, token) + this.stack[this.stack.length - 1].url = + 'mailto:' + this.sliceSerialize(token) + } + + // + // Creaters. + // + + function blockQuote() { + return {type: 'blockquote', children: []} + } + + function codeFlow() { + return {type: 'code', lang: null, meta: null, value: ''} + } + + function codeText() { + return {type: 'inlineCode', value: ''} + } + + function definition() { + return { + type: 'definition', + identifier: '', + label: null, + title: null, + url: '' + } + } + + function emphasis() { + return {type: 'emphasis', children: []} + } + + function heading() { + return {type: 'heading', depth: undefined, children: []} + } + + function hardBreak() { + return {type: 'break'} + } + + function html() { + return {type: 'html', value: ''} + } + + function image() { + return {type: 'image', title: null, url: '', alt: null} + } + + function link() { + return {type: 'link', title: null, url: '', children: []} + } + + function list(token) { + return { + type: 'list', + ordered: token.type === 'listOrdered', + start: null, + spread: token._spread, + children: [] + } + } + + function listItem(token) { + return { + type: 'listItem', + spread: token._spread, + checked: null, + children: [] + } + } + + function paragraph() { + return {type: 'paragraph', children: []} + } + + function strong() { + return {type: 'strong', children: []} + } + + function text() { + return {type: 'text', value: ''} + } + + function thematicBreak() { + return {type: 'thematicBreak'} + } +} + +function configure(config, extensions) { + var index = -1 + + while (++index < extensions.length) { + extension(config, extensions[index]) + } + + return config +} + +function extension(config, extension) { + var key + var left + + for (key in extension) { + left = own.call(config, key) ? config[key] : (config[key] = {}) + + if (key === 'canContainEols' || key === 'transforms') { + config[key] = [].concat(left, extension[key]) + } else { + Object.assign(left, extension[key]) + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/index.js new file mode 100644 index 00000000000000..2b74f75ae99432 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/index.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('./dist') diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/lib/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/lib/index.js new file mode 100644 index 00000000000000..1e2e7806c09075 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/lib/index.js @@ -0,0 +1,819 @@ +'use strict' + +module.exports = fromMarkdown + +// These three are compiled away in the `dist/` +var codes = require('micromark/dist/character/codes') +var constants = require('micromark/dist/constant/constants') +var types = require('micromark/dist/constant/types') + +var toString = require('mdast-util-to-string') +var assign = require('micromark/dist/constant/assign') +var own = require('micromark/dist/constant/has-own-property') +var normalizeIdentifier = require('micromark/dist/util/normalize-identifier') +var safeFromInt = require('micromark/dist/util/safe-from-int') +var parser = require('micromark/dist/parse') +var preprocessor = require('micromark/dist/preprocess') +var postprocess = require('micromark/dist/postprocess') +var decode = require('parse-entities/decode-entity') +var stringifyPosition = require('unist-util-stringify-position') + +function fromMarkdown(value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding + encoding = undefined + } + + return compiler(options)( + postprocess( + parser(options).document().write(preprocessor()(value, encoding, true)) + ) + ) +} + +// Note this compiler only understand complete buffering, not streaming. +function compiler(options) { + var settings = options || {} + var config = configure( + { + transforms: [], + canContainEols: [ + 'emphasis', + 'fragment', + 'heading', + 'paragraph', + 'strong' + ], + enter: { + autolink: opener(link), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading), + blockQuote: opener(blockQuote), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: opener(codeFlow, buffer), + codeText: opener(codeText, buffer), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition), + definitionDestinationString: buffer, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: opener(emphasis), + hardBreakEscape: opener(hardBreak), + hardBreakTrailing: opener(hardBreak), + htmlFlow: opener(html, buffer), + htmlFlowData: onenterdata, + htmlText: opener(html, buffer), + htmlTextData: onenterdata, + image: opener(image), + label: buffer, + link: opener(link), + listItem: opener(listItem), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list, onenterlistordered), + listUnordered: opener(list), + paragraph: opener(paragraph), + reference: onenterreference, + referenceString: buffer, + resourceDestinationString: buffer, + resourceTitleString: buffer, + setextHeading: opener(heading), + strong: opener(strong), + thematicBreak: opener(thematicBreak) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }, + settings.mdastExtensions || [] + ) + + var data = {} + + return compile + + function compile(events) { + var tree = {type: 'root', children: []} + var stack = [tree] + var tokenStack = [] + var listStack = [] + var index = -1 + var handler + var listStart + + var context = { + stack: stack, + tokenStack: tokenStack, + config: config, + enter: enter, + exit: exit, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + } + + while (++index < events.length) { + // We preprocess lists to add `listItem` tokens, and to infer whether + // items the list itself are spread out. + if ( + events[index][1].type === types.listOrdered || + events[index][1].type === types.listUnordered + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + listStart = listStack.pop(index) + index = prepareList(events, listStart, index) + } + } + } + + index = -1 + + while (++index < events.length) { + handler = config[events[index][0]] + + if (own.call(handler, events[index][1].type)) { + handler[events[index][1].type].call( + assign({sliceSerialize: events[index][2].sliceSerialize}, context), + events[index][1] + ) + } + } + + if (tokenStack.length) { + throw new Error( + 'Cannot close document, a token (`' + + tokenStack[tokenStack.length - 1].type + + '`, ' + + stringifyPosition({ + start: tokenStack[tokenStack.length - 1].start, + end: tokenStack[tokenStack.length - 1].end + }) + + ') is still open' + ) + } + + // Figure out `root` position. + tree.position = { + start: point( + events.length ? events[0][1].start : {line: 1, column: 1, offset: 0} + ), + end: point( + events.length + ? events[events.length - 2][1].end + : {line: 1, column: 1, offset: 0} + ) + } + + index = -1 + while (++index < config.transforms.length) { + tree = config.transforms[index](tree) || tree + } + + return tree + } + + function prepareList(events, start, length) { + var index = start - 1 + var containerBalance = -1 + var listSpread = false + var listItem + var tailIndex + var lineIndex + var tailEvent + var event + var firstBlankLineIndex + var atMarker + + while (++index <= length) { + event = events[index] + + if ( + event[1].type === types.listUnordered || + event[1].type === types.listOrdered || + event[1].type === types.blockQuote + ) { + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + + atMarker = undefined + } else if (event[1].type === types.lineEndingBlank) { + if (event[0] === 'enter') { + if ( + listItem && + !atMarker && + !containerBalance && + !firstBlankLineIndex + ) { + firstBlankLineIndex = index + } + + atMarker = undefined + } + } else if ( + event[1].type === types.linePrefix || + event[1].type === types.listItemValue || + event[1].type === types.listItemMarker || + event[1].type === types.listItemPrefix || + event[1].type === types.listItemPrefixWhitespace + ) { + // Empty. + } else { + atMarker = undefined + } + + if ( + (!containerBalance && + event[0] === 'enter' && + event[1].type === types.listItemPrefix) || + (containerBalance === -1 && + event[0] === 'exit' && + (event[1].type === types.listUnordered || + event[1].type === types.listOrdered)) + ) { + if (listItem) { + tailIndex = index + lineIndex = undefined + + while (tailIndex--) { + tailEvent = events[tailIndex] + + if ( + tailEvent[1].type === types.lineEnding || + tailEvent[1].type === types.lineEndingBlank + ) { + if (tailEvent[0] === 'exit') continue + + if (lineIndex) { + events[lineIndex][1].type = types.lineEndingBlank + listSpread = true + } + + tailEvent[1].type = types.lineEnding + lineIndex = tailIndex + } else if ( + tailEvent[1].type === types.linePrefix || + tailEvent[1].type === types.blockQuotePrefix || + tailEvent[1].type === types.blockQuotePrefixWhitespace || + tailEvent[1].type === types.blockQuoteMarker || + tailEvent[1].type === types.listItemIndent + ) { + // Empty + } else { + break + } + } + + if ( + firstBlankLineIndex && + (!lineIndex || firstBlankLineIndex < lineIndex) + ) { + listItem._spread = true + } + + // Fix position. + listItem.end = point( + lineIndex ? events[lineIndex][1].start : event[1].end + ) + + events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]) + index++ + length++ + } + + // Create a new list item. + if (event[1].type === types.listItemPrefix) { + listItem = { + type: 'listItem', + _spread: false, + start: point(event[1].start) + } + events.splice(index, 0, ['enter', listItem, event[2]]) + index++ + length++ + firstBlankLineIndex = undefined + atMarker = true + } + } + } + + events[start][1]._spread = listSpread + return length + } + + function setData(key, value) { + data[key] = value + } + + function getData(key) { + return data[key] + } + + function point(d) { + return {line: d.line, column: d.column, offset: d.offset} + } + + function opener(create, and) { + return open + + function open(token) { + enter.call(this, create(token), token) + if (and) and.call(this, token) + } + } + + function buffer() { + this.stack.push({type: 'fragment', children: []}) + } + + function enter(node, token) { + this.stack[this.stack.length - 1].children.push(node) + this.stack.push(node) + this.tokenStack.push(token) + node.position = {start: point(token.start)} + return node + } + + function closer(and) { + return close + + function close(token) { + if (and) and.call(this, token) + exit.call(this, token) + } + } + + function exit(token) { + var node = this.stack.pop() + var open = this.tokenStack.pop() + + if (!open) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({start: token.start, end: token.end}) + + '): it’s not open' + ) + } else if (open.type !== token.type) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({start: token.start, end: token.end}) + + '): a different token (`' + + open.type + + '`, ' + + stringifyPosition({start: open.start, end: open.end}) + + ') is open' + ) + } + + node.position.end = point(token.end) + return node + } + + function resume() { + return toString(this.stack.pop()) + } + + // + // Handlers. + // + + function onenterlistordered() { + setData('expectingFirstListItemValue', true) + } + + function onenterlistitemvalue(token) { + if (getData('expectingFirstListItemValue')) { + this.stack[this.stack.length - 2].start = parseInt( + this.sliceSerialize(token), + constants.numericBaseDecimal + ) + setData('expectingFirstListItemValue') + } + } + + function onexitcodefencedfenceinfo() { + var data = this.resume() + this.stack[this.stack.length - 1].lang = data + } + + function onexitcodefencedfencemeta() { + var data = this.resume() + this.stack[this.stack.length - 1].meta = data + } + + function onexitcodefencedfence() { + // Exit if this is the closing fence. + if (getData('flowCodeInside')) return + this.buffer() + setData('flowCodeInside', true) + } + + function onexitcodefenced() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data.replace( + /^(\r?\n|\r)|(\r?\n|\r)$/g, + '' + ) + setData('flowCodeInside') + } + + function onexitcodeindented() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitdefinitionlabelstring(token) { + // Discard label, use the source content instead. + var label = this.resume() + this.stack[this.stack.length - 1].label = label + this.stack[this.stack.length - 1].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + } + + function onexitdefinitiontitlestring() { + var data = this.resume() + this.stack[this.stack.length - 1].title = data + } + + function onexitdefinitiondestinationstring() { + var data = this.resume() + this.stack[this.stack.length - 1].url = data + } + + function onexitatxheadingsequence(token) { + if (!this.stack[this.stack.length - 1].depth) { + this.stack[this.stack.length - 1].depth = this.sliceSerialize( + token + ).length + } + } + + function onexitsetextheadingtext() { + setData('setextHeadingSlurpLineEnding', true) + } + + function onexitsetextheadinglinesequence(token) { + this.stack[this.stack.length - 1].depth = + this.sliceSerialize(token).charCodeAt(0) === codes.equalsTo ? 1 : 2 + } + + function onexitsetextheading() { + setData('setextHeadingSlurpLineEnding') + } + + function onenterdata(token) { + var siblings = this.stack[this.stack.length - 1].children + var tail = siblings[siblings.length - 1] + + if (!tail || tail.type !== 'text') { + // Add a new text node. + tail = text() + tail.position = {start: point(token.start)} + this.stack[this.stack.length - 1].children.push(tail) + } + + this.stack.push(tail) + } + + function onexitdata(token) { + var tail = this.stack.pop() + tail.value += this.sliceSerialize(token) + tail.position.end = point(token.end) + } + + function onexitlineending(token) { + var context = this.stack[this.stack.length - 1] + + // If we’re at a hard break, include the line ending in there. + if (getData('atHardBreak')) { + context.children[context.children.length - 1].position.end = point( + token.end + ) + setData('atHardBreak') + return + } + + if ( + !getData('setextHeadingSlurpLineEnding') && + config.canContainEols.indexOf(context.type) > -1 + ) { + onenterdata.call(this, token) + onexitdata.call(this, token) + } + } + + function onexithardbreak() { + setData('atHardBreak', true) + } + + function onexithtmlflow() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexithtmltext() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitcodetext() { + var data = this.resume() + this.stack[this.stack.length - 1].value = data + } + + function onexitlink() { + var context = this.stack[this.stack.length - 1] + + // To do: clean. + if (getData('inReference')) { + context.type += 'Reference' + context.referenceType = getData('referenceType') || 'shortcut' + delete context.url + delete context.title + } else { + delete context.identifier + delete context.label + delete context.referenceType + } + + setData('referenceType') + } + + function onexitimage() { + var context = this.stack[this.stack.length - 1] + + // To do: clean. + if (getData('inReference')) { + context.type += 'Reference' + context.referenceType = getData('referenceType') || 'shortcut' + delete context.url + delete context.title + } else { + delete context.identifier + delete context.label + delete context.referenceType + } + + setData('referenceType') + } + + function onexitlabeltext(token) { + this.stack[this.stack.length - 2].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + } + + function onexitlabel() { + var fragment = this.stack[this.stack.length - 1] + var value = this.resume() + + this.stack[this.stack.length - 1].label = value + + // Assume a reference. + setData('inReference', true) + + if (this.stack[this.stack.length - 1].type === 'link') { + this.stack[this.stack.length - 1].children = fragment.children + } else { + this.stack[this.stack.length - 1].alt = value + } + } + + function onexitresourcedestinationstring() { + var data = this.resume() + this.stack[this.stack.length - 1].url = data + } + + function onexitresourcetitlestring() { + var data = this.resume() + this.stack[this.stack.length - 1].title = data + } + + function onexitresource() { + setData('inReference') + } + + function onenterreference() { + setData('referenceType', 'collapsed') + } + + function onexitreferencestring(token) { + var label = this.resume() + this.stack[this.stack.length - 1].label = label + this.stack[this.stack.length - 1].identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + setData('referenceType', 'full') + } + + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type) + } + + function onexitcharacterreferencevalue(token) { + var data = this.sliceSerialize(token) + var type = getData('characterReferenceType') + var value + var tail + + if (type) { + value = safeFromInt( + data, + type === types.characterReferenceMarkerNumeric + ? constants.numericBaseDecimal + : constants.numericBaseHexadecimal + ) + setData('characterReferenceType') + } else { + value = decode(data) + } + + tail = this.stack.pop() + tail.value += value + tail.position.end = point(token.end) + } + + function onexitautolinkprotocol(token) { + onexitdata.call(this, token) + this.stack[this.stack.length - 1].url = this.sliceSerialize(token) + } + + function onexitautolinkemail(token) { + onexitdata.call(this, token) + this.stack[this.stack.length - 1].url = + 'mailto:' + this.sliceSerialize(token) + } + + // + // Creaters. + // + + function blockQuote() { + return {type: 'blockquote', children: []} + } + + function codeFlow() { + return {type: 'code', lang: null, meta: null, value: ''} + } + + function codeText() { + return {type: 'inlineCode', value: ''} + } + + function definition() { + return { + type: 'definition', + identifier: '', + label: null, + title: null, + url: '' + } + } + + function emphasis() { + return {type: 'emphasis', children: []} + } + + function heading() { + return {type: 'heading', depth: undefined, children: []} + } + + function hardBreak() { + return {type: 'break'} + } + + function html() { + return {type: 'html', value: ''} + } + + function image() { + return {type: 'image', title: null, url: '', alt: null} + } + + function link() { + return {type: 'link', title: null, url: '', children: []} + } + + function list(token) { + return { + type: 'list', + ordered: token.type === 'listOrdered', + start: null, + spread: token._spread, + children: [] + } + } + + function listItem(token) { + return { + type: 'listItem', + spread: token._spread, + checked: null, + children: [] + } + } + + function paragraph() { + return {type: 'paragraph', children: []} + } + + function strong() { + return {type: 'strong', children: []} + } + + function text() { + return {type: 'text', value: ''} + } + + function thematicBreak() { + return {type: 'thematicBreak'} + } +} + +function configure(config, extensions) { + var index = -1 + + while (++index < extensions.length) { + extension(config, extensions[index]) + } + + return config +} + +function extension(config, extension) { + var key + var left + + for (key in extension) { + left = own.call(config, key) ? config[key] : (config[key] = {}) + + if (key === 'canContainEols' || key === 'transforms') { + config[key] = [].concat(left, extension[key]) + } else { + Object.assign(left, extension[key]) + } + } +} diff --git a/tools/node_modules/eslint/node_modules/markdown-escapes/license b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/license similarity index 94% rename from tools/node_modules/eslint/node_modules/markdown-escapes/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/license index 8d8660d36ef2ec..39372356c47d0f 100644 --- a/tools/node_modules/eslint/node_modules/markdown-escapes/license +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/license @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2016 Titus Wormer +Copyright (c) 2020 Titus Wormer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/package.json new file mode 100644 index 00000000000000..b17e76df3f7162 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/package.json @@ -0,0 +1,109 @@ +{ + "name": "mdast-util-from-markdown", + "version": "0.8.5", + "description": "mdast utility to parse markdown", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "parse", + "syntax", + "tree", + "ast" + ], + "repository": "syntax-tree/mdast-util-from-markdown", + "bugs": "https://github.com/syntax-tree/mdast-util-from-markdown/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "dist/", + "lib/", + "index.js", + "types/index.d.ts" + ], + "types": "types", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "babel-plugin-inline-constants": "^1.0.0", + "browserify": "^17.0.0", + "commonmark.json": "^0.29.0", + "dtslint": "^4.0.0", + "gzip-size-cli": "^4.0.0", + "hast-util-to-html": "^7.0.0", + "mdast-util-to-hast": "^10.0.0", + "nyc": "^15.0.0", + "prettier": "^2.0.0", + "rehype-parse": "^7.0.0", + "rehype-stringify": "^8.0.0", + "remark-cli": "^9.0.0", + "remark-preset-wooorm": "^8.0.0", + "tape": "^5.0.0", + "tinyify": "^3.0.0", + "unified": "^9.0.0", + "xo": "^0.37.0" + }, + "scripts": { + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "generate-dist": "babel lib/ --out-dir dist/ --quiet --retain-lines; prettier dist/ --loglevel error --write", + "generate-size": "browserify . -p tinyify -s mdast-util-from-markdown -o mdast-util-from-markdown.min.js; gzip-size mdast-util-from-markdown.min.js --raw", + "generate": "npm run generate-dist && npm run generate-size", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test/index.js", + "test-types": "dtslint types", + "test": "npm run format && npm run generate && npm run test-coverage && npm run test-types" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "complexity": "off", + "guard-for-in": "off", + "unicorn/explicit-length-check": "off", + "unicorn/no-array-callback-reference": "off", + "unicorn/prefer-includes": "off", + "unicorn/prefer-number-properties": "off", + "unicorn/prefer-optional-catch-binding": "off" + }, + "ignores": [ + "types/" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/readme.md new file mode 100644 index 00000000000000..30362141dc2e08 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown/readme.md @@ -0,0 +1,206 @@ +# mdast-util-from-markdown + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**[mdast][]** utility to parse markdown. + +## Install + +[npm][]: + +```sh +npm install mdast-util-from-markdown +``` + +## Use + +Say we have the following markdown file, `example.md`: + +```markdown +## Hello, *World*! +``` + +And our script, `example.js`, looks as follows: + +```js +var fs = require('fs') +var fromMarkdown = require('mdast-util-from-markdown') + +var doc = fs.readFileSync('example.md') + +var tree = fromMarkdown(doc) + +console.log(tree) +``` + +Now, running `node example` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'heading', + depth: 2, + children: [ + {type: 'text', value: 'Hello, '}, + { + type: 'emphasis', + children: [{type: 'text', value: 'World'}] + }, + {type: 'text', value: '!'} + ] + } + ] +} +``` + +## API + +### `fromMarkdown(doc[, encoding][, options])` + +Parse markdown to a **[mdast][]** tree. + +##### Parameters + +###### `doc` + +Value to parse (`string` or [`Buffer`][buffer]). + +###### `encoding` + +[Character encoding][encoding] to understand `doc` as when it’s a +[`Buffer`][buffer] (`string`, default: `'utf8'`). + +###### `options.extensions` + +Array of syntax extensions (`Array.`, default: `[]`). +Passed to [`micromark` as `extensions`][micromark-extensions]. + +###### `options.mdastExtensions` + +Array of mdast extensions (`Array.`, default: `[]`). + +##### Returns + +[`Root`][root]. + +## List of extensions + +* [`syntax-tree/mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive) + — parse directives +* [`syntax-tree/mdast-util-footnote`](https://github.com/syntax-tree/mdast-util-footnote) + — parse footnotes +* [`syntax-tree/mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter) + — parse frontmatter (YAML, TOML, more) +* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm) + — parse GFM +* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal) + — parse GFM autolink literals +* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough) + — parse GFM strikethrough +* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table) + — parse GFM tables +* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) + — parse GFM task list items +* [`syntax-tree/mdast-util-math`](https://github.com/syntax-tree/mdast-util-math) + — parse math +* [`syntax-tree/mdast-util-mdx`](https://github.com/syntax-tree/mdast-util-mdx) + — parse MDX or MDX.js +* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression) + — parse MDX or MDX.js expressions +* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx) + — parse MDX or MDX.js JSX +* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm) + — parse MDX.js ESM + +## Security + +As Markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-from-markdown` +can also be unsafe. +When going to HTML, use this utility in combination with +[`hast-util-sanitize`][sanitize] to make the tree safe. + +## Related + +* [`micromark/micromark`](https://github.com/micromark/micromark) + — the smallest commonmark-compliant markdown parser that exists +* [`remarkjs/remark`](https://github.com/remarkjs/remark) + — markdown processor powered by plugins +* [`syntax-tree/mdast-util-to-markdown`](https://github.com/syntax-tree/mdast-util-to-markdown) + — serialize mdast to markdown + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-from-markdown/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-from-markdown/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-from-markdown.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-from-markdown + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-from-markdown.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-from-markdown + +[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-from-markdown.svg + +[size]: https://bundlephobia.com/result?p=mdast-util-from-markdown + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[root]: https://github.com/syntax-tree/mdast#root + +[encoding]: https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + +[buffer]: https://nodejs.org/api/buffer.html + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[sanitize]: https://github.com/syntax-tree/hast-util-sanitize + +[micromark-extensions]: https://github.com/micromark/micromark#optionsextensions diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/index.js new file mode 100644 index 00000000000000..0ae5f1dbdb3cfc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/index.js @@ -0,0 +1,29 @@ +'use strict' + +module.exports = toString + +// Get the text content of a node. +// Prefer the node’s plain-text fields, otherwise serialize its children, +// and if the given value is an array, serialize the nodes in it. +function toString(node) { + return ( + (node && + (node.value || + node.alt || + node.title || + ('children' in node && all(node.children)) || + ('length' in node && all(node)))) || + '' + ) +} + +function all(values) { + var result = [] + var index = -1 + + while (++index < values.length) { + result[index] = toString(values[index]) + } + + return result.join('') +} diff --git a/tools/node_modules/eslint/node_modules/collapse-white-space/license b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/license similarity index 100% rename from tools/node_modules/eslint/node_modules/collapse-white-space/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/license diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/package.json new file mode 100644 index 00000000000000..124287e2978476 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/package.json @@ -0,0 +1,80 @@ +{ + "name": "mdast-util-to-string", + "version": "2.0.0", + "description": "mdast utility to get the plain text content of a node", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "node", + "string", + "serialize" + ], + "repository": "syntax-tree/mdast-util-to-string", + "bugs": "https://github.com/syntax-tree/mdast-util-to-string/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js", + "types/index.d.ts" + ], + "types": "types/index.d.ts", + "devDependencies": { + "browserify": "^17.0.0", + "dtslint": "^4.0.0", + "nyc": "^15.0.0", + "prettier": "^2.0.0", + "remark-cli": "^9.0.0", + "remark-preset-wooorm": "^8.0.0", + "tape": "^5.0.0", + "tinyify": "^3.0.0", + "xo": "^0.34.0" + }, + "scripts": { + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "build-bundle": "browserify . -s mdastUtilToString -o mdast-util-to-string.js", + "build-mangle": "browserify . -s mdastUtilToString -o mdast-util-to-string.min.js -p tinyify", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "ignore": [ + "mdast-util-to-string.js", + "types/test.ts" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/readme.md new file mode 100644 index 00000000000000..2b7f1a0ed03ad5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string/readme.md @@ -0,0 +1,127 @@ +# mdast-util-to-string + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**[mdast][]** utility to get the plain text content of a node. + +## Install + +[npm][]: + +```sh +npm install mdast-util-to-string +``` + +## Use + +```js +var unified = require('unified') +var parse = require('remark-parse') +var toString = require('mdast-util-to-string') + +var tree = unified() + .use(parse) + .parse('Some _emphasis_, **importance**, and `code`.') + +console.log(toString(tree)) // => 'Some emphasis, importance, and code.' +``` + +## API + +### `toString(node)` + +Get the text content of a [node][] or list of nodes. + +The algorithm checks `value` of `node`, then `alt`, and finally `title`. +If no value is found, the algorithm checks the children of `node` and joins them +(without spaces or newlines). + +> This is not a markdown to plain-text library. +> Use [`strip-markdown`][strip-markdown] for that. + +## Security + +Use of `mdast-util-to-string` does not involve **[hast][]**, user content, or +change the tree, so there are no openings for [cross-site scripting (XSS)][xss] +attacks. + +## Related + +* [`nlcst-to-string`](https://github.com/syntax-tree/nlcst-to-string) + — Get text content in nlcst +* [`hast-util-to-string`](https://github.com/wooorm/rehype-minify/tree/HEAD/packages/hast-util-to-string) + — Get text content in hast +* [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text) + — Get text content in hast according to the `innerText` algorithm +* [`hast-util-from-string`](https://github.com/wooorm/rehype-minify/tree/HEAD/packages/hast-util-from-string) + — Set text content in hast + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-to-string/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-to-string/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-string.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-string + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-string.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-to-string + +[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-to-string.svg + +[size]: https://bundlephobia.com/result?p=mdast-util-to-string + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[node]: https://github.com/syntax-tree/mdast#nodes + +[strip-markdown]: https://github.com/remarkjs/strip-markdown + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[hast]: https://github.com/syntax-tree/hast diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.js new file mode 100644 index 00000000000000..2b74f75ae99432 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('./dist') diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.mjs new file mode 100644 index 00000000000000..9b91a071fdaca6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/buffer.mjs @@ -0,0 +1 @@ +export {default} from './dist/index.js' diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alpha.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alpha.js new file mode 100644 index 00000000000000..4e5b20d20b9315 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alpha.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAlpha = regexCheck(/[A-Za-z]/) + +module.exports = asciiAlpha diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alphanumeric.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alphanumeric.js new file mode 100644 index 00000000000000..4ab360273aa25e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-alphanumeric.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/) + +module.exports = asciiAlphanumeric diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-atext.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-atext.js new file mode 100644 index 00000000000000..8962f996ede7ef --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-atext.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/) + +module.exports = asciiAtext diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-control.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-control.js new file mode 100644 index 00000000000000..604ed1f2c66ee7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-control.js @@ -0,0 +1,12 @@ +'use strict' + +// Note: EOF is seen as ASCII control here, because `null < 32 == true`. +function asciiControl(code) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + code < 32 || code === 127 + ) +} + +module.exports = asciiControl diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-digit.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-digit.js new file mode 100644 index 00000000000000..da614c4e409dd3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-digit.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiDigit = regexCheck(/\d/) + +module.exports = asciiDigit diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-hex-digit.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-hex-digit.js new file mode 100644 index 00000000000000..a0e7af43edd1b7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-hex-digit.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/) + +module.exports = asciiHexDigit diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-punctuation.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-punctuation.js new file mode 100644 index 00000000000000..596b45a5eb084b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/ascii-punctuation.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/) + +module.exports = asciiPunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/codes.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/codes.js new file mode 100644 index 00000000000000..01ea00a654b709 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/codes.js @@ -0,0 +1,257 @@ +'use strict' + +// This module is compiled away! +// +// micromark works based on character codes. +// This module contains constants for the ASCII block and the replacement +// character. +// A couple of them are handled in a special way, such as the line endings +// (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal +// tab) and its expansion based on what column it’s at (virtual space), +// and the end-of-file (eof) character. +// As values are preprocessed before handling them, the actual characters LF, +// CR, HT, and NUL (which is present as the replacement character), are +// guaranteed to not exist. +// +// Unicode basic latin block. +var codes = { + carriageReturn: -5, + lineFeed: -4, + carriageReturnLineFeed: -3, + horizontalTab: -2, + virtualSpace: -1, + eof: null, + nul: 0, + soh: 1, + stx: 2, + etx: 3, + eot: 4, + enq: 5, + ack: 6, + bel: 7, + bs: 8, + ht: 9, + // `\t` + lf: 10, + // `\n` + vt: 11, + // `\v` + ff: 12, + // `\f` + cr: 13, + // `\r` + so: 14, + si: 15, + dle: 16, + dc1: 17, + dc2: 18, + dc3: 19, + dc4: 20, + nak: 21, + syn: 22, + etb: 23, + can: 24, + em: 25, + sub: 26, + esc: 27, + fs: 28, + gs: 29, + rs: 30, + us: 31, + space: 32, + exclamationMark: 33, + // `!` + quotationMark: 34, + // `"` + numberSign: 35, + // `#` + dollarSign: 36, + // `$` + percentSign: 37, + // `%` + ampersand: 38, + // `&` + apostrophe: 39, + // `'` + leftParenthesis: 40, + // `(` + rightParenthesis: 41, + // `)` + asterisk: 42, + // `*` + plusSign: 43, + // `+` + comma: 44, + // `,` + dash: 45, + // `-` + dot: 46, + // `.` + slash: 47, + // `/` + digit0: 48, + // `0` + digit1: 49, + // `1` + digit2: 50, + // `2` + digit3: 51, + // `3` + digit4: 52, + // `4` + digit5: 53, + // `5` + digit6: 54, + // `6` + digit7: 55, + // `7` + digit8: 56, + // `8` + digit9: 57, + // `9` + colon: 58, + // `:` + semicolon: 59, + // `;` + lessThan: 60, + // `<` + equalsTo: 61, + // `=` + greaterThan: 62, + // `>` + questionMark: 63, + // `?` + atSign: 64, + // `@` + uppercaseA: 65, + // `A` + uppercaseB: 66, + // `B` + uppercaseC: 67, + // `C` + uppercaseD: 68, + // `D` + uppercaseE: 69, + // `E` + uppercaseF: 70, + // `F` + uppercaseG: 71, + // `G` + uppercaseH: 72, + // `H` + uppercaseI: 73, + // `I` + uppercaseJ: 74, + // `J` + uppercaseK: 75, + // `K` + uppercaseL: 76, + // `L` + uppercaseM: 77, + // `M` + uppercaseN: 78, + // `N` + uppercaseO: 79, + // `O` + uppercaseP: 80, + // `P` + uppercaseQ: 81, + // `Q` + uppercaseR: 82, + // `R` + uppercaseS: 83, + // `S` + uppercaseT: 84, + // `T` + uppercaseU: 85, + // `U` + uppercaseV: 86, + // `V` + uppercaseW: 87, + // `W` + uppercaseX: 88, + // `X` + uppercaseY: 89, + // `Y` + uppercaseZ: 90, + // `Z` + leftSquareBracket: 91, + // `[` + backslash: 92, + // `\` + rightSquareBracket: 93, + // `]` + caret: 94, + // `^` + underscore: 95, + // `_` + graveAccent: 96, + // `` ` `` + lowercaseA: 97, + // `a` + lowercaseB: 98, + // `b` + lowercaseC: 99, + // `c` + lowercaseD: 100, + // `d` + lowercaseE: 101, + // `e` + lowercaseF: 102, + // `f` + lowercaseG: 103, + // `g` + lowercaseH: 104, + // `h` + lowercaseI: 105, + // `i` + lowercaseJ: 106, + // `j` + lowercaseK: 107, + // `k` + lowercaseL: 108, + // `l` + lowercaseM: 109, + // `m` + lowercaseN: 110, + // `n` + lowercaseO: 111, + // `o` + lowercaseP: 112, + // `p` + lowercaseQ: 113, + // `q` + lowercaseR: 114, + // `r` + lowercaseS: 115, + // `s` + lowercaseT: 116, + // `t` + lowercaseU: 117, + // `u` + lowercaseV: 118, + // `v` + lowercaseW: 119, + // `w` + lowercaseX: 120, + // `x` + lowercaseY: 121, + // `y` + lowercaseZ: 122, + // `z` + leftCurlyBrace: 123, + // `{` + verticalBar: 124, + // `|` + rightCurlyBrace: 125, + // `}` + tilde: 126, + // `~` + del: 127, + // Unicode Specials block. + byteOrderMarker: 65279, + // Unicode Specials block. + replacementCharacter: 65533 // `�` +} + +module.exports = codes diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending-or-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending-or-space.js new file mode 100644 index 00000000000000..d78d17d1df30c9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending-or-space.js @@ -0,0 +1,7 @@ +'use strict' + +function markdownLineEndingOrSpace(code) { + return code < 0 || code === 32 +} + +module.exports = markdownLineEndingOrSpace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending.js new file mode 100644 index 00000000000000..5893934c321a6c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-line-ending.js @@ -0,0 +1,7 @@ +'use strict' + +function markdownLineEnding(code) { + return code < -2 +} + +module.exports = markdownLineEnding diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-space.js new file mode 100644 index 00000000000000..e1b907b3009212 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/markdown-space.js @@ -0,0 +1,7 @@ +'use strict' + +function markdownSpace(code) { + return code === -2 || code === -1 || code === 32 +} + +module.exports = markdownSpace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-punctuation.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-punctuation.js new file mode 100644 index 00000000000000..eea51658c743c6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-punctuation.js @@ -0,0 +1,10 @@ +'use strict' + +var unicodePunctuationRegex = require('../constant/unicode-punctuation-regex.js') +var regexCheck = require('../util/regex-check.js') + +// In fact adds to the bundle size. + +var unicodePunctuation = regexCheck(unicodePunctuationRegex) + +module.exports = unicodePunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-whitespace.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-whitespace.js new file mode 100644 index 00000000000000..b09537ea087786 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/unicode-whitespace.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var unicodeWhitespace = regexCheck(/\s/) + +module.exports = unicodeWhitespace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/values.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/values.js new file mode 100644 index 00000000000000..cd1794fd97342a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/character/values.js @@ -0,0 +1,111 @@ +'use strict' + +// This module is compiled away! +// +// While micromark works based on character codes, this module includes the +// string versions of ’em. +// The C0 block, except for LF, CR, HT, and w/ the replacement character added, +// are available here. +var values = { + ht: '\t', + lf: '\n', + cr: '\r', + space: ' ', + exclamationMark: '!', + quotationMark: '"', + numberSign: '#', + dollarSign: '$', + percentSign: '%', + ampersand: '&', + apostrophe: "'", + leftParenthesis: '(', + rightParenthesis: ')', + asterisk: '*', + plusSign: '+', + comma: ',', + dash: '-', + dot: '.', + slash: '/', + digit0: '0', + digit1: '1', + digit2: '2', + digit3: '3', + digit4: '4', + digit5: '5', + digit6: '6', + digit7: '7', + digit8: '8', + digit9: '9', + colon: ':', + semicolon: ';', + lessThan: '<', + equalsTo: '=', + greaterThan: '>', + questionMark: '?', + atSign: '@', + uppercaseA: 'A', + uppercaseB: 'B', + uppercaseC: 'C', + uppercaseD: 'D', + uppercaseE: 'E', + uppercaseF: 'F', + uppercaseG: 'G', + uppercaseH: 'H', + uppercaseI: 'I', + uppercaseJ: 'J', + uppercaseK: 'K', + uppercaseL: 'L', + uppercaseM: 'M', + uppercaseN: 'N', + uppercaseO: 'O', + uppercaseP: 'P', + uppercaseQ: 'Q', + uppercaseR: 'R', + uppercaseS: 'S', + uppercaseT: 'T', + uppercaseU: 'U', + uppercaseV: 'V', + uppercaseW: 'W', + uppercaseX: 'X', + uppercaseY: 'Y', + uppercaseZ: 'Z', + leftSquareBracket: '[', + backslash: '\\', + rightSquareBracket: ']', + caret: '^', + underscore: '_', + graveAccent: '`', + lowercaseA: 'a', + lowercaseB: 'b', + lowercaseC: 'c', + lowercaseD: 'd', + lowercaseE: 'e', + lowercaseF: 'f', + lowercaseG: 'g', + lowercaseH: 'h', + lowercaseI: 'i', + lowercaseJ: 'j', + lowercaseK: 'k', + lowercaseL: 'l', + lowercaseM: 'm', + lowercaseN: 'n', + lowercaseO: 'o', + lowercaseP: 'p', + lowercaseQ: 'q', + lowercaseR: 'r', + lowercaseS: 's', + lowercaseT: 't', + lowercaseU: 'u', + lowercaseV: 'v', + lowercaseW: 'w', + lowercaseX: 'x', + lowercaseY: 'y', + lowercaseZ: 'z', + leftCurlyBrace: '{', + verticalBar: '|', + rightCurlyBrace: '}', + tilde: '~', + replacementCharacter: '�' +} + +module.exports = values diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/compile/html.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/compile/html.js new file mode 100644 index 00000000000000..b6170ef506fd97 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/compile/html.js @@ -0,0 +1,787 @@ +'use strict' + +var decodeEntity = require('parse-entities/decode-entity.js') +var assign = require('../constant/assign.js') +var hasOwnProperty = require('../constant/has-own-property.js') +var combineHtmlExtensions = require('../util/combine-html-extensions.js') +var chunkedPush = require('../util/chunked-push.js') +var miniflat = require('../util/miniflat.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var normalizeUri = require('../util/normalize-uri.js') +var safeFromInt = require('../util/safe-from-int.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var decodeEntity__default = /*#__PURE__*/ _interopDefaultLegacy(decodeEntity) + +// While micromark is a lexer/tokenizer, the common case of going from markdown +// dealt with. +// Technically, we can skip `>` and `"` in many cases, but CM includes them. + +var characterReferences = { + '"': 'quot', + '&': 'amp', + '<': 'lt', + '>': 'gt' +} // These two are allowlists of essentially safe protocols for full URLs in +// respectively the `href` (on ``) and `src` (on ``) attributes. +// They are based on what is allowed on GitHub, +// + +var protocolHref = /^(https?|ircs?|mailto|xmpp)$/i +var protocolSrc = /^https?$/i + +function compileHtml(options) { + // Configuration. + // Includes `htmlExtensions` (an array of extensions), `defaultLineEnding` (a + // preferred EOL), `allowDangerousProtocol` (whether to allow potential + // dangerous protocols), and `allowDangerousHtml` (whether to allow potential + // dangerous HTML). + var settings = options || {} // Tags is needed because according to markdown, links and emphasis and + // whatnot can exist in images, however, as HTML doesn’t allow content in + // images, the tags are ignored in the `alt` attribute, but the content + // remains. + + var tags = true // An object to track identifiers to media (URLs and titles) defined with + // definitions. + + var definitions = {} // A lot of the handlers need to capture some of the output data, modify it + // somehow, and then deal with it. + // We do that by tracking a stack of buffers, that can be opened (with + // `buffer`) and closed (with `resume`) to access them. + + var buffers = [[]] // As we can have links in images and the other way around, where the deepest + // ones are closed first, we need to track which one we’re in. + + var mediaStack = [] // Same for tightness, which is specific to lists. + // We need to track if we’re currently in a tight or loose container. + + var tightStack = [] + var defaultHandlers = { + enter: { + blockQuote: onenterblockquote, + codeFenced: onentercodefenced, + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: onentercodeindented, + codeText: onentercodetext, + content: onentercontent, + definition: onenterdefinition, + definitionDestinationString: onenterdefinitiondestinationstring, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: onenteremphasis, + htmlFlow: onenterhtmlflow, + htmlText: onenterhtml, + image: onenterimage, + label: buffer, + link: onenterlink, + listItemMarker: onenterlistitemmarker, + listItemValue: onenterlistitemvalue, + listOrdered: onenterlistordered, + listUnordered: onenterlistunordered, + paragraph: onenterparagraph, + reference: buffer, + resource: onenterresource, + resourceDestinationString: onenterresourcedestinationstring, + resourceTitleString: buffer, + setextHeading: onentersetextheading, + strong: onenterstrong + }, + exit: { + atxHeading: onexitatxheading, + atxHeadingSequence: onexitatxheadingsequence, + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: onexitblockquote, + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: onexitflowcode, + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: resume, + codeFlowValue: onexitcodeflowvalue, + codeIndented: onexitflowcode, + codeText: onexitcodetext, + codeTextData: onexitdata, + data: onexitdata, + definition: onexitdefinition, + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: onexitemphasis, + hardBreakEscape: onexithardbreak, + hardBreakTrailing: onexithardbreak, + htmlFlow: onexithtml, + htmlFlowData: onexitdata, + htmlText: onexithtml, + htmlTextData: onexitdata, + image: onexitmedia, + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: onexitmedia, + listOrdered: onexitlistordered, + listUnordered: onexitlistunordered, + paragraph: onexitparagraph, + reference: resume, + referenceString: onexitreferencestring, + resource: resume, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + setextHeading: onexitsetextheading, + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: onexitstrong, + thematicBreak: onexitthematicbreak + } + } // Combine the HTML extensions with the default handlers. + // An HTML extension is an object whose fields are either `enter` or `exit` + // (reflecting whether a token is entered or exited). + // The values at such objects are names of tokens mapping to handlers. + // Handlers are called, respectively when a token is opener or closed, with + // that token, and a context as `this`. + + var handlers = combineHtmlExtensions( + [defaultHandlers].concat(miniflat(settings.htmlExtensions)) + ) // Handlers do often need to keep track of some state. + // That state is provided here as a key-value store (an object). + + var data = { + tightStack: tightStack + } // The context for handlers references a couple of useful functions. + // In handlers from extensions, those can be accessed at `this`. + // For the handlers here, they can be accessed directly. + + var context = { + lineEndingIfNeeded: lineEndingIfNeeded, + options: settings, + encode: encode, + raw: raw, + tag: tag, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + } // Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the + // markdown document over to the compiled HTML. + // In some cases, such as `> a`, CommonMark requires that extra line endings + // are added: `
\n

a

\n
`. + // This variable hold the default line ending when given (or `undefined`), + // and in the latter case will be updated to the first found line ending if + // there is one. + + var lineEndingStyle = settings.defaultLineEnding // Return the function that handles a slice of events. + + return compile // Deal w/ a slice of events. + // Return either the empty string if there’s nothing of note to return, or the + // result when done. + + function compile(events) { + // As definitions can come after references, we need to figure out the media + // (urls and titles) defined by them before handling the references. + // So, we do sort of what HTML does: put metadata at the start (in head), and + // then put content after (`body`). + var head = [] + var body = [] + var index + var start + var listStack + var handler + var result + index = -1 + start = 0 + listStack = [] + + while (++index < events.length) { + // Figure out the line ending style used in the document. + if ( + !lineEndingStyle && + (events[index][1].type === 'lineEnding' || + events[index][1].type === 'lineEndingBlank') + ) { + lineEndingStyle = events[index][2].sliceSerialize(events[index][1]) + } // Preprocess lists to infer whether the list is loose or not. + + if ( + events[index][1].type === 'listOrdered' || + events[index][1].type === 'listUnordered' + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + prepareList(events.slice(listStack.pop(), index)) + } + } // Move definitions to the front. + + if (events[index][1].type === 'definition') { + if (events[index][0] === 'enter') { + body = chunkedPush(body, events.slice(start, index)) + start = index + } else { + head = chunkedPush(head, events.slice(start, index + 1)) + start = index + 1 + } + } + } + + head = chunkedPush(head, body) + head = chunkedPush(head, events.slice(start)) + result = head + index = -1 // Handle the start of the document, if defined. + + if (handlers.enter.null) { + handlers.enter.null.call(context) + } // Handle all events. + + while (++index < events.length) { + handler = handlers[result[index][0]] + + if (hasOwnProperty.call(handler, result[index][1].type)) { + handler[result[index][1].type].call( + assign( + { + sliceSerialize: result[index][2].sliceSerialize + }, + context + ), + result[index][1] + ) + } + } // Handle the end of the document, if defined. + + if (handlers.exit.null) { + handlers.exit.null.call(context) + } + + return buffers[0].join('') + } // Figure out whether lists are loose or not. + + function prepareList(slice) { + var length = slice.length - 1 // Skip close. + + var index = 0 // Skip open. + + var containerBalance = 0 + var loose + var atMarker + var event + + while (++index < length) { + event = slice[index] + + if (event[1]._container) { + atMarker = undefined + + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + } else if (event[1].type === 'listItemPrefix') { + if (event[0] === 'exit') { + atMarker = true + } + } else if (event[1].type === 'linePrefix'); + else if (event[1].type === 'lineEndingBlank') { + if (event[0] === 'enter' && !containerBalance) { + if (atMarker) { + atMarker = undefined + } else { + loose = true + } + } + } else { + atMarker = undefined + } + } + + slice[0][1]._loose = loose + } // Set data into the key-value store. + + function setData(key, value) { + data[key] = value + } // Get data from the key-value store. + + function getData(key) { + return data[key] + } // Capture some of the output data. + + function buffer() { + buffers.push([]) + } // Stop capturing and access the output data. + + function resume() { + return buffers.pop().join('') + } // Output (parts of) HTML tags. + + function tag(value) { + if (!tags) return + setData('lastWasTag', true) + buffers[buffers.length - 1].push(value) + } // Output raw data. + + function raw(value) { + setData('lastWasTag') + buffers[buffers.length - 1].push(value) + } // Output an extra line ending. + + function lineEnding() { + raw(lineEndingStyle || '\n') + } // Output an extra line ending if the previous value wasn’t EOF/EOL. + + function lineEndingIfNeeded() { + var buffer = buffers[buffers.length - 1] + var slice = buffer[buffer.length - 1] + var previous = slice ? slice.charCodeAt(slice.length - 1) : null + + if (previous === 10 || previous === 13 || previous === null) { + return + } + + lineEnding() + } // Make a value safe for injection in HTML (except w/ `ignoreEncode`). + + function encode(value) { + return getData('ignoreEncode') ? value : value.replace(/["&<>]/g, replace) + + function replace(value) { + return '&' + characterReferences[value] + ';' + } + } // Make a value safe for injection as a URL. + // This does encode unsafe characters with percent-encoding, skipping already + // encoded sequences (`normalizeUri`). + // Further unsafe characters are encoded as character references (`encode`). + // Finally, if the URL includes an unknown protocol (such as a dangerous + // example, `javascript:`), the value is ignored. + + function url(url, protocol) { + var value = encode(normalizeUri(url || '')) + var colon = value.indexOf(':') + var questionMark = value.indexOf('?') + var numberSign = value.indexOf('#') + var slash = value.indexOf('/') + + if ( + settings.allowDangerousProtocol || // If there is no protocol, it’s relative. + colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol. + (slash > -1 && colon > slash) || + (questionMark > -1 && colon > questionMark) || + (numberSign > -1 && colon > numberSign) || // It is a protocol, it should be allowed. + protocol.test(value.slice(0, colon)) + ) { + return value + } + + return '' + } // + // Handlers. + // + + function onenterlistordered(token) { + tightStack.push(!token._loose) + lineEndingIfNeeded() + tag('') + } else { + onexitlistitem() + } + + lineEndingIfNeeded() + tag('
  • ') + setData('expectFirstItem') // “Hack” to prevent a line ending from showing up if the item is empty. + + setData('lastWasTag') + } + + function onexitlistordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistunordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistitem() { + if (getData('lastWasTag') && !getData('slurpAllLineEndings')) { + lineEndingIfNeeded() + } + + tag('
  • ') + setData('slurpAllLineEndings') + } + + function onenterblockquote() { + tightStack.push(false) + lineEndingIfNeeded() + tag('
    ') + } + + function onexitblockquote() { + tightStack.pop() + lineEndingIfNeeded() + tag('
    ') + setData('slurpAllLineEndings') + } + + function onenterparagraph() { + if (!tightStack[tightStack.length - 1]) { + lineEndingIfNeeded() + tag('

    ') + } + + setData('slurpAllLineEndings') + } + + function onexitparagraph() { + if (tightStack[tightStack.length - 1]) { + setData('slurpAllLineEndings', true) + } else { + tag('

    ') + } + } + + function onentercodefenced() { + lineEndingIfNeeded() + tag('
    ')
    +      setData('fencedCodeInside', true)
    +      setData('slurpOneLineEnding', true)
    +    }
    +
    +    setData('fencesCount', getData('fencesCount') + 1)
    +  }
    +
    +  function onentercodeindented() {
    +    lineEndingIfNeeded()
    +    tag('
    ')
    +  }
    +
    +  function onexitflowcode() {
    +    // Send an extra line feed if we saw data.
    +    if (getData('flowCodeSeenData')) lineEndingIfNeeded()
    +    tag('
    ') + if (getData('fencesCount') < 2) lineEndingIfNeeded() + setData('flowCodeSeenData') + setData('fencesCount') + setData('slurpOneLineEnding') + } + + function onenterimage() { + mediaStack.push({ + image: true + }) + tags = undefined // Disallow tags. + } + + function onenterlink() { + mediaStack.push({}) + } + + function onexitlabeltext(token) { + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onexitlabel() { + mediaStack[mediaStack.length - 1].label = resume() + } + + function onexitreferencestring(token) { + mediaStack[mediaStack.length - 1].referenceId = this.sliceSerialize(token) + } + + function onenterresource() { + buffer() // We can have line endings in the resource, ignore them. + + mediaStack[mediaStack.length - 1].destination = '' + } + + function onenterresourcedestinationstring() { + buffer() // Ignore encoding the result, as we’ll first percent encode the url and + // encode manually after. + + setData('ignoreEncode', true) + } + + function onexitresourcedestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitresourcetitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitmedia() { + var index = mediaStack.length - 1 // Skip current. + + var media = mediaStack[index] + var context = + media.destination === undefined + ? definitions[normalizeIdentifier(media.referenceId || media.labelId)] + : media + tags = true + + while (index--) { + if (mediaStack[index].image) { + tags = undefined + break + } + } + + if (media.image) { + tag('')
+      raw(media.label)
+      tag('') + } else { + tag('>') + raw(media.label) + tag('
    ') + } + + mediaStack.pop() + } + + function onenterdefinition() { + buffer() + mediaStack.push({}) + } + + function onexitdefinitionlabelstring(token) { + // Discard label, use the source content instead. + resume() + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onenterdefinitiondestinationstring() { + buffer() + setData('ignoreEncode', true) + } + + function onexitdefinitiondestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitdefinitiontitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitdefinition() { + var id = normalizeIdentifier(mediaStack[mediaStack.length - 1].labelId) + resume() + + if (!hasOwnProperty.call(definitions, id)) { + definitions[id] = mediaStack[mediaStack.length - 1] + } + + mediaStack.pop() + } + + function onentercontent() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheadingsequence(token) { + // Exit for further sequences. + if (getData('headingRank')) return + setData('headingRank', this.sliceSerialize(token).length) + lineEndingIfNeeded() + tag('') + } + + function onentersetextheading() { + buffer() + setData('slurpAllLineEndings') + } + + function onexitsetextheadingtext() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheading() { + tag('') + setData('headingRank') + } + + function onexitsetextheadinglinesequence(token) { + setData( + 'headingRank', + this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2 + ) + } + + function onexitsetextheading() { + var value = resume() + lineEndingIfNeeded() + tag('') + raw(value) + tag('') + setData('slurpAllLineEndings') + setData('headingRank') + } + + function onexitdata(token) { + raw(encode(this.sliceSerialize(token))) + } + + function onexitlineending(token) { + if (getData('slurpAllLineEndings')) { + return + } + + if (getData('slurpOneLineEnding')) { + setData('slurpOneLineEnding') + return + } + + if (getData('inCodeText')) { + raw(' ') + return + } + + raw(encode(this.sliceSerialize(token))) + } + + function onexitcodeflowvalue(token) { + raw(encode(this.sliceSerialize(token))) + setData('flowCodeSeenData', true) + } + + function onexithardbreak() { + tag('
    ') + } + + function onenterhtmlflow() { + lineEndingIfNeeded() + onenterhtml() + } + + function onexithtml() { + setData('ignoreEncode') + } + + function onenterhtml() { + if (settings.allowDangerousHtml) { + setData('ignoreEncode', true) + } + } + + function onenteremphasis() { + tag('') + } + + function onenterstrong() { + tag('') + } + + function onentercodetext() { + setData('inCodeText', true) + tag('') + } + + function onexitcodetext() { + setData('inCodeText') + tag('') + } + + function onexitemphasis() { + tag('') + } + + function onexitstrong() { + tag('') + } + + function onexitthematicbreak() { + lineEndingIfNeeded() + tag('
    ') + } + + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type) + } + + function onexitcharacterreferencevalue(token) { + var value = this.sliceSerialize(token) + value = getData('characterReferenceType') + ? safeFromInt( + value, + getData('characterReferenceType') === + 'characterReferenceMarkerNumeric' + ? 10 + : 16 + ) + : decodeEntity__default['default'](value) + raw(encode(value)) + setData('characterReferenceType') + } + + function onexitautolinkprotocol(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } + + function onexitautolinkemail(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } +} + +module.exports = compileHtml diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/assign.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/assign.js new file mode 100644 index 00000000000000..b6ae48a0903c93 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/assign.js @@ -0,0 +1,5 @@ +'use strict' + +var assign = Object.assign + +module.exports = assign diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/constants.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/constants.js new file mode 100644 index 00000000000000..88772494881ca7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/constants.js @@ -0,0 +1,71 @@ +'use strict' + +// This module is compiled away! +// +// Parsing markdown comes with a couple of constants, such as minimum or maximum +// sizes of certain sequences. +// Additionally, there are a couple symbols used inside micromark. +// These are all defined here, but compiled away by scripts. +var constants = { + attentionSideBefore: 1, + // Symbol to mark an attention sequence as before content: `*a` + attentionSideAfter: 2, + // Symbol to mark an attention sequence as after content: `a*` + atxHeadingOpeningFenceSizeMax: 6, + // 6 number signs is fine, 7 isn’t. + autolinkDomainSizeMax: 63, + // 63 characters is fine, 64 is too many. + autolinkSchemeSizeMax: 32, + // 32 characters is fine, 33 is too many. + cdataOpeningString: 'CDATA[', + // And preceded by `` + htmlComment: 2, + // Symbol for `` + htmlInstruction: 3, + // Symbol for `` + htmlDeclaration: 4, + // Symbol for `` + htmlCdata: 5, + // Symbol for `` + htmlBasic: 6, + // Symbol for `` + htmlRawSizeMax: 8, + // Length of `textarea`. + linkResourceDestinationBalanceMax: 3, + // See: + linkReferenceSizeMax: 999, + // See: + listItemValueSizeMax: 10, + // See: + numericBaseDecimal: 10, + numericBaseHexadecimal: 0x10, + tabSize: 4, + // Tabs have a hard-coded size of 4, per CommonMark. + thematicBreakMarkerCountMin: 3, + // At least 3 asterisks, dashes, or underscores are needed. + v8MaxSafeChunkSize: 10000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks. +} + +module.exports = constants diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/from-char-code.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/from-char-code.js new file mode 100644 index 00000000000000..232eac74053d18 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/from-char-code.js @@ -0,0 +1,5 @@ +'use strict' + +var fromCharCode = String.fromCharCode + +module.exports = fromCharCode diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/has-own-property.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/has-own-property.js new file mode 100644 index 00000000000000..aa9197cd2593d1 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/has-own-property.js @@ -0,0 +1,5 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = own diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-block-names.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-block-names.js new file mode 100644 index 00000000000000..9b5ada73f0671a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-block-names.js @@ -0,0 +1,69 @@ +'use strict' + +// This module is copied from . +var basics = [ + 'address', + 'article', + 'aside', + 'base', + 'basefont', + 'blockquote', + 'body', + 'caption', + 'center', + 'col', + 'colgroup', + 'dd', + 'details', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hr', + 'html', + 'iframe', + 'legend', + 'li', + 'link', + 'main', + 'menu', + 'menuitem', + 'nav', + 'noframes', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'section', + 'source', + 'summary', + 'table', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'title', + 'tr', + 'track', + 'ul' +] + +module.exports = basics diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-raw-names.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-raw-names.js new file mode 100644 index 00000000000000..c22a3954291f82 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/html-raw-names.js @@ -0,0 +1,6 @@ +'use strict' + +// This module is copied from . +var raws = ['pre', 'script', 'style', 'textarea'] + +module.exports = raws diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/splice.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/splice.js new file mode 100644 index 00000000000000..8917210ac71670 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/splice.js @@ -0,0 +1,5 @@ +'use strict' + +var splice = [].splice + +module.exports = splice diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/types.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/types.js new file mode 100644 index 00000000000000..b4e8787fb94154 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/types.js @@ -0,0 +1,357 @@ +'use strict' + +// This module is compiled away! +// +// Here is the list of all types of tokens exposed by micromark, with a short +// explanation of what they include and where they are found. +// In picking names, generally, the rule is to be as explicit as possible +// instead of reusing names. +// For example, there is a `definitionDestination` and a `resourceDestination`, +// instead of one shared name. +var types = { + // Generic type for data, such as in a title, a destination, etc. + data: 'data', + // Generic type for syntactic whitespace (tabs, virtual spaces, spaces). + // Such as, between a fenced code fence and an info string. + whitespace: 'whitespace', + // Generic type for line endings (line feed, carriage return, carriage return + + // line feed). + lineEnding: 'lineEnding', + // A line ending, but ending a blank line. + lineEndingBlank: 'lineEndingBlank', + // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a + // line. + linePrefix: 'linePrefix', + // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a + // line. + lineSuffix: 'lineSuffix', + // Whole ATX heading: + // + // ```markdown + // # + // ## Alpha + // ### Bravo ### + // ``` + // + // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`. + atxHeading: 'atxHeading', + // Sequence of number signs in an ATX heading (`###`). + atxHeadingSequence: 'atxHeadingSequence', + // Content in an ATX heading (`alpha`). + // Includes text. + atxHeadingText: 'atxHeadingText', + // Whole autolink (`` or ``) + // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`. + autolink: 'autolink', + // Email autolink w/o markers (`admin@example.com`) + autolinkEmail: 'autolinkEmail', + // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`). + autolinkMarker: 'autolinkMarker', + // Protocol autolink w/o markers (`https://example.com`) + autolinkProtocol: 'autolinkProtocol', + // A whole character escape (`\-`). + // Includes `escapeMarker` and `characterEscapeValue`. + characterEscape: 'characterEscape', + // The escaped character (`-`). + characterEscapeValue: 'characterEscapeValue', + // A whole character reference (`&`, `≠`, or `𝌆`). + // Includes `characterReferenceMarker`, an optional + // `characterReferenceMarkerNumeric`, in which case an optional + // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`. + characterReference: 'characterReference', + // The start or end marker (`&` or `;`). + characterReferenceMarker: 'characterReferenceMarker', + // Mark reference as numeric (`#`). + characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric', + // Mark reference as numeric (`x` or `X`). + characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal', + // Value of character reference w/o markers (`amp`, `8800`, or `1D306`). + characterReferenceValue: 'characterReferenceValue', + // Whole fenced code: + // + // ````markdown + // ```js + // alert(1) + // ``` + // ```` + codeFenced: 'codeFenced', + // A fenced code fence, including whitespace, sequence, info, and meta + // (` ```js `). + codeFencedFence: 'codeFencedFence', + // Sequence of grave accent or tilde characters (` ``` `) in a fence. + codeFencedFenceSequence: 'codeFencedFenceSequence', + // Info word (`js`) in a fence. + // Includes string. + codeFencedFenceInfo: 'codeFencedFenceInfo', + // Meta words (`highlight="1"`) in a fence. + // Includes string. + codeFencedFenceMeta: 'codeFencedFenceMeta', + // A line of code. + codeFlowValue: 'codeFlowValue', + // Whole indented code: + // + // ```markdown + // alert(1) + // ``` + // + // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`. + codeIndented: 'codeIndented', + // A text code (``` `alpha` ```). + // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include + // `codeTextPadding`. + codeText: 'codeText', + codeTextData: 'codeTextData', + // A space or line ending right after or before a tick. + codeTextPadding: 'codeTextPadding', + // A text code fence (` `` `). + codeTextSequence: 'codeTextSequence', + // Whole content: + // + // ```markdown + // [a]: b + // c + // = + // d + // ``` + // + // Includes `paragraph` and `definition`. + content: 'content', + // Whole definition: + // + // ```markdown + // [micromark]: https://github.com/micromark/micromark + // ``` + // + // Includes `definitionLabel`, `definitionMarker`, `whitespace`, + // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`. + definition: 'definition', + // Destination of a definition (`https://github.com/micromark/micromark` or + // ``). + // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`. + definitionDestination: 'definitionDestination', + // Enclosed destination of a definition + // (``). + // Includes `definitionDestinationLiteralMarker` and optionally + // `definitionDestinationString`. + definitionDestinationLiteral: 'definitionDestinationLiteral', + // Markers of an enclosed definition destination (`<` or `>`). + definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker', + // Unenclosed destination of a definition + // (`https://github.com/micromark/micromark`). + // Includes `definitionDestinationString`. + definitionDestinationRaw: 'definitionDestinationRaw', + // Text in an destination (`https://github.com/micromark/micromark`). + // Includes string. + definitionDestinationString: 'definitionDestinationString', + // Label of a definition (`[micromark]`). + // Includes `definitionLabelMarker` and `definitionLabelString`. + definitionLabel: 'definitionLabel', + // Markers of a definition label (`[` or `]`). + definitionLabelMarker: 'definitionLabelMarker', + // Value of a definition label (`micromark`). + // Includes string. + definitionLabelString: 'definitionLabelString', + // Marker between a label and a destination (`:`). + definitionMarker: 'definitionMarker', + // Title of a definition (`"x"`, `'y'`, or `(z)`). + // Includes `definitionTitleMarker` and optionally `definitionTitleString`. + definitionTitle: 'definitionTitle', + // Marker around a title of a definition (`"`, `'`, `(`, or `)`). + definitionTitleMarker: 'definitionTitleMarker', + // Data without markers in a title (`z`). + // Includes string. + definitionTitleString: 'definitionTitleString', + // Emphasis (`*alpha*`). + // Includes `emphasisSequence` and `emphasisText`. + emphasis: 'emphasis', + // Sequence of emphasis markers (`*` or `_`). + emphasisSequence: 'emphasisSequence', + // Emphasis text (`alpha`). + // Includes text. + emphasisText: 'emphasisText', + // The character escape marker (`\`). + escapeMarker: 'escapeMarker', + // A hard break created with a backslash (`\\n`). + // Includes `escapeMarker` (does not include the line ending) + hardBreakEscape: 'hardBreakEscape', + // A hard break created with trailing spaces (` \n`). + // Does not include the line ending. + hardBreakTrailing: 'hardBreakTrailing', + // Flow HTML: + // + // ```markdown + //
    b`). + // Includes `lineEnding`, `htmlTextData`. + htmlText: 'htmlText', + htmlTextData: 'htmlTextData', + // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or + // `![alpha]`). + // Includes `label` and an optional `resource` or `reference`. + image: 'image', + // Whole link label (`[*alpha*]`). + // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`. + label: 'label', + // Text in an label (`*alpha*`). + // Includes text. + labelText: 'labelText', + // Start a link label (`[`). + // Includes a `labelMarker`. + labelLink: 'labelLink', + // Start an image label (`![`). + // Includes `labelImageMarker` and `labelMarker`. + labelImage: 'labelImage', + // Marker of a label (`[` or `]`). + labelMarker: 'labelMarker', + // Marker to start an image (`!`). + labelImageMarker: 'labelImageMarker', + // End a label (`]`). + // Includes `labelMarker`. + labelEnd: 'labelEnd', + // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`). + // Includes `label` and an optional `resource` or `reference`. + link: 'link', + // Whole paragraph: + // + // ```markdown + // alpha + // bravo. + // ``` + // + // Includes text. + paragraph: 'paragraph', + // A reference (`[alpha]` or `[]`). + // Includes `referenceMarker` and an optional `referenceString`. + reference: 'reference', + // A reference marker (`[` or `]`). + referenceMarker: 'referenceMarker', + // Reference text (`alpha`). + // Includes string. + referenceString: 'referenceString', + // A resource (`(https://example.com "alpha")`). + // Includes `resourceMarker`, an optional `resourceDestination` with an optional + // `whitespace` and `resourceTitle`. + resource: 'resource', + // A resource destination (`https://example.com`). + // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`. + resourceDestination: 'resourceDestination', + // A literal resource destination (``). + // Includes `resourceDestinationLiteralMarker` and optionally + // `resourceDestinationString`. + resourceDestinationLiteral: 'resourceDestinationLiteral', + // A resource destination marker (`<` or `>`). + resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker', + // A raw resource destination (`https://example.com`). + // Includes `resourceDestinationString`. + resourceDestinationRaw: 'resourceDestinationRaw', + // Resource destination text (`https://example.com`). + // Includes string. + resourceDestinationString: 'resourceDestinationString', + // A resource marker (`(` or `)`). + resourceMarker: 'resourceMarker', + // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`). + // Includes `resourceTitleMarker` and optionally `resourceTitleString`. + resourceTitle: 'resourceTitle', + // A resource title marker (`"`, `'`, `(`, or `)`). + resourceTitleMarker: 'resourceTitleMarker', + // Resource destination title (`alpha`). + // Includes string. + resourceTitleString: 'resourceTitleString', + // Whole setext heading: + // + // ```markdown + // alpha + // bravo + // ===== + // ``` + // + // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and + // `setextHeadingLine`. + setextHeading: 'setextHeading', + // Content in a setext heading (`alpha\nbravo`). + // Includes text. + setextHeadingText: 'setextHeadingText', + // Underline in a setext heading, including whitespace suffix (`==`). + // Includes `setextHeadingLineSequence`. + setextHeadingLine: 'setextHeadingLine', + // Sequence of equals or dash characters in underline in a setext heading (`-`). + setextHeadingLineSequence: 'setextHeadingLineSequence', + // Strong (`**alpha**`). + // Includes `strongSequence` and `strongText`. + strong: 'strong', + // Sequence of strong markers (`**` or `__`). + strongSequence: 'strongSequence', + // Strong text (`alpha`). + // Includes text. + strongText: 'strongText', + // Whole thematic break: + // + // ```markdown + // * * * + // ``` + // + // Includes `thematicBreakSequence` and `whitespace`. + thematicBreak: 'thematicBreak', + // A sequence of one or more thematic break markers (`***`). + thematicBreakSequence: 'thematicBreakSequence', + // Whole block quote: + // + // ```markdown + // > a + // > + // > b + // ``` + // + // Includes `blockQuotePrefix` and flow. + blockQuote: 'blockQuote', + // The `>` or `> ` of a block quote. + blockQuotePrefix: 'blockQuotePrefix', + // The `>` of a block quote prefix. + blockQuoteMarker: 'blockQuoteMarker', + // The optional ` ` of a block quote prefix. + blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace', + // Whole unordered list: + // + // ```markdown + // - a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listOrdered: 'listOrdered', + // Whole ordered list: + // + // ```markdown + // 1. a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listUnordered: 'listUnordered', + // The indent of further list item lines. + listItemIndent: 'listItemIndent', + // A marker, as in, `*`, `+`, `-`, `.`, or `)`. + listItemMarker: 'listItemMarker', + // The thing that starts a list item, such as `1. `. + // Includes `listItemValue` if ordered, `listItemMarker`, and + // `listItemPrefixWhitespace` (unless followed by a line ending). + listItemPrefix: 'listItemPrefix', + // The whitespace after a marker. + listItemPrefixWhitespace: 'listItemPrefixWhitespace', + // The numerical value of an ordered item. + listItemValue: 'listItemValue', + // Internal types used for subtokenizers, compiled away + chunkContent: 'chunkContent', + chunkFlow: 'chunkFlow', + chunkText: 'chunkText', + chunkString: 'chunkString' +} + +module.exports = types diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/unicode-punctuation-regex.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/unicode-punctuation-regex.js new file mode 100644 index 00000000000000..6d25ee4bae5ef2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constant/unicode-punctuation-regex.js @@ -0,0 +1,11 @@ +'use strict' + +// This module is generated by `script/`. +// +// CommonMark handles attention (emphasis, strong) markers based on what comes +// before or after them. +// One such difference is if those characters are Unicode punctuation. +// This script is generated from the Unicode data. +var unicodePunctuation = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/ + +module.exports = unicodePunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constructs.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constructs.js new file mode 100644 index 00000000000000..adcc84a44b390a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/constructs.js @@ -0,0 +1,127 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var text$1 = require('./initialize/text.js') +var attention = require('./tokenize/attention.js') +var autolink = require('./tokenize/autolink.js') +var blockQuote = require('./tokenize/block-quote.js') +var characterEscape = require('./tokenize/character-escape.js') +var characterReference = require('./tokenize/character-reference.js') +var codeFenced = require('./tokenize/code-fenced.js') +var codeIndented = require('./tokenize/code-indented.js') +var codeText = require('./tokenize/code-text.js') +var definition = require('./tokenize/definition.js') +var hardBreakEscape = require('./tokenize/hard-break-escape.js') +var headingAtx = require('./tokenize/heading-atx.js') +var htmlFlow = require('./tokenize/html-flow.js') +var htmlText = require('./tokenize/html-text.js') +var labelEnd = require('./tokenize/label-end.js') +var labelStartImage = require('./tokenize/label-start-image.js') +var labelStartLink = require('./tokenize/label-start-link.js') +var lineEnding = require('./tokenize/line-ending.js') +var list = require('./tokenize/list.js') +var setextUnderline = require('./tokenize/setext-underline.js') +var thematicBreak = require('./tokenize/thematic-break.js') + +var document = { + 42: list, + // Asterisk + 43: list, + // Plus sign + 45: list, + // Dash + 48: list, + // 0 + 49: list, + // 1 + 50: list, + // 2 + 51: list, + // 3 + 52: list, + // 4 + 53: list, + // 5 + 54: list, + // 6 + 55: list, + // 7 + 56: list, + // 8 + 57: list, + // 9 + 62: blockQuote // Greater than +} +var contentInitial = { + 91: definition // Left square bracket +} +var flowInitial = { + '-2': codeIndented, + // Horizontal tab + '-1': codeIndented, + // Virtual space + 32: codeIndented // Space +} +var flow = { + 35: headingAtx, + // Number sign + 42: thematicBreak, + // Asterisk + 45: [setextUnderline, thematicBreak], + // Dash + 60: htmlFlow, + // Less than + 61: setextUnderline, + // Equals to + 95: thematicBreak, + // Underscore + 96: codeFenced, + // Grave accent + 126: codeFenced // Tilde +} +var string = { + 38: characterReference, + // Ampersand + 92: characterEscape // Backslash +} +var text = { + '-5': lineEnding, + // Carriage return + '-4': lineEnding, + // Line feed + '-3': lineEnding, + // Carriage return + line feed + 33: labelStartImage, + // Exclamation mark + 38: characterReference, + // Ampersand + 42: attention, + // Asterisk + 60: [autolink, htmlText], + // Less than + 91: labelStartLink, + // Left square bracket + 92: [hardBreakEscape, characterEscape], + // Backslash + 93: labelEnd, + // Right square bracket + 95: attention, + // Underscore + 96: codeText // Grave accent +} +var insideSpan = { + null: [attention, text$1.resolver] +} +var disable = { + null: [] +} + +exports.contentInitial = contentInitial +exports.disable = disable +exports.document = document +exports.flow = flow +exports.flowInitial = flowInitial +exports.insideSpan = insideSpan +exports.string = string +exports.text = text diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/index.js new file mode 100644 index 00000000000000..8b289a298f114b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/index.js @@ -0,0 +1,21 @@ +'use strict' + +var html = require('./compile/html.js') +var parse = require('./parse.js') +var postprocess = require('./postprocess.js') +var preprocess = require('./preprocess.js') + +function buffer(value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding + encoding = undefined + } + + return html(options)( + postprocess( + parse(options).document().write(preprocess()(value, encoding, true)) + ) + ) +} + +module.exports = buffer diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/content.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/content.js new file mode 100644 index 00000000000000..546aafece686a0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/content.js @@ -0,0 +1,69 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var factorySpace = require('../tokenize/factory-space.js') + +var tokenize = initializeContent + +function initializeContent(effects) { + var contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ) + var previous + return contentStart + + function afterContentStartConstruct(code) { + if (code === null) { + effects.consume(code) + return + } + + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace(effects, contentStart, 'linePrefix') + } + + function paragraphInitial(code) { + effects.enter('paragraph') + return lineStart(code) + } + + function lineStart(code) { + var token = effects.enter('chunkText', { + contentType: 'text', + previous: previous + }) + + if (previous) { + previous.next = token + } + + previous = token + return data(code) + } + + function data(code) { + if (code === null) { + effects.exit('chunkText') + effects.exit('paragraph') + effects.consume(code) + return + } + + if (markdownLineEnding(code)) { + effects.consume(code) + effects.exit('chunkText') + return lineStart + } // Data. + + effects.consume(code) + return data + } +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/document.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/document.js new file mode 100644 index 00000000000000..fa357fc3d4aff5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/document.js @@ -0,0 +1,237 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var factorySpace = require('../tokenize/factory-space.js') +var partialBlankLine = require('../tokenize/partial-blank-line.js') + +var tokenize = initializeDocument +var containerConstruct = { + tokenize: tokenizeContainer +} +var lazyFlowConstruct = { + tokenize: tokenizeLazyFlow +} + +function initializeDocument(effects) { + var self = this + var stack = [] + var continued = 0 + var inspectConstruct = { + tokenize: tokenizeInspect, + partial: true + } + var inspectResult + var childFlow + var childToken + return start + + function start(code) { + if (continued < stack.length) { + self.containerState = stack[continued][1] + return effects.attempt( + stack[continued][0].continuation, + documentContinue, + documentContinued + )(code) + } + + return documentContinued(code) + } + + function documentContinue(code) { + continued++ + return start(code) + } + + function documentContinued(code) { + // If we’re in a concrete construct (such as when expecting another line of + // HTML, or we resulted in lazy content), we can immediately start flow. + if (inspectResult && inspectResult.flowContinue) { + return flowStart(code) + } + + self.interrupt = + childFlow && + childFlow.currentConstruct && + childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code) + } + + function containerContinue(code) { + stack.push([self.currentConstruct, self.containerState]) + self.containerState = undefined + return documentContinued(code) + } + + function flowStart(code) { + if (code === null) { + exitContainers(0, true) + effects.consume(code) + return + } + + childFlow = childFlow || self.parser.flow(self.now()) + effects.enter('chunkFlow', { + contentType: 'flow', + previous: childToken, + _tokenizer: childFlow + }) + return flowContinue(code) + } + + function flowContinue(code) { + if (code === null) { + continueFlow(effects.exit('chunkFlow')) + return flowStart(code) + } + + if (markdownLineEnding(code)) { + effects.consume(code) + continueFlow(effects.exit('chunkFlow')) + return effects.check(inspectConstruct, documentAfterPeek) + } + + effects.consume(code) + return flowContinue + } + + function documentAfterPeek(code) { + exitContainers( + inspectResult.continued, + inspectResult && inspectResult.flowEnd + ) + continued = 0 + return start(code) + } + + function continueFlow(token) { + if (childToken) childToken.next = token + childToken = token + childFlow.lazy = inspectResult && inspectResult.lazy + childFlow.defineSkip(token.start) + childFlow.write(self.sliceStream(token)) + } + + function exitContainers(size, end) { + var index = stack.length // Close the flow. + + if (childFlow && end) { + childFlow.write([null]) + childToken = childFlow = undefined + } // Exit open containers. + + while (index-- > size) { + self.containerState = stack[index][1] + stack[index][0].exit.call(self, effects) + } + + stack.length = size + } + + function tokenizeInspect(effects, ok) { + var subcontinued = 0 + inspectResult = {} + return inspectStart + + function inspectStart(code) { + if (subcontinued < stack.length) { + self.containerState = stack[subcontinued][1] + return effects.attempt( + stack[subcontinued][0].continuation, + inspectContinue, + inspectLess + )(code) + } // If we’re continued but in a concrete flow, we can’t have more + // containers. + + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + inspectResult.flowContinue = true + return inspectDone(code) + } + + self.interrupt = + childFlow.currentConstruct && childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, + inspectDone + )(code) + } + + function inspectContinue(code) { + subcontinued++ + return self.containerState._closeFlow + ? inspectFlowEnd(code) + : inspectStart(code) + } + + function inspectLess(code) { + if (childFlow.currentConstruct && childFlow.currentConstruct.lazy) { + // Maybe another container? + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, // Maybe flow, or a blank line? + effects.attempt( + lazyFlowConstruct, + inspectFlowEnd, + effects.check(partialBlankLine, inspectFlowEnd, inspectLazy) + ) + )(code) + } // Otherwise we’re interrupting. + + return inspectFlowEnd(code) + } + + function inspectLazy(code) { + // Act as if all containers are continued. + subcontinued = stack.length + inspectResult.lazy = true + inspectResult.flowContinue = true + return inspectDone(code) + } // We’re done with flow if we have more containers, or an interruption. + + function inspectFlowEnd(code) { + inspectResult.flowEnd = true + return inspectDone(code) + } + + function inspectDone(code) { + inspectResult.continued = subcontinued + self.interrupt = self.containerState = undefined + return ok(code) + } + } +} + +function tokenizeContainer(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok, nok), + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) +} + +function tokenizeLazyFlow(effects, ok, nok) { + return factorySpace( + effects, + effects.lazy(this.parser.constructs.flow, ok, nok), + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/flow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/flow.js new file mode 100644 index 00000000000000..0b7813c8927fcd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/flow.js @@ -0,0 +1,60 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var content = require('../tokenize/content.js') +var factorySpace = require('../tokenize/factory-space.js') +var partialBlankLine = require('../tokenize/partial-blank-line.js') + +var tokenize = initializeFlow + +function initializeFlow(effects) { + var self = this + var initial = effects.attempt( + // Try to parse a blank line. + partialBlankLine, + atBlankEnding, // Try to parse initial flow (essentially, only code). + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct) + ), + 'linePrefix' + ) + ) + ) + return initial + + function atBlankEnding(code) { + if (code === null) { + effects.consume(code) + return + } + + effects.enter('lineEndingBlank') + effects.consume(code) + effects.exit('lineEndingBlank') + self.currentConstruct = undefined + return initial + } + + function afterConstruct(code) { + if (code === null) { + effects.consume(code) + return + } + + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + self.currentConstruct = undefined + return initial + } +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/text.js new file mode 100644 index 00000000000000..d0d460f4c0e860 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/initialize/text.js @@ -0,0 +1,201 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var assign = require('../constant/assign.js') +var shallow = require('../util/shallow.js') + +var text = initializeFactory('text') +var string = initializeFactory('string') +var resolver = { + resolveAll: createResolver() +} + +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === 'text' ? resolveAllLineSuffixes : undefined + ) + } + + function initializeText(effects) { + var self = this + var constructs = this.parser.constructs[field] + var text = effects.attempt(constructs, start, notText) + return start + + function start(code) { + return atBreak(code) ? text(code) : notText(code) + } + + function notText(code) { + if (code === null) { + effects.consume(code) + return + } + + effects.enter('data') + effects.consume(code) + return data + } + + function data(code) { + if (atBreak(code)) { + effects.exit('data') + return text(code) + } // Data. + + effects.consume(code) + return data + } + + function atBreak(code) { + var list = constructs[code] + var index = -1 + + if (code === null) { + return true + } + + if (list) { + while (++index < list.length) { + if ( + !list[index].previous || + list[index].previous.call(self, self.previous) + ) { + return true + } + } + } + } + } +} + +function createResolver(extraResolver) { + return resolveAllText + + function resolveAllText(events, context) { + var index = -1 + var enter // A rather boring computation (to merge adjacent `data` events) which + // improves mm performance by 29%. + + while (++index <= events.length) { + if (enter === undefined) { + if (events[index] && events[index][1].type === 'data') { + enter = index + index++ + } + } else if (!events[index] || events[index][1].type !== 'data') { + // Don’t do anything if there is one data token. + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + index = enter + 2 + } + + enter = undefined + } + } + + return extraResolver ? extraResolver(events, context) : events + } +} // A rather ugly set of instructions which again looks at chunks in the input +// stream. +// The reason to do this here is that it is *much* faster to parse in reverse. +// And that we can’t hook into `null` to split the line suffix before an EOF. +// To do: figure out if we can make this into a clean utility, or even in core. +// As it will be useful for GFMs literal autolink extension (and maybe even +// tables?) + +function resolveAllLineSuffixes(events, context) { + var eventIndex = -1 + var chunks + var data + var chunk + var index + var bufferIndex + var size + var tabs + var token + + while (++eventIndex <= events.length) { + if ( + (eventIndex === events.length || + events[eventIndex][1].type === 'lineEnding') && + events[eventIndex - 1][1].type === 'data' + ) { + data = events[eventIndex - 1][1] + chunks = context.sliceStream(data) + index = chunks.length + bufferIndex = -1 + size = 0 + tabs = undefined + + while (index--) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + bufferIndex = chunk.length + + while (chunk.charCodeAt(bufferIndex - 1) === 32) { + size++ + bufferIndex-- + } + + if (bufferIndex) break + bufferIndex = -1 + } // Number + else if (chunk === -2) { + tabs = true + size++ + } else if (chunk === -1); + else { + // Replacement character, exit. + index++ + break + } + } + + if (size) { + token = { + type: + eventIndex === events.length || tabs || size < 2 + ? 'lineSuffix' + : 'hardBreakTrailing', + start: { + line: data.end.line, + column: data.end.column - size, + offset: data.end.offset - size, + _index: data.start._index + index, + _bufferIndex: index + ? bufferIndex + : data.start._bufferIndex + bufferIndex + }, + end: shallow(data.end) + } + data.end = shallow(token.start) + + if (data.start.offset === data.end.offset) { + assign(data, token) + } else { + events.splice( + eventIndex, + 0, + ['enter', token, context], + ['exit', token, context] + ) + eventIndex += 2 + } + } + + eventIndex++ + } + } + + return events +} + +exports.resolver = resolver +exports.string = string +exports.text = text diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/parse.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/parse.js new file mode 100644 index 00000000000000..9482300adce474 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/parse.js @@ -0,0 +1,36 @@ +'use strict' + +var content = require('./initialize/content.js') +var document = require('./initialize/document.js') +var flow = require('./initialize/flow.js') +var text = require('./initialize/text.js') +var combineExtensions = require('./util/combine-extensions.js') +var createTokenizer = require('./util/create-tokenizer.js') +var miniflat = require('./util/miniflat.js') +var constructs = require('./constructs.js') + +function parse(options) { + var settings = options || {} + var parser = { + defined: [], + constructs: combineExtensions( + [constructs].concat(miniflat(settings.extensions)) + ), + content: create(content), + document: create(document), + flow: create(flow), + string: create(text.string), + text: create(text.text) + } + return parser + + function create(initializer) { + return creator + + function creator(from) { + return createTokenizer(parser, initializer, from) + } + } +} + +module.exports = parse diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/postprocess.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/postprocess.js new file mode 100644 index 00000000000000..842f8ce8bfc64d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/postprocess.js @@ -0,0 +1,13 @@ +'use strict' + +var subtokenize = require('./util/subtokenize.js') + +function postprocess(events) { + while (!subtokenize(events)) { + // Empty + } + + return events +} + +module.exports = postprocess diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/preprocess.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/preprocess.js new file mode 100644 index 00000000000000..b7186454e72bde --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/preprocess.js @@ -0,0 +1,87 @@ +'use strict' + +var search = /[\0\t\n\r]/g + +function preprocess() { + var start = true + var column = 1 + var buffer = '' + var atCarriageReturn + return preprocessor + + function preprocessor(value, encoding, end) { + var chunks = [] + var match + var next + var startPosition + var endPosition + var code + value = buffer + value.toString(encoding) + startPosition = 0 + buffer = '' + + if (start) { + if (value.charCodeAt(0) === 65279) { + startPosition++ + } + + start = undefined + } + + while (startPosition < value.length) { + search.lastIndex = startPosition + match = search.exec(value) + endPosition = match ? match.index : value.length + code = value.charCodeAt(endPosition) + + if (!match) { + buffer = value.slice(startPosition) + break + } + + if (code === 10 && startPosition === endPosition && atCarriageReturn) { + chunks.push(-3) + atCarriageReturn = undefined + } else { + if (atCarriageReturn) { + chunks.push(-5) + atCarriageReturn = undefined + } + + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)) + column += endPosition - startPosition + } + + if (code === 0) { + chunks.push(65533) + column++ + } else if (code === 9) { + next = Math.ceil(column / 4) * 4 + chunks.push(-2) + + while (column++ < next) chunks.push(-1) + } else if (code === 10) { + chunks.push(-4) + column = 1 + } // Must be carriage return. + else { + atCarriageReturn = true + column = 1 + } + } + + startPosition = endPosition + 1 + } + + if (end) { + if (atCarriageReturn) chunks.push(-5) + if (buffer) chunks.push(buffer) + chunks.push(null) + } + + return chunks + } +} + +module.exports = preprocess diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/stream.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/stream.js new file mode 100644 index 00000000000000..c26d4d3b5f14f9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/stream.js @@ -0,0 +1,103 @@ +'use strict' + +var events = require('events') +var html = require('./compile/html.js') +var parse = require('./parse.js') +var postprocess = require('./postprocess.js') +var preprocess = require('./preprocess.js') + +function stream(options) { + var preprocess$1 = preprocess() + var tokenize = parse(options).document().write + var compile = html(options) + var emitter = new events.EventEmitter() + var ended + emitter.writable = emitter.readable = true + emitter.write = write + emitter.end = end + emitter.pipe = pipe + return emitter // Write a chunk into memory. + + function write(chunk, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = undefined + } + + if (ended) { + throw new Error('Did not expect `write` after `end`') + } + + tokenize(preprocess$1(chunk || '', encoding)) + + if (callback) { + callback() + } // Signal succesful write. + + return true + } // End the writing. + // Passes all arguments to a final `write`. + + function end(chunk, encoding, callback) { + write(chunk, encoding, callback) + emitter.emit( + 'data', + compile(postprocess(tokenize(preprocess$1('', encoding, true)))) + ) + emitter.emit('end') + ended = true + return true + } // Pipe the processor into a writable stream. + // Basically `Stream#pipe`, but inlined and simplified to keep the bundled + // size down. + // See: . + + function pipe(dest, options) { + emitter.on('data', ondata) + emitter.on('error', onerror) + emitter.on('end', cleanup) + emitter.on('close', cleanup) // If the `end` option is not supplied, `dest.end()` will be called when the + // `end` or `close` events are received. + + if (!dest._isStdio && (!options || options.end !== false)) { + emitter.on('end', onend) + } + + dest.on('error', onerror) + dest.on('close', cleanup) + dest.emit('pipe', emitter) + return dest // End destination. + + function onend() { + if (dest.end) { + dest.end() + } + } // Handle data. + + function ondata(chunk) { + if (dest.writable) { + dest.write(chunk) + } + } // Clean listeners. + + function cleanup() { + emitter.removeListener('data', ondata) + emitter.removeListener('end', onend) + emitter.removeListener('error', onerror) + emitter.removeListener('end', cleanup) + emitter.removeListener('close', cleanup) + dest.removeListener('error', onerror) + dest.removeListener('close', cleanup) + } // Close dangling pipes and handle unheard errors. + + function onerror(error) { + cleanup() + + if (!emitter.listenerCount('error')) { + throw error // Unhandled stream error in pipe. + } + } + } +} + +module.exports = stream diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/attention.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/attention.js new file mode 100644 index 00000000000000..b34be6f204f4ea --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/attention.js @@ -0,0 +1,186 @@ +'use strict' + +var chunkedPush = require('../util/chunked-push.js') +var chunkedSplice = require('../util/chunked-splice.js') +var classifyCharacter = require('../util/classify-character.js') +var movePoint = require('../util/move-point.js') +var resolveAll = require('../util/resolve-all.js') +var shallow = require('../util/shallow.js') + +var attention = { + name: 'attention', + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +} + +function resolveAllAttention(events, context) { + var index = -1 + var open + var group + var text + var openingSequence + var closingSequence + var use + var nextEvents + var offset // Walk through all events. + // + // Note: performance of this is fine on an mb of normal markdown, but it’s + // a bottleneck for malicious stuff. + + while (++index < events.length) { + // Find a token that can close. + if ( + events[index][0] === 'enter' && + events[index][1].type === 'attentionSequence' && + events[index][1]._close + ) { + open = index // Now walk back to find an opener. + + while (open--) { + // Find a token that can open the closer. + if ( + events[open][0] === 'exit' && + events[open][1].type === 'attentionSequence' && + events[open][1]._open && // If the markers are the same: + context.sliceSerialize(events[open][1]).charCodeAt(0) === + context.sliceSerialize(events[index][1]).charCodeAt(0) + ) { + // If the opening can close or the closing can open, + // and the close size *is not* a multiple of three, + // but the sum of the opening and closing size *is* multiple of three, + // then don’t match. + if ( + (events[open][1]._close || events[index][1]._open) && + (events[index][1].end.offset - events[index][1].start.offset) % 3 && + !( + (events[open][1].end.offset - + events[open][1].start.offset + + events[index][1].end.offset - + events[index][1].start.offset) % + 3 + ) + ) { + continue + } // Number of markers to use from the sequence. + + use = + events[open][1].end.offset - events[open][1].start.offset > 1 && + events[index][1].end.offset - events[index][1].start.offset > 1 + ? 2 + : 1 + openingSequence = { + type: use > 1 ? 'strongSequence' : 'emphasisSequence', + start: movePoint(shallow(events[open][1].end), -use), + end: shallow(events[open][1].end) + } + closingSequence = { + type: use > 1 ? 'strongSequence' : 'emphasisSequence', + start: shallow(events[index][1].start), + end: movePoint(shallow(events[index][1].start), use) + } + text = { + type: use > 1 ? 'strongText' : 'emphasisText', + start: shallow(events[open][1].end), + end: shallow(events[index][1].start) + } + group = { + type: use > 1 ? 'strong' : 'emphasis', + start: shallow(openingSequence.start), + end: shallow(closingSequence.end) + } + events[open][1].end = shallow(openingSequence.start) + events[index][1].start = shallow(closingSequence.end) + nextEvents = [] // If there are more markers in the opening, add them before. + + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[open][1], context], + ['exit', events[open][1], context] + ]) + } // Opening. + + nextEvents = chunkedPush(nextEvents, [ + ['enter', group, context], + ['enter', openingSequence, context], + ['exit', openingSequence, context], + ['enter', text, context] + ]) // Between. + + nextEvents = chunkedPush( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index), + context + ) + ) // Closing. + + nextEvents = chunkedPush(nextEvents, [ + ['exit', text, context], + ['enter', closingSequence, context], + ['exit', closingSequence, context], + ['exit', group, context] + ]) // If there are more markers in the closing, add them after. + + if (events[index][1].end.offset - events[index][1].start.offset) { + offset = 2 + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[index][1], context], + ['exit', events[index][1], context] + ]) + } else { + offset = 0 + } + + chunkedSplice(events, open - 1, index - open + 3, nextEvents) + index = open + nextEvents.length - offset - 2 + break + } + } + } + } // Remove remaining sequences. + + index = -1 + + while (++index < events.length) { + if (events[index][1].type === 'attentionSequence') { + events[index][1].type = 'data' + } + } + + return events +} + +function tokenizeAttention(effects, ok) { + var before = classifyCharacter(this.previous) + var marker + return start + + function start(code) { + effects.enter('attentionSequence') + marker = code + return sequence(code) + } + + function sequence(code) { + var token + var after + var open + var close + + if (code === marker) { + effects.consume(code) + return sequence + } + + token = effects.exit('attentionSequence') + after = classifyCharacter(code) + open = !after || (after === 2 && before) + close = !before || (before === 2 && after) + token._open = marker === 42 ? open : open && (before || !close) + token._close = marker === 42 ? close : close && (after || !open) + return ok(code) + } +} + +module.exports = attention diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/autolink.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/autolink.js new file mode 100644 index 00000000000000..d235d5f46d821e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/autolink.js @@ -0,0 +1,125 @@ +'use strict' + +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var asciiAtext = require('../character/ascii-atext.js') +var asciiControl = require('../character/ascii-control.js') + +var autolink = { + name: 'autolink', + tokenize: tokenizeAutolink +} + +function tokenizeAutolink(effects, ok, nok) { + var size = 1 + return start + + function start(code) { + effects.enter('autolink') + effects.enter('autolinkMarker') + effects.consume(code) + effects.exit('autolinkMarker') + effects.enter('autolinkProtocol') + return open + } + + function open(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return schemeOrEmailAtext + } + + return asciiAtext(code) ? emailAtext(code) : nok(code) + } + + function schemeOrEmailAtext(code) { + return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code) + ? schemeInsideOrEmailAtext(code) + : emailAtext(code) + } + + function schemeInsideOrEmailAtext(code) { + if (code === 58) { + effects.consume(code) + return urlInside + } + + if ( + (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && + size++ < 32 + ) { + effects.consume(code) + return schemeInsideOrEmailAtext + } + + return emailAtext(code) + } + + function urlInside(code) { + if (code === 62) { + effects.exit('autolinkProtocol') + return end(code) + } + + if (code === 32 || code === 60 || asciiControl(code)) { + return nok(code) + } + + effects.consume(code) + return urlInside + } + + function emailAtext(code) { + if (code === 64) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (asciiAtext(code)) { + effects.consume(code) + return emailAtext + } + + return nok(code) + } + + function emailAtSignOrDot(code) { + return asciiAlphanumeric(code) ? emailLabel(code) : nok(code) + } + + function emailLabel(code) { + if (code === 46) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (code === 62) { + // Exit, then change the type. + effects.exit('autolinkProtocol').type = 'autolinkEmail' + return end(code) + } + + return emailValue(code) + } + + function emailValue(code) { + if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { + effects.consume(code) + return code === 45 ? emailValue : emailLabel + } + + return nok(code) + } + + function end(code) { + effects.enter('autolinkMarker') + effects.consume(code) + effects.exit('autolinkMarker') + effects.exit('autolink') + return ok + } +} + +module.exports = autolink diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/block-quote.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/block-quote.js new file mode 100644 index 00000000000000..b3090ca23892d3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/block-quote.js @@ -0,0 +1,67 @@ +'use strict' + +var markdownSpace = require('../character/markdown-space.js') +var factorySpace = require('./factory-space.js') + +var blockQuote = { + name: 'blockQuote', + tokenize: tokenizeBlockQuoteStart, + continuation: { + tokenize: tokenizeBlockQuoteContinuation + }, + exit: exit +} + +function tokenizeBlockQuoteStart(effects, ok, nok) { + var self = this + return start + + function start(code) { + if (code === 62) { + if (!self.containerState.open) { + effects.enter('blockQuote', { + _container: true + }) + self.containerState.open = true + } + + effects.enter('blockQuotePrefix') + effects.enter('blockQuoteMarker') + effects.consume(code) + effects.exit('blockQuoteMarker') + return after + } + + return nok(code) + } + + function after(code) { + if (markdownSpace(code)) { + effects.enter('blockQuotePrefixWhitespace') + effects.consume(code) + effects.exit('blockQuotePrefixWhitespace') + effects.exit('blockQuotePrefix') + return ok + } + + effects.exit('blockQuotePrefix') + return ok(code) + } +} + +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(blockQuote, ok, nok), + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) +} + +function exit(effects) { + effects.exit('blockQuote') +} + +module.exports = blockQuote diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-escape.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-escape.js new file mode 100644 index 00000000000000..dcad7353cd01ad --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-escape.js @@ -0,0 +1,34 @@ +'use strict' + +var asciiPunctuation = require('../character/ascii-punctuation.js') + +var characterEscape = { + name: 'characterEscape', + tokenize: tokenizeCharacterEscape +} + +function tokenizeCharacterEscape(effects, ok, nok) { + return start + + function start(code) { + effects.enter('characterEscape') + effects.enter('escapeMarker') + effects.consume(code) + effects.exit('escapeMarker') + return open + } + + function open(code) { + if (asciiPunctuation(code)) { + effects.enter('characterEscapeValue') + effects.consume(code) + effects.exit('characterEscapeValue') + effects.exit('characterEscape') + return ok + } + + return nok(code) + } +} + +module.exports = characterEscape diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-reference.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-reference.js new file mode 100644 index 00000000000000..101027dbde4120 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/character-reference.js @@ -0,0 +1,94 @@ +'use strict' + +var decodeEntity = require('parse-entities/decode-entity.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var asciiDigit = require('../character/ascii-digit.js') +var asciiHexDigit = require('../character/ascii-hex-digit.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var decodeEntity__default = /*#__PURE__*/ _interopDefaultLegacy(decodeEntity) + +var characterReference = { + name: 'characterReference', + tokenize: tokenizeCharacterReference +} + +function tokenizeCharacterReference(effects, ok, nok) { + var self = this + var size = 0 + var max + var test + return start + + function start(code) { + effects.enter('characterReference') + effects.enter('characterReferenceMarker') + effects.consume(code) + effects.exit('characterReferenceMarker') + return open + } + + function open(code) { + if (code === 35) { + effects.enter('characterReferenceMarkerNumeric') + effects.consume(code) + effects.exit('characterReferenceMarkerNumeric') + return numeric + } + + effects.enter('characterReferenceValue') + max = 31 + test = asciiAlphanumeric + return value(code) + } + + function numeric(code) { + if (code === 88 || code === 120) { + effects.enter('characterReferenceMarkerHexadecimal') + effects.consume(code) + effects.exit('characterReferenceMarkerHexadecimal') + effects.enter('characterReferenceValue') + max = 6 + test = asciiHexDigit + return value + } + + effects.enter('characterReferenceValue') + max = 7 + test = asciiDigit + return value(code) + } + + function value(code) { + var token + + if (code === 59 && size) { + token = effects.exit('characterReferenceValue') + + if ( + test === asciiAlphanumeric && + !decodeEntity__default['default'](self.sliceSerialize(token)) + ) { + return nok(code) + } + + effects.enter('characterReferenceMarker') + effects.consume(code) + effects.exit('characterReferenceMarker') + effects.exit('characterReference') + return ok + } + + if (test(code) && size++ < max) { + effects.consume(code) + return value + } + + return nok(code) + } +} + +module.exports = characterReference diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-fenced.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-fenced.js new file mode 100644 index 00000000000000..16f8894704a385 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-fenced.js @@ -0,0 +1,176 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var prefixSize = require('../util/prefix-size.js') +var factorySpace = require('./factory-space.js') + +var codeFenced = { + name: 'codeFenced', + tokenize: tokenizeCodeFenced, + concrete: true +} + +function tokenizeCodeFenced(effects, ok, nok) { + var self = this + var closingFenceConstruct = { + tokenize: tokenizeClosingFence, + partial: true + } + var initialPrefix = prefixSize(this.events, 'linePrefix') + var sizeOpen = 0 + var marker + return start + + function start(code) { + effects.enter('codeFenced') + effects.enter('codeFencedFence') + effects.enter('codeFencedFenceSequence') + marker = code + return sequenceOpen(code) + } + + function sequenceOpen(code) { + if (code === marker) { + effects.consume(code) + sizeOpen++ + return sequenceOpen + } + + effects.exit('codeFencedFenceSequence') + return sizeOpen < 3 + ? nok(code) + : factorySpace(effects, infoOpen, 'whitespace')(code) + } + + function infoOpen(code) { + if (code === null || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter('codeFencedFenceInfo') + effects.enter('chunkString', { + contentType: 'string' + }) + return info(code) + } + + function info(code) { + if (code === null || markdownLineEndingOrSpace(code)) { + effects.exit('chunkString') + effects.exit('codeFencedFenceInfo') + return factorySpace(effects, infoAfter, 'whitespace')(code) + } + + if (code === 96 && code === marker) return nok(code) + effects.consume(code) + return info + } + + function infoAfter(code) { + if (code === null || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter('codeFencedFenceMeta') + effects.enter('chunkString', { + contentType: 'string' + }) + return meta(code) + } + + function meta(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('chunkString') + effects.exit('codeFencedFenceMeta') + return openAfter(code) + } + + if (code === 96 && code === marker) return nok(code) + effects.consume(code) + return meta + } + + function openAfter(code) { + effects.exit('codeFencedFence') + return self.interrupt ? ok(code) : content(code) + } + + function content(code) { + if (code === null) { + return after(code) + } + + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return effects.attempt( + closingFenceConstruct, + after, + initialPrefix + ? factorySpace(effects, content, 'linePrefix', initialPrefix + 1) + : content + ) + } + + effects.enter('codeFlowValue') + return contentContinue(code) + } + + function contentContinue(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('codeFlowValue') + return content(code) + } + + effects.consume(code) + return contentContinue + } + + function after(code) { + effects.exit('codeFenced') + return ok(code) + } + + function tokenizeClosingFence(effects, ok, nok) { + var size = 0 + return factorySpace( + effects, + closingSequenceStart, + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) + + function closingSequenceStart(code) { + effects.enter('codeFencedFence') + effects.enter('codeFencedFenceSequence') + return closingSequence(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return closingSequence + } + + if (size < sizeOpen) return nok(code) + effects.exit('codeFencedFenceSequence') + return factorySpace(effects, closingSequenceEnd, 'whitespace')(code) + } + + function closingSequenceEnd(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('codeFencedFence') + return ok(code) + } + + return nok(code) + } + } +} + +module.exports = codeFenced diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-indented.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-indented.js new file mode 100644 index 00000000000000..604f094dbc7a38 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-indented.js @@ -0,0 +1,72 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var chunkedSplice = require('../util/chunked-splice.js') +var prefixSize = require('../util/prefix-size.js') +var factorySpace = require('./factory-space.js') + +var codeIndented = { + name: 'codeIndented', + tokenize: tokenizeCodeIndented, + resolve: resolveCodeIndented +} +var indentedContentConstruct = { + tokenize: tokenizeIndentedContent, + partial: true +} + +function resolveCodeIndented(events, context) { + var code = { + type: 'codeIndented', + start: events[0][1].start, + end: events[events.length - 1][1].end + } + chunkedSplice(events, 0, 0, [['enter', code, context]]) + chunkedSplice(events, events.length, 0, [['exit', code, context]]) + return events +} + +function tokenizeCodeIndented(effects, ok, nok) { + return effects.attempt(indentedContentConstruct, afterPrefix, nok) + + function afterPrefix(code) { + if (code === null) { + return ok(code) + } + + if (markdownLineEnding(code)) { + return effects.attempt(indentedContentConstruct, afterPrefix, ok)(code) + } + + effects.enter('codeFlowValue') + return content(code) + } + + function content(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('codeFlowValue') + return afterPrefix(code) + } + + effects.consume(code) + return content + } +} + +function tokenizeIndentedContent(effects, ok, nok) { + var self = this + return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1) + + function afterPrefix(code) { + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1) + } + + return prefixSize(self.events, 'linePrefix') < 4 ? nok(code) : ok(code) + } +} + +module.exports = codeIndented diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-text.js new file mode 100644 index 00000000000000..d4a8fbe31c0bf8 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/code-text.js @@ -0,0 +1,162 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') + +var codeText = { + name: 'codeText', + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous: previous +} + +function resolveCodeText(events) { + var tailExitIndex = events.length - 4 + var headEnterIndex = 3 + var index + var enter // If we start and end with an EOL or a space. + + if ( + (events[headEnterIndex][1].type === 'lineEnding' || + events[headEnterIndex][1].type === 'space') && + (events[tailExitIndex][1].type === 'lineEnding' || + events[tailExitIndex][1].type === 'space') + ) { + index = headEnterIndex // And we have data. + + while (++index < tailExitIndex) { + if (events[index][1].type === 'codeTextData') { + // Then we have padding. + events[tailExitIndex][1].type = events[headEnterIndex][1].type = + 'codeTextPadding' + headEnterIndex += 2 + tailExitIndex -= 2 + break + } + } + } // Merge adjacent spaces and data. + + index = headEnterIndex - 1 + tailExitIndex++ + + while (++index <= tailExitIndex) { + if (enter === undefined) { + if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') { + enter = index + } + } else if ( + index === tailExitIndex || + events[index][1].type === 'lineEnding' + ) { + events[enter][1].type = 'codeTextData' + + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + tailExitIndex -= index - enter - 2 + index = enter + 2 + } + + enter = undefined + } + } + + return events +} + +function previous(code) { + // If there is a previous code, there will always be a tail. + return ( + code !== 96 || + this.events[this.events.length - 1][1].type === 'characterEscape' + ) +} + +function tokenizeCodeText(effects, ok, nok) { + var sizeOpen = 0 + var size + var token + return start + + function start(code) { + effects.enter('codeText') + effects.enter('codeTextSequence') + return openingSequence(code) + } + + function openingSequence(code) { + if (code === 96) { + effects.consume(code) + sizeOpen++ + return openingSequence + } + + effects.exit('codeTextSequence') + return gap(code) + } + + function gap(code) { + // EOF. + if (code === null) { + return nok(code) + } // Closing fence? + // Could also be data. + + if (code === 96) { + token = effects.enter('codeTextSequence') + size = 0 + return closingSequence(code) + } // Tabs don’t work, and virtual spaces don’t make sense. + + if (code === 32) { + effects.enter('space') + effects.consume(code) + effects.exit('space') + return gap + } + + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return gap + } // Data. + + effects.enter('codeTextData') + return data(code) + } // In code. + + function data(code) { + if ( + code === null || + code === 32 || + code === 96 || + markdownLineEnding(code) + ) { + effects.exit('codeTextData') + return gap(code) + } + + effects.consume(code) + return data + } // Closing fence. + + function closingSequence(code) { + // More. + if (code === 96) { + effects.consume(code) + size++ + return closingSequence + } // Done! + + if (size === sizeOpen) { + effects.exit('codeTextSequence') + effects.exit('codeText') + return ok(code) + } // More or less accents: mark as data. + + token.type = 'codeTextData' + return data(code) + } +} + +module.exports = codeText diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/content.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/content.js new file mode 100644 index 00000000000000..e1a712eb8ba112 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/content.js @@ -0,0 +1,99 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var prefixSize = require('../util/prefix-size.js') +var subtokenize = require('../util/subtokenize.js') +var factorySpace = require('./factory-space.js') + +// No name because it must not be turned off. +var content = { + tokenize: tokenizeContent, + resolve: resolveContent, + interruptible: true, + lazy: true +} +var continuationConstruct = { + tokenize: tokenizeContinuation, + partial: true +} // Content is transparent: it’s parsed right now. That way, definitions are also +// parsed right now: before text in paragraphs (specifically, media) are parsed. + +function resolveContent(events) { + subtokenize(events) + return events +} + +function tokenizeContent(effects, ok) { + var previous + return start + + function start(code) { + effects.enter('content') + previous = effects.enter('chunkContent', { + contentType: 'content' + }) + return data(code) + } + + function data(code) { + if (code === null) { + return contentEnd(code) + } + + if (markdownLineEnding(code)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code) + } // Data. + + effects.consume(code) + return data + } + + function contentEnd(code) { + effects.exit('chunkContent') + effects.exit('content') + return ok(code) + } + + function contentContinue(code) { + effects.consume(code) + effects.exit('chunkContent') + previous = previous.next = effects.enter('chunkContent', { + contentType: 'content', + previous: previous + }) + return data + } +} + +function tokenizeContinuation(effects, ok, nok) { + var self = this + return startLookahead + + function startLookahead(code) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace(effects, prefixed, 'linePrefix') + } + + function prefixed(code) { + if (code === null || markdownLineEnding(code)) { + return nok(code) + } + + if ( + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 || + prefixSize(self.events, 'linePrefix') < 4 + ) { + return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) + } + + return ok(code) + } +} + +module.exports = content diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/definition.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/definition.js new file mode 100644 index 00000000000000..21505d8943ab5d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/definition.js @@ -0,0 +1,115 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var factoryDestination = require('./factory-destination.js') +var factoryLabel = require('./factory-label.js') +var factorySpace = require('./factory-space.js') +var factoryWhitespace = require('./factory-whitespace.js') +var factoryTitle = require('./factory-title.js') + +var definition = { + name: 'definition', + tokenize: tokenizeDefinition +} +var titleConstruct = { + tokenize: tokenizeTitle, + partial: true +} + +function tokenizeDefinition(effects, ok, nok) { + var self = this + var identifier + return start + + function start(code) { + effects.enter('definition') + return factoryLabel.call( + self, + effects, + labelAfter, + nok, + 'definitionLabel', + 'definitionLabelMarker', + 'definitionLabelString' + )(code) + } + + function labelAfter(code) { + identifier = normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + + if (code === 58) { + effects.enter('definitionMarker') + effects.consume(code) + effects.exit('definitionMarker') // Note: blank lines can’t exist in content. + + return factoryWhitespace( + effects, + factoryDestination( + effects, + effects.attempt( + titleConstruct, + factorySpace(effects, after, 'whitespace'), + factorySpace(effects, after, 'whitespace') + ), + nok, + 'definitionDestination', + 'definitionDestinationLiteral', + 'definitionDestinationLiteralMarker', + 'definitionDestinationRaw', + 'definitionDestinationString' + ) + ) + } + + return nok(code) + } + + function after(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('definition') + + if (self.parser.defined.indexOf(identifier) < 0) { + self.parser.defined.push(identifier) + } + + return ok(code) + } + + return nok(code) + } +} + +function tokenizeTitle(effects, ok, nok) { + return start + + function start(code) { + return markdownLineEndingOrSpace(code) + ? factoryWhitespace(effects, before)(code) + : nok(code) + } + + function before(code) { + if (code === 34 || code === 39 || code === 40) { + return factoryTitle( + effects, + factorySpace(effects, after, 'whitespace'), + nok, + 'definitionTitle', + 'definitionTitleMarker', + 'definitionTitleString' + )(code) + } + + return nok(code) + } + + function after(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code) + } +} + +module.exports = definition diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-destination.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-destination.js new file mode 100644 index 00000000000000..1572025cffdddd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-destination.js @@ -0,0 +1,131 @@ +'use strict' + +var asciiControl = require('../character/ascii-control.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') + +// eslint-disable-next-line max-params +function destinationFactory( + effects, + ok, + nok, + type, + literalType, + literalMarkerType, + rawType, + stringType, + max +) { + var limit = max || Infinity + var balance = 0 + return start + + function start(code) { + if (code === 60) { + effects.enter(type) + effects.enter(literalType) + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + return destinationEnclosedBefore + } + + if (asciiControl(code) || code === 41) { + return nok(code) + } + + effects.enter(type) + effects.enter(rawType) + effects.enter(stringType) + effects.enter('chunkString', { + contentType: 'string' + }) + return destinationRaw(code) + } + + function destinationEnclosedBefore(code) { + if (code === 62) { + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + effects.exit(literalType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + effects.enter('chunkString', { + contentType: 'string' + }) + return destinationEnclosed(code) + } + + function destinationEnclosed(code) { + if (code === 62) { + effects.exit('chunkString') + effects.exit(stringType) + return destinationEnclosedBefore(code) + } + + if (code === null || code === 60 || markdownLineEnding(code)) { + return nok(code) + } + + effects.consume(code) + return code === 92 ? destinationEnclosedEscape : destinationEnclosed + } + + function destinationEnclosedEscape(code) { + if (code === 60 || code === 62 || code === 92) { + effects.consume(code) + return destinationEnclosed + } + + return destinationEnclosed(code) + } + + function destinationRaw(code) { + if (code === 40) { + if (++balance > limit) return nok(code) + effects.consume(code) + return destinationRaw + } + + if (code === 41) { + if (!balance--) { + effects.exit('chunkString') + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + effects.consume(code) + return destinationRaw + } + + if (code === null || markdownLineEndingOrSpace(code)) { + if (balance) return nok(code) + effects.exit('chunkString') + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + if (asciiControl(code)) return nok(code) + effects.consume(code) + return code === 92 ? destinationRawEscape : destinationRaw + } + + function destinationRawEscape(code) { + if (code === 40 || code === 41 || code === 92) { + effects.consume(code) + return destinationRaw + } + + return destinationRaw(code) + } +} + +module.exports = destinationFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-label.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-label.js new file mode 100644 index 00000000000000..500c95a8f7f53e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-label.js @@ -0,0 +1,88 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') + +// eslint-disable-next-line max-params +function labelFactory(effects, ok, nok, type, markerType, stringType) { + var self = this + var size = 0 + var data + return start + + function start(code) { + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.enter(stringType) + return atBreak + } + + function atBreak(code) { + if ( + code === null || + code === 91 || + (code === 93 && !data) || + /* c8 ignore next */ + (code === 94 && + /* c8 ignore next */ + !size && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs) || + size > 999 + ) { + return nok(code) + } + + if (code === 93) { + effects.exit(stringType) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return atBreak + } + + effects.enter('chunkString', { + contentType: 'string' + }) + return label(code) + } + + function label(code) { + if ( + code === null || + code === 91 || + code === 93 || + markdownLineEnding(code) || + size++ > 999 + ) { + effects.exit('chunkString') + return atBreak(code) + } + + effects.consume(code) + data = data || !markdownSpace(code) + return code === 92 ? labelEscape : label + } + + function labelEscape(code) { + if (code === 91 || code === 92 || code === 93) { + effects.consume(code) + size++ + return label + } + + return label(code) + } +} + +module.exports = labelFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-space.js new file mode 100644 index 00000000000000..b1026df91f2674 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-space.js @@ -0,0 +1,30 @@ +'use strict' + +var markdownSpace = require('../character/markdown-space.js') + +function spaceFactory(effects, ok, type, max) { + var limit = max ? max - 1 : Infinity + var size = 0 + return start + + function start(code) { + if (markdownSpace(code)) { + effects.enter(type) + return prefix(code) + } + + return ok(code) + } + + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code) + return prefix + } + + effects.exit(type) + return ok(code) + } +} + +module.exports = spaceFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-title.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-title.js new file mode 100644 index 00000000000000..6b3d05456e44f4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-title.js @@ -0,0 +1,75 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var factorySpace = require('./factory-space.js') + +function titleFactory(effects, ok, nok, type, markerType, stringType) { + var marker + return start + + function start(code) { + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + marker = code === 40 ? 41 : code + return atFirstTitleBreak + } + + function atFirstTitleBreak(code) { + if (code === marker) { + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + return atTitleBreak(code) + } + + function atTitleBreak(code) { + if (code === marker) { + effects.exit(stringType) + return atFirstTitleBreak(marker) + } + + if (code === null) { + return nok(code) + } // Note: blank lines can’t exist in content. + + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace(effects, atTitleBreak, 'linePrefix') + } + + effects.enter('chunkString', { + contentType: 'string' + }) + return title(code) + } + + function title(code) { + if (code === marker || code === null || markdownLineEnding(code)) { + effects.exit('chunkString') + return atTitleBreak(code) + } + + effects.consume(code) + return code === 92 ? titleEscape : title + } + + function titleEscape(code) { + if (code === marker || code === 92) { + effects.consume(code) + return title + } + + return title(code) + } +} + +module.exports = titleFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-whitespace.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-whitespace.js new file mode 100644 index 00000000000000..8141e961d3cce9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/factory-whitespace.js @@ -0,0 +1,32 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') +var factorySpace = require('./factory-space.js') + +function whitespaceFactory(effects, ok) { + var seen + return start + + function start(code) { + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + seen = true + return start + } + + if (markdownSpace(code)) { + return factorySpace( + effects, + start, + seen ? 'linePrefix' : 'lineSuffix' + )(code) + } + + return ok(code) + } +} + +module.exports = whitespaceFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/hard-break-escape.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/hard-break-escape.js new file mode 100644 index 00000000000000..bb49becb517fbe --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/hard-break-escape.js @@ -0,0 +1,31 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') + +var hardBreakEscape = { + name: 'hardBreakEscape', + tokenize: tokenizeHardBreakEscape +} + +function tokenizeHardBreakEscape(effects, ok, nok) { + return start + + function start(code) { + effects.enter('hardBreakEscape') + effects.enter('escapeMarker') + effects.consume(code) + return open + } + + function open(code) { + if (markdownLineEnding(code)) { + effects.exit('escapeMarker') + effects.exit('hardBreakEscape') + return ok(code) + } + + return nok(code) + } +} + +module.exports = hardBreakEscape diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/heading-atx.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/heading-atx.js new file mode 100644 index 00000000000000..8d8514ba03b68e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/heading-atx.js @@ -0,0 +1,129 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var chunkedSplice = require('../util/chunked-splice.js') +var factorySpace = require('./factory-space.js') + +var headingAtx = { + name: 'headingAtx', + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +} + +function resolveHeadingAtx(events, context) { + var contentEnd = events.length - 2 + var contentStart = 3 + var content + var text // Prefix whitespace, part of the opening. + + if (events[contentStart][1].type === 'whitespace') { + contentStart += 2 + } // Suffix whitespace, part of the closing. + + if ( + contentEnd - 2 > contentStart && + events[contentEnd][1].type === 'whitespace' + ) { + contentEnd -= 2 + } + + if ( + events[contentEnd][1].type === 'atxHeadingSequence' && + (contentStart === contentEnd - 1 || + (contentEnd - 4 > contentStart && + events[contentEnd - 2][1].type === 'whitespace')) + ) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4 + } + + if (contentEnd > contentStart) { + content = { + type: 'atxHeadingText', + start: events[contentStart][1].start, + end: events[contentEnd][1].end + } + text = { + type: 'chunkText', + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: 'text' + } + chunkedSplice(events, contentStart, contentEnd - contentStart + 1, [ + ['enter', content, context], + ['enter', text, context], + ['exit', text, context], + ['exit', content, context] + ]) + } + + return events +} + +function tokenizeHeadingAtx(effects, ok, nok) { + var self = this + var size = 0 + return start + + function start(code) { + effects.enter('atxHeading') + effects.enter('atxHeadingSequence') + return fenceOpenInside(code) + } + + function fenceOpenInside(code) { + if (code === 35 && size++ < 6) { + effects.consume(code) + return fenceOpenInside + } + + if (code === null || markdownLineEndingOrSpace(code)) { + effects.exit('atxHeadingSequence') + return self.interrupt ? ok(code) : headingBreak(code) + } + + return nok(code) + } + + function headingBreak(code) { + if (code === 35) { + effects.enter('atxHeadingSequence') + return sequence(code) + } + + if (code === null || markdownLineEnding(code)) { + effects.exit('atxHeading') + return ok(code) + } + + if (markdownSpace(code)) { + return factorySpace(effects, headingBreak, 'whitespace')(code) + } + + effects.enter('atxHeadingText') + return data(code) + } + + function sequence(code) { + if (code === 35) { + effects.consume(code) + return sequence + } + + effects.exit('atxHeadingSequence') + return headingBreak(code) + } + + function data(code) { + if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { + effects.exit('atxHeadingText') + return headingBreak(code) + } + + effects.consume(code) + return data + } +} + +module.exports = headingAtx diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-flow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-flow.js new file mode 100644 index 00000000000000..dc604bf71b4298 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-flow.js @@ -0,0 +1,486 @@ +'use strict' + +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var fromCharCode = require('../constant/from-char-code.js') +var htmlBlockNames = require('../constant/html-block-names.js') +var htmlRawNames = require('../constant/html-raw-names.js') +var partialBlankLine = require('./partial-blank-line.js') + +var htmlFlow = { + name: 'htmlFlow', + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +} +var nextBlankConstruct = { + tokenize: tokenizeNextBlank, + partial: true +} + +function resolveToHtmlFlow(events) { + var index = events.length + + while (index--) { + if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') { + break + } + } + + if (index > 1 && events[index - 2][1].type === 'linePrefix') { + // Add the prefix start to the HTML token. + events[index][1].start = events[index - 2][1].start // Add the prefix start to the HTML line token. + + events[index + 1][1].start = events[index - 2][1].start // Remove the line prefix. + + events.splice(index - 2, 2) + } + + return events +} + +function tokenizeHtmlFlow(effects, ok, nok) { + var self = this + var kind + var startTag + var buffer + var index + var marker + return start + + function start(code) { + effects.enter('htmlFlow') + effects.enter('htmlFlowData') + effects.consume(code) + return open + } + + function open(code) { + if (code === 33) { + effects.consume(code) + return declarationStart + } + + if (code === 47) { + effects.consume(code) + return tagCloseStart + } + + if (code === 63) { + effects.consume(code) + kind = 3 // While we’re in an instruction instead of a declaration, we’re on a `?` + // right now, so we do need to search for `>`, similar to declarations. + + return self.interrupt ? ok : continuationDeclarationInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + startTag = true + return tagName + } + + return nok(code) + } + + function declarationStart(code) { + if (code === 45) { + effects.consume(code) + kind = 2 + return commentOpenInside + } + + if (code === 91) { + effects.consume(code) + kind = 5 + buffer = 'CDATA[' + index = 0 + return cdataOpenInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + kind = 4 + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function commentOpenInside(code) { + if (code === 45) { + effects.consume(code) + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function cdataOpenInside(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length + ? self.interrupt + ? ok + : continuation + : cdataOpenInside + } + + return nok(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + return tagName + } + + return nok(code) + } + + function tagName(code) { + if ( + code === null || + code === 47 || + code === 62 || + markdownLineEndingOrSpace(code) + ) { + if ( + code !== 47 && + startTag && + htmlRawNames.indexOf(buffer.toLowerCase()) > -1 + ) { + kind = 1 + return self.interrupt ? ok(code) : continuation(code) + } + + if (htmlBlockNames.indexOf(buffer.toLowerCase()) > -1) { + kind = 6 + + if (code === 47) { + effects.consume(code) + return basicSelfClosing + } + + return self.interrupt ? ok(code) : continuation(code) + } + + kind = 7 // Do not support complete HTML when interrupting. + + return self.interrupt + ? nok(code) + : startTag + ? completeAttributeNameBefore(code) + : completeClosingTagAfter(code) + } + + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code) + buffer += fromCharCode(code) + return tagName + } + + return nok(code) + } + + function basicSelfClosing(code) { + if (code === 62) { + effects.consume(code) + return self.interrupt ? ok : continuation + } + + return nok(code) + } + + function completeClosingTagAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeClosingTagAfter + } + + return completeEnd(code) + } + + function completeAttributeNameBefore(code) { + if (code === 47) { + effects.consume(code) + return completeEnd + } + + if (code === 58 || code === 95 || asciiAlpha(code)) { + effects.consume(code) + return completeAttributeName + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameBefore + } + + return completeEnd(code) + } + + function completeAttributeName(code) { + if ( + code === 45 || + code === 46 || + code === 58 || + code === 95 || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return completeAttributeName + } + + return completeAttributeNameAfter(code) + } + + function completeAttributeNameAfter(code) { + if (code === 61) { + effects.consume(code) + return completeAttributeValueBefore + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameAfter + } + + return completeAttributeNameBefore(code) + } + + function completeAttributeValueBefore(code) { + if ( + code === null || + code === 60 || + code === 61 || + code === 62 || + code === 96 + ) { + return nok(code) + } + + if (code === 34 || code === 39) { + effects.consume(code) + marker = code + return completeAttributeValueQuoted + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeValueBefore + } + + marker = undefined + return completeAttributeValueUnquoted(code) + } + + function completeAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return completeAttributeValueQuotedAfter + } + + if (code === null || markdownLineEnding(code)) { + return nok(code) + } + + effects.consume(code) + return completeAttributeValueQuoted + } + + function completeAttributeValueUnquoted(code) { + if ( + code === null || + code === 34 || + code === 39 || + code === 60 || + code === 61 || + code === 62 || + code === 96 || + markdownLineEndingOrSpace(code) + ) { + return completeAttributeNameAfter(code) + } + + effects.consume(code) + return completeAttributeValueUnquoted + } + + function completeAttributeValueQuotedAfter(code) { + if (code === 47 || code === 62 || markdownSpace(code)) { + return completeAttributeNameBefore(code) + } + + return nok(code) + } + + function completeEnd(code) { + if (code === 62) { + effects.consume(code) + return completeAfter + } + + return nok(code) + } + + function completeAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeAfter + } + + return code === null || markdownLineEnding(code) + ? continuation(code) + : nok(code) + } + + function continuation(code) { + if (code === 45 && kind === 2) { + effects.consume(code) + return continuationCommentInside + } + + if (code === 60 && kind === 1) { + effects.consume(code) + return continuationRawTagOpen + } + + if (code === 62 && kind === 4) { + effects.consume(code) + return continuationClose + } + + if (code === 63 && kind === 3) { + effects.consume(code) + return continuationDeclarationInside + } + + if (code === 93 && kind === 5) { + effects.consume(code) + return continuationCharacterDataInside + } + + if (markdownLineEnding(code) && (kind === 6 || kind === 7)) { + return effects.check( + nextBlankConstruct, + continuationClose, + continuationAtLineEnding + )(code) + } + + if (code === null || markdownLineEnding(code)) { + return continuationAtLineEnding(code) + } + + effects.consume(code) + return continuation + } + + function continuationAtLineEnding(code) { + effects.exit('htmlFlowData') + return htmlContinueStart(code) + } + + function htmlContinueStart(code) { + if (code === null) { + return done(code) + } + + if (markdownLineEnding(code)) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return htmlContinueStart + } + + effects.enter('htmlFlowData') + return continuation(code) + } + + function continuationCommentInside(code) { + if (code === 45) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationRawTagOpen(code) { + if (code === 47) { + effects.consume(code) + buffer = '' + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationRawEndTag(code) { + if (code === 62 && htmlRawNames.indexOf(buffer.toLowerCase()) > -1) { + effects.consume(code) + return continuationClose + } + + if (asciiAlpha(code) && buffer.length < 8) { + effects.consume(code) + buffer += fromCharCode(code) + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationCharacterDataInside(code) { + if (code === 93) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationDeclarationInside(code) { + if (code === 62) { + effects.consume(code) + return continuationClose + } + + return continuation(code) + } + + function continuationClose(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('htmlFlowData') + return done(code) + } + + effects.consume(code) + return continuationClose + } + + function done(code) { + effects.exit('htmlFlow') + return ok(code) + } +} + +function tokenizeNextBlank(effects, ok, nok) { + return start + + function start(code) { + effects.exit('htmlFlowData') + effects.enter('lineEndingBlank') + effects.consume(code) + effects.exit('lineEndingBlank') + return effects.attempt(partialBlankLine, ok, nok) + } +} + +module.exports = htmlFlow diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-text.js new file mode 100644 index 00000000000000..92d1eeeccdfc8e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/html-text.js @@ -0,0 +1,435 @@ +'use strict' + +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var factorySpace = require('./factory-space.js') + +var htmlText = { + name: 'htmlText', + tokenize: tokenizeHtmlText +} + +function tokenizeHtmlText(effects, ok, nok) { + var self = this + var marker + var buffer + var index + var returnState + return start + + function start(code) { + effects.enter('htmlText') + effects.enter('htmlTextData') + effects.consume(code) + return open + } + + function open(code) { + if (code === 33) { + effects.consume(code) + return declarationOpen + } + + if (code === 47) { + effects.consume(code) + return tagCloseStart + } + + if (code === 63) { + effects.consume(code) + return instruction + } + + if (asciiAlpha(code)) { + effects.consume(code) + return tagOpen + } + + return nok(code) + } + + function declarationOpen(code) { + if (code === 45) { + effects.consume(code) + return commentOpen + } + + if (code === 91) { + effects.consume(code) + buffer = 'CDATA[' + index = 0 + return cdataOpen + } + + if (asciiAlpha(code)) { + effects.consume(code) + return declaration + } + + return nok(code) + } + + function commentOpen(code) { + if (code === 45) { + effects.consume(code) + return commentStart + } + + return nok(code) + } + + function commentStart(code) { + if (code === null || code === 62) { + return nok(code) + } + + if (code === 45) { + effects.consume(code) + return commentStartDash + } + + return comment(code) + } + + function commentStartDash(code) { + if (code === null || code === 62) { + return nok(code) + } + + return comment(code) + } + + function comment(code) { + if (code === null) { + return nok(code) + } + + if (code === 45) { + effects.consume(code) + return commentClose + } + + if (markdownLineEnding(code)) { + returnState = comment + return atLineEnding(code) + } + + effects.consume(code) + return comment + } + + function commentClose(code) { + if (code === 45) { + effects.consume(code) + return end + } + + return comment(code) + } + + function cdataOpen(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length ? cdata : cdataOpen + } + + return nok(code) + } + + function cdata(code) { + if (code === null) { + return nok(code) + } + + if (code === 93) { + effects.consume(code) + return cdataClose + } + + if (markdownLineEnding(code)) { + returnState = cdata + return atLineEnding(code) + } + + effects.consume(code) + return cdata + } + + function cdataClose(code) { + if (code === 93) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function cdataEnd(code) { + if (code === 62) { + return end(code) + } + + if (code === 93) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function declaration(code) { + if (code === null || code === 62) { + return end(code) + } + + if (markdownLineEnding(code)) { + returnState = declaration + return atLineEnding(code) + } + + effects.consume(code) + return declaration + } + + function instruction(code) { + if (code === null) { + return nok(code) + } + + if (code === 63) { + effects.consume(code) + return instructionClose + } + + if (markdownLineEnding(code)) { + returnState = instruction + return atLineEnding(code) + } + + effects.consume(code) + return instruction + } + + function instructionClose(code) { + return code === 62 ? end(code) : instruction(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return tagClose + } + + return nok(code) + } + + function tagClose(code) { + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code) + return tagClose + } + + return tagCloseBetween(code) + } + + function tagCloseBetween(code) { + if (markdownLineEnding(code)) { + returnState = tagCloseBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagCloseBetween + } + + return end(code) + } + + function tagOpen(code) { + if (code === 45 || asciiAlphanumeric(code)) { + effects.consume(code) + return tagOpen + } + + if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenBetween(code) { + if (code === 47) { + effects.consume(code) + return end + } + + if (code === 58 || code === 95 || asciiAlpha(code)) { + effects.consume(code) + return tagOpenAttributeName + } + + if (markdownLineEnding(code)) { + returnState = tagOpenBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenBetween + } + + return end(code) + } + + function tagOpenAttributeName(code) { + if ( + code === 45 || + code === 46 || + code === 58 || + code === 95 || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return tagOpenAttributeName + } + + return tagOpenAttributeNameAfter(code) + } + + function tagOpenAttributeNameAfter(code) { + if (code === 61) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeNameAfter + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeNameAfter + } + + return tagOpenBetween(code) + } + + function tagOpenAttributeValueBefore(code) { + if ( + code === null || + code === 60 || + code === 61 || + code === 62 || + code === 96 + ) { + return nok(code) + } + + if (code === 34 || code === 39) { + effects.consume(code) + marker = code + return tagOpenAttributeValueQuoted + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueBefore + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + effects.consume(code) + marker = undefined + return tagOpenAttributeValueUnquoted + } + + function tagOpenAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return tagOpenAttributeValueQuotedAfter + } + + if (code === null) { + return nok(code) + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueQuoted + return atLineEnding(code) + } + + effects.consume(code) + return tagOpenAttributeValueQuoted + } + + function tagOpenAttributeValueQuotedAfter(code) { + if (code === 62 || code === 47 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenAttributeValueUnquoted(code) { + if ( + code === null || + code === 34 || + code === 39 || + code === 60 || + code === 61 || + code === 96 + ) { + return nok(code) + } + + if (code === 62 || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code) + } + + effects.consume(code) + return tagOpenAttributeValueUnquoted + } // We can’t have blank lines in content, so no need to worry about empty + // tokens. + + function atLineEnding(code) { + effects.exit('htmlTextData') + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace( + effects, + afterPrefix, + 'linePrefix', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) + } + + function afterPrefix(code) { + effects.enter('htmlTextData') + return returnState(code) + } + + function end(code) { + if (code === 62) { + effects.consume(code) + effects.exit('htmlTextData') + effects.exit('htmlText') + return ok + } + + return nok(code) + } +} + +module.exports = htmlText diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-end.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-end.js new file mode 100644 index 00000000000000..9e8ffce8c8a13c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-end.js @@ -0,0 +1,330 @@ +'use strict' + +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var chunkedPush = require('../util/chunked-push.js') +var chunkedSplice = require('../util/chunked-splice.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var resolveAll = require('../util/resolve-all.js') +var shallow = require('../util/shallow.js') +var factoryDestination = require('./factory-destination.js') +var factoryLabel = require('./factory-label.js') +var factoryTitle = require('./factory-title.js') +var factoryWhitespace = require('./factory-whitespace.js') + +var labelEnd = { + name: 'labelEnd', + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +} +var resourceConstruct = { + tokenize: tokenizeResource +} +var fullReferenceConstruct = { + tokenize: tokenizeFullReference +} +var collapsedReferenceConstruct = { + tokenize: tokenizeCollapsedReference +} + +function resolveAllLabelEnd(events) { + var index = -1 + var token + + while (++index < events.length) { + token = events[index][1] + + if ( + !token._used && + (token.type === 'labelImage' || + token.type === 'labelLink' || + token.type === 'labelEnd') + ) { + // Remove the marker. + events.splice(index + 1, token.type === 'labelImage' ? 4 : 2) + token.type = 'data' + index++ + } + } + + return events +} + +function resolveToLabelEnd(events, context) { + var index = events.length + var offset = 0 + var group + var label + var text + var token + var open + var close + var media // Find an opening. + + while (index--) { + token = events[index][1] + + if (open) { + // If we see another link, or inactive link label, we’ve been here before. + if ( + token.type === 'link' || + (token.type === 'labelLink' && token._inactive) + ) { + break + } // Mark other link openings as inactive, as we can’t have links in + // links. + + if (events[index][0] === 'enter' && token.type === 'labelLink') { + token._inactive = true + } + } else if (close) { + if ( + events[index][0] === 'enter' && + (token.type === 'labelImage' || token.type === 'labelLink') && + !token._balanced + ) { + open = index + + if (token.type !== 'labelLink') { + offset = 2 + break + } + } + } else if (token.type === 'labelEnd') { + close = index + } + } + + group = { + type: events[open][1].type === 'labelLink' ? 'link' : 'image', + start: shallow(events[open][1].start), + end: shallow(events[events.length - 1][1].end) + } + label = { + type: 'label', + start: shallow(events[open][1].start), + end: shallow(events[close][1].end) + } + text = { + type: 'labelText', + start: shallow(events[open + offset + 2][1].end), + end: shallow(events[close - 2][1].start) + } + media = [ + ['enter', group, context], + ['enter', label, context] + ] // Opening marker. + + media = chunkedPush(media, events.slice(open + 1, open + offset + 3)) // Text open. + + media = chunkedPush(media, [['enter', text, context]]) // Between. + + media = chunkedPush( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset + 4, close - 3), + context + ) + ) // Text close, marker close, label close. + + media = chunkedPush(media, [ + ['exit', text, context], + events[close - 2], + events[close - 1], + ['exit', label, context] + ]) // Reference, resource, or so. + + media = chunkedPush(media, events.slice(close + 1)) // Media close. + + media = chunkedPush(media, [['exit', group, context]]) + chunkedSplice(events, open, events.length, media) + return events +} + +function tokenizeLabelEnd(effects, ok, nok) { + var self = this + var index = self.events.length + var labelStart + var defined // Find an opening. + + while (index--) { + if ( + (self.events[index][1].type === 'labelImage' || + self.events[index][1].type === 'labelLink') && + !self.events[index][1]._balanced + ) { + labelStart = self.events[index][1] + break + } + } + + return start + + function start(code) { + if (!labelStart) { + return nok(code) + } // It’s a balanced bracket, but contains a link. + + if (labelStart._inactive) return balanced(code) + defined = + self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize({ + start: labelStart.end, + end: self.now() + }) + ) + ) > -1 + effects.enter('labelEnd') + effects.enter('labelMarker') + effects.consume(code) + effects.exit('labelMarker') + effects.exit('labelEnd') + return afterLabelEnd + } + + function afterLabelEnd(code) { + // Resource: `[asd](fgh)`. + if (code === 40) { + return effects.attempt( + resourceConstruct, + ok, + defined ? ok : balanced + )(code) + } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? + + if (code === 91) { + return effects.attempt( + fullReferenceConstruct, + ok, + defined + ? effects.attempt(collapsedReferenceConstruct, ok, balanced) + : balanced + )(code) + } // Shortcut reference: `[asd]`? + + return defined ? ok(code) : balanced(code) + } + + function balanced(code) { + labelStart._balanced = true + return nok(code) + } +} + +function tokenizeResource(effects, ok, nok) { + return start + + function start(code) { + effects.enter('resource') + effects.enter('resourceMarker') + effects.consume(code) + effects.exit('resourceMarker') + return factoryWhitespace(effects, open) + } + + function open(code) { + if (code === 41) { + return end(code) + } + + return factoryDestination( + effects, + destinationAfter, + nok, + 'resourceDestination', + 'resourceDestinationLiteral', + 'resourceDestinationLiteralMarker', + 'resourceDestinationRaw', + 'resourceDestinationString', + 3 + )(code) + } + + function destinationAfter(code) { + return markdownLineEndingOrSpace(code) + ? factoryWhitespace(effects, between)(code) + : end(code) + } + + function between(code) { + if (code === 34 || code === 39 || code === 40) { + return factoryTitle( + effects, + factoryWhitespace(effects, end), + nok, + 'resourceTitle', + 'resourceTitleMarker', + 'resourceTitleString' + )(code) + } + + return end(code) + } + + function end(code) { + if (code === 41) { + effects.enter('resourceMarker') + effects.consume(code) + effects.exit('resourceMarker') + effects.exit('resource') + return ok + } + + return nok(code) + } +} + +function tokenizeFullReference(effects, ok, nok) { + var self = this + return start + + function start(code) { + return factoryLabel.call( + self, + effects, + afterLabel, + nok, + 'reference', + 'referenceMarker', + 'referenceString' + )(code) + } + + function afterLabel(code) { + return self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + ) < 0 + ? nok(code) + : ok(code) + } +} + +function tokenizeCollapsedReference(effects, ok, nok) { + return start + + function start(code) { + effects.enter('reference') + effects.enter('referenceMarker') + effects.consume(code) + effects.exit('referenceMarker') + return open + } + + function open(code) { + if (code === 93) { + effects.enter('referenceMarker') + effects.consume(code) + effects.exit('referenceMarker') + effects.exit('reference') + return ok + } + + return nok(code) + } +} + +module.exports = labelEnd diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-image.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-image.js new file mode 100644 index 00000000000000..90bc3d90dd5a88 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-image.js @@ -0,0 +1,46 @@ +'use strict' + +var labelEnd = require('./label-end.js') + +var labelStartImage = { + name: 'labelStartImage', + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +} + +function tokenizeLabelStartImage(effects, ok, nok) { + var self = this + return start + + function start(code) { + effects.enter('labelImage') + effects.enter('labelImageMarker') + effects.consume(code) + effects.exit('labelImageMarker') + return open + } + + function open(code) { + if (code === 91) { + effects.enter('labelMarker') + effects.consume(code) + effects.exit('labelMarker') + effects.exit('labelImage') + return after + } + + return nok(code) + } + + function after(code) { + /* c8 ignore next */ + return code === 94 && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) + : ok(code) + } +} + +module.exports = labelStartImage diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-link.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-link.js new file mode 100644 index 00000000000000..22942059979103 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/label-start-link.js @@ -0,0 +1,35 @@ +'use strict' + +var labelEnd = require('./label-end.js') + +var labelStartLink = { + name: 'labelStartLink', + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +} + +function tokenizeLabelStartLink(effects, ok, nok) { + var self = this + return start + + function start(code) { + effects.enter('labelLink') + effects.enter('labelMarker') + effects.consume(code) + effects.exit('labelMarker') + effects.exit('labelLink') + return after + } + + function after(code) { + /* c8 ignore next */ + return code === 94 && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) + : ok(code) + } +} + +module.exports = labelStartLink diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/line-ending.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/line-ending.js new file mode 100644 index 00000000000000..d381f6dc895088 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/line-ending.js @@ -0,0 +1,21 @@ +'use strict' + +var factorySpace = require('./factory-space.js') + +var lineEnding = { + name: 'lineEnding', + tokenize: tokenizeLineEnding +} + +function tokenizeLineEnding(effects, ok) { + return start + + function start(code) { + effects.enter('lineEnding') + effects.consume(code) + effects.exit('lineEnding') + return factorySpace(effects, ok, 'linePrefix') + } +} + +module.exports = lineEnding diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/list.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/list.js new file mode 100644 index 00000000000000..21f14c37b2db87 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/list.js @@ -0,0 +1,214 @@ +'use strict' + +var asciiDigit = require('../character/ascii-digit.js') +var markdownSpace = require('../character/markdown-space.js') +var prefixSize = require('../util/prefix-size.js') +var sizeChunks = require('../util/size-chunks.js') +var factorySpace = require('./factory-space.js') +var partialBlankLine = require('./partial-blank-line.js') +var thematicBreak = require('./thematic-break.js') + +var list = { + name: 'list', + tokenize: tokenizeListStart, + continuation: { + tokenize: tokenizeListContinuation + }, + exit: tokenizeListEnd +} +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +} +var indentConstruct = { + tokenize: tokenizeIndent, + partial: true +} + +function tokenizeListStart(effects, ok, nok) { + var self = this + var initialSize = prefixSize(self.events, 'linePrefix') + var size = 0 + return start + + function start(code) { + var kind = + self.containerState.type || + (code === 42 || code === 43 || code === 45 + ? 'listUnordered' + : 'listOrdered') + + if ( + kind === 'listUnordered' + ? !self.containerState.marker || code === self.containerState.marker + : asciiDigit(code) + ) { + if (!self.containerState.type) { + self.containerState.type = kind + effects.enter(kind, { + _container: true + }) + } + + if (kind === 'listUnordered') { + effects.enter('listItemPrefix') + return code === 42 || code === 45 + ? effects.check(thematicBreak, nok, atMarker)(code) + : atMarker(code) + } + + if (!self.interrupt || code === 49) { + effects.enter('listItemPrefix') + effects.enter('listItemValue') + return inside(code) + } + } + + return nok(code) + } + + function inside(code) { + if (asciiDigit(code) && ++size < 10) { + effects.consume(code) + return inside + } + + if ( + (!self.interrupt || size < 2) && + (self.containerState.marker + ? code === self.containerState.marker + : code === 41 || code === 46) + ) { + effects.exit('listItemValue') + return atMarker(code) + } + + return nok(code) + } + + function atMarker(code) { + effects.enter('listItemMarker') + effects.consume(code) + effects.exit('listItemMarker') + self.containerState.marker = self.containerState.marker || code + return effects.check( + partialBlankLine, // Can’t be empty when interrupting. + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ) + } + + function onBlank(code) { + self.containerState.initialBlankLine = true + initialSize++ + return endOfPrefix(code) + } + + function otherPrefix(code) { + if (markdownSpace(code)) { + effects.enter('listItemPrefixWhitespace') + effects.consume(code) + effects.exit('listItemPrefixWhitespace') + return endOfPrefix + } + + return nok(code) + } + + function endOfPrefix(code) { + self.containerState.size = + initialSize + sizeChunks(self.sliceStream(effects.exit('listItemPrefix'))) + return ok(code) + } +} + +function tokenizeListContinuation(effects, ok, nok) { + var self = this + self.containerState._closeFlow = undefined + return effects.check(partialBlankLine, onBlank, notBlank) + + function onBlank(code) { + self.containerState.furtherBlankLines = + self.containerState.furtherBlankLines || + self.containerState.initialBlankLine // We have a blank line. + // Still, try to consume at most the items size. + + return factorySpace( + effects, + ok, + 'listItemIndent', + self.containerState.size + 1 + )(code) + } + + function notBlank(code) { + if (self.containerState.furtherBlankLines || !markdownSpace(code)) { + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return notInCurrentItem(code) + } + + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) + } + + function notInCurrentItem(code) { + // While we do continue, we signal that the flow should be closed. + self.containerState._closeFlow = true // As we’re closing flow, we’re no longer interrupting. + + self.interrupt = undefined + return factorySpace( + effects, + effects.attempt(list, ok, nok), + 'linePrefix', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + )(code) + } +} + +function tokenizeIndent(effects, ok, nok) { + var self = this + return factorySpace( + effects, + afterPrefix, + 'listItemIndent', + self.containerState.size + 1 + ) + + function afterPrefix(code) { + return prefixSize(self.events, 'listItemIndent') === + self.containerState.size + ? ok(code) + : nok(code) + } +} + +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type) +} + +function tokenizeListItemPrefixWhitespace(effects, ok, nok) { + var self = this + return factorySpace( + effects, + afterPrefix, + 'listItemPrefixWhitespace', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + 1 + ) + + function afterPrefix(code) { + return markdownSpace(code) || + !prefixSize(self.events, 'listItemPrefixWhitespace') + ? nok(code) + : ok(code) + } +} + +module.exports = list diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/partial-blank-line.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/partial-blank-line.js new file mode 100644 index 00000000000000..b5207df20695d9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/partial-blank-line.js @@ -0,0 +1,19 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var factorySpace = require('./factory-space.js') + +var partialBlankLine = { + tokenize: tokenizePartialBlankLine, + partial: true +} + +function tokenizePartialBlankLine(effects, ok, nok) { + return factorySpace(effects, afterWhitespace, 'linePrefix') + + function afterWhitespace(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code) + } +} + +module.exports = partialBlankLine diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/setext-underline.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/setext-underline.js new file mode 100644 index 00000000000000..4f2770707ca986 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/setext-underline.js @@ -0,0 +1,117 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var shallow = require('../util/shallow.js') +var factorySpace = require('./factory-space.js') + +var setextUnderline = { + name: 'setextUnderline', + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +} + +function resolveToSetextUnderline(events, context) { + var index = events.length + var content + var text + var definition + var heading // Find the opening of the content. + // It’ll always exist: we don’t tokenize if it isn’t there. + + while (index--) { + if (events[index][0] === 'enter') { + if (events[index][1].type === 'content') { + content = index + break + } + + if (events[index][1].type === 'paragraph') { + text = index + } + } // Exit + else { + if (events[index][1].type === 'content') { + // Remove the content end (if needed we’ll add it later) + events.splice(index, 1) + } + + if (!definition && events[index][1].type === 'definition') { + definition = index + } + } + } + + heading = { + type: 'setextHeading', + start: shallow(events[text][1].start), + end: shallow(events[events.length - 1][1].end) + } // Change the paragraph to setext heading text. + + events[text][1].type = 'setextHeadingText' // If we have definitions in the content, we’ll keep on having content, + // but we need move it. + + if (definition) { + events.splice(text, 0, ['enter', heading, context]) + events.splice(definition + 1, 0, ['exit', events[content][1], context]) + events[content][1].end = shallow(events[definition][1].end) + } else { + events[content][1] = heading + } // Add the heading exit at the end. + + events.push(['exit', heading, context]) + return events +} + +function tokenizeSetextUnderline(effects, ok, nok) { + var self = this + var index = self.events.length + var marker + var paragraph // Find an opening. + + while (index--) { + // Skip enter/exit of line ending, line prefix, and content. + // We can now either have a definition or a paragraph. + if ( + self.events[index][1].type !== 'lineEnding' && + self.events[index][1].type !== 'linePrefix' && + self.events[index][1].type !== 'content' + ) { + paragraph = self.events[index][1].type === 'paragraph' + break + } + } + + return start + + function start(code) { + if (!self.lazy && (self.interrupt || paragraph)) { + effects.enter('setextHeadingLine') + effects.enter('setextHeadingLineSequence') + marker = code + return closingSequence(code) + } + + return nok(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + return closingSequence + } + + effects.exit('setextHeadingLineSequence') + return factorySpace(effects, closingSequenceEnd, 'lineSuffix')(code) + } + + function closingSequenceEnd(code) { + if (code === null || markdownLineEnding(code)) { + effects.exit('setextHeadingLine') + return ok(code) + } + + return nok(code) + } +} + +module.exports = setextUnderline diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/thematic-break.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/thematic-break.js new file mode 100644 index 00000000000000..3abbe554e45181 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/tokenize/thematic-break.js @@ -0,0 +1,53 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') +var factorySpace = require('./factory-space.js') + +var thematicBreak = { + name: 'thematicBreak', + tokenize: tokenizeThematicBreak +} + +function tokenizeThematicBreak(effects, ok, nok) { + var size = 0 + var marker + return start + + function start(code) { + effects.enter('thematicBreak') + marker = code + return atBreak(code) + } + + function atBreak(code) { + if (code === marker) { + effects.enter('thematicBreakSequence') + return sequence(code) + } + + if (markdownSpace(code)) { + return factorySpace(effects, atBreak, 'whitespace')(code) + } + + if (size < 3 || (code !== null && !markdownLineEnding(code))) { + return nok(code) + } + + effects.exit('thematicBreak') + return ok(code) + } + + function sequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return sequence + } + + effects.exit('thematicBreakSequence') + return atBreak(code) + } +} + +module.exports = thematicBreak diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-push.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-push.js new file mode 100644 index 00000000000000..77689779959fbb --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-push.js @@ -0,0 +1,14 @@ +'use strict' + +var chunkedSplice = require('./chunked-splice.js') + +function chunkedPush(list, items) { + if (list.length) { + chunkedSplice(list, list.length, 0, items) + return list + } + + return items +} + +module.exports = chunkedPush diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-splice.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-splice.js new file mode 100644 index 00000000000000..99525d76a242bb --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/chunked-splice.js @@ -0,0 +1,38 @@ +'use strict' + +var splice = require('../constant/splice.js') + +// causes a stack overflow in V8 when trying to insert 100k items for instance. + +function chunkedSplice(list, start, remove, items) { + var end = list.length + var chunkStart = 0 + var parameters // Make start between zero and `end` (included). + + if (start < 0) { + start = -start > end ? 0 : end + start + } else { + start = start > end ? end : start + } + + remove = remove > 0 ? remove : 0 // No need to chunk the items if there’s only a couple (10k) items. + + if (items.length < 10000) { + parameters = Array.from(items) + parameters.unshift(start, remove) + splice.apply(list, parameters) + } else { + // Delete `remove` items starting from `start` + if (remove) splice.apply(list, [start, remove]) // Insert the items in chunks to not cause stack overflows. + + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 10000) + parameters.unshift(start, 0) + splice.apply(list, parameters) + chunkStart += 10000 + start += 10000 + } + } +} + +module.exports = chunkedSplice diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/classify-character.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/classify-character.js new file mode 100644 index 00000000000000..9d3b21b96a1acd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/classify-character.js @@ -0,0 +1,25 @@ +'use strict' + +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var unicodePunctuation = require('../character/unicode-punctuation.js') +var unicodeWhitespace = require('../character/unicode-whitespace.js') + +// Classify whether a character is unicode whitespace, unicode punctuation, or +// anything else. +// Used for attention (emphasis, strong), whose sequences can open or close +// based on the class of surrounding characters. +function classifyCharacter(code) { + if ( + code === null || + markdownLineEndingOrSpace(code) || + unicodeWhitespace(code) + ) { + return 1 + } + + if (unicodePunctuation(code)) { + return 2 + } +} + +module.exports = classifyCharacter diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-extensions.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-extensions.js new file mode 100644 index 00000000000000..a6f8f347b8d3bd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-extensions.js @@ -0,0 +1,49 @@ +'use strict' + +var hasOwnProperty = require('../constant/has-own-property.js') +var chunkedSplice = require('./chunked-splice.js') +var miniflat = require('./miniflat.js') + +function combineExtensions(extensions) { + var all = {} + var index = -1 + + while (++index < extensions.length) { + extension(all, extensions[index]) + } + + return all +} + +function extension(all, extension) { + var hook + var left + var right + var code + + for (hook in extension) { + left = hasOwnProperty.call(all, hook) ? all[hook] : (all[hook] = {}) + right = extension[hook] + + for (code in right) { + left[code] = constructs( + miniflat(right[code]), + hasOwnProperty.call(left, code) ? left[code] : [] + ) + } + } +} + +function constructs(list, existing) { + var index = -1 + var before = [] + + while (++index < list.length) { + ;(list[index].add === 'after' ? existing : before).push(list[index]) + } + + chunkedSplice(existing, 0, 0, before) + return existing +} + +module.exports = combineExtensions diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-html-extensions.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-html-extensions.js new file mode 100644 index 00000000000000..c54258783a7c09 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/combine-html-extensions.js @@ -0,0 +1,34 @@ +'use strict' + +var hasOwnProperty = require('../constant/has-own-property.js') + +function combineHtmlExtensions(extensions) { + var handlers = {} + var index = -1 + + while (++index < extensions.length) { + extension(handlers, extensions[index]) + } + + return handlers +} + +function extension(handlers, extension) { + var hook + var left + var right + var type + + for (hook in extension) { + left = hasOwnProperty.call(handlers, hook) + ? handlers[hook] + : (handlers[hook] = {}) + right = extension[hook] + + for (type in right) { + left[type] = right[type] + } + } +} + +module.exports = combineHtmlExtensions diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/create-tokenizer.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/create-tokenizer.js new file mode 100644 index 00000000000000..9051658c83c3f8 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/create-tokenizer.js @@ -0,0 +1,316 @@ +'use strict' + +var assign = require('../constant/assign.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var chunkedPush = require('./chunked-push.js') +var chunkedSplice = require('./chunked-splice.js') +var miniflat = require('./miniflat.js') +var resolveAll = require('./resolve-all.js') +var serializeChunks = require('./serialize-chunks.js') +var shallow = require('./shallow.js') +var sliceChunks = require('./slice-chunks.js') + +// Create a tokenizer. +// Tokenizers deal with one type of data (e.g., containers, flow, text). +// The parser is the object dealing with it all. +// `initialize` works like other constructs, except that only its `tokenize` +// function is used, in which case it doesn’t receive an `ok` or `nok`. +// `from` can be given to set the point before the first character, although +// when further lines are indented, they must be set with `defineSkip`. +function createTokenizer(parser, initialize, from) { + var point = from + ? shallow(from) + : { + line: 1, + column: 1, + offset: 0 + } + var columnStart = {} + var resolveAllConstructs = [] + var chunks = [] + var stack = [] + + var effects = { + consume: consume, + enter: enter, + exit: exit, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true + }), + lazy: constructFactory(onsuccessfulcheck, { + lazy: true + }) + } // State and tools for resolving and serializing. + + var context = { + previous: null, + events: [], + parser: parser, + sliceStream: sliceStream, + sliceSerialize: sliceSerialize, + now: now, + defineSkip: skip, + write: write + } // The state function. + + var state = initialize.tokenize.call(context, effects) // Track which character we expect to be consumed, to catch bugs. + + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize) + } // Store where we are in the input stream. + + point._index = 0 + point._bufferIndex = -1 + return context + + function write(slice) { + chunks = chunkedPush(chunks, slice) + main() // Exit if we’re not done, resolve might change stuff. + + if (chunks[chunks.length - 1] !== null) { + return [] + } + + addResult(initialize, 0) // Otherwise, resolve, and exit. + + context.events = resolveAll(resolveAllConstructs, context.events, context) + return context.events + } // + // Tools. + // + + function sliceSerialize(token) { + return serializeChunks(sliceStream(token)) + } + + function sliceStream(token) { + return sliceChunks(chunks, token) + } + + function now() { + return shallow(point) + } + + function skip(value) { + columnStart[value.line] = value.column + accountForPotentialSkip() + } // + // State management. + // + // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by + // `consume`). + // Here is where we walk through the chunks, which either include strings of + // several characters, or numerical character codes. + // The reason to do this in a loop instead of a call is so the stack can + // drain. + + function main() { + var chunkIndex + var chunk + + while (point._index < chunks.length) { + chunk = chunks[point._index] // If we’re in a buffer chunk, loop through it. + + if (typeof chunk === 'string') { + chunkIndex = point._index + + if (point._bufferIndex < 0) { + point._bufferIndex = 0 + } + + while ( + point._index === chunkIndex && + point._bufferIndex < chunk.length + ) { + go(chunk.charCodeAt(point._bufferIndex)) + } + } else { + go(chunk) + } + } + } // Deal with one code. + + function go(code) { + state = state(code) + } // Move a character forward. + + function consume(code) { + if (markdownLineEnding(code)) { + point.line++ + point.column = 1 + point.offset += code === -3 ? 2 : 1 + accountForPotentialSkip() + } else if (code !== -1) { + point.column++ + point.offset++ + } // Not in a string chunk. + + if (point._bufferIndex < 0) { + point._index++ + } else { + point._bufferIndex++ // At end of string chunk. + + if (point._bufferIndex === chunks[point._index].length) { + point._bufferIndex = -1 + point._index++ + } + } // Expose the previous character. + + context.previous = code // Mark as consumed. + } // Start a token. + + function enter(type, fields) { + var token = fields || {} + token.type = type + token.start = now() + context.events.push(['enter', token, context]) + stack.push(token) + return token + } // Stop a token. + + function exit(type) { + var token = stack.pop() + token.end = now() + context.events.push(['exit', token, context]) + return token + } // Use results. + + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from) + } // Discard results. + + function onsuccessfulcheck(construct, info) { + info.restore() + } // Factory to attempt/check/interrupt. + + function constructFactory(onreturn, fields) { + return hook // Handle either an object mapping codes to constructs, a list of + // constructs, or a single construct. + + function hook(constructs, returnState, bogusState) { + var listOfConstructs + var constructIndex + var currentConstruct + var info + return constructs.tokenize || 'length' in constructs + ? handleListOfConstructs(miniflat(constructs)) + : handleMapOfConstructs + + function handleMapOfConstructs(code) { + if (code in constructs || null in constructs) { + return handleListOfConstructs( + constructs.null + ? /* c8 ignore next */ + miniflat(constructs[code]).concat(miniflat(constructs.null)) + : constructs[code] + )(code) + } + + return bogusState(code) + } + + function handleListOfConstructs(list) { + listOfConstructs = list + constructIndex = 0 + return handleConstruct(list[constructIndex]) + } + + function handleConstruct(construct) { + return start + + function start(code) { + // To do: not nede to store if there is no bogus state, probably? + // Currently doesn’t work because `inspect` in document does a check + // w/o a bogus, which doesn’t make sense. But it does seem to help perf + // by not storing. + info = store() + currentConstruct = construct + + if (!construct.partial) { + context.currentConstruct = construct + } + + if ( + construct.name && + context.parser.constructs.disable.null.indexOf(construct.name) > -1 + ) { + return nok() + } + + return construct.tokenize.call( + fields ? assign({}, context, fields) : context, + effects, + ok, + nok + )(code) + } + } + + function ok(code) { + onreturn(currentConstruct, info) + return returnState + } + + function nok(code) { + info.restore() + + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]) + } + + return bogusState + } + } + } + + function addResult(construct, from) { + if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) { + resolveAllConstructs.push(construct) + } + + if (construct.resolve) { + chunkedSplice( + context.events, + from, + context.events.length - from, + construct.resolve(context.events.slice(from), context) + ) + } + + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context) + } + } + + function store() { + var startPoint = now() + var startPrevious = context.previous + var startCurrentConstruct = context.currentConstruct + var startEventsIndex = context.events.length + var startStack = Array.from(stack) + return { + restore: restore, + from: startEventsIndex + } + + function restore() { + point = startPoint + context.previous = startPrevious + context.currentConstruct = startCurrentConstruct + context.events.length = startEventsIndex + stack = startStack + accountForPotentialSkip() + } + } + + function accountForPotentialSkip() { + if (point.line in columnStart && point.column < 2) { + point.column = columnStart[point.line] + point.offset += columnStart[point.line] - 1 + } + } +} + +module.exports = createTokenizer diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/miniflat.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/miniflat.js new file mode 100644 index 00000000000000..39c5dd4f6435fc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/miniflat.js @@ -0,0 +1,11 @@ +'use strict' + +function miniflat(value) { + return value === null || value === undefined + ? [] + : 'length' in value + ? value + : [value] +} + +module.exports = miniflat diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/move-point.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/move-point.js new file mode 100644 index 00000000000000..63c69a2b4144d4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/move-point.js @@ -0,0 +1,12 @@ +'use strict' + +// chunks (replacement characters, tabs, or line endings). + +function movePoint(point, offset) { + point.column += offset + point.offset += offset + point._bufferIndex += offset + return point +} + +module.exports = movePoint diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-identifier.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-identifier.js new file mode 100644 index 00000000000000..f063213454473e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-identifier.js @@ -0,0 +1,18 @@ +'use strict' + +function normalizeIdentifier(value) { + return ( + value // Collapse Markdown whitespace. + .replace(/[\t\n\r ]+/g, ' ') // Trim. + .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase + // counterpart is uppercased will result in a different uppercase + // character. + // Hence, to get that form, we perform both lower- and uppercase. + // Upper case makes sure keys will not interact with default prototypal + // methods: no object method is uppercase. + .toLowerCase() + .toUpperCase() + ) +} + +module.exports = normalizeIdentifier diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-uri.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-uri.js new file mode 100644 index 00000000000000..8a19ace27737a2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/normalize-uri.js @@ -0,0 +1,62 @@ +'use strict' + +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var fromCharCode = require('../constant/from-char-code.js') + +// encoded sequences. + +function normalizeUri(value) { + var index = -1 + var result = [] + var start = 0 + var skip = 0 + var code + var next + var replace + + while (++index < value.length) { + code = value.charCodeAt(index) // A correct percent encoded value. + + if ( + code === 37 && + asciiAlphanumeric(value.charCodeAt(index + 1)) && + asciiAlphanumeric(value.charCodeAt(index + 2)) + ) { + skip = 2 + } // ASCII. + else if (code < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(fromCharCode(code))) { + replace = fromCharCode(code) + } + } // Astral. + else if (code > 55295 && code < 57344) { + next = value.charCodeAt(index + 1) // A correct surrogate pair. + + if (code < 56320 && next > 56319 && next < 57344) { + replace = fromCharCode(code, next) + skip = 1 + } // Lone surrogate. + else { + replace = '\uFFFD' + } + } // Unicode. + else { + replace = fromCharCode(code) + } + + if (replace) { + result.push(value.slice(start, index), encodeURIComponent(replace)) + start = index + skip + 1 + replace = undefined + } + + if (skip) { + index += skip + skip = 0 + } + } + + return result.join('') + value.slice(start) +} + +module.exports = normalizeUri diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/prefix-size.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/prefix-size.js new file mode 100644 index 00000000000000..a560e3e83a9215 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/prefix-size.js @@ -0,0 +1,11 @@ +'use strict' + +var sizeChunks = require('./size-chunks.js') + +function prefixSize(events, type) { + var tail = events[events.length - 1] + if (!tail || tail[1].type !== type) return 0 + return sizeChunks(tail[2].sliceStream(tail[1])) +} + +module.exports = prefixSize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/regex-check.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/regex-check.js new file mode 100644 index 00000000000000..b879f444f34ea5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/regex-check.js @@ -0,0 +1,13 @@ +'use strict' + +var fromCharCode = require('../constant/from-char-code.js') + +function regexCheck(regex) { + return check + + function check(code) { + return regex.test(fromCharCode(code)) + } +} + +module.exports = regexCheck diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/resolve-all.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/resolve-all.js new file mode 100644 index 00000000000000..3e8d76b4a460a2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/resolve-all.js @@ -0,0 +1,20 @@ +'use strict' + +function resolveAll(constructs, events, context) { + var called = [] + var index = -1 + var resolve + + while (++index < constructs.length) { + resolve = constructs[index].resolveAll + + if (resolve && called.indexOf(resolve) < 0) { + events = resolve(events, context) + called.push(resolve) + } + } + + return events +} + +module.exports = resolveAll diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/safe-from-int.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/safe-from-int.js new file mode 100644 index 00000000000000..08dcac944cc9ed --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/safe-from-int.js @@ -0,0 +1,26 @@ +'use strict' + +var fromCharCode = require('../constant/from-char-code.js') + +function safeFromInt(value, base) { + var code = parseInt(value, base) + + if ( + // C0 except for HT, LF, FF, CR, space + code < 9 || + code === 11 || + (code > 13 && code < 32) || // Control character (DEL) of the basic block and C1 controls. + (code > 126 && code < 160) || // Lone high surrogates and low surrogates. + (code > 55295 && code < 57344) || // Noncharacters. + (code > 64975 && code < 65008) || + (code & 65535) === 65535 || + (code & 65535) === 65534 || // Out of range + code > 1114111 + ) { + return '\uFFFD' + } + + return fromCharCode(code) +} + +module.exports = safeFromInt diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/serialize-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/serialize-chunks.js new file mode 100644 index 00000000000000..48d9e24f51630a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/serialize-chunks.js @@ -0,0 +1,40 @@ +'use strict' + +var fromCharCode = require('../constant/from-char-code.js') + +function serializeChunks(chunks) { + var index = -1 + var result = [] + var chunk + var value + var atTab + + while (++index < chunks.length) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + value = chunk + } else if (chunk === -5) { + value = '\r' + } else if (chunk === -4) { + value = '\n' + } else if (chunk === -3) { + value = '\r' + '\n' + } else if (chunk === -2) { + value = '\t' + } else if (chunk === -1) { + if (atTab) continue + value = ' ' + } else { + // Currently only replacement character. + value = fromCharCode(chunk) + } + + atTab = chunk === -2 + result.push(value) + } + + return result.join('') +} + +module.exports = serializeChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/shallow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/shallow.js new file mode 100644 index 00000000000000..f980ab99e4c090 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/shallow.js @@ -0,0 +1,9 @@ +'use strict' + +var assign = require('../constant/assign.js') + +function shallow(object) { + return assign({}, object) +} + +module.exports = shallow diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/size-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/size-chunks.js new file mode 100644 index 00000000000000..85bacf0d4f9f22 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/size-chunks.js @@ -0,0 +1,16 @@ +'use strict' + +// Counts tabs based on their expanded size, and CR+LF as one character. + +function sizeChunks(chunks) { + var index = -1 + var size = 0 + + while (++index < chunks.length) { + size += typeof chunks[index] === 'string' ? chunks[index].length : 1 + } + + return size +} + +module.exports = sizeChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/slice-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/slice-chunks.js new file mode 100644 index 00000000000000..a1ad9289c19f19 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/slice-chunks.js @@ -0,0 +1,27 @@ +'use strict' + +function sliceChunks(chunks, token) { + var startIndex = token.start._index + var startBufferIndex = token.start._bufferIndex + var endIndex = token.end._index + var endBufferIndex = token.end._bufferIndex + var view + + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] + } else { + view = chunks.slice(startIndex, endIndex) + + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex) + } + + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)) + } + } + + return view +} + +module.exports = sliceChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/subtokenize.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/subtokenize.js new file mode 100644 index 00000000000000..dd960c6ee4f621 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/dist/util/subtokenize.js @@ -0,0 +1,199 @@ +'use strict' + +var assign = require('../constant/assign.js') +var chunkedSplice = require('./chunked-splice.js') +var shallow = require('./shallow.js') + +function subtokenize(events) { + var jumps = {} + var index = -1 + var event + var lineIndex + var otherIndex + var otherEvent + var parameters + var subevents + var more + + while (++index < events.length) { + while (index in jumps) { + index = jumps[index] + } + + event = events[index] // Add a hook for the GFM tasklist extension, which needs to know if text + // is in the first content of a list item. + + if ( + index && + event[1].type === 'chunkFlow' && + events[index - 1][1].type === 'listItemPrefix' + ) { + subevents = event[1]._tokenizer.events + otherIndex = 0 + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === 'lineEndingBlank' + ) { + otherIndex += 2 + } + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === 'content' + ) { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === 'content') { + break + } + + if (subevents[otherIndex][1].type === 'chunkText') { + subevents[otherIndex][1].isInFirstContentOfListItem = true + otherIndex++ + } + } + } + } // Enter. + + if (event[0] === 'enter') { + if (event[1].contentType) { + assign(jumps, subcontent(events, index)) + index = jumps[index] + more = true + } + } // Exit. + else if (event[1]._container || event[1]._movePreviousLineEndings) { + otherIndex = index + lineIndex = undefined + + while (otherIndex--) { + otherEvent = events[otherIndex] + + if ( + otherEvent[1].type === 'lineEnding' || + otherEvent[1].type === 'lineEndingBlank' + ) { + if (otherEvent[0] === 'enter') { + if (lineIndex) { + events[lineIndex][1].type = 'lineEndingBlank' + } + + otherEvent[1].type = 'lineEnding' + lineIndex = otherIndex + } + } else { + break + } + } + + if (lineIndex) { + // Fix position. + event[1].end = shallow(events[lineIndex][1].start) // Switch container exit w/ line endings. + + parameters = events.slice(lineIndex, index) + parameters.unshift(event) + chunkedSplice(events, lineIndex, index - lineIndex + 1, parameters) + } + } + } + + return !more +} + +function subcontent(events, eventIndex) { + var token = events[eventIndex][1] + var context = events[eventIndex][2] + var startPosition = eventIndex - 1 + var startPositions = [] + var tokenizer = + token._tokenizer || context.parser[token.contentType](token.start) + var childEvents = tokenizer.events + var jumps = [] + var gaps = {} + var stream + var previous + var index + var entered + var end + var adjust // Loop forward through the linked tokens to pass them in order to the + // subtokenizer. + + while (token) { + // Find the position of the event for this token. + while (events[++startPosition][1] !== token) { + // Empty. + } + + startPositions.push(startPosition) + + if (!token._tokenizer) { + stream = context.sliceStream(token) + + if (!token.next) { + stream.push(null) + } + + if (previous) { + tokenizer.defineSkip(token.start) + } + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = true + } + + tokenizer.write(stream) + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = undefined + } + } // Unravel the next token. + + previous = token + token = token.next + } // Now, loop back through all events (and linked tokens), to figure out which + // parts belong where. + + token = previous + index = childEvents.length + + while (index--) { + // Make sure we’ve at least seen something (final eol is part of the last + // token). + if (childEvents[index][0] === 'enter') { + entered = true + } else if ( + // Find a void token that includes a break. + entered && + childEvents[index][1].type === childEvents[index - 1][1].type && + childEvents[index][1].start.line !== childEvents[index][1].end.line + ) { + add(childEvents.slice(index + 1, end)) + // Help GC. + token._tokenizer = token.next = undefined + token = token.previous + end = index + 1 + } + } + + // Help GC. + tokenizer.events = token._tokenizer = token.next = undefined // Do head: + + add(childEvents.slice(0, end)) + index = -1 + adjust = 0 + + while (++index < jumps.length) { + gaps[adjust + jumps[index][0]] = adjust + jumps[index][1] + adjust += jumps[index][1] - jumps[index][0] - 1 + } + + return gaps + + function add(slice) { + var start = startPositions.pop() + jumps.unshift([start, start + slice.length - 1]) + chunkedSplice(events, start, 2, slice) + } +} + +module.exports = subtokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.js new file mode 100644 index 00000000000000..bb7c67d973d210 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('./buffer.js') diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.mjs new file mode 100644 index 00000000000000..2e841cc14a7222 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/index.mjs @@ -0,0 +1 @@ +export {default} from './buffer.mjs' diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.js new file mode 100644 index 00000000000000..4e5b20d20b9315 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAlpha = regexCheck(/[A-Za-z]/) + +module.exports = asciiAlpha diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.mjs new file mode 100644 index 00000000000000..f6f3aaba7417be --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alpha.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/[A-Za-z]/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.js new file mode 100644 index 00000000000000..4ab360273aa25e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/) + +module.exports = asciiAlphanumeric diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.mjs new file mode 100644 index 00000000000000..efed7145656d29 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-alphanumeric.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/[\dA-Za-z]/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.js new file mode 100644 index 00000000000000..8962f996ede7ef --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/) + +module.exports = asciiAtext diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.mjs new file mode 100644 index 00000000000000..56b84c42e82240 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-atext.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/[#-'*+\--9=?A-Z^-~]/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.js new file mode 100644 index 00000000000000..c134a613fe725a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.js @@ -0,0 +1,14 @@ +'use strict' + +var codes = require('./codes.js') + +// Note: EOF is seen as ASCII control here, because `null < 32 == true`. +function asciiControl(code) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + code < codes.space || code === codes.del + ) +} + +module.exports = asciiControl diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.mjs new file mode 100644 index 00000000000000..0824191947a4cf --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-control.mjs @@ -0,0 +1,12 @@ +export default asciiControl + +import codes from './codes.mjs' + +// Note: EOF is seen as ASCII control here, because `null < 32 == true`. +function asciiControl(code) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + code < codes.space || code === codes.del + ) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.js new file mode 100644 index 00000000000000..da614c4e409dd3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiDigit = regexCheck(/\d/) + +module.exports = asciiDigit diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.mjs new file mode 100644 index 00000000000000..ec3b6e11dbb432 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-digit.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/\d/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.js new file mode 100644 index 00000000000000..a0e7af43edd1b7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/) + +module.exports = asciiHexDigit diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.mjs new file mode 100644 index 00000000000000..3eabedbf786c09 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-hex-digit.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/[\dA-Fa-f]/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.js new file mode 100644 index 00000000000000..596b45a5eb084b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/) + +module.exports = asciiPunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.mjs new file mode 100644 index 00000000000000..d8308f1139e4fd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/ascii-punctuation.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/[!-/:-@[-`{-~]/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.js new file mode 100644 index 00000000000000..46ab818040f06d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.js @@ -0,0 +1,158 @@ +'use strict' + +// This module is compiled away! +// +// micromark works based on character codes. +// This module contains constants for the ASCII block and the replacement +// character. +// A couple of them are handled in a special way, such as the line endings +// (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal +// tab) and its expansion based on what column it’s at (virtual space), +// and the end-of-file (eof) character. +// As values are preprocessed before handling them, the actual characters LF, +// CR, HT, and NUL (which is present as the replacement character), are +// guaranteed to not exist. +// +// Unicode basic latin block. +var codes = { + carriageReturn: -5, + lineFeed: -4, + carriageReturnLineFeed: -3, + horizontalTab: -2, + virtualSpace: -1, + eof: null, + nul: 0, + soh: 1, + stx: 2, + etx: 3, + eot: 4, + enq: 5, + ack: 6, + bel: 7, + bs: 8, + ht: 9, // `\t` + lf: 10, // `\n` + vt: 11, // `\v` + ff: 12, // `\f` + cr: 13, // `\r` + so: 14, + si: 15, + dle: 16, + dc1: 17, + dc2: 18, + dc3: 19, + dc4: 20, + nak: 21, + syn: 22, + etb: 23, + can: 24, + em: 25, + sub: 26, + esc: 27, + fs: 28, + gs: 29, + rs: 30, + us: 31, + space: 32, + exclamationMark: 33, // `!` + quotationMark: 34, // `"` + numberSign: 35, // `#` + dollarSign: 36, // `$` + percentSign: 37, // `%` + ampersand: 38, // `&` + apostrophe: 39, // `'` + leftParenthesis: 40, // `(` + rightParenthesis: 41, // `)` + asterisk: 42, // `*` + plusSign: 43, // `+` + comma: 44, // `,` + dash: 45, // `-` + dot: 46, // `.` + slash: 47, // `/` + digit0: 48, // `0` + digit1: 49, // `1` + digit2: 50, // `2` + digit3: 51, // `3` + digit4: 52, // `4` + digit5: 53, // `5` + digit6: 54, // `6` + digit7: 55, // `7` + digit8: 56, // `8` + digit9: 57, // `9` + colon: 58, // `:` + semicolon: 59, // `;` + lessThan: 60, // `<` + equalsTo: 61, // `=` + greaterThan: 62, // `>` + questionMark: 63, // `?` + atSign: 64, // `@` + uppercaseA: 65, // `A` + uppercaseB: 66, // `B` + uppercaseC: 67, // `C` + uppercaseD: 68, // `D` + uppercaseE: 69, // `E` + uppercaseF: 70, // `F` + uppercaseG: 71, // `G` + uppercaseH: 72, // `H` + uppercaseI: 73, // `I` + uppercaseJ: 74, // `J` + uppercaseK: 75, // `K` + uppercaseL: 76, // `L` + uppercaseM: 77, // `M` + uppercaseN: 78, // `N` + uppercaseO: 79, // `O` + uppercaseP: 80, // `P` + uppercaseQ: 81, // `Q` + uppercaseR: 82, // `R` + uppercaseS: 83, // `S` + uppercaseT: 84, // `T` + uppercaseU: 85, // `U` + uppercaseV: 86, // `V` + uppercaseW: 87, // `W` + uppercaseX: 88, // `X` + uppercaseY: 89, // `Y` + uppercaseZ: 90, // `Z` + leftSquareBracket: 91, // `[` + backslash: 92, // `\` + rightSquareBracket: 93, // `]` + caret: 94, // `^` + underscore: 95, // `_` + graveAccent: 96, // `` ` `` + lowercaseA: 97, // `a` + lowercaseB: 98, // `b` + lowercaseC: 99, // `c` + lowercaseD: 100, // `d` + lowercaseE: 101, // `e` + lowercaseF: 102, // `f` + lowercaseG: 103, // `g` + lowercaseH: 104, // `h` + lowercaseI: 105, // `i` + lowercaseJ: 106, // `j` + lowercaseK: 107, // `k` + lowercaseL: 108, // `l` + lowercaseM: 109, // `m` + lowercaseN: 110, // `n` + lowercaseO: 111, // `o` + lowercaseP: 112, // `p` + lowercaseQ: 113, // `q` + lowercaseR: 114, // `r` + lowercaseS: 115, // `s` + lowercaseT: 116, // `t` + lowercaseU: 117, // `u` + lowercaseV: 118, // `v` + lowercaseW: 119, // `w` + lowercaseX: 120, // `x` + lowercaseY: 121, // `y` + lowercaseZ: 122, // `z` + leftCurlyBrace: 123, // `{` + verticalBar: 124, // `|` + rightCurlyBrace: 125, // `}` + tilde: 126, // `~` + del: 127, + // Unicode Specials block. + byteOrderMarker: 65279, + // Unicode Specials block. + replacementCharacter: 65533 // `�` +} + +module.exports = codes diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.mjs new file mode 100644 index 00000000000000..7503f4728e2c9f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/codes.mjs @@ -0,0 +1,154 @@ +// This module is compiled away! +// +// micromark works based on character codes. +// This module contains constants for the ASCII block and the replacement +// character. +// A couple of them are handled in a special way, such as the line endings +// (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal +// tab) and its expansion based on what column it’s at (virtual space), +// and the end-of-file (eof) character. +// As values are preprocessed before handling them, the actual characters LF, +// CR, HT, and NUL (which is present as the replacement character), are +// guaranteed to not exist. +// +// Unicode basic latin block. +export default { + carriageReturn: -5, + lineFeed: -4, + carriageReturnLineFeed: -3, + horizontalTab: -2, + virtualSpace: -1, + eof: null, + nul: 0, + soh: 1, + stx: 2, + etx: 3, + eot: 4, + enq: 5, + ack: 6, + bel: 7, + bs: 8, + ht: 9, // `\t` + lf: 10, // `\n` + vt: 11, // `\v` + ff: 12, // `\f` + cr: 13, // `\r` + so: 14, + si: 15, + dle: 16, + dc1: 17, + dc2: 18, + dc3: 19, + dc4: 20, + nak: 21, + syn: 22, + etb: 23, + can: 24, + em: 25, + sub: 26, + esc: 27, + fs: 28, + gs: 29, + rs: 30, + us: 31, + space: 32, + exclamationMark: 33, // `!` + quotationMark: 34, // `"` + numberSign: 35, // `#` + dollarSign: 36, // `$` + percentSign: 37, // `%` + ampersand: 38, // `&` + apostrophe: 39, // `'` + leftParenthesis: 40, // `(` + rightParenthesis: 41, // `)` + asterisk: 42, // `*` + plusSign: 43, // `+` + comma: 44, // `,` + dash: 45, // `-` + dot: 46, // `.` + slash: 47, // `/` + digit0: 48, // `0` + digit1: 49, // `1` + digit2: 50, // `2` + digit3: 51, // `3` + digit4: 52, // `4` + digit5: 53, // `5` + digit6: 54, // `6` + digit7: 55, // `7` + digit8: 56, // `8` + digit9: 57, // `9` + colon: 58, // `:` + semicolon: 59, // `;` + lessThan: 60, // `<` + equalsTo: 61, // `=` + greaterThan: 62, // `>` + questionMark: 63, // `?` + atSign: 64, // `@` + uppercaseA: 65, // `A` + uppercaseB: 66, // `B` + uppercaseC: 67, // `C` + uppercaseD: 68, // `D` + uppercaseE: 69, // `E` + uppercaseF: 70, // `F` + uppercaseG: 71, // `G` + uppercaseH: 72, // `H` + uppercaseI: 73, // `I` + uppercaseJ: 74, // `J` + uppercaseK: 75, // `K` + uppercaseL: 76, // `L` + uppercaseM: 77, // `M` + uppercaseN: 78, // `N` + uppercaseO: 79, // `O` + uppercaseP: 80, // `P` + uppercaseQ: 81, // `Q` + uppercaseR: 82, // `R` + uppercaseS: 83, // `S` + uppercaseT: 84, // `T` + uppercaseU: 85, // `U` + uppercaseV: 86, // `V` + uppercaseW: 87, // `W` + uppercaseX: 88, // `X` + uppercaseY: 89, // `Y` + uppercaseZ: 90, // `Z` + leftSquareBracket: 91, // `[` + backslash: 92, // `\` + rightSquareBracket: 93, // `]` + caret: 94, // `^` + underscore: 95, // `_` + graveAccent: 96, // `` ` `` + lowercaseA: 97, // `a` + lowercaseB: 98, // `b` + lowercaseC: 99, // `c` + lowercaseD: 100, // `d` + lowercaseE: 101, // `e` + lowercaseF: 102, // `f` + lowercaseG: 103, // `g` + lowercaseH: 104, // `h` + lowercaseI: 105, // `i` + lowercaseJ: 106, // `j` + lowercaseK: 107, // `k` + lowercaseL: 108, // `l` + lowercaseM: 109, // `m` + lowercaseN: 110, // `n` + lowercaseO: 111, // `o` + lowercaseP: 112, // `p` + lowercaseQ: 113, // `q` + lowercaseR: 114, // `r` + lowercaseS: 115, // `s` + lowercaseT: 116, // `t` + lowercaseU: 117, // `u` + lowercaseV: 118, // `v` + lowercaseW: 119, // `w` + lowercaseX: 120, // `x` + lowercaseY: 121, // `y` + lowercaseZ: 122, // `z` + leftCurlyBrace: 123, // `{` + verticalBar: 124, // `|` + rightCurlyBrace: 125, // `}` + tilde: 126, // `~` + del: 127, + // Unicode Specials block. + byteOrderMarker: 65279, + // Unicode Specials block. + replacementCharacter: 65533 // `�` +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.js new file mode 100644 index 00000000000000..2b6ffb9b595100 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.js @@ -0,0 +1,9 @@ +'use strict' + +var codes = require('./codes.js') + +function markdownLineEndingOrSpace(code) { + return code < codes.nul || code === codes.space +} + +module.exports = markdownLineEndingOrSpace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.mjs new file mode 100644 index 00000000000000..6e27e03752b3dd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending-or-space.mjs @@ -0,0 +1,7 @@ +export default markdownLineEndingOrSpace + +import codes from './codes.mjs' + +function markdownLineEndingOrSpace(code) { + return code < codes.nul || code === codes.space +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.js new file mode 100644 index 00000000000000..05032eefc5325f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.js @@ -0,0 +1,9 @@ +'use strict' + +var codes = require('./codes.js') + +function markdownLineEnding(code) { + return code < codes.horizontalTab +} + +module.exports = markdownLineEnding diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.mjs new file mode 100644 index 00000000000000..63c1b71c077447 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-line-ending.mjs @@ -0,0 +1,7 @@ +export default markdownLineEnding + +import codes from './codes.mjs' + +function markdownLineEnding(code) { + return code < codes.horizontalTab +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.js new file mode 100644 index 00000000000000..6273782f9d195f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.js @@ -0,0 +1,13 @@ +'use strict' + +var codes = require('./codes.js') + +function markdownSpace(code) { + return ( + code === codes.horizontalTab || + code === codes.virtualSpace || + code === codes.space + ) +} + +module.exports = markdownSpace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.mjs new file mode 100644 index 00000000000000..03b72a18fe9e36 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/markdown-space.mjs @@ -0,0 +1,11 @@ +export default markdownSpace + +import codes from './codes.mjs' + +function markdownSpace(code) { + return ( + code === codes.horizontalTab || + code === codes.virtualSpace || + code === codes.space + ) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.js new file mode 100644 index 00000000000000..ae28b173101749 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.js @@ -0,0 +1,10 @@ +'use strict' + +var unicodePunctuationRegex = require('../constant/unicode-punctuation-regex.js') +var regexCheck = require('../util/regex-check.js') + +// Size note: removing ASCII from the regex and using `ascii-punctuation` here +// In fact adds to the bundle size. +var unicodePunctuation = regexCheck(unicodePunctuationRegex) + +module.exports = unicodePunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.mjs new file mode 100644 index 00000000000000..037f7f9bea4029 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-punctuation.mjs @@ -0,0 +1,6 @@ +import unicodePunctuation from '../constant/unicode-punctuation-regex.mjs' +import check from '../util/regex-check.mjs' + +// Size note: removing ASCII from the regex and using `ascii-punctuation` here +// In fact adds to the bundle size. +export default check(unicodePunctuation) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.js new file mode 100644 index 00000000000000..b09537ea087786 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.js @@ -0,0 +1,7 @@ +'use strict' + +var regexCheck = require('../util/regex-check.js') + +var unicodeWhitespace = regexCheck(/\s/) + +module.exports = unicodeWhitespace diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.mjs new file mode 100644 index 00000000000000..5a7a530ac73b11 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/unicode-whitespace.mjs @@ -0,0 +1,3 @@ +import check from '../util/regex-check.mjs' + +export default check(/\s/) diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.js new file mode 100644 index 00000000000000..cd1794fd97342a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.js @@ -0,0 +1,111 @@ +'use strict' + +// This module is compiled away! +// +// While micromark works based on character codes, this module includes the +// string versions of ’em. +// The C0 block, except for LF, CR, HT, and w/ the replacement character added, +// are available here. +var values = { + ht: '\t', + lf: '\n', + cr: '\r', + space: ' ', + exclamationMark: '!', + quotationMark: '"', + numberSign: '#', + dollarSign: '$', + percentSign: '%', + ampersand: '&', + apostrophe: "'", + leftParenthesis: '(', + rightParenthesis: ')', + asterisk: '*', + plusSign: '+', + comma: ',', + dash: '-', + dot: '.', + slash: '/', + digit0: '0', + digit1: '1', + digit2: '2', + digit3: '3', + digit4: '4', + digit5: '5', + digit6: '6', + digit7: '7', + digit8: '8', + digit9: '9', + colon: ':', + semicolon: ';', + lessThan: '<', + equalsTo: '=', + greaterThan: '>', + questionMark: '?', + atSign: '@', + uppercaseA: 'A', + uppercaseB: 'B', + uppercaseC: 'C', + uppercaseD: 'D', + uppercaseE: 'E', + uppercaseF: 'F', + uppercaseG: 'G', + uppercaseH: 'H', + uppercaseI: 'I', + uppercaseJ: 'J', + uppercaseK: 'K', + uppercaseL: 'L', + uppercaseM: 'M', + uppercaseN: 'N', + uppercaseO: 'O', + uppercaseP: 'P', + uppercaseQ: 'Q', + uppercaseR: 'R', + uppercaseS: 'S', + uppercaseT: 'T', + uppercaseU: 'U', + uppercaseV: 'V', + uppercaseW: 'W', + uppercaseX: 'X', + uppercaseY: 'Y', + uppercaseZ: 'Z', + leftSquareBracket: '[', + backslash: '\\', + rightSquareBracket: ']', + caret: '^', + underscore: '_', + graveAccent: '`', + lowercaseA: 'a', + lowercaseB: 'b', + lowercaseC: 'c', + lowercaseD: 'd', + lowercaseE: 'e', + lowercaseF: 'f', + lowercaseG: 'g', + lowercaseH: 'h', + lowercaseI: 'i', + lowercaseJ: 'j', + lowercaseK: 'k', + lowercaseL: 'l', + lowercaseM: 'm', + lowercaseN: 'n', + lowercaseO: 'o', + lowercaseP: 'p', + lowercaseQ: 'q', + lowercaseR: 'r', + lowercaseS: 's', + lowercaseT: 't', + lowercaseU: 'u', + lowercaseV: 'v', + lowercaseW: 'w', + lowercaseX: 'x', + lowercaseY: 'y', + lowercaseZ: 'z', + leftCurlyBrace: '{', + verticalBar: '|', + rightCurlyBrace: '}', + tilde: '~', + replacementCharacter: '�' +} + +module.exports = values diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.mjs new file mode 100644 index 00000000000000..bc0be3fee93306 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/character/values.mjs @@ -0,0 +1,107 @@ +// This module is compiled away! +// +// While micromark works based on character codes, this module includes the +// string versions of ’em. +// The C0 block, except for LF, CR, HT, and w/ the replacement character added, +// are available here. +export default { + ht: '\t', + lf: '\n', + cr: '\r', + space: ' ', + exclamationMark: '!', + quotationMark: '"', + numberSign: '#', + dollarSign: '$', + percentSign: '%', + ampersand: '&', + apostrophe: "'", + leftParenthesis: '(', + rightParenthesis: ')', + asterisk: '*', + plusSign: '+', + comma: ',', + dash: '-', + dot: '.', + slash: '/', + digit0: '0', + digit1: '1', + digit2: '2', + digit3: '3', + digit4: '4', + digit5: '5', + digit6: '6', + digit7: '7', + digit8: '8', + digit9: '9', + colon: ':', + semicolon: ';', + lessThan: '<', + equalsTo: '=', + greaterThan: '>', + questionMark: '?', + atSign: '@', + uppercaseA: 'A', + uppercaseB: 'B', + uppercaseC: 'C', + uppercaseD: 'D', + uppercaseE: 'E', + uppercaseF: 'F', + uppercaseG: 'G', + uppercaseH: 'H', + uppercaseI: 'I', + uppercaseJ: 'J', + uppercaseK: 'K', + uppercaseL: 'L', + uppercaseM: 'M', + uppercaseN: 'N', + uppercaseO: 'O', + uppercaseP: 'P', + uppercaseQ: 'Q', + uppercaseR: 'R', + uppercaseS: 'S', + uppercaseT: 'T', + uppercaseU: 'U', + uppercaseV: 'V', + uppercaseW: 'W', + uppercaseX: 'X', + uppercaseY: 'Y', + uppercaseZ: 'Z', + leftSquareBracket: '[', + backslash: '\\', + rightSquareBracket: ']', + caret: '^', + underscore: '_', + graveAccent: '`', + lowercaseA: 'a', + lowercaseB: 'b', + lowercaseC: 'c', + lowercaseD: 'd', + lowercaseE: 'e', + lowercaseF: 'f', + lowercaseG: 'g', + lowercaseH: 'h', + lowercaseI: 'i', + lowercaseJ: 'j', + lowercaseK: 'k', + lowercaseL: 'l', + lowercaseM: 'm', + lowercaseN: 'n', + lowercaseO: 'o', + lowercaseP: 'p', + lowercaseQ: 'q', + lowercaseR: 'r', + lowercaseS: 's', + lowercaseT: 't', + lowercaseU: 'u', + lowercaseV: 'v', + lowercaseW: 'w', + lowercaseX: 'x', + lowercaseY: 'y', + lowercaseZ: 'z', + leftCurlyBrace: '{', + verticalBar: '|', + rightCurlyBrace: '}', + tilde: '~', + replacementCharacter: '�' +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.js new file mode 100644 index 00000000000000..ab6874b3cdfc27 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.js @@ -0,0 +1,810 @@ +'use strict' + +var decodeEntity = require('parse-entities/decode-entity.js') +var codes = require('../character/codes.js') +var assign = require('../constant/assign.js') +var constants = require('../constant/constants.js') +var hasOwnProperty = require('../constant/has-own-property.js') +var types = require('../constant/types.js') +var combineHtmlExtensions = require('../util/combine-html-extensions.js') +var chunkedPush = require('../util/chunked-push.js') +var miniflat = require('../util/miniflat.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var normalizeUri = require('../util/normalize-uri.js') +var safeFromInt = require('../util/safe-from-int.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var decodeEntity__default = /*#__PURE__*/ _interopDefaultLegacy(decodeEntity) + +// While micromark is a lexer/tokenizer, the common case of going from markdown + +// This ensures that certain characters which have special meaning in HTML are +// dealt with. +// Technically, we can skip `>` and `"` in many cases, but CM includes them. +var characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'} + +// These two are allowlists of essentially safe protocols for full URLs in +// respectively the `href` (on ``) and `src` (on ``) attributes. +// They are based on what is allowed on GitHub, +// +var protocolHref = /^(https?|ircs?|mailto|xmpp)$/i +var protocolSrc = /^https?$/i + +function compileHtml(options) { + // Configuration. + // Includes `htmlExtensions` (an array of extensions), `defaultLineEnding` (a + // preferred EOL), `allowDangerousProtocol` (whether to allow potential + // dangerous protocols), and `allowDangerousHtml` (whether to allow potential + // dangerous HTML). + var settings = options || {} + // Tags is needed because according to markdown, links and emphasis and + // whatnot can exist in images, however, as HTML doesn’t allow content in + // images, the tags are ignored in the `alt` attribute, but the content + // remains. + var tags = true + // An object to track identifiers to media (URLs and titles) defined with + // definitions. + var definitions = {} + // A lot of the handlers need to capture some of the output data, modify it + // somehow, and then deal with it. + // We do that by tracking a stack of buffers, that can be opened (with + // `buffer`) and closed (with `resume`) to access them. + var buffers = [[]] + // As we can have links in images and the other way around, where the deepest + // ones are closed first, we need to track which one we’re in. + var mediaStack = [] + // Same for tightness, which is specific to lists. + // We need to track if we’re currently in a tight or loose container. + var tightStack = [] + + var defaultHandlers = { + enter: { + blockQuote: onenterblockquote, + codeFenced: onentercodefenced, + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: onentercodeindented, + codeText: onentercodetext, + content: onentercontent, + definition: onenterdefinition, + definitionDestinationString: onenterdefinitiondestinationstring, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: onenteremphasis, + htmlFlow: onenterhtmlflow, + htmlText: onenterhtml, + image: onenterimage, + label: buffer, + link: onenterlink, + listItemMarker: onenterlistitemmarker, + listItemValue: onenterlistitemvalue, + listOrdered: onenterlistordered, + listUnordered: onenterlistunordered, + paragraph: onenterparagraph, + reference: buffer, + resource: onenterresource, + resourceDestinationString: onenterresourcedestinationstring, + resourceTitleString: buffer, + setextHeading: onentersetextheading, + strong: onenterstrong + }, + exit: { + atxHeading: onexitatxheading, + atxHeadingSequence: onexitatxheadingsequence, + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: onexitblockquote, + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: onexitflowcode, + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: resume, + codeFlowValue: onexitcodeflowvalue, + codeIndented: onexitflowcode, + codeText: onexitcodetext, + codeTextData: onexitdata, + data: onexitdata, + definition: onexitdefinition, + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: onexitemphasis, + hardBreakEscape: onexithardbreak, + hardBreakTrailing: onexithardbreak, + htmlFlow: onexithtml, + htmlFlowData: onexitdata, + htmlText: onexithtml, + htmlTextData: onexitdata, + image: onexitmedia, + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: onexitmedia, + listOrdered: onexitlistordered, + listUnordered: onexitlistunordered, + paragraph: onexitparagraph, + reference: resume, + referenceString: onexitreferencestring, + resource: resume, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + setextHeading: onexitsetextheading, + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: onexitstrong, + thematicBreak: onexitthematicbreak + } + } + + // Combine the HTML extensions with the default handlers. + // An HTML extension is an object whose fields are either `enter` or `exit` + // (reflecting whether a token is entered or exited). + // The values at such objects are names of tokens mapping to handlers. + // Handlers are called, respectively when a token is opener or closed, with + // that token, and a context as `this`. + var handlers = combineHtmlExtensions( + [defaultHandlers].concat(miniflat(settings.htmlExtensions)) + ) + + // Handlers do often need to keep track of some state. + // That state is provided here as a key-value store (an object). + var data = {tightStack: tightStack} + + // The context for handlers references a couple of useful functions. + // In handlers from extensions, those can be accessed at `this`. + // For the handlers here, they can be accessed directly. + var context = { + lineEndingIfNeeded: lineEndingIfNeeded, + options: settings, + encode: encode, + raw: raw, + tag: tag, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + } + + // Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the + // markdown document over to the compiled HTML. + // In some cases, such as `> a`, CommonMark requires that extra line endings + // are added: `
    \n

    a

    \n
    `. + // This variable hold the default line ending when given (or `undefined`), + // and in the latter case will be updated to the first found line ending if + // there is one. + var lineEndingStyle = settings.defaultLineEnding + + // Return the function that handles a slice of events. + return compile + + // Deal w/ a slice of events. + // Return either the empty string if there’s nothing of note to return, or the + // result when done. + function compile(events) { + // As definitions can come after references, we need to figure out the media + // (urls and titles) defined by them before handling the references. + // So, we do sort of what HTML does: put metadata at the start (in head), and + // then put content after (`body`). + var head = [] + var body = [] + var index + var start + var listStack + var handler + var result + + index = -1 + start = 0 + listStack = [] + + while (++index < events.length) { + // Figure out the line ending style used in the document. + if ( + !lineEndingStyle && + (events[index][1].type === types.lineEnding || + events[index][1].type === types.lineEndingBlank) + ) { + lineEndingStyle = events[index][2].sliceSerialize(events[index][1]) + } + + // Preprocess lists to infer whether the list is loose or not. + if ( + events[index][1].type === types.listOrdered || + events[index][1].type === types.listUnordered + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + prepareList(events.slice(listStack.pop(), index)) + } + } + + // Move definitions to the front. + if (events[index][1].type === types.definition) { + if (events[index][0] === 'enter') { + body = chunkedPush(body, events.slice(start, index)) + start = index + } else { + head = chunkedPush(head, events.slice(start, index + 1)) + start = index + 1 + } + } + } + + head = chunkedPush(head, body) + head = chunkedPush(head, events.slice(start)) + result = head + index = -1 + + // Handle the start of the document, if defined. + if (handlers.enter.null) { + handlers.enter.null.call(context) + } + + // Handle all events. + while (++index < events.length) { + handler = handlers[result[index][0]] + + if (hasOwnProperty.call(handler, result[index][1].type)) { + handler[result[index][1].type].call( + assign({sliceSerialize: result[index][2].sliceSerialize}, context), + result[index][1] + ) + } + } + + // Handle the end of the document, if defined. + if (handlers.exit.null) { + handlers.exit.null.call(context) + } + + return buffers[0].join('') + } + + // Figure out whether lists are loose or not. + function prepareList(slice) { + var length = slice.length - 1 // Skip close. + var index = 0 // Skip open. + var containerBalance = 0 + var loose + var atMarker + var event + + while (++index < length) { + event = slice[index] + + if (event[1]._container) { + atMarker = undefined + + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + } else if (event[1].type === types.listItemPrefix) { + if (event[0] === 'exit') { + atMarker = true + } + } else if (event[1].type === types.linePrefix); + else if (event[1].type === types.lineEndingBlank) { + if (event[0] === 'enter' && !containerBalance) { + if (atMarker) { + atMarker = undefined + } else { + loose = true + } + } + } else { + atMarker = undefined + } + } + + slice[0][1]._loose = loose + } + + // Set data into the key-value store. + function setData(key, value) { + data[key] = value + } + + // Get data from the key-value store. + function getData(key) { + return data[key] + } + + // Capture some of the output data. + function buffer() { + buffers.push([]) + } + + // Stop capturing and access the output data. + function resume() { + return buffers.pop().join('') + } + + // Output (parts of) HTML tags. + function tag(value) { + if (!tags) return + setData('lastWasTag', true) + buffers[buffers.length - 1].push(value) + } + + // Output raw data. + function raw(value) { + setData('lastWasTag') + buffers[buffers.length - 1].push(value) + } + + // Output an extra line ending. + function lineEnding() { + raw(lineEndingStyle || '\n') + } + + // Output an extra line ending if the previous value wasn’t EOF/EOL. + function lineEndingIfNeeded() { + var buffer = buffers[buffers.length - 1] + var slice = buffer[buffer.length - 1] + var previous = slice ? slice.charCodeAt(slice.length - 1) : codes.eof + + if ( + previous === codes.lf || + previous === codes.cr || + previous === codes.eof + ) { + return + } + + lineEnding() + } + + // Make a value safe for injection in HTML (except w/ `ignoreEncode`). + function encode(value) { + return getData('ignoreEncode') ? value : value.replace(/["&<>]/g, replace) + function replace(value) { + return '&' + characterReferences[value] + ';' + } + } + + // Make a value safe for injection as a URL. + // This does encode unsafe characters with percent-encoding, skipping already + // encoded sequences (`normalizeUri`). + // Further unsafe characters are encoded as character references (`encode`). + // Finally, if the URL includes an unknown protocol (such as a dangerous + // example, `javascript:`), the value is ignored. + function url(url, protocol) { + var value = encode(normalizeUri(url || '')) + var colon = value.indexOf(':') + var questionMark = value.indexOf('?') + var numberSign = value.indexOf('#') + var slash = value.indexOf('/') + + if ( + settings.allowDangerousProtocol || + // If there is no protocol, it’s relative. + colon < 0 || + // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol. + (slash > -1 && colon > slash) || + (questionMark > -1 && colon > questionMark) || + (numberSign > -1 && colon > numberSign) || + // It is a protocol, it should be allowed. + protocol.test(value.slice(0, colon)) + ) { + return value + } + + return '' + } + + // + // Handlers. + // + + function onenterlistordered(token) { + tightStack.push(!token._loose) + lineEndingIfNeeded() + tag('') + } else { + onexitlistitem() + } + + lineEndingIfNeeded() + tag('
  • ') + setData('expectFirstItem') + // “Hack” to prevent a line ending from showing up if the item is empty. + setData('lastWasTag') + } + + function onexitlistordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistunordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistitem() { + if (getData('lastWasTag') && !getData('slurpAllLineEndings')) { + lineEndingIfNeeded() + } + + tag('
  • ') + setData('slurpAllLineEndings') + } + + function onenterblockquote() { + tightStack.push(false) + lineEndingIfNeeded() + tag('
    ') + } + + function onexitblockquote() { + tightStack.pop() + lineEndingIfNeeded() + tag('
    ') + setData('slurpAllLineEndings') + } + + function onenterparagraph() { + if (!tightStack[tightStack.length - 1]) { + lineEndingIfNeeded() + tag('

    ') + } + + setData('slurpAllLineEndings') + } + + function onexitparagraph() { + if (tightStack[tightStack.length - 1]) { + setData('slurpAllLineEndings', true) + } else { + tag('

    ') + } + } + + function onentercodefenced() { + lineEndingIfNeeded() + tag('
    ')
    +      setData('fencedCodeInside', true)
    +      setData('slurpOneLineEnding', true)
    +    }
    +
    +    setData('fencesCount', getData('fencesCount') + 1)
    +  }
    +
    +  function onentercodeindented() {
    +    lineEndingIfNeeded()
    +    tag('
    ')
    +  }
    +
    +  function onexitflowcode() {
    +    // Send an extra line feed if we saw data.
    +    if (getData('flowCodeSeenData')) lineEndingIfNeeded()
    +    tag('
    ') + if (getData('fencesCount') < 2) lineEndingIfNeeded() + setData('flowCodeSeenData') + setData('fencesCount') + setData('slurpOneLineEnding') + } + + function onenterimage() { + mediaStack.push({image: true}) + tags = undefined // Disallow tags. + } + + function onenterlink() { + mediaStack.push({}) + } + + function onexitlabeltext(token) { + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onexitlabel() { + mediaStack[mediaStack.length - 1].label = resume() + } + + function onexitreferencestring(token) { + mediaStack[mediaStack.length - 1].referenceId = this.sliceSerialize(token) + } + + function onenterresource() { + buffer() // We can have line endings in the resource, ignore them. + mediaStack[mediaStack.length - 1].destination = '' + } + + function onenterresourcedestinationstring() { + buffer() + // Ignore encoding the result, as we’ll first percent encode the url and + // encode manually after. + setData('ignoreEncode', true) + } + + function onexitresourcedestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitresourcetitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitmedia() { + var index = mediaStack.length - 1 // Skip current. + var media = mediaStack[index] + var context = + media.destination === undefined + ? definitions[normalizeIdentifier(media.referenceId || media.labelId)] + : media + + tags = true + + while (index--) { + if (mediaStack[index].image) { + tags = undefined + break + } + } + + if (media.image) { + tag('')
+      raw(media.label)
+      tag('') + } else { + tag('>') + raw(media.label) + tag('
    ') + } + + mediaStack.pop() + } + + function onenterdefinition() { + buffer() + mediaStack.push({}) + } + + function onexitdefinitionlabelstring(token) { + // Discard label, use the source content instead. + resume() + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onenterdefinitiondestinationstring() { + buffer() + setData('ignoreEncode', true) + } + + function onexitdefinitiondestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitdefinitiontitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitdefinition() { + var id = normalizeIdentifier(mediaStack[mediaStack.length - 1].labelId) + + resume() + + if (!hasOwnProperty.call(definitions, id)) { + definitions[id] = mediaStack[mediaStack.length - 1] + } + + mediaStack.pop() + } + + function onentercontent() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheadingsequence(token) { + // Exit for further sequences. + if (getData('headingRank')) return + setData('headingRank', this.sliceSerialize(token).length) + lineEndingIfNeeded() + tag('') + } + + function onentersetextheading() { + buffer() + setData('slurpAllLineEndings') + } + + function onexitsetextheadingtext() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheading() { + tag('') + setData('headingRank') + } + + function onexitsetextheadinglinesequence(token) { + setData( + 'headingRank', + this.sliceSerialize(token).charCodeAt(0) === codes.equalsTo ? 1 : 2 + ) + } + + function onexitsetextheading() { + var value = resume() + lineEndingIfNeeded() + tag('') + raw(value) + tag('') + setData('slurpAllLineEndings') + setData('headingRank') + } + + function onexitdata(token) { + raw(encode(this.sliceSerialize(token))) + } + + function onexitlineending(token) { + if (getData('slurpAllLineEndings')) { + return + } + + if (getData('slurpOneLineEnding')) { + setData('slurpOneLineEnding') + return + } + + if (getData('inCodeText')) { + raw(' ') + return + } + + raw(encode(this.sliceSerialize(token))) + } + + function onexitcodeflowvalue(token) { + raw(encode(this.sliceSerialize(token))) + setData('flowCodeSeenData', true) + } + + function onexithardbreak() { + tag('
    ') + } + + function onenterhtmlflow() { + lineEndingIfNeeded() + onenterhtml() + } + + function onexithtml() { + setData('ignoreEncode') + } + + function onenterhtml() { + if (settings.allowDangerousHtml) { + setData('ignoreEncode', true) + } + } + + function onenteremphasis() { + tag('') + } + + function onenterstrong() { + tag('') + } + + function onentercodetext() { + setData('inCodeText', true) + tag('') + } + + function onexitcodetext() { + setData('inCodeText') + tag('') + } + + function onexitemphasis() { + tag('') + } + + function onexitstrong() { + tag('') + } + + function onexitthematicbreak() { + lineEndingIfNeeded() + tag('
    ') + } + + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type) + } + + function onexitcharacterreferencevalue(token) { + var value = this.sliceSerialize(token) + + value = getData('characterReferenceType') + ? safeFromInt( + value, + getData('characterReferenceType') === + types.characterReferenceMarkerNumeric + ? constants.numericBaseDecimal + : constants.numericBaseHexadecimal + ) + : decodeEntity__default['default'](value) + + raw(encode(value)) + setData('characterReferenceType') + } + + function onexitautolinkprotocol(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } + + function onexitautolinkemail(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } +} + +module.exports = compileHtml diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.mjs new file mode 100644 index 00000000000000..3cfbe1a6511b60 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/compile/html.mjs @@ -0,0 +1,813 @@ +// While micromark is a lexer/tokenizer, the common case of going from markdown +// to html is currently built in as this module, even though the parts can be +// used separately to build ASTs, CSTs, or many other output formats. +// +// Having an HTML compiler built in is useful because it allows us to check for +// compliancy to CommonMark, the de facto norm of markdown, specified in roughly +// 600 input/output cases. +// +// This module has an interface which accepts lists of events instead of the +// whole at once, however, because markdown can’t be truly streaming, we buffer +// events before processing and outputting the final result. + +export default compileHtml + +import decodeEntity from 'parse-entities/decode-entity.js' +import codes from '../character/codes.mjs' +import assign from '../constant/assign.mjs' +import constants from '../constant/constants.mjs' +import own from '../constant/has-own-property.mjs' +import types from '../constant/types.mjs' +import combineHtmlExtensions from '../util/combine-html-extensions.mjs' +import chunkedPush from '../util/chunked-push.mjs' +import miniflat from '../util/miniflat.mjs' +import normalizeIdentifier from '../util/normalize-identifier.mjs' +import normalizeUri from '../util/normalize-uri.mjs' +import safeFromInt from '../util/safe-from-int.mjs' + +// This ensures that certain characters which have special meaning in HTML are +// dealt with. +// Technically, we can skip `>` and `"` in many cases, but CM includes them. +var characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'} + +// These two are allowlists of essentially safe protocols for full URLs in +// respectively the `href` (on ``) and `src` (on ``) attributes. +// They are based on what is allowed on GitHub, +// +var protocolHref = /^(https?|ircs?|mailto|xmpp)$/i +var protocolSrc = /^https?$/i + +function compileHtml(options) { + // Configuration. + // Includes `htmlExtensions` (an array of extensions), `defaultLineEnding` (a + // preferred EOL), `allowDangerousProtocol` (whether to allow potential + // dangerous protocols), and `allowDangerousHtml` (whether to allow potential + // dangerous HTML). + var settings = options || {} + // Tags is needed because according to markdown, links and emphasis and + // whatnot can exist in images, however, as HTML doesn’t allow content in + // images, the tags are ignored in the `alt` attribute, but the content + // remains. + var tags = true + // An object to track identifiers to media (URLs and titles) defined with + // definitions. + var definitions = {} + // A lot of the handlers need to capture some of the output data, modify it + // somehow, and then deal with it. + // We do that by tracking a stack of buffers, that can be opened (with + // `buffer`) and closed (with `resume`) to access them. + var buffers = [[]] + // As we can have links in images and the other way around, where the deepest + // ones are closed first, we need to track which one we’re in. + var mediaStack = [] + // Same for tightness, which is specific to lists. + // We need to track if we’re currently in a tight or loose container. + var tightStack = [] + + var defaultHandlers = { + enter: { + blockQuote: onenterblockquote, + codeFenced: onentercodefenced, + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: onentercodeindented, + codeText: onentercodetext, + content: onentercontent, + definition: onenterdefinition, + definitionDestinationString: onenterdefinitiondestinationstring, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: onenteremphasis, + htmlFlow: onenterhtmlflow, + htmlText: onenterhtml, + image: onenterimage, + label: buffer, + link: onenterlink, + listItemMarker: onenterlistitemmarker, + listItemValue: onenterlistitemvalue, + listOrdered: onenterlistordered, + listUnordered: onenterlistunordered, + paragraph: onenterparagraph, + reference: buffer, + resource: onenterresource, + resourceDestinationString: onenterresourcedestinationstring, + resourceTitleString: buffer, + setextHeading: onentersetextheading, + strong: onenterstrong + }, + exit: { + atxHeading: onexitatxheading, + atxHeadingSequence: onexitatxheadingsequence, + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: onexitblockquote, + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: onexitflowcode, + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: resume, + codeFlowValue: onexitcodeflowvalue, + codeIndented: onexitflowcode, + codeText: onexitcodetext, + codeTextData: onexitdata, + data: onexitdata, + definition: onexitdefinition, + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: onexitemphasis, + hardBreakEscape: onexithardbreak, + hardBreakTrailing: onexithardbreak, + htmlFlow: onexithtml, + htmlFlowData: onexitdata, + htmlText: onexithtml, + htmlTextData: onexitdata, + image: onexitmedia, + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: onexitmedia, + listOrdered: onexitlistordered, + listUnordered: onexitlistunordered, + paragraph: onexitparagraph, + reference: resume, + referenceString: onexitreferencestring, + resource: resume, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + setextHeading: onexitsetextheading, + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: onexitstrong, + thematicBreak: onexitthematicbreak + } + } + + // Combine the HTML extensions with the default handlers. + // An HTML extension is an object whose fields are either `enter` or `exit` + // (reflecting whether a token is entered or exited). + // The values at such objects are names of tokens mapping to handlers. + // Handlers are called, respectively when a token is opener or closed, with + // that token, and a context as `this`. + var handlers = combineHtmlExtensions( + [defaultHandlers].concat(miniflat(settings.htmlExtensions)) + ) + + // Handlers do often need to keep track of some state. + // That state is provided here as a key-value store (an object). + var data = {tightStack: tightStack} + + // The context for handlers references a couple of useful functions. + // In handlers from extensions, those can be accessed at `this`. + // For the handlers here, they can be accessed directly. + var context = { + lineEndingIfNeeded: lineEndingIfNeeded, + options: settings, + encode: encode, + raw: raw, + tag: tag, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + } + + // Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the + // markdown document over to the compiled HTML. + // In some cases, such as `> a`, CommonMark requires that extra line endings + // are added: `
    \n

    a

    \n
    `. + // This variable hold the default line ending when given (or `undefined`), + // and in the latter case will be updated to the first found line ending if + // there is one. + var lineEndingStyle = settings.defaultLineEnding + + // Return the function that handles a slice of events. + return compile + + // Deal w/ a slice of events. + // Return either the empty string if there’s nothing of note to return, or the + // result when done. + function compile(events) { + // As definitions can come after references, we need to figure out the media + // (urls and titles) defined by them before handling the references. + // So, we do sort of what HTML does: put metadata at the start (in head), and + // then put content after (`body`). + var head = [] + var body = [] + var index + var start + var listStack + var handler + var result + + index = -1 + start = 0 + listStack = [] + + while (++index < events.length) { + // Figure out the line ending style used in the document. + if ( + !lineEndingStyle && + (events[index][1].type === types.lineEnding || + events[index][1].type === types.lineEndingBlank) + ) { + lineEndingStyle = events[index][2].sliceSerialize(events[index][1]) + } + + // Preprocess lists to infer whether the list is loose or not. + if ( + events[index][1].type === types.listOrdered || + events[index][1].type === types.listUnordered + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + prepareList(events.slice(listStack.pop(), index)) + } + } + + // Move definitions to the front. + if (events[index][1].type === types.definition) { + if (events[index][0] === 'enter') { + body = chunkedPush(body, events.slice(start, index)) + start = index + } else { + head = chunkedPush(head, events.slice(start, index + 1)) + start = index + 1 + } + } + } + + head = chunkedPush(head, body) + head = chunkedPush(head, events.slice(start)) + result = head + index = -1 + + // Handle the start of the document, if defined. + if (handlers.enter.null) { + handlers.enter.null.call(context) + } + + // Handle all events. + while (++index < events.length) { + handler = handlers[result[index][0]] + + if (own.call(handler, result[index][1].type)) { + handler[result[index][1].type].call( + assign({sliceSerialize: result[index][2].sliceSerialize}, context), + result[index][1] + ) + } + } + + // Handle the end of the document, if defined. + if (handlers.exit.null) { + handlers.exit.null.call(context) + } + + return buffers[0].join('') + } + + // Figure out whether lists are loose or not. + function prepareList(slice) { + var length = slice.length - 1 // Skip close. + var index = 0 // Skip open. + var containerBalance = 0 + var loose + var atMarker + var event + + while (++index < length) { + event = slice[index] + + if (event[1]._container) { + atMarker = undefined + + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + } else if (event[1].type === types.listItemPrefix) { + if (event[0] === 'exit') { + atMarker = true + } + } else if (event[1].type === types.linePrefix) { + // Ignore + } else if (event[1].type === types.lineEndingBlank) { + if (event[0] === 'enter' && !containerBalance) { + if (atMarker) { + atMarker = undefined + } else { + loose = true + } + } + } else { + atMarker = undefined + } + } + + slice[0][1]._loose = loose + } + + // Set data into the key-value store. + function setData(key, value) { + data[key] = value + } + + // Get data from the key-value store. + function getData(key) { + return data[key] + } + + // Capture some of the output data. + function buffer() { + buffers.push([]) + } + + // Stop capturing and access the output data. + function resume() { + return buffers.pop().join('') + } + + // Output (parts of) HTML tags. + function tag(value) { + if (!tags) return + setData('lastWasTag', true) + buffers[buffers.length - 1].push(value) + } + + // Output raw data. + function raw(value) { + setData('lastWasTag') + buffers[buffers.length - 1].push(value) + } + + // Output an extra line ending. + function lineEnding() { + raw(lineEndingStyle || '\n') + } + + // Output an extra line ending if the previous value wasn’t EOF/EOL. + function lineEndingIfNeeded() { + var buffer = buffers[buffers.length - 1] + var slice = buffer[buffer.length - 1] + var previous = slice ? slice.charCodeAt(slice.length - 1) : codes.eof + + if ( + previous === codes.lf || + previous === codes.cr || + previous === codes.eof + ) { + return + } + + lineEnding() + } + + // Make a value safe for injection in HTML (except w/ `ignoreEncode`). + function encode(value) { + return getData('ignoreEncode') ? value : value.replace(/["&<>]/g, replace) + function replace(value) { + return '&' + characterReferences[value] + ';' + } + } + + // Make a value safe for injection as a URL. + // This does encode unsafe characters with percent-encoding, skipping already + // encoded sequences (`normalizeUri`). + // Further unsafe characters are encoded as character references (`encode`). + // Finally, if the URL includes an unknown protocol (such as a dangerous + // example, `javascript:`), the value is ignored. + function url(url, protocol) { + var value = encode(normalizeUri(url || '')) + var colon = value.indexOf(':') + var questionMark = value.indexOf('?') + var numberSign = value.indexOf('#') + var slash = value.indexOf('/') + + if ( + settings.allowDangerousProtocol || + // If there is no protocol, it’s relative. + colon < 0 || + // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol. + (slash > -1 && colon > slash) || + (questionMark > -1 && colon > questionMark) || + (numberSign > -1 && colon > numberSign) || + // It is a protocol, it should be allowed. + protocol.test(value.slice(0, colon)) + ) { + return value + } + + return '' + } + + // + // Handlers. + // + + function onenterlistordered(token) { + tightStack.push(!token._loose) + lineEndingIfNeeded() + tag('') + } else { + onexitlistitem() + } + + lineEndingIfNeeded() + tag('
  • ') + setData('expectFirstItem') + // “Hack” to prevent a line ending from showing up if the item is empty. + setData('lastWasTag') + } + + function onexitlistordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistunordered() { + onexitlistitem() + tightStack.pop() + lineEnding() + tag('') + } + + function onexitlistitem() { + if (getData('lastWasTag') && !getData('slurpAllLineEndings')) { + lineEndingIfNeeded() + } + + tag('
  • ') + setData('slurpAllLineEndings') + } + + function onenterblockquote() { + tightStack.push(false) + lineEndingIfNeeded() + tag('
    ') + } + + function onexitblockquote() { + tightStack.pop() + lineEndingIfNeeded() + tag('
    ') + setData('slurpAllLineEndings') + } + + function onenterparagraph() { + if (!tightStack[tightStack.length - 1]) { + lineEndingIfNeeded() + tag('

    ') + } + + setData('slurpAllLineEndings') + } + + function onexitparagraph() { + if (tightStack[tightStack.length - 1]) { + setData('slurpAllLineEndings', true) + } else { + tag('

    ') + } + } + + function onentercodefenced() { + lineEndingIfNeeded() + tag('
    ')
    +      setData('fencedCodeInside', true)
    +      setData('slurpOneLineEnding', true)
    +    }
    +
    +    setData('fencesCount', getData('fencesCount') + 1)
    +  }
    +
    +  function onentercodeindented() {
    +    lineEndingIfNeeded()
    +    tag('
    ')
    +  }
    +
    +  function onexitflowcode() {
    +    // Send an extra line feed if we saw data.
    +    if (getData('flowCodeSeenData')) lineEndingIfNeeded()
    +    tag('
    ') + if (getData('fencesCount') < 2) lineEndingIfNeeded() + setData('flowCodeSeenData') + setData('fencesCount') + setData('slurpOneLineEnding') + } + + function onenterimage() { + mediaStack.push({image: true}) + tags = undefined // Disallow tags. + } + + function onenterlink() { + mediaStack.push({}) + } + + function onexitlabeltext(token) { + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onexitlabel() { + mediaStack[mediaStack.length - 1].label = resume() + } + + function onexitreferencestring(token) { + mediaStack[mediaStack.length - 1].referenceId = this.sliceSerialize(token) + } + + function onenterresource() { + buffer() // We can have line endings in the resource, ignore them. + mediaStack[mediaStack.length - 1].destination = '' + } + + function onenterresourcedestinationstring() { + buffer() + // Ignore encoding the result, as we’ll first percent encode the url and + // encode manually after. + setData('ignoreEncode', true) + } + + function onexitresourcedestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitresourcetitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitmedia() { + var index = mediaStack.length - 1 // Skip current. + var media = mediaStack[index] + var context = + media.destination === undefined + ? definitions[normalizeIdentifier(media.referenceId || media.labelId)] + : media + + tags = true + + while (index--) { + if (mediaStack[index].image) { + tags = undefined + break + } + } + + if (media.image) { + tag('')
+      raw(media.label)
+      tag('') + } else { + tag('>') + raw(media.label) + tag('
    ') + } + + mediaStack.pop() + } + + function onenterdefinition() { + buffer() + mediaStack.push({}) + } + + function onexitdefinitionlabelstring(token) { + // Discard label, use the source content instead. + resume() + mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token) + } + + function onenterdefinitiondestinationstring() { + buffer() + setData('ignoreEncode', true) + } + + function onexitdefinitiondestinationstring() { + mediaStack[mediaStack.length - 1].destination = resume() + setData('ignoreEncode') + } + + function onexitdefinitiontitlestring() { + mediaStack[mediaStack.length - 1].title = resume() + } + + function onexitdefinition() { + var id = normalizeIdentifier(mediaStack[mediaStack.length - 1].labelId) + + resume() + + if (!own.call(definitions, id)) { + definitions[id] = mediaStack[mediaStack.length - 1] + } + + mediaStack.pop() + } + + function onentercontent() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheadingsequence(token) { + // Exit for further sequences. + if (getData('headingRank')) return + setData('headingRank', this.sliceSerialize(token).length) + lineEndingIfNeeded() + tag('') + } + + function onentersetextheading() { + buffer() + setData('slurpAllLineEndings') + } + + function onexitsetextheadingtext() { + setData('slurpAllLineEndings', true) + } + + function onexitatxheading() { + tag('') + setData('headingRank') + } + + function onexitsetextheadinglinesequence(token) { + setData( + 'headingRank', + this.sliceSerialize(token).charCodeAt(0) === codes.equalsTo ? 1 : 2 + ) + } + + function onexitsetextheading() { + var value = resume() + lineEndingIfNeeded() + tag('') + raw(value) + tag('') + setData('slurpAllLineEndings') + setData('headingRank') + } + + function onexitdata(token) { + raw(encode(this.sliceSerialize(token))) + } + + function onexitlineending(token) { + if (getData('slurpAllLineEndings')) { + return + } + + if (getData('slurpOneLineEnding')) { + setData('slurpOneLineEnding') + return + } + + if (getData('inCodeText')) { + raw(' ') + return + } + + raw(encode(this.sliceSerialize(token))) + } + + function onexitcodeflowvalue(token) { + raw(encode(this.sliceSerialize(token))) + setData('flowCodeSeenData', true) + } + + function onexithardbreak() { + tag('
    ') + } + + function onenterhtmlflow() { + lineEndingIfNeeded() + onenterhtml() + } + + function onexithtml() { + setData('ignoreEncode') + } + + function onenterhtml() { + if (settings.allowDangerousHtml) { + setData('ignoreEncode', true) + } + } + + function onenteremphasis() { + tag('') + } + + function onenterstrong() { + tag('') + } + + function onentercodetext() { + setData('inCodeText', true) + tag('') + } + + function onexitcodetext() { + setData('inCodeText') + tag('') + } + + function onexitemphasis() { + tag('') + } + + function onexitstrong() { + tag('') + } + + function onexitthematicbreak() { + lineEndingIfNeeded() + tag('
    ') + } + + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type) + } + + function onexitcharacterreferencevalue(token) { + var value = this.sliceSerialize(token) + + value = getData('characterReferenceType') + ? safeFromInt( + value, + getData('characterReferenceType') === + types.characterReferenceMarkerNumeric + ? constants.numericBaseDecimal + : constants.numericBaseHexadecimal + ) + : decodeEntity(value) + + raw(encode(value)) + setData('characterReferenceType') + } + + function onexitautolinkprotocol(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } + + function onexitautolinkemail(token) { + var uri = this.sliceSerialize(token) + tag('') + raw(encode(uri)) + tag('') + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.js new file mode 100644 index 00000000000000..b6ae48a0903c93 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.js @@ -0,0 +1,5 @@ +'use strict' + +var assign = Object.assign + +module.exports = assign diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.mjs new file mode 100644 index 00000000000000..8cfbca32c571ef --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/assign.mjs @@ -0,0 +1 @@ +export default Object.assign diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.js new file mode 100644 index 00000000000000..cd75c0718a9783 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.js @@ -0,0 +1,45 @@ +'use strict' + +// This module is compiled away! +// +// Parsing markdown comes with a couple of constants, such as minimum or maximum +// sizes of certain sequences. +// Additionally, there are a couple symbols used inside micromark. +// These are all defined here, but compiled away by scripts. +var constants = { + attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a` + attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*` + atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t. + autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many. + autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many. + cdataOpeningString: 'CDATA[', // And preceded by `` + htmlComment: 2, // Symbol for `` + htmlInstruction: 3, // Symbol for `` + htmlDeclaration: 4, // Symbol for `` + htmlCdata: 5, // Symbol for `` + htmlBasic: 6, // Symbol for `` + htmlRawSizeMax: 8, // Length of `textarea`. + linkResourceDestinationBalanceMax: 3, // See: + linkReferenceSizeMax: 999, // See: + listItemValueSizeMax: 10, // See: + numericBaseDecimal: 10, + numericBaseHexadecimal: 0x10, + tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark. + thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed. + v8MaxSafeChunkSize: 10000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks. +} + +module.exports = constants diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.mjs new file mode 100644 index 00000000000000..65db9017671d09 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/constants.mjs @@ -0,0 +1,41 @@ +// This module is compiled away! +// +// Parsing markdown comes with a couple of constants, such as minimum or maximum +// sizes of certain sequences. +// Additionally, there are a couple symbols used inside micromark. +// These are all defined here, but compiled away by scripts. +export default { + attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a` + attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*` + atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t. + autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many. + autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many. + cdataOpeningString: 'CDATA[', // And preceded by `` + htmlComment: 2, // Symbol for `` + htmlInstruction: 3, // Symbol for `` + htmlDeclaration: 4, // Symbol for `` + htmlCdata: 5, // Symbol for `` + htmlBasic: 6, // Symbol for `` + htmlRawSizeMax: 8, // Length of `textarea`. + linkResourceDestinationBalanceMax: 3, // See: + linkReferenceSizeMax: 999, // See: + listItemValueSizeMax: 10, // See: + numericBaseDecimal: 10, + numericBaseHexadecimal: 0x10, + tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark. + thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed. + v8MaxSafeChunkSize: 10000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks. +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.js new file mode 100644 index 00000000000000..232eac74053d18 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.js @@ -0,0 +1,5 @@ +'use strict' + +var fromCharCode = String.fromCharCode + +module.exports = fromCharCode diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.mjs new file mode 100644 index 00000000000000..0476a76366caff --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/from-char-code.mjs @@ -0,0 +1 @@ +export default String.fromCharCode diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.js new file mode 100644 index 00000000000000..aa9197cd2593d1 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.js @@ -0,0 +1,5 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = own diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.mjs new file mode 100644 index 00000000000000..1da16d6dd42e4e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/has-own-property.mjs @@ -0,0 +1 @@ +export default {}.hasOwnProperty diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.js new file mode 100644 index 00000000000000..9b5ada73f0671a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.js @@ -0,0 +1,69 @@ +'use strict' + +// This module is copied from . +var basics = [ + 'address', + 'article', + 'aside', + 'base', + 'basefont', + 'blockquote', + 'body', + 'caption', + 'center', + 'col', + 'colgroup', + 'dd', + 'details', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hr', + 'html', + 'iframe', + 'legend', + 'li', + 'link', + 'main', + 'menu', + 'menuitem', + 'nav', + 'noframes', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'section', + 'source', + 'summary', + 'table', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'title', + 'tr', + 'track', + 'ul' +] + +module.exports = basics diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.mjs new file mode 100644 index 00000000000000..8d974d8f35cbd0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-block-names.mjs @@ -0,0 +1,65 @@ +// This module is copied from . +export default [ + 'address', + 'article', + 'aside', + 'base', + 'basefont', + 'blockquote', + 'body', + 'caption', + 'center', + 'col', + 'colgroup', + 'dd', + 'details', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hr', + 'html', + 'iframe', + 'legend', + 'li', + 'link', + 'main', + 'menu', + 'menuitem', + 'nav', + 'noframes', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'section', + 'source', + 'summary', + 'table', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'title', + 'tr', + 'track', + 'ul' +] diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.js new file mode 100644 index 00000000000000..c22a3954291f82 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.js @@ -0,0 +1,6 @@ +'use strict' + +// This module is copied from . +var raws = ['pre', 'script', 'style', 'textarea'] + +module.exports = raws diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.mjs new file mode 100644 index 00000000000000..2da5febe3f80fb --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/html-raw-names.mjs @@ -0,0 +1,2 @@ +// This module is copied from . +export default ['pre', 'script', 'style', 'textarea'] diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.js new file mode 100644 index 00000000000000..8917210ac71670 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.js @@ -0,0 +1,5 @@ +'use strict' + +var splice = [].splice + +module.exports = splice diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.mjs new file mode 100644 index 00000000000000..482404ddf7a96e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/splice.mjs @@ -0,0 +1 @@ +export default [].splice diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.js new file mode 100644 index 00000000000000..11d9e4ed1dda90 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.js @@ -0,0 +1,452 @@ +'use strict' + +// This module is compiled away! +// +// Here is the list of all types of tokens exposed by micromark, with a short +// explanation of what they include and where they are found. +// In picking names, generally, the rule is to be as explicit as possible +// instead of reusing names. +// For example, there is a `definitionDestination` and a `resourceDestination`, +// instead of one shared name. + +var types = { + // Generic type for data, such as in a title, a destination, etc. + data: 'data', + + // Generic type for syntactic whitespace (tabs, virtual spaces, spaces). + // Such as, between a fenced code fence and an info string. + whitespace: 'whitespace', + + // Generic type for line endings (line feed, carriage return, carriage return + + // line feed). + lineEnding: 'lineEnding', + + // A line ending, but ending a blank line. + lineEndingBlank: 'lineEndingBlank', + + // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a + // line. + linePrefix: 'linePrefix', + + // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a + // line. + lineSuffix: 'lineSuffix', + + // Whole ATX heading: + // + // ```markdown + // # + // ## Alpha + // ### Bravo ### + // ``` + // + // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`. + atxHeading: 'atxHeading', + + // Sequence of number signs in an ATX heading (`###`). + atxHeadingSequence: 'atxHeadingSequence', + + // Content in an ATX heading (`alpha`). + // Includes text. + atxHeadingText: 'atxHeadingText', + + // Whole autolink (`` or ``) + // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`. + autolink: 'autolink', + + // Email autolink w/o markers (`admin@example.com`) + autolinkEmail: 'autolinkEmail', + + // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`). + autolinkMarker: 'autolinkMarker', + + // Protocol autolink w/o markers (`https://example.com`) + autolinkProtocol: 'autolinkProtocol', + + // A whole character escape (`\-`). + // Includes `escapeMarker` and `characterEscapeValue`. + characterEscape: 'characterEscape', + + // The escaped character (`-`). + characterEscapeValue: 'characterEscapeValue', + + // A whole character reference (`&`, `≠`, or `𝌆`). + // Includes `characterReferenceMarker`, an optional + // `characterReferenceMarkerNumeric`, in which case an optional + // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`. + characterReference: 'characterReference', + + // The start or end marker (`&` or `;`). + characterReferenceMarker: 'characterReferenceMarker', + + // Mark reference as numeric (`#`). + characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric', + + // Mark reference as numeric (`x` or `X`). + characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal', + + // Value of character reference w/o markers (`amp`, `8800`, or `1D306`). + characterReferenceValue: 'characterReferenceValue', + + // Whole fenced code: + // + // ````markdown + // ```js + // alert(1) + // ``` + // ```` + codeFenced: 'codeFenced', + + // A fenced code fence, including whitespace, sequence, info, and meta + // (` ```js `). + codeFencedFence: 'codeFencedFence', + + // Sequence of grave accent or tilde characters (` ``` `) in a fence. + codeFencedFenceSequence: 'codeFencedFenceSequence', + + // Info word (`js`) in a fence. + // Includes string. + codeFencedFenceInfo: 'codeFencedFenceInfo', + + // Meta words (`highlight="1"`) in a fence. + // Includes string. + codeFencedFenceMeta: 'codeFencedFenceMeta', + + // A line of code. + codeFlowValue: 'codeFlowValue', + + // Whole indented code: + // + // ```markdown + // alert(1) + // ``` + // + // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`. + codeIndented: 'codeIndented', + + // A text code (``` `alpha` ```). + // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include + // `codeTextPadding`. + codeText: 'codeText', + + codeTextData: 'codeTextData', + + // A space or line ending right after or before a tick. + codeTextPadding: 'codeTextPadding', + + // A text code fence (` `` `). + codeTextSequence: 'codeTextSequence', + + // Whole content: + // + // ```markdown + // [a]: b + // c + // = + // d + // ``` + // + // Includes `paragraph` and `definition`. + content: 'content', + // Whole definition: + // + // ```markdown + // [micromark]: https://github.com/micromark/micromark + // ``` + // + // Includes `definitionLabel`, `definitionMarker`, `whitespace`, + // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`. + definition: 'definition', + + // Destination of a definition (`https://github.com/micromark/micromark` or + // ``). + // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`. + definitionDestination: 'definitionDestination', + + // Enclosed destination of a definition + // (``). + // Includes `definitionDestinationLiteralMarker` and optionally + // `definitionDestinationString`. + definitionDestinationLiteral: 'definitionDestinationLiteral', + + // Markers of an enclosed definition destination (`<` or `>`). + definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker', + + // Unenclosed destination of a definition + // (`https://github.com/micromark/micromark`). + // Includes `definitionDestinationString`. + definitionDestinationRaw: 'definitionDestinationRaw', + + // Text in an destination (`https://github.com/micromark/micromark`). + // Includes string. + definitionDestinationString: 'definitionDestinationString', + + // Label of a definition (`[micromark]`). + // Includes `definitionLabelMarker` and `definitionLabelString`. + definitionLabel: 'definitionLabel', + + // Markers of a definition label (`[` or `]`). + definitionLabelMarker: 'definitionLabelMarker', + + // Value of a definition label (`micromark`). + // Includes string. + definitionLabelString: 'definitionLabelString', + + // Marker between a label and a destination (`:`). + definitionMarker: 'definitionMarker', + + // Title of a definition (`"x"`, `'y'`, or `(z)`). + // Includes `definitionTitleMarker` and optionally `definitionTitleString`. + definitionTitle: 'definitionTitle', + + // Marker around a title of a definition (`"`, `'`, `(`, or `)`). + definitionTitleMarker: 'definitionTitleMarker', + + // Data without markers in a title (`z`). + // Includes string. + definitionTitleString: 'definitionTitleString', + + // Emphasis (`*alpha*`). + // Includes `emphasisSequence` and `emphasisText`. + emphasis: 'emphasis', + + // Sequence of emphasis markers (`*` or `_`). + emphasisSequence: 'emphasisSequence', + + // Emphasis text (`alpha`). + // Includes text. + emphasisText: 'emphasisText', + + // The character escape marker (`\`). + escapeMarker: 'escapeMarker', + + // A hard break created with a backslash (`\\n`). + // Includes `escapeMarker` (does not include the line ending) + hardBreakEscape: 'hardBreakEscape', + + // A hard break created with trailing spaces (` \n`). + // Does not include the line ending. + hardBreakTrailing: 'hardBreakTrailing', + + // Flow HTML: + // + // ```markdown + //
    b`). + // Includes `lineEnding`, `htmlTextData`. + htmlText: 'htmlText', + + htmlTextData: 'htmlTextData', + + // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or + // `![alpha]`). + // Includes `label` and an optional `resource` or `reference`. + image: 'image', + + // Whole link label (`[*alpha*]`). + // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`. + label: 'label', + + // Text in an label (`*alpha*`). + // Includes text. + labelText: 'labelText', + + // Start a link label (`[`). + // Includes a `labelMarker`. + labelLink: 'labelLink', + + // Start an image label (`![`). + // Includes `labelImageMarker` and `labelMarker`. + labelImage: 'labelImage', + + // Marker of a label (`[` or `]`). + labelMarker: 'labelMarker', + + // Marker to start an image (`!`). + labelImageMarker: 'labelImageMarker', + + // End a label (`]`). + // Includes `labelMarker`. + labelEnd: 'labelEnd', + + // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`). + // Includes `label` and an optional `resource` or `reference`. + link: 'link', + + // Whole paragraph: + // + // ```markdown + // alpha + // bravo. + // ``` + // + // Includes text. + paragraph: 'paragraph', + + // A reference (`[alpha]` or `[]`). + // Includes `referenceMarker` and an optional `referenceString`. + reference: 'reference', + + // A reference marker (`[` or `]`). + referenceMarker: 'referenceMarker', + + // Reference text (`alpha`). + // Includes string. + referenceString: 'referenceString', + + // A resource (`(https://example.com "alpha")`). + // Includes `resourceMarker`, an optional `resourceDestination` with an optional + // `whitespace` and `resourceTitle`. + resource: 'resource', + + // A resource destination (`https://example.com`). + // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`. + resourceDestination: 'resourceDestination', + + // A literal resource destination (``). + // Includes `resourceDestinationLiteralMarker` and optionally + // `resourceDestinationString`. + resourceDestinationLiteral: 'resourceDestinationLiteral', + + // A resource destination marker (`<` or `>`). + resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker', + + // A raw resource destination (`https://example.com`). + // Includes `resourceDestinationString`. + resourceDestinationRaw: 'resourceDestinationRaw', + + // Resource destination text (`https://example.com`). + // Includes string. + resourceDestinationString: 'resourceDestinationString', + + // A resource marker (`(` or `)`). + resourceMarker: 'resourceMarker', + + // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`). + // Includes `resourceTitleMarker` and optionally `resourceTitleString`. + resourceTitle: 'resourceTitle', + + // A resource title marker (`"`, `'`, `(`, or `)`). + resourceTitleMarker: 'resourceTitleMarker', + + // Resource destination title (`alpha`). + // Includes string. + resourceTitleString: 'resourceTitleString', + + // Whole setext heading: + // + // ```markdown + // alpha + // bravo + // ===== + // ``` + // + // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and + // `setextHeadingLine`. + setextHeading: 'setextHeading', + + // Content in a setext heading (`alpha\nbravo`). + // Includes text. + setextHeadingText: 'setextHeadingText', + + // Underline in a setext heading, including whitespace suffix (`==`). + // Includes `setextHeadingLineSequence`. + setextHeadingLine: 'setextHeadingLine', + + // Sequence of equals or dash characters in underline in a setext heading (`-`). + setextHeadingLineSequence: 'setextHeadingLineSequence', + + // Strong (`**alpha**`). + // Includes `strongSequence` and `strongText`. + strong: 'strong', + + // Sequence of strong markers (`**` or `__`). + strongSequence: 'strongSequence', + + // Strong text (`alpha`). + // Includes text. + strongText: 'strongText', + + // Whole thematic break: + // + // ```markdown + // * * * + // ``` + // + // Includes `thematicBreakSequence` and `whitespace`. + thematicBreak: 'thematicBreak', + + // A sequence of one or more thematic break markers (`***`). + thematicBreakSequence: 'thematicBreakSequence', + + // Whole block quote: + // + // ```markdown + // > a + // > + // > b + // ``` + // + // Includes `blockQuotePrefix` and flow. + blockQuote: 'blockQuote', + // The `>` or `> ` of a block quote. + blockQuotePrefix: 'blockQuotePrefix', + // The `>` of a block quote prefix. + blockQuoteMarker: 'blockQuoteMarker', + // The optional ` ` of a block quote prefix. + blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace', + + // Whole unordered list: + // + // ```markdown + // - a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listOrdered: 'listOrdered', + + // Whole ordered list: + // + // ```markdown + // 1. a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listUnordered: 'listUnordered', + + // The indent of further list item lines. + listItemIndent: 'listItemIndent', + + // A marker, as in, `*`, `+`, `-`, `.`, or `)`. + listItemMarker: 'listItemMarker', + + // The thing that starts a list item, such as `1. `. + // Includes `listItemValue` if ordered, `listItemMarker`, and + // `listItemPrefixWhitespace` (unless followed by a line ending). + listItemPrefix: 'listItemPrefix', + + // The whitespace after a marker. + listItemPrefixWhitespace: 'listItemPrefixWhitespace', + + // The numerical value of an ordered item. + listItemValue: 'listItemValue', + + // Internal types used for subtokenizers, compiled away + chunkContent: 'chunkContent', + chunkFlow: 'chunkFlow', + chunkText: 'chunkText', + chunkString: 'chunkString' +} + +module.exports = types diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.mjs new file mode 100644 index 00000000000000..d39d97900104af --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/types.mjs @@ -0,0 +1,448 @@ +// This module is compiled away! +// +// Here is the list of all types of tokens exposed by micromark, with a short +// explanation of what they include and where they are found. +// In picking names, generally, the rule is to be as explicit as possible +// instead of reusing names. +// For example, there is a `definitionDestination` and a `resourceDestination`, +// instead of one shared name. + +export default { + // Generic type for data, such as in a title, a destination, etc. + data: 'data', + + // Generic type for syntactic whitespace (tabs, virtual spaces, spaces). + // Such as, between a fenced code fence and an info string. + whitespace: 'whitespace', + + // Generic type for line endings (line feed, carriage return, carriage return + + // line feed). + lineEnding: 'lineEnding', + + // A line ending, but ending a blank line. + lineEndingBlank: 'lineEndingBlank', + + // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a + // line. + linePrefix: 'linePrefix', + + // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a + // line. + lineSuffix: 'lineSuffix', + + // Whole ATX heading: + // + // ```markdown + // # + // ## Alpha + // ### Bravo ### + // ``` + // + // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`. + atxHeading: 'atxHeading', + + // Sequence of number signs in an ATX heading (`###`). + atxHeadingSequence: 'atxHeadingSequence', + + // Content in an ATX heading (`alpha`). + // Includes text. + atxHeadingText: 'atxHeadingText', + + // Whole autolink (`` or ``) + // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`. + autolink: 'autolink', + + // Email autolink w/o markers (`admin@example.com`) + autolinkEmail: 'autolinkEmail', + + // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`). + autolinkMarker: 'autolinkMarker', + + // Protocol autolink w/o markers (`https://example.com`) + autolinkProtocol: 'autolinkProtocol', + + // A whole character escape (`\-`). + // Includes `escapeMarker` and `characterEscapeValue`. + characterEscape: 'characterEscape', + + // The escaped character (`-`). + characterEscapeValue: 'characterEscapeValue', + + // A whole character reference (`&`, `≠`, or `𝌆`). + // Includes `characterReferenceMarker`, an optional + // `characterReferenceMarkerNumeric`, in which case an optional + // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`. + characterReference: 'characterReference', + + // The start or end marker (`&` or `;`). + characterReferenceMarker: 'characterReferenceMarker', + + // Mark reference as numeric (`#`). + characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric', + + // Mark reference as numeric (`x` or `X`). + characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal', + + // Value of character reference w/o markers (`amp`, `8800`, or `1D306`). + characterReferenceValue: 'characterReferenceValue', + + // Whole fenced code: + // + // ````markdown + // ```js + // alert(1) + // ``` + // ```` + codeFenced: 'codeFenced', + + // A fenced code fence, including whitespace, sequence, info, and meta + // (` ```js `). + codeFencedFence: 'codeFencedFence', + + // Sequence of grave accent or tilde characters (` ``` `) in a fence. + codeFencedFenceSequence: 'codeFencedFenceSequence', + + // Info word (`js`) in a fence. + // Includes string. + codeFencedFenceInfo: 'codeFencedFenceInfo', + + // Meta words (`highlight="1"`) in a fence. + // Includes string. + codeFencedFenceMeta: 'codeFencedFenceMeta', + + // A line of code. + codeFlowValue: 'codeFlowValue', + + // Whole indented code: + // + // ```markdown + // alert(1) + // ``` + // + // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`. + codeIndented: 'codeIndented', + + // A text code (``` `alpha` ```). + // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include + // `codeTextPadding`. + codeText: 'codeText', + + codeTextData: 'codeTextData', + + // A space or line ending right after or before a tick. + codeTextPadding: 'codeTextPadding', + + // A text code fence (` `` `). + codeTextSequence: 'codeTextSequence', + + // Whole content: + // + // ```markdown + // [a]: b + // c + // = + // d + // ``` + // + // Includes `paragraph` and `definition`. + content: 'content', + // Whole definition: + // + // ```markdown + // [micromark]: https://github.com/micromark/micromark + // ``` + // + // Includes `definitionLabel`, `definitionMarker`, `whitespace`, + // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`. + definition: 'definition', + + // Destination of a definition (`https://github.com/micromark/micromark` or + // ``). + // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`. + definitionDestination: 'definitionDestination', + + // Enclosed destination of a definition + // (``). + // Includes `definitionDestinationLiteralMarker` and optionally + // `definitionDestinationString`. + definitionDestinationLiteral: 'definitionDestinationLiteral', + + // Markers of an enclosed definition destination (`<` or `>`). + definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker', + + // Unenclosed destination of a definition + // (`https://github.com/micromark/micromark`). + // Includes `definitionDestinationString`. + definitionDestinationRaw: 'definitionDestinationRaw', + + // Text in an destination (`https://github.com/micromark/micromark`). + // Includes string. + definitionDestinationString: 'definitionDestinationString', + + // Label of a definition (`[micromark]`). + // Includes `definitionLabelMarker` and `definitionLabelString`. + definitionLabel: 'definitionLabel', + + // Markers of a definition label (`[` or `]`). + definitionLabelMarker: 'definitionLabelMarker', + + // Value of a definition label (`micromark`). + // Includes string. + definitionLabelString: 'definitionLabelString', + + // Marker between a label and a destination (`:`). + definitionMarker: 'definitionMarker', + + // Title of a definition (`"x"`, `'y'`, or `(z)`). + // Includes `definitionTitleMarker` and optionally `definitionTitleString`. + definitionTitle: 'definitionTitle', + + // Marker around a title of a definition (`"`, `'`, `(`, or `)`). + definitionTitleMarker: 'definitionTitleMarker', + + // Data without markers in a title (`z`). + // Includes string. + definitionTitleString: 'definitionTitleString', + + // Emphasis (`*alpha*`). + // Includes `emphasisSequence` and `emphasisText`. + emphasis: 'emphasis', + + // Sequence of emphasis markers (`*` or `_`). + emphasisSequence: 'emphasisSequence', + + // Emphasis text (`alpha`). + // Includes text. + emphasisText: 'emphasisText', + + // The character escape marker (`\`). + escapeMarker: 'escapeMarker', + + // A hard break created with a backslash (`\\n`). + // Includes `escapeMarker` (does not include the line ending) + hardBreakEscape: 'hardBreakEscape', + + // A hard break created with trailing spaces (` \n`). + // Does not include the line ending. + hardBreakTrailing: 'hardBreakTrailing', + + // Flow HTML: + // + // ```markdown + //
    b`). + // Includes `lineEnding`, `htmlTextData`. + htmlText: 'htmlText', + + htmlTextData: 'htmlTextData', + + // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or + // `![alpha]`). + // Includes `label` and an optional `resource` or `reference`. + image: 'image', + + // Whole link label (`[*alpha*]`). + // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`. + label: 'label', + + // Text in an label (`*alpha*`). + // Includes text. + labelText: 'labelText', + + // Start a link label (`[`). + // Includes a `labelMarker`. + labelLink: 'labelLink', + + // Start an image label (`![`). + // Includes `labelImageMarker` and `labelMarker`. + labelImage: 'labelImage', + + // Marker of a label (`[` or `]`). + labelMarker: 'labelMarker', + + // Marker to start an image (`!`). + labelImageMarker: 'labelImageMarker', + + // End a label (`]`). + // Includes `labelMarker`. + labelEnd: 'labelEnd', + + // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`). + // Includes `label` and an optional `resource` or `reference`. + link: 'link', + + // Whole paragraph: + // + // ```markdown + // alpha + // bravo. + // ``` + // + // Includes text. + paragraph: 'paragraph', + + // A reference (`[alpha]` or `[]`). + // Includes `referenceMarker` and an optional `referenceString`. + reference: 'reference', + + // A reference marker (`[` or `]`). + referenceMarker: 'referenceMarker', + + // Reference text (`alpha`). + // Includes string. + referenceString: 'referenceString', + + // A resource (`(https://example.com "alpha")`). + // Includes `resourceMarker`, an optional `resourceDestination` with an optional + // `whitespace` and `resourceTitle`. + resource: 'resource', + + // A resource destination (`https://example.com`). + // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`. + resourceDestination: 'resourceDestination', + + // A literal resource destination (``). + // Includes `resourceDestinationLiteralMarker` and optionally + // `resourceDestinationString`. + resourceDestinationLiteral: 'resourceDestinationLiteral', + + // A resource destination marker (`<` or `>`). + resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker', + + // A raw resource destination (`https://example.com`). + // Includes `resourceDestinationString`. + resourceDestinationRaw: 'resourceDestinationRaw', + + // Resource destination text (`https://example.com`). + // Includes string. + resourceDestinationString: 'resourceDestinationString', + + // A resource marker (`(` or `)`). + resourceMarker: 'resourceMarker', + + // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`). + // Includes `resourceTitleMarker` and optionally `resourceTitleString`. + resourceTitle: 'resourceTitle', + + // A resource title marker (`"`, `'`, `(`, or `)`). + resourceTitleMarker: 'resourceTitleMarker', + + // Resource destination title (`alpha`). + // Includes string. + resourceTitleString: 'resourceTitleString', + + // Whole setext heading: + // + // ```markdown + // alpha + // bravo + // ===== + // ``` + // + // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and + // `setextHeadingLine`. + setextHeading: 'setextHeading', + + // Content in a setext heading (`alpha\nbravo`). + // Includes text. + setextHeadingText: 'setextHeadingText', + + // Underline in a setext heading, including whitespace suffix (`==`). + // Includes `setextHeadingLineSequence`. + setextHeadingLine: 'setextHeadingLine', + + // Sequence of equals or dash characters in underline in a setext heading (`-`). + setextHeadingLineSequence: 'setextHeadingLineSequence', + + // Strong (`**alpha**`). + // Includes `strongSequence` and `strongText`. + strong: 'strong', + + // Sequence of strong markers (`**` or `__`). + strongSequence: 'strongSequence', + + // Strong text (`alpha`). + // Includes text. + strongText: 'strongText', + + // Whole thematic break: + // + // ```markdown + // * * * + // ``` + // + // Includes `thematicBreakSequence` and `whitespace`. + thematicBreak: 'thematicBreak', + + // A sequence of one or more thematic break markers (`***`). + thematicBreakSequence: 'thematicBreakSequence', + + // Whole block quote: + // + // ```markdown + // > a + // > + // > b + // ``` + // + // Includes `blockQuotePrefix` and flow. + blockQuote: 'blockQuote', + // The `>` or `> ` of a block quote. + blockQuotePrefix: 'blockQuotePrefix', + // The `>` of a block quote prefix. + blockQuoteMarker: 'blockQuoteMarker', + // The optional ` ` of a block quote prefix. + blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace', + + // Whole unordered list: + // + // ```markdown + // - a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listOrdered: 'listOrdered', + + // Whole ordered list: + // + // ```markdown + // 1. a + // b + // ``` + // + // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further + // lines. + listUnordered: 'listUnordered', + + // The indent of further list item lines. + listItemIndent: 'listItemIndent', + + // A marker, as in, `*`, `+`, `-`, `.`, or `)`. + listItemMarker: 'listItemMarker', + + // The thing that starts a list item, such as `1. `. + // Includes `listItemValue` if ordered, `listItemMarker`, and + // `listItemPrefixWhitespace` (unless followed by a line ending). + listItemPrefix: 'listItemPrefix', + + // The whitespace after a marker. + listItemPrefixWhitespace: 'listItemPrefixWhitespace', + + // The numerical value of an ordered item. + listItemValue: 'listItemValue', + + // Internal types used for subtokenizers, compiled away + chunkContent: 'chunkContent', + chunkFlow: 'chunkFlow', + chunkText: 'chunkText', + chunkString: 'chunkString' +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.js new file mode 100644 index 00000000000000..6d25ee4bae5ef2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.js @@ -0,0 +1,11 @@ +'use strict' + +// This module is generated by `script/`. +// +// CommonMark handles attention (emphasis, strong) markers based on what comes +// before or after them. +// One such difference is if those characters are Unicode punctuation. +// This script is generated from the Unicode data. +var unicodePunctuation = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/ + +module.exports = unicodePunctuation diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.mjs new file mode 100644 index 00000000000000..3b6ac3f16c20ad --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constant/unicode-punctuation-regex.mjs @@ -0,0 +1,7 @@ +// This module is generated by `script/`. +// +// CommonMark handles attention (emphasis, strong) markers based on what comes +// before or after them. +// One such difference is if those characters are Unicode punctuation. +// This script is generated from the Unicode data. +export default /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/ diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.js new file mode 100644 index 00000000000000..d9e5ae1b529247 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.js @@ -0,0 +1,98 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var text$1 = require('./initialize/text.js') +var attention = require('./tokenize/attention.js') +var autolink = require('./tokenize/autolink.js') +var blockQuote = require('./tokenize/block-quote.js') +var characterEscape = require('./tokenize/character-escape.js') +var characterReference = require('./tokenize/character-reference.js') +var codeFenced = require('./tokenize/code-fenced.js') +var codeIndented = require('./tokenize/code-indented.js') +var codeText = require('./tokenize/code-text.js') +var definition = require('./tokenize/definition.js') +var hardBreakEscape = require('./tokenize/hard-break-escape.js') +var headingAtx = require('./tokenize/heading-atx.js') +var htmlFlow = require('./tokenize/html-flow.js') +var htmlText = require('./tokenize/html-text.js') +var labelEnd = require('./tokenize/label-end.js') +var labelStartImage = require('./tokenize/label-start-image.js') +var labelStartLink = require('./tokenize/label-start-link.js') +var lineEnding = require('./tokenize/line-ending.js') +var list = require('./tokenize/list.js') +var setextUnderline = require('./tokenize/setext-underline.js') +var thematicBreak = require('./tokenize/thematic-break.js') + +var document = { + 42: list, // Asterisk + 43: list, // Plus sign + 45: list, // Dash + 48: list, // 0 + 49: list, // 1 + 50: list, // 2 + 51: list, // 3 + 52: list, // 4 + 53: list, // 5 + 54: list, // 6 + 55: list, // 7 + 56: list, // 8 + 57: list, // 9 + 62: blockQuote // Greater than +} + +var contentInitial = { + 91: definition // Left square bracket +} + +var flowInitial = { + '-2': codeIndented, // Horizontal tab + '-1': codeIndented, // Virtual space + 32: codeIndented // Space +} + +var flow = { + 35: headingAtx, // Number sign + 42: thematicBreak, // Asterisk + 45: [setextUnderline, thematicBreak], // Dash + 60: htmlFlow, // Less than + 61: setextUnderline, // Equals to + 95: thematicBreak, // Underscore + 96: codeFenced, // Grave accent + 126: codeFenced // Tilde +} + +var string = { + 38: characterReference, // Ampersand + 92: characterEscape // Backslash +} + +var text = { + '-5': lineEnding, // Carriage return + '-4': lineEnding, // Line feed + '-3': lineEnding, // Carriage return + line feed + 33: labelStartImage, // Exclamation mark + 38: characterReference, // Ampersand + 42: attention, // Asterisk + 60: [autolink, htmlText], // Less than + 91: labelStartLink, // Left square bracket + 92: [hardBreakEscape, characterEscape], // Backslash + 93: labelEnd, // Right square bracket + 95: attention, // Underscore + 96: codeText // Grave accent +} + +var insideSpan = { + null: [attention, text$1.resolver] +} + +var disable = {null: []} + +exports.contentInitial = contentInitial +exports.disable = disable +exports.document = document +exports.flow = flow +exports.flowInitial = flowInitial +exports.insideSpan = insideSpan +exports.string = string +exports.text = text diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.mjs new file mode 100644 index 00000000000000..e52c3df34974f6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/constructs.mjs @@ -0,0 +1,85 @@ +import {resolver as resolveText} from './initialize/text.mjs' +import attention from './tokenize/attention.mjs' +import autolink from './tokenize/autolink.mjs' +import blockQuote from './tokenize/block-quote.mjs' +import characterEscape from './tokenize/character-escape.mjs' +import characterReference from './tokenize/character-reference.mjs' +import codeFenced from './tokenize/code-fenced.mjs' +import codeIndented from './tokenize/code-indented.mjs' +import codeText from './tokenize/code-text.mjs' +import definition from './tokenize/definition.mjs' +import hardBreakEscape from './tokenize/hard-break-escape.mjs' +import headingAtx from './tokenize/heading-atx.mjs' +import htmlFlow from './tokenize/html-flow.mjs' +import htmlText from './tokenize/html-text.mjs' +import labelEnd from './tokenize/label-end.mjs' +import labelImage from './tokenize/label-start-image.mjs' +import labelLink from './tokenize/label-start-link.mjs' +import lineEnding from './tokenize/line-ending.mjs' +import list from './tokenize/list.mjs' +import setextUnderline from './tokenize/setext-underline.mjs' +import thematicBreak from './tokenize/thematic-break.mjs' + +export var document = { + 42: list, // Asterisk + 43: list, // Plus sign + 45: list, // Dash + 48: list, // 0 + 49: list, // 1 + 50: list, // 2 + 51: list, // 3 + 52: list, // 4 + 53: list, // 5 + 54: list, // 6 + 55: list, // 7 + 56: list, // 8 + 57: list, // 9 + 62: blockQuote // Greater than +} + +export var contentInitial = { + 91: definition // Left square bracket +} + +export var flowInitial = { + '-2': codeIndented, // Horizontal tab + '-1': codeIndented, // Virtual space + 32: codeIndented // Space +} + +export var flow = { + 35: headingAtx, // Number sign + 42: thematicBreak, // Asterisk + 45: [setextUnderline, thematicBreak], // Dash + 60: htmlFlow, // Less than + 61: setextUnderline, // Equals to + 95: thematicBreak, // Underscore + 96: codeFenced, // Grave accent + 126: codeFenced // Tilde +} + +export var string = { + 38: characterReference, // Ampersand + 92: characterEscape // Backslash +} + +export var text = { + '-5': lineEnding, // Carriage return + '-4': lineEnding, // Line feed + '-3': lineEnding, // Carriage return + line feed + 33: labelImage, // Exclamation mark + 38: characterReference, // Ampersand + 42: attention, // Asterisk + 60: [autolink, htmlText], // Less than + 91: labelLink, // Left square bracket + 92: [hardBreakEscape, characterEscape], // Backslash + 93: labelEnd, // Right square bracket + 95: attention, // Underscore + 96: codeText // Grave accent +} + +export var insideSpan = { + null: [attention, resolveText] +} + +export var disable = {null: []} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.js new file mode 100644 index 00000000000000..8b289a298f114b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.js @@ -0,0 +1,21 @@ +'use strict' + +var html = require('./compile/html.js') +var parse = require('./parse.js') +var postprocess = require('./postprocess.js') +var preprocess = require('./preprocess.js') + +function buffer(value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding + encoding = undefined + } + + return html(options)( + postprocess( + parse(options).document().write(preprocess()(value, encoding, true)) + ) + ) +} + +module.exports = buffer diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.mjs new file mode 100644 index 00000000000000..2f8db57c394435 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/index.mjs @@ -0,0 +1,19 @@ +export default buffer + +import compiler from './compile/html.mjs' +import parser from './parse.mjs' +import postprocess from './postprocess.mjs' +import preprocessor from './preprocess.mjs' + +function buffer(value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding + encoding = undefined + } + + return compiler(options)( + postprocess( + parser(options).document().write(preprocessor()(value, encoding, true)) + ) + ) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.js new file mode 100644 index 00000000000000..75922234a36bf2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.js @@ -0,0 +1,91 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('../tokenize/factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var tokenize = initializeContent + +function initializeContent(effects) { + var contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ) + var previous + + return contentStart + + function afterContentStartConstruct(code) { + assert__default['default']( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace(effects, contentStart, types.linePrefix) + } + + function paragraphInitial(code) { + assert__default['default']( + code !== codes.eof && !markdownLineEnding(code), + 'expected anything other than a line ending or EOF' + ) + effects.enter(types.paragraph) + return lineStart(code) + } + + function lineStart(code) { + var token = effects.enter(types.chunkText, { + contentType: constants.contentTypeText, + previous: previous + }) + + if (previous) { + previous.next = token + } + + previous = token + + return data(code) + } + + function data(code) { + if (code === codes.eof) { + effects.exit(types.chunkText) + effects.exit(types.paragraph) + effects.consume(code) + return + } + + if (markdownLineEnding(code)) { + effects.consume(code) + effects.exit(types.chunkText) + return lineStart + } + + // Data. + effects.consume(code) + return data + } +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.mjs new file mode 100644 index 00000000000000..73a9c41311a261 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/content.mjs @@ -0,0 +1,79 @@ +export var tokenize = initializeContent + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from '../tokenize/factory-space.mjs' + +function initializeContent(effects) { + var contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ) + var previous + + return contentStart + + function afterContentStartConstruct(code) { + assert( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory(effects, contentStart, types.linePrefix) + } + + function paragraphInitial(code) { + assert( + code !== codes.eof && !markdownLineEnding(code), + 'expected anything other than a line ending or EOF' + ) + effects.enter(types.paragraph) + return lineStart(code) + } + + function lineStart(code) { + var token = effects.enter(types.chunkText, { + contentType: constants.contentTypeText, + previous: previous + }) + + if (previous) { + previous.next = token + } + + previous = token + + return data(code) + } + + function data(code) { + if (code === codes.eof) { + effects.exit(types.chunkText) + effects.exit(types.paragraph) + effects.consume(code) + return + } + + if (markdownLineEnding(code)) { + effects.consume(code) + effects.exit(types.chunkText) + return lineStart + } + + // Data. + effects.consume(code) + return data + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.js new file mode 100644 index 00000000000000..fae240f744bf70 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.js @@ -0,0 +1,245 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('../tokenize/factory-space.js') +var partialBlankLine = require('../tokenize/partial-blank-line.js') + +var tokenize = initializeDocument + +var containerConstruct = {tokenize: tokenizeContainer} +var lazyFlowConstruct = {tokenize: tokenizeLazyFlow} + +function initializeDocument(effects) { + var self = this + var stack = [] + var continued = 0 + var inspectConstruct = {tokenize: tokenizeInspect, partial: true} + var inspectResult + var childFlow + var childToken + + return start + + function start(code) { + if (continued < stack.length) { + self.containerState = stack[continued][1] + return effects.attempt( + stack[continued][0].continuation, + documentContinue, + documentContinued + )(code) + } + + return documentContinued(code) + } + + function documentContinue(code) { + continued++ + return start(code) + } + + function documentContinued(code) { + // If we’re in a concrete construct (such as when expecting another line of + // HTML, or we resulted in lazy content), we can immediately start flow. + if (inspectResult && inspectResult.flowContinue) { + return flowStart(code) + } + + self.interrupt = + childFlow && + childFlow.currentConstruct && + childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code) + } + + function containerContinue(code) { + stack.push([self.currentConstruct, self.containerState]) + self.containerState = undefined + return documentContinued(code) + } + + function flowStart(code) { + if (code === codes.eof) { + exitContainers(0, true) + effects.consume(code) + return + } + + childFlow = childFlow || self.parser.flow(self.now()) + + effects.enter(types.chunkFlow, { + contentType: constants.contentTypeFlow, + previous: childToken, + _tokenizer: childFlow + }) + + return flowContinue(code) + } + + function flowContinue(code) { + if (code === codes.eof) { + continueFlow(effects.exit(types.chunkFlow)) + return flowStart(code) + } + + if (markdownLineEnding(code)) { + effects.consume(code) + continueFlow(effects.exit(types.chunkFlow)) + return effects.check(inspectConstruct, documentAfterPeek) + } + + effects.consume(code) + return flowContinue + } + + function documentAfterPeek(code) { + exitContainers( + inspectResult.continued, + inspectResult && inspectResult.flowEnd + ) + continued = 0 + return start(code) + } + + function continueFlow(token) { + if (childToken) childToken.next = token + childToken = token + childFlow.lazy = inspectResult && inspectResult.lazy + childFlow.defineSkip(token.start) + childFlow.write(self.sliceStream(token)) + } + + function exitContainers(size, end) { + var index = stack.length + + // Close the flow. + if (childFlow && end) { + childFlow.write([codes.eof]) + childToken = childFlow = undefined + } + + // Exit open containers. + while (index-- > size) { + self.containerState = stack[index][1] + stack[index][0].exit.call(self, effects) + } + + stack.length = size + } + + function tokenizeInspect(effects, ok) { + var subcontinued = 0 + + inspectResult = {} + + return inspectStart + + function inspectStart(code) { + if (subcontinued < stack.length) { + self.containerState = stack[subcontinued][1] + return effects.attempt( + stack[subcontinued][0].continuation, + inspectContinue, + inspectLess + )(code) + } + + // If we’re continued but in a concrete flow, we can’t have more + // containers. + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + inspectResult.flowContinue = true + return inspectDone(code) + } + + self.interrupt = + childFlow.currentConstruct && childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, + inspectDone + )(code) + } + + function inspectContinue(code) { + subcontinued++ + return self.containerState._closeFlow + ? inspectFlowEnd(code) + : inspectStart(code) + } + + function inspectLess(code) { + if (childFlow.currentConstruct && childFlow.currentConstruct.lazy) { + // Maybe another container? + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, + // Maybe flow, or a blank line? + effects.attempt( + lazyFlowConstruct, + inspectFlowEnd, + effects.check(partialBlankLine, inspectFlowEnd, inspectLazy) + ) + )(code) + } + + // Otherwise we’re interrupting. + return inspectFlowEnd(code) + } + + function inspectLazy(code) { + // Act as if all containers are continued. + subcontinued = stack.length + inspectResult.lazy = true + inspectResult.flowContinue = true + return inspectDone(code) + } + + // We’re done with flow if we have more containers, or an interruption. + function inspectFlowEnd(code) { + inspectResult.flowEnd = true + return inspectDone(code) + } + + function inspectDone(code) { + inspectResult.continued = subcontinued + self.interrupt = self.containerState = undefined + return ok(code) + } + } +} + +function tokenizeContainer(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} + +function tokenizeLazyFlow(effects, ok, nok) { + return factorySpace( + effects, + effects.lazy(this.parser.constructs.flow, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.mjs new file mode 100644 index 00000000000000..9b084f3cd571fd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/document.mjs @@ -0,0 +1,239 @@ +export var tokenize = initializeDocument + +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from '../tokenize/factory-space.mjs' +import blank from '../tokenize/partial-blank-line.mjs' + +var containerConstruct = {tokenize: tokenizeContainer} +var lazyFlowConstruct = {tokenize: tokenizeLazyFlow} + +function initializeDocument(effects) { + var self = this + var stack = [] + var continued = 0 + var inspectConstruct = {tokenize: tokenizeInspect, partial: true} + var inspectResult + var childFlow + var childToken + + return start + + function start(code) { + if (continued < stack.length) { + self.containerState = stack[continued][1] + return effects.attempt( + stack[continued][0].continuation, + documentContinue, + documentContinued + )(code) + } + + return documentContinued(code) + } + + function documentContinue(code) { + continued++ + return start(code) + } + + function documentContinued(code) { + // If we’re in a concrete construct (such as when expecting another line of + // HTML, or we resulted in lazy content), we can immediately start flow. + if (inspectResult && inspectResult.flowContinue) { + return flowStart(code) + } + + self.interrupt = + childFlow && + childFlow.currentConstruct && + childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code) + } + + function containerContinue(code) { + stack.push([self.currentConstruct, self.containerState]) + self.containerState = undefined + return documentContinued(code) + } + + function flowStart(code) { + if (code === codes.eof) { + exitContainers(0, true) + effects.consume(code) + return + } + + childFlow = childFlow || self.parser.flow(self.now()) + + effects.enter(types.chunkFlow, { + contentType: constants.contentTypeFlow, + previous: childToken, + _tokenizer: childFlow + }) + + return flowContinue(code) + } + + function flowContinue(code) { + if (code === codes.eof) { + continueFlow(effects.exit(types.chunkFlow)) + return flowStart(code) + } + + if (markdownLineEnding(code)) { + effects.consume(code) + continueFlow(effects.exit(types.chunkFlow)) + return effects.check(inspectConstruct, documentAfterPeek) + } + + effects.consume(code) + return flowContinue + } + + function documentAfterPeek(code) { + exitContainers( + inspectResult.continued, + inspectResult && inspectResult.flowEnd + ) + continued = 0 + return start(code) + } + + function continueFlow(token) { + if (childToken) childToken.next = token + childToken = token + childFlow.lazy = inspectResult && inspectResult.lazy + childFlow.defineSkip(token.start) + childFlow.write(self.sliceStream(token)) + } + + function exitContainers(size, end) { + var index = stack.length + + // Close the flow. + if (childFlow && end) { + childFlow.write([codes.eof]) + childToken = childFlow = undefined + } + + // Exit open containers. + while (index-- > size) { + self.containerState = stack[index][1] + stack[index][0].exit.call(self, effects) + } + + stack.length = size + } + + function tokenizeInspect(effects, ok) { + var subcontinued = 0 + + inspectResult = {} + + return inspectStart + + function inspectStart(code) { + if (subcontinued < stack.length) { + self.containerState = stack[subcontinued][1] + return effects.attempt( + stack[subcontinued][0].continuation, + inspectContinue, + inspectLess + )(code) + } + + // If we’re continued but in a concrete flow, we can’t have more + // containers. + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + inspectResult.flowContinue = true + return inspectDone(code) + } + + self.interrupt = + childFlow.currentConstruct && childFlow.currentConstruct.interruptible + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, + inspectDone + )(code) + } + + function inspectContinue(code) { + subcontinued++ + return self.containerState._closeFlow + ? inspectFlowEnd(code) + : inspectStart(code) + } + + function inspectLess(code) { + if (childFlow.currentConstruct && childFlow.currentConstruct.lazy) { + // Maybe another container? + self.containerState = {} + return effects.attempt( + containerConstruct, + inspectFlowEnd, + // Maybe flow, or a blank line? + effects.attempt( + lazyFlowConstruct, + inspectFlowEnd, + effects.check(blank, inspectFlowEnd, inspectLazy) + ) + )(code) + } + + // Otherwise we’re interrupting. + return inspectFlowEnd(code) + } + + function inspectLazy(code) { + // Act as if all containers are continued. + subcontinued = stack.length + inspectResult.lazy = true + inspectResult.flowContinue = true + return inspectDone(code) + } + + // We’re done with flow if we have more containers, or an interruption. + function inspectFlowEnd(code) { + inspectResult.flowEnd = true + return inspectDone(code) + } + + function inspectDone(code) { + inspectResult.continued = subcontinued + self.interrupt = self.containerState = undefined + return ok(code) + } + } +} + +function tokenizeContainer(effects, ok, nok) { + return spaceFactory( + effects, + effects.attempt(this.parser.constructs.document, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} + +function tokenizeLazyFlow(effects, ok, nok) { + return spaceFactory( + effects, + effects.lazy(this.parser.constructs.flow, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.js new file mode 100644 index 00000000000000..2d71db26e6fe8a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.js @@ -0,0 +1,82 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') +var content = require('../tokenize/content.js') +var factorySpace = require('../tokenize/factory-space.js') +var partialBlankLine = require('../tokenize/partial-blank-line.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var tokenize = initializeFlow + +function initializeFlow(effects) { + var self = this + var initial = effects.attempt( + // Try to parse a blank line. + partialBlankLine, + atBlankEnding, + // Try to parse initial flow (essentially, only code). + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct) + ), + types.linePrefix + ) + ) + ) + + return initial + + function atBlankEnding(code) { + assert__default['default']( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEndingBlank) + effects.consume(code) + effects.exit(types.lineEndingBlank) + self.currentConstruct = undefined + return initial + } + + function afterConstruct(code) { + assert__default['default']( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + self.currentConstruct = undefined + return initial + } +} + +exports.tokenize = tokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.mjs new file mode 100644 index 00000000000000..2f4b905d90ba47 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/flow.mjs @@ -0,0 +1,70 @@ +export var tokenize = initializeFlow + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' +import content from '../tokenize/content.mjs' +import spaceFactory from '../tokenize/factory-space.mjs' +import blank from '../tokenize/partial-blank-line.mjs' + +function initializeFlow(effects) { + var self = this + var initial = effects.attempt( + // Try to parse a blank line. + blank, + atBlankEnding, + // Try to parse initial flow (essentially, only code). + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + spaceFactory( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct) + ), + types.linePrefix + ) + ) + ) + + return initial + + function atBlankEnding(code) { + assert( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEndingBlank) + effects.consume(code) + effects.exit(types.lineEndingBlank) + self.currentConstruct = undefined + return initial + } + + function afterConstruct(code) { + assert( + code === codes.eof || markdownLineEnding(code), + 'expected eol or eof' + ) + + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + self.currentConstruct = undefined + return initial + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.js new file mode 100644 index 00000000000000..10274966ed3ead --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.js @@ -0,0 +1,210 @@ +'use strict' + +Object.defineProperty(exports, '__esModule', {value: true}) + +var codes = require('../character/codes.js') +var assign = require('../constant/assign.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var shallow = require('../util/shallow.js') + +var text = initializeFactory('text') +var string = initializeFactory('string') +var resolver = {resolveAll: createResolver()} + +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === 'text' ? resolveAllLineSuffixes : undefined + ) + } + + function initializeText(effects) { + var self = this + var constructs = this.parser.constructs[field] + var text = effects.attempt(constructs, start, notText) + + return start + + function start(code) { + return atBreak(code) ? text(code) : notText(code) + } + + function notText(code) { + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.data) + effects.consume(code) + return data + } + + function data(code) { + if (atBreak(code)) { + effects.exit(types.data) + return text(code) + } + + // Data. + effects.consume(code) + return data + } + + function atBreak(code) { + var list = constructs[code] + var index = -1 + + if (code === codes.eof) { + return true + } + + if (list) { + while (++index < list.length) { + if ( + !list[index].previous || + list[index].previous.call(self, self.previous) + ) { + return true + } + } + } + } + } +} + +function createResolver(extraResolver) { + return resolveAllText + + function resolveAllText(events, context) { + var index = -1 + var enter + + // A rather boring computation (to merge adjacent `data` events) which + // improves mm performance by 29%. + while (++index <= events.length) { + if (enter === undefined) { + if (events[index] && events[index][1].type === types.data) { + enter = index + index++ + } + } else if (!events[index] || events[index][1].type !== types.data) { + // Don’t do anything if there is one data token. + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + index = enter + 2 + } + + enter = undefined + } + } + + return extraResolver ? extraResolver(events, context) : events + } +} + +// A rather ugly set of instructions which again looks at chunks in the input +// stream. +// The reason to do this here is that it is *much* faster to parse in reverse. +// And that we can’t hook into `null` to split the line suffix before an EOF. +// To do: figure out if we can make this into a clean utility, or even in core. +// As it will be useful for GFMs literal autolink extension (and maybe even +// tables?) +function resolveAllLineSuffixes(events, context) { + var eventIndex = -1 + var chunks + var data + var chunk + var index + var bufferIndex + var size + var tabs + var token + + while (++eventIndex <= events.length) { + if ( + (eventIndex === events.length || + events[eventIndex][1].type === types.lineEnding) && + events[eventIndex - 1][1].type === types.data + ) { + data = events[eventIndex - 1][1] + chunks = context.sliceStream(data) + index = chunks.length + bufferIndex = -1 + size = 0 + tabs = undefined + + while (index--) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + bufferIndex = chunk.length + + while (chunk.charCodeAt(bufferIndex - 1) === codes.space) { + size++ + bufferIndex-- + } + + if (bufferIndex) break + bufferIndex = -1 + } + // Number + else if (chunk === codes.horizontalTab) { + tabs = true + size++ + } else if (chunk === codes.virtualSpace); + else { + // Replacement character, exit. + index++ + break + } + } + + if (size) { + token = { + type: + eventIndex === events.length || + tabs || + size < constants.hardBreakPrefixSizeMin + ? types.lineSuffix + : types.hardBreakTrailing, + start: { + line: data.end.line, + column: data.end.column - size, + offset: data.end.offset - size, + _index: data.start._index + index, + _bufferIndex: index + ? bufferIndex + : data.start._bufferIndex + bufferIndex + }, + end: shallow(data.end) + } + + data.end = shallow(token.start) + + if (data.start.offset === data.end.offset) { + assign(data, token) + } else { + events.splice( + eventIndex, + 0, + ['enter', token, context], + ['exit', token, context] + ) + eventIndex += 2 + } + } + + eventIndex++ + } + } + + return events +} + +exports.resolver = resolver +exports.string = string +exports.text = text diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.mjs new file mode 100644 index 00000000000000..8e1bca1fb4237b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/initialize/text.mjs @@ -0,0 +1,203 @@ +export var text = initializeFactory('text') +export var string = initializeFactory('string') +export var resolver = {resolveAll: createResolver()} + +import codes from '../character/codes.mjs' +import assign from '../constant/assign.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import shallow from '../util/shallow.mjs' + +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === 'text' ? resolveAllLineSuffixes : undefined + ) + } + + function initializeText(effects) { + var self = this + var constructs = this.parser.constructs[field] + var text = effects.attempt(constructs, start, notText) + + return start + + function start(code) { + return atBreak(code) ? text(code) : notText(code) + } + + function notText(code) { + if (code === codes.eof) { + effects.consume(code) + return + } + + effects.enter(types.data) + effects.consume(code) + return data + } + + function data(code) { + if (atBreak(code)) { + effects.exit(types.data) + return text(code) + } + + // Data. + effects.consume(code) + return data + } + + function atBreak(code) { + var list = constructs[code] + var index = -1 + + if (code === codes.eof) { + return true + } + + if (list) { + while (++index < list.length) { + if ( + !list[index].previous || + list[index].previous.call(self, self.previous) + ) { + return true + } + } + } + } + } +} + +function createResolver(extraResolver) { + return resolveAllText + + function resolveAllText(events, context) { + var index = -1 + var enter + + // A rather boring computation (to merge adjacent `data` events) which + // improves mm performance by 29%. + while (++index <= events.length) { + if (enter === undefined) { + if (events[index] && events[index][1].type === types.data) { + enter = index + index++ + } + } else if (!events[index] || events[index][1].type !== types.data) { + // Don’t do anything if there is one data token. + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + index = enter + 2 + } + + enter = undefined + } + } + + return extraResolver ? extraResolver(events, context) : events + } +} + +// A rather ugly set of instructions which again looks at chunks in the input +// stream. +// The reason to do this here is that it is *much* faster to parse in reverse. +// And that we can’t hook into `null` to split the line suffix before an EOF. +// To do: figure out if we can make this into a clean utility, or even in core. +// As it will be useful for GFMs literal autolink extension (and maybe even +// tables?) +function resolveAllLineSuffixes(events, context) { + var eventIndex = -1 + var chunks + var data + var chunk + var index + var bufferIndex + var size + var tabs + var token + + while (++eventIndex <= events.length) { + if ( + (eventIndex === events.length || + events[eventIndex][1].type === types.lineEnding) && + events[eventIndex - 1][1].type === types.data + ) { + data = events[eventIndex - 1][1] + chunks = context.sliceStream(data) + index = chunks.length + bufferIndex = -1 + size = 0 + tabs = undefined + + while (index--) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + bufferIndex = chunk.length + + while (chunk.charCodeAt(bufferIndex - 1) === codes.space) { + size++ + bufferIndex-- + } + + if (bufferIndex) break + bufferIndex = -1 + } + // Number + else if (chunk === codes.horizontalTab) { + tabs = true + size++ + } else if (chunk === codes.virtualSpace) { + // Empty + } else { + // Replacement character, exit. + index++ + break + } + } + + if (size) { + token = { + type: + eventIndex === events.length || + tabs || + size < constants.hardBreakPrefixSizeMin + ? types.lineSuffix + : types.hardBreakTrailing, + start: { + line: data.end.line, + column: data.end.column - size, + offset: data.end.offset - size, + _index: data.start._index + index, + _bufferIndex: index + ? bufferIndex + : data.start._bufferIndex + bufferIndex + }, + end: shallow(data.end) + } + + data.end = shallow(token.start) + + if (data.start.offset === data.end.offset) { + assign(data, token) + } else { + events.splice( + eventIndex, + 0, + ['enter', token, context], + ['exit', token, context] + ) + eventIndex += 2 + } + } + + eventIndex++ + } + } + + return events +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.js new file mode 100644 index 00000000000000..aad11f9ee75e08 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.js @@ -0,0 +1,36 @@ +'use strict' + +var content = require('./initialize/content.js') +var document = require('./initialize/document.js') +var flow = require('./initialize/flow.js') +var text = require('./initialize/text.js') +var combineExtensions = require('./util/combine-extensions.js') +var createTokenizer = require('./util/create-tokenizer.js') +var miniflat = require('./util/miniflat.js') +var constructs = require('./constructs.js') + +function parse(options) { + var settings = options || {} + var parser = { + defined: [], + constructs: combineExtensions( + [constructs].concat(miniflat(settings.extensions)) + ), + content: create(content), + document: create(document), + flow: create(flow), + string: create(text.string), + text: create(text.text) + } + + return parser + + function create(initializer) { + return creator + function creator(from) { + return createTokenizer(parser, initializer, from) + } + } +} + +module.exports = parse diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.mjs new file mode 100644 index 00000000000000..a4ca9ac681a3f5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/parse.mjs @@ -0,0 +1,34 @@ +export default parse + +import * as initializeContent from './initialize/content.mjs' +import * as initializeDocument from './initialize/document.mjs' +import * as initializeFlow from './initialize/flow.mjs' +import * as initializeText from './initialize/text.mjs' +import combineExtensions from './util/combine-extensions.mjs' +import createTokenizer from './util/create-tokenizer.mjs' +import miniflat from './util/miniflat.mjs' +import * as constructs from './constructs.mjs' + +function parse(options) { + var settings = options || {} + var parser = { + defined: [], + constructs: combineExtensions( + [constructs].concat(miniflat(settings.extensions)) + ), + content: create(initializeContent), + document: create(initializeDocument), + flow: create(initializeFlow), + string: create(initializeText.string), + text: create(initializeText.text) + } + + return parser + + function create(initializer) { + return creator + function creator(from) { + return createTokenizer(parser, initializer, from) + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.js new file mode 100644 index 00000000000000..842f8ce8bfc64d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.js @@ -0,0 +1,13 @@ +'use strict' + +var subtokenize = require('./util/subtokenize.js') + +function postprocess(events) { + while (!subtokenize(events)) { + // Empty + } + + return events +} + +module.exports = postprocess diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.mjs new file mode 100644 index 00000000000000..f32e378d3f98e9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/postprocess.mjs @@ -0,0 +1,11 @@ +export default postprocess + +import subtokenize from './util/subtokenize.mjs' + +function postprocess(events) { + while (!subtokenize(events)) { + // Empty + } + + return events +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.js new file mode 100644 index 00000000000000..caf9c07059f3a4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.js @@ -0,0 +1,96 @@ +'use strict' + +var codes = require('./character/codes.js') +var constants = require('./constant/constants.js') + +var search = /[\0\t\n\r]/g + +function preprocess() { + var start = true + var column = 1 + var buffer = '' + var atCarriageReturn + + return preprocessor + + function preprocessor(value, encoding, end) { + var chunks = [] + var match + var next + var startPosition + var endPosition + var code + + value = buffer + value.toString(encoding) + startPosition = 0 + buffer = '' + + if (start) { + if (value.charCodeAt(0) === codes.byteOrderMarker) { + startPosition++ + } + + start = undefined + } + + while (startPosition < value.length) { + search.lastIndex = startPosition + match = search.exec(value) + endPosition = match ? match.index : value.length + code = value.charCodeAt(endPosition) + + if (!match) { + buffer = value.slice(startPosition) + break + } + + if ( + code === codes.lf && + startPosition === endPosition && + atCarriageReturn + ) { + chunks.push(codes.carriageReturnLineFeed) + atCarriageReturn = undefined + } else { + if (atCarriageReturn) { + chunks.push(codes.carriageReturn) + atCarriageReturn = undefined + } + + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)) + column += endPosition - startPosition + } + + if (code === codes.nul) { + chunks.push(codes.replacementCharacter) + column++ + } else if (code === codes.ht) { + next = Math.ceil(column / constants.tabSize) * constants.tabSize + chunks.push(codes.horizontalTab) + while (column++ < next) chunks.push(codes.virtualSpace) + } else if (code === codes.lf) { + chunks.push(codes.lineFeed) + column = 1 + } + // Must be carriage return. + else { + atCarriageReturn = true + column = 1 + } + } + + startPosition = endPosition + 1 + } + + if (end) { + if (atCarriageReturn) chunks.push(codes.carriageReturn) + if (buffer) chunks.push(buffer) + chunks.push(codes.eof) + } + + return chunks + } +} + +module.exports = preprocess diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.mjs new file mode 100644 index 00000000000000..4413159d36cd9a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/preprocess.mjs @@ -0,0 +1,94 @@ +export default preprocess + +import codes from './character/codes.mjs' +import constants from './constant/constants.mjs' + +var search = /[\0\t\n\r]/g + +function preprocess() { + var start = true + var column = 1 + var buffer = '' + var atCarriageReturn + + return preprocessor + + function preprocessor(value, encoding, end) { + var chunks = [] + var match + var next + var startPosition + var endPosition + var code + + value = buffer + value.toString(encoding) + startPosition = 0 + buffer = '' + + if (start) { + if (value.charCodeAt(0) === codes.byteOrderMarker) { + startPosition++ + } + + start = undefined + } + + while (startPosition < value.length) { + search.lastIndex = startPosition + match = search.exec(value) + endPosition = match ? match.index : value.length + code = value.charCodeAt(endPosition) + + if (!match) { + buffer = value.slice(startPosition) + break + } + + if ( + code === codes.lf && + startPosition === endPosition && + atCarriageReturn + ) { + chunks.push(codes.carriageReturnLineFeed) + atCarriageReturn = undefined + } else { + if (atCarriageReturn) { + chunks.push(codes.carriageReturn) + atCarriageReturn = undefined + } + + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)) + column += endPosition - startPosition + } + + if (code === codes.nul) { + chunks.push(codes.replacementCharacter) + column++ + } else if (code === codes.ht) { + next = Math.ceil(column / constants.tabSize) * constants.tabSize + chunks.push(codes.horizontalTab) + while (column++ < next) chunks.push(codes.virtualSpace) + } else if (code === codes.lf) { + chunks.push(codes.lineFeed) + column = 1 + } + // Must be carriage return. + else { + atCarriageReturn = true + column = 1 + } + } + + startPosition = endPosition + 1 + } + + if (end) { + if (atCarriageReturn) chunks.push(codes.carriageReturn) + if (buffer) chunks.push(buffer) + chunks.push(codes.eof) + } + + return chunks + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.js new file mode 100644 index 00000000000000..07fb675b62665f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.js @@ -0,0 +1,119 @@ +'use strict' + +var events = require('events') +var html = require('./compile/html.js') +var parse = require('./parse.js') +var postprocess = require('./postprocess.js') +var preprocess = require('./preprocess.js') + +function stream(options) { + var preprocess$1 = preprocess() + var tokenize = parse(options).document().write + var compile = html(options) + var emitter = new events.EventEmitter() + var ended + + emitter.writable = emitter.readable = true + emitter.write = write + emitter.end = end + emitter.pipe = pipe + + return emitter + + // Write a chunk into memory. + function write(chunk, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = undefined + } + + if (ended) { + throw new Error('Did not expect `write` after `end`') + } + + tokenize(preprocess$1(chunk || '', encoding)) + + if (callback) { + callback() + } + + // Signal succesful write. + return true + } + + // End the writing. + // Passes all arguments to a final `write`. + function end(chunk, encoding, callback) { + write(chunk, encoding, callback) + + emitter.emit( + 'data', + compile(postprocess(tokenize(preprocess$1('', encoding, true)))) + ) + + emitter.emit('end') + ended = true + return true + } + + // Pipe the processor into a writable stream. + // Basically `Stream#pipe`, but inlined and simplified to keep the bundled + // size down. + // See: . + function pipe(dest, options) { + emitter.on('data', ondata) + emitter.on('error', onerror) + emitter.on('end', cleanup) + emitter.on('close', cleanup) + + // If the `end` option is not supplied, `dest.end()` will be called when the + // `end` or `close` events are received. + if (!dest._isStdio && (!options || options.end !== false)) { + emitter.on('end', onend) + } + + dest.on('error', onerror) + dest.on('close', cleanup) + + dest.emit('pipe', emitter) + + return dest + + // End destination. + function onend() { + if (dest.end) { + dest.end() + } + } + + // Handle data. + function ondata(chunk) { + if (dest.writable) { + dest.write(chunk) + } + } + + // Clean listeners. + function cleanup() { + emitter.removeListener('data', ondata) + emitter.removeListener('end', onend) + emitter.removeListener('error', onerror) + emitter.removeListener('end', cleanup) + emitter.removeListener('close', cleanup) + + dest.removeListener('error', onerror) + dest.removeListener('close', cleanup) + } + + // Close dangling pipes and handle unheard errors. + function onerror(error) { + cleanup() + + if (!emitter.listenerCount('error')) { + throw error // Unhandled stream error in pipe. + } + } + } +} + +module.exports = stream diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.mjs new file mode 100644 index 00000000000000..d00c74a89ba3b6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/stream.mjs @@ -0,0 +1,117 @@ +export default stream + +import {EventEmitter} from 'events' +import compiler from './compile/html.mjs' +import parser from './parse.mjs' +import postprocess from './postprocess.mjs' +import preprocessor from './preprocess.mjs' + +function stream(options) { + var preprocess = preprocessor() + var tokenize = parser(options).document().write + var compile = compiler(options) + var emitter = new EventEmitter() + var ended + + emitter.writable = emitter.readable = true + emitter.write = write + emitter.end = end + emitter.pipe = pipe + + return emitter + + // Write a chunk into memory. + function write(chunk, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = undefined + } + + if (ended) { + throw new Error('Did not expect `write` after `end`') + } + + tokenize(preprocess(chunk || '', encoding)) + + if (callback) { + callback() + } + + // Signal succesful write. + return true + } + + // End the writing. + // Passes all arguments to a final `write`. + function end(chunk, encoding, callback) { + write(chunk, encoding, callback) + + emitter.emit( + 'data', + compile(postprocess(tokenize(preprocess('', encoding, true)))) + ) + + emitter.emit('end') + ended = true + return true + } + + // Pipe the processor into a writable stream. + // Basically `Stream#pipe`, but inlined and simplified to keep the bundled + // size down. + // See: . + function pipe(dest, options) { + emitter.on('data', ondata) + emitter.on('error', onerror) + emitter.on('end', cleanup) + emitter.on('close', cleanup) + + // If the `end` option is not supplied, `dest.end()` will be called when the + // `end` or `close` events are received. + if (!dest._isStdio && (!options || options.end !== false)) { + emitter.on('end', onend) + } + + dest.on('error', onerror) + dest.on('close', cleanup) + + dest.emit('pipe', emitter) + + return dest + + // End destination. + function onend() { + if (dest.end) { + dest.end() + } + } + + // Handle data. + function ondata(chunk) { + if (dest.writable) { + dest.write(chunk) + } + } + + // Clean listeners. + function cleanup() { + emitter.removeListener('data', ondata) + emitter.removeListener('end', onend) + emitter.removeListener('error', onerror) + emitter.removeListener('end', cleanup) + emitter.removeListener('close', cleanup) + + dest.removeListener('error', onerror) + dest.removeListener('close', cleanup) + } + + // Close dangling pipes and handle unheard errors. + function onerror(error) { + cleanup() + + if (!emitter.listenerCount('error')) { + throw error // Unhandled stream error in pipe. + } + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.js new file mode 100644 index 00000000000000..b38970d99e077a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.js @@ -0,0 +1,216 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var chunkedPush = require('../util/chunked-push.js') +var chunkedSplice = require('../util/chunked-splice.js') +var classifyCharacter = require('../util/classify-character.js') +var movePoint = require('../util/move-point.js') +var resolveAll = require('../util/resolve-all.js') +var shallow = require('../util/shallow.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var attention = { + name: 'attention', + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +} + +// Take all events and resolve attention to emphasis or strong. +function resolveAllAttention(events, context) { + var index = -1 + var open + var group + var text + var openingSequence + var closingSequence + var use + var nextEvents + var offset + + // Walk through all events. + // + // Note: performance of this is fine on an mb of normal markdown, but it’s + // a bottleneck for malicious stuff. + while (++index < events.length) { + // Find a token that can close. + if ( + events[index][0] === 'enter' && + events[index][1].type === 'attentionSequence' && + events[index][1]._close + ) { + open = index + + // Now walk back to find an opener. + while (open--) { + // Find a token that can open the closer. + if ( + events[open][0] === 'exit' && + events[open][1].type === 'attentionSequence' && + events[open][1]._open && + // If the markers are the same: + context.sliceSerialize(events[open][1]).charCodeAt(0) === + context.sliceSerialize(events[index][1]).charCodeAt(0) + ) { + // If the opening can close or the closing can open, + // and the close size *is not* a multiple of three, + // but the sum of the opening and closing size *is* multiple of three, + // then don’t match. + if ( + (events[open][1]._close || events[index][1]._open) && + (events[index][1].end.offset - events[index][1].start.offset) % 3 && + !( + (events[open][1].end.offset - + events[open][1].start.offset + + events[index][1].end.offset - + events[index][1].start.offset) % + 3 + ) + ) { + continue + } + + // Number of markers to use from the sequence. + use = + events[open][1].end.offset - events[open][1].start.offset > 1 && + events[index][1].end.offset - events[index][1].start.offset > 1 + ? 2 + : 1 + + openingSequence = { + type: use > 1 ? types.strongSequence : types.emphasisSequence, + start: movePoint(shallow(events[open][1].end), -use), + end: shallow(events[open][1].end) + } + closingSequence = { + type: use > 1 ? types.strongSequence : types.emphasisSequence, + start: shallow(events[index][1].start), + end: movePoint(shallow(events[index][1].start), use) + } + text = { + type: use > 1 ? types.strongText : types.emphasisText, + start: shallow(events[open][1].end), + end: shallow(events[index][1].start) + } + group = { + type: use > 1 ? types.strong : types.emphasis, + start: shallow(openingSequence.start), + end: shallow(closingSequence.end) + } + + events[open][1].end = shallow(openingSequence.start) + events[index][1].start = shallow(closingSequence.end) + + nextEvents = [] + + // If there are more markers in the opening, add them before. + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[open][1], context], + ['exit', events[open][1], context] + ]) + } + + // Opening. + nextEvents = chunkedPush(nextEvents, [ + ['enter', group, context], + ['enter', openingSequence, context], + ['exit', openingSequence, context], + ['enter', text, context] + ]) + + // Between. + nextEvents = chunkedPush( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index), + context + ) + ) + + // Closing. + nextEvents = chunkedPush(nextEvents, [ + ['exit', text, context], + ['enter', closingSequence, context], + ['exit', closingSequence, context], + ['exit', group, context] + ]) + + // If there are more markers in the closing, add them after. + if (events[index][1].end.offset - events[index][1].start.offset) { + offset = 2 + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[index][1], context], + ['exit', events[index][1], context] + ]) + } else { + offset = 0 + } + + chunkedSplice(events, open - 1, index - open + 3, nextEvents) + + index = open + nextEvents.length - offset - 2 + break + } + } + } + } + + // Remove remaining sequences. + index = -1 + + while (++index < events.length) { + if (events[index][1].type === 'attentionSequence') { + events[index][1].type = 'data' + } + } + + return events +} + +function tokenizeAttention(effects, ok) { + var before = classifyCharacter(this.previous) + var marker + + return start + + function start(code) { + assert__default['default']( + code === codes.asterisk || code === codes.underscore, + 'expected asterisk or underscore' + ) + effects.enter('attentionSequence') + marker = code + return sequence(code) + } + + function sequence(code) { + var token + var after + var open + var close + + if (code === marker) { + effects.consume(code) + return sequence + } + + token = effects.exit('attentionSequence') + after = classifyCharacter(code) + open = !after || (after === constants.characterGroupPunctuation && before) + close = !before || (before === constants.characterGroupPunctuation && after) + token._open = marker === codes.asterisk ? open : open && (before || !close) + token._close = marker === codes.asterisk ? close : close && (after || !open) + return ok(code) + } +} + +module.exports = attention diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.mjs new file mode 100644 index 00000000000000..a3c81460f9a79e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/attention.mjs @@ -0,0 +1,207 @@ +var attention = { + name: 'attention', + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +} +export default attention + +import assert from 'assert' +import codes from '../character/codes.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import chunkedPush from '../util/chunked-push.mjs' +import chunkedSplice from '../util/chunked-splice.mjs' +import classifyCharacter from '../util/classify-character.mjs' +import movePoint from '../util/move-point.mjs' +import resolveAll from '../util/resolve-all.mjs' +import shallow from '../util/shallow.mjs' + +// Take all events and resolve attention to emphasis or strong. +function resolveAllAttention(events, context) { + var index = -1 + var open + var group + var text + var openingSequence + var closingSequence + var use + var nextEvents + var offset + + // Walk through all events. + // + // Note: performance of this is fine on an mb of normal markdown, but it’s + // a bottleneck for malicious stuff. + while (++index < events.length) { + // Find a token that can close. + if ( + events[index][0] === 'enter' && + events[index][1].type === 'attentionSequence' && + events[index][1]._close + ) { + open = index + + // Now walk back to find an opener. + while (open--) { + // Find a token that can open the closer. + if ( + events[open][0] === 'exit' && + events[open][1].type === 'attentionSequence' && + events[open][1]._open && + // If the markers are the same: + context.sliceSerialize(events[open][1]).charCodeAt(0) === + context.sliceSerialize(events[index][1]).charCodeAt(0) + ) { + // If the opening can close or the closing can open, + // and the close size *is not* a multiple of three, + // but the sum of the opening and closing size *is* multiple of three, + // then don’t match. + if ( + (events[open][1]._close || events[index][1]._open) && + (events[index][1].end.offset - events[index][1].start.offset) % 3 && + !( + (events[open][1].end.offset - + events[open][1].start.offset + + events[index][1].end.offset - + events[index][1].start.offset) % + 3 + ) + ) { + continue + } + + // Number of markers to use from the sequence. + use = + events[open][1].end.offset - events[open][1].start.offset > 1 && + events[index][1].end.offset - events[index][1].start.offset > 1 + ? 2 + : 1 + + openingSequence = { + type: use > 1 ? types.strongSequence : types.emphasisSequence, + start: movePoint(shallow(events[open][1].end), -use), + end: shallow(events[open][1].end) + } + closingSequence = { + type: use > 1 ? types.strongSequence : types.emphasisSequence, + start: shallow(events[index][1].start), + end: movePoint(shallow(events[index][1].start), use) + } + text = { + type: use > 1 ? types.strongText : types.emphasisText, + start: shallow(events[open][1].end), + end: shallow(events[index][1].start) + } + group = { + type: use > 1 ? types.strong : types.emphasis, + start: shallow(openingSequence.start), + end: shallow(closingSequence.end) + } + + events[open][1].end = shallow(openingSequence.start) + events[index][1].start = shallow(closingSequence.end) + + nextEvents = [] + + // If there are more markers in the opening, add them before. + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[open][1], context], + ['exit', events[open][1], context] + ]) + } + + // Opening. + nextEvents = chunkedPush(nextEvents, [ + ['enter', group, context], + ['enter', openingSequence, context], + ['exit', openingSequence, context], + ['enter', text, context] + ]) + + // Between. + nextEvents = chunkedPush( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index), + context + ) + ) + + // Closing. + nextEvents = chunkedPush(nextEvents, [ + ['exit', text, context], + ['enter', closingSequence, context], + ['exit', closingSequence, context], + ['exit', group, context] + ]) + + // If there are more markers in the closing, add them after. + if (events[index][1].end.offset - events[index][1].start.offset) { + offset = 2 + nextEvents = chunkedPush(nextEvents, [ + ['enter', events[index][1], context], + ['exit', events[index][1], context] + ]) + } else { + offset = 0 + } + + chunkedSplice(events, open - 1, index - open + 3, nextEvents) + + index = open + nextEvents.length - offset - 2 + break + } + } + } + } + + // Remove remaining sequences. + index = -1 + + while (++index < events.length) { + if (events[index][1].type === 'attentionSequence') { + events[index][1].type = 'data' + } + } + + return events +} + +function tokenizeAttention(effects, ok) { + var before = classifyCharacter(this.previous) + var marker + + return start + + function start(code) { + assert( + code === codes.asterisk || code === codes.underscore, + 'expected asterisk or underscore' + ) + effects.enter('attentionSequence') + marker = code + return sequence(code) + } + + function sequence(code) { + var token + var after + var open + var close + + if (code === marker) { + effects.consume(code) + return sequence + } + + token = effects.exit('attentionSequence') + after = classifyCharacter(code) + open = !after || (after === constants.characterGroupPunctuation && before) + close = !before || (before === constants.characterGroupPunctuation && after) + token._open = marker === codes.asterisk ? open : open && (before || !close) + token._close = marker === codes.asterisk ? close : close && (after || !open) + return ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.js new file mode 100644 index 00000000000000..037280bbd2ced2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.js @@ -0,0 +1,147 @@ +'use strict' + +var assert = require('assert') +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var asciiAtext = require('../character/ascii-atext.js') +var asciiControl = require('../character/ascii-control.js') +var codes = require('../character/codes.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var autolink = { + name: 'autolink', + tokenize: tokenizeAutolink +} + +function tokenizeAutolink(effects, ok, nok) { + var size = 1 + + return start + + function start(code) { + assert__default['default'](code === codes.lessThan, 'expected `<`') + effects.enter(types.autolink) + effects.enter(types.autolinkMarker) + effects.consume(code) + effects.exit(types.autolinkMarker) + effects.enter(types.autolinkProtocol) + return open + } + + function open(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return schemeOrEmailAtext + } + + return asciiAtext(code) ? emailAtext(code) : nok(code) + } + + function schemeOrEmailAtext(code) { + return code === codes.plusSign || + code === codes.dash || + code === codes.dot || + asciiAlphanumeric(code) + ? schemeInsideOrEmailAtext(code) + : emailAtext(code) + } + + function schemeInsideOrEmailAtext(code) { + if (code === codes.colon) { + effects.consume(code) + return urlInside + } + + if ( + (code === codes.plusSign || + code === codes.dash || + code === codes.dot || + asciiAlphanumeric(code)) && + size++ < constants.autolinkSchemeSizeMax + ) { + effects.consume(code) + return schemeInsideOrEmailAtext + } + + return emailAtext(code) + } + + function urlInside(code) { + if (code === codes.greaterThan) { + effects.exit(types.autolinkProtocol) + return end(code) + } + + if (code === codes.space || code === codes.lessThan || asciiControl(code)) { + return nok(code) + } + + effects.consume(code) + return urlInside + } + + function emailAtext(code) { + if (code === codes.atSign) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (asciiAtext(code)) { + effects.consume(code) + return emailAtext + } + + return nok(code) + } + + function emailAtSignOrDot(code) { + return asciiAlphanumeric(code) ? emailLabel(code) : nok(code) + } + + function emailLabel(code) { + if (code === codes.dot) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (code === codes.greaterThan) { + // Exit, then change the type. + effects.exit(types.autolinkProtocol).type = types.autolinkEmail + return end(code) + } + + return emailValue(code) + } + + function emailValue(code) { + if ( + (code === codes.dash || asciiAlphanumeric(code)) && + size++ < constants.autolinkDomainSizeMax + ) { + effects.consume(code) + return code === codes.dash ? emailValue : emailLabel + } + + return nok(code) + } + + function end(code) { + assert__default['default'].equal(code, codes.greaterThan, 'expected `>`') + effects.enter(types.autolinkMarker) + effects.consume(code) + effects.exit(types.autolinkMarker) + effects.exit(types.autolink) + return ok + } +} + +module.exports = autolink diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.mjs new file mode 100644 index 00000000000000..890cd6c468144a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/autolink.mjs @@ -0,0 +1,138 @@ +var autolink = { + name: 'autolink', + tokenize: tokenizeAutolink +} +export default autolink + +import assert from 'assert' +import asciiAlpha from '../character/ascii-alpha.mjs' +import asciiAlphanumeric from '../character/ascii-alphanumeric.mjs' +import asciiAtext from '../character/ascii-atext.mjs' +import asciiControl from '../character/ascii-control.mjs' +import codes from '../character/codes.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' + +function tokenizeAutolink(effects, ok, nok) { + var size = 1 + + return start + + function start(code) { + assert(code === codes.lessThan, 'expected `<`') + effects.enter(types.autolink) + effects.enter(types.autolinkMarker) + effects.consume(code) + effects.exit(types.autolinkMarker) + effects.enter(types.autolinkProtocol) + return open + } + + function open(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return schemeOrEmailAtext + } + + return asciiAtext(code) ? emailAtext(code) : nok(code) + } + + function schemeOrEmailAtext(code) { + return code === codes.plusSign || + code === codes.dash || + code === codes.dot || + asciiAlphanumeric(code) + ? schemeInsideOrEmailAtext(code) + : emailAtext(code) + } + + function schemeInsideOrEmailAtext(code) { + if (code === codes.colon) { + effects.consume(code) + return urlInside + } + + if ( + (code === codes.plusSign || + code === codes.dash || + code === codes.dot || + asciiAlphanumeric(code)) && + size++ < constants.autolinkSchemeSizeMax + ) { + effects.consume(code) + return schemeInsideOrEmailAtext + } + + return emailAtext(code) + } + + function urlInside(code) { + if (code === codes.greaterThan) { + effects.exit(types.autolinkProtocol) + return end(code) + } + + if (code === codes.space || code === codes.lessThan || asciiControl(code)) { + return nok(code) + } + + effects.consume(code) + return urlInside + } + + function emailAtext(code) { + if (code === codes.atSign) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (asciiAtext(code)) { + effects.consume(code) + return emailAtext + } + + return nok(code) + } + + function emailAtSignOrDot(code) { + return asciiAlphanumeric(code) ? emailLabel(code) : nok(code) + } + + function emailLabel(code) { + if (code === codes.dot) { + effects.consume(code) + size = 0 + return emailAtSignOrDot + } + + if (code === codes.greaterThan) { + // Exit, then change the type. + effects.exit(types.autolinkProtocol).type = types.autolinkEmail + return end(code) + } + + return emailValue(code) + } + + function emailValue(code) { + if ( + (code === codes.dash || asciiAlphanumeric(code)) && + size++ < constants.autolinkDomainSizeMax + ) { + effects.consume(code) + return code === codes.dash ? emailValue : emailLabel + } + + return nok(code) + } + + function end(code) { + assert.equal(code, codes.greaterThan, 'expected `>`') + effects.enter(types.autolinkMarker) + effects.consume(code) + effects.exit(types.autolinkMarker) + effects.exit(types.autolink) + return ok + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.js new file mode 100644 index 00000000000000..66f58d0715314b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.js @@ -0,0 +1,67 @@ +'use strict' + +var codes = require('../character/codes.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +var blockQuote = { + name: 'blockQuote', + tokenize: tokenizeBlockQuoteStart, + continuation: {tokenize: tokenizeBlockQuoteContinuation}, + exit: exit +} + +function tokenizeBlockQuoteStart(effects, ok, nok) { + var self = this + + return start + + function start(code) { + if (code === codes.greaterThan) { + if (!self.containerState.open) { + effects.enter(types.blockQuote, {_container: true}) + self.containerState.open = true + } + + effects.enter(types.blockQuotePrefix) + effects.enter(types.blockQuoteMarker) + effects.consume(code) + effects.exit(types.blockQuoteMarker) + return after + } + + return nok(code) + } + + function after(code) { + if (markdownSpace(code)) { + effects.enter(types.blockQuotePrefixWhitespace) + effects.consume(code) + effects.exit(types.blockQuotePrefixWhitespace) + effects.exit(types.blockQuotePrefix) + return ok + } + + effects.exit(types.blockQuotePrefix) + return ok(code) + } +} + +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(blockQuote, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} + +function exit(effects) { + effects.exit(types.blockQuote) +} + +module.exports = blockQuote diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.mjs new file mode 100644 index 00000000000000..cf215ba60297ee --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/block-quote.mjs @@ -0,0 +1,64 @@ +var blockQuote = { + name: 'blockQuote', + tokenize: tokenizeBlockQuoteStart, + continuation: {tokenize: tokenizeBlockQuoteContinuation}, + exit: exit +} +export default blockQuote + +import codes from '../character/codes.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizeBlockQuoteStart(effects, ok, nok) { + var self = this + + return start + + function start(code) { + if (code === codes.greaterThan) { + if (!self.containerState.open) { + effects.enter(types.blockQuote, {_container: true}) + self.containerState.open = true + } + + effects.enter(types.blockQuotePrefix) + effects.enter(types.blockQuoteMarker) + effects.consume(code) + effects.exit(types.blockQuoteMarker) + return after + } + + return nok(code) + } + + function after(code) { + if (markdownSpace(code)) { + effects.enter(types.blockQuotePrefixWhitespace) + effects.consume(code) + effects.exit(types.blockQuotePrefixWhitespace) + effects.exit(types.blockQuotePrefix) + return ok + } + + effects.exit(types.blockQuotePrefix) + return ok(code) + } +} + +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + return spaceFactory( + effects, + effects.attempt(blockQuote, ok, nok), + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) +} + +function exit(effects) { + effects.exit(types.blockQuote) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.js new file mode 100644 index 00000000000000..2c796400033887 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.js @@ -0,0 +1,44 @@ +'use strict' + +var assert = require('assert') +var asciiPunctuation = require('../character/ascii-punctuation.js') +var codes = require('../character/codes.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var characterEscape = { + name: 'characterEscape', + tokenize: tokenizeCharacterEscape +} + +function tokenizeCharacterEscape(effects, ok, nok) { + return start + + function start(code) { + assert__default['default'](code === codes.backslash, 'expected `\\`') + effects.enter(types.characterEscape) + effects.enter(types.escapeMarker) + effects.consume(code) + effects.exit(types.escapeMarker) + return open + } + + function open(code) { + if (asciiPunctuation(code)) { + effects.enter(types.characterEscapeValue) + effects.consume(code) + effects.exit(types.characterEscapeValue) + effects.exit(types.characterEscape) + return ok + } + + return nok(code) + } +} + +module.exports = characterEscape diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.mjs new file mode 100644 index 00000000000000..fae1f771082a34 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-escape.mjs @@ -0,0 +1,35 @@ +var characterEscape = { + name: 'characterEscape', + tokenize: tokenizeCharacterEscape +} +export default characterEscape + +import assert from 'assert' +import asciiPunctuation from '../character/ascii-punctuation.mjs' +import codes from '../character/codes.mjs' +import types from '../constant/types.mjs' + +function tokenizeCharacterEscape(effects, ok, nok) { + return start + + function start(code) { + assert(code === codes.backslash, 'expected `\\`') + effects.enter(types.characterEscape) + effects.enter(types.escapeMarker) + effects.consume(code) + effects.exit(types.escapeMarker) + return open + } + + function open(code) { + if (asciiPunctuation(code)) { + effects.enter(types.characterEscapeValue) + effects.consume(code) + effects.exit(types.characterEscapeValue) + effects.exit(types.characterEscape) + return ok + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.js new file mode 100644 index 00000000000000..0f3966c6d77b4b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.js @@ -0,0 +1,101 @@ +'use strict' + +var assert = require('assert') +var decodeEntity = require('parse-entities/decode-entity.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var asciiDigit = require('../character/ascii-digit.js') +var asciiHexDigit = require('../character/ascii-hex-digit.js') +var codes = require('../character/codes.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) +var decodeEntity__default = /*#__PURE__*/ _interopDefaultLegacy(decodeEntity) + +var characterReference = { + name: 'characterReference', + tokenize: tokenizeCharacterReference +} + +function tokenizeCharacterReference(effects, ok, nok) { + var self = this + var size = 0 + var max + var test + + return start + + function start(code) { + assert__default['default'](code === codes.ampersand, 'expected `&`') + effects.enter(types.characterReference) + effects.enter(types.characterReferenceMarker) + effects.consume(code) + effects.exit(types.characterReferenceMarker) + return open + } + + function open(code) { + if (code === codes.numberSign) { + effects.enter(types.characterReferenceMarkerNumeric) + effects.consume(code) + effects.exit(types.characterReferenceMarkerNumeric) + return numeric + } + + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceNamedSizeMax + test = asciiAlphanumeric + return value(code) + } + + function numeric(code) { + if (code === codes.uppercaseX || code === codes.lowercaseX) { + effects.enter(types.characterReferenceMarkerHexadecimal) + effects.consume(code) + effects.exit(types.characterReferenceMarkerHexadecimal) + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceHexadecimalSizeMax + test = asciiHexDigit + return value + } + + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceDecimalSizeMax + test = asciiDigit + return value(code) + } + + function value(code) { + var token + + if (code === codes.semicolon && size) { + token = effects.exit(types.characterReferenceValue) + + if ( + test === asciiAlphanumeric && + !decodeEntity__default['default'](self.sliceSerialize(token)) + ) { + return nok(code) + } + + effects.enter(types.characterReferenceMarker) + effects.consume(code) + effects.exit(types.characterReferenceMarker) + effects.exit(types.characterReference) + return ok + } + + if (test(code) && size++ < max) { + effects.consume(code) + return value + } + + return nok(code) + } +} + +module.exports = characterReference diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.mjs new file mode 100644 index 00000000000000..eb76075a6dacaa --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/character-reference.mjs @@ -0,0 +1,88 @@ +var characterReference = { + name: 'characterReference', + tokenize: tokenizeCharacterReference +} +export default characterReference + +import assert from 'assert' +import decode from 'parse-entities/decode-entity.js' +import asciiAlphanumeric from '../character/ascii-alphanumeric.mjs' +import asciiDigit from '../character/ascii-digit.mjs' +import asciiHexDigit from '../character/ascii-hex-digit.mjs' +import codes from '../character/codes.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' + +function tokenizeCharacterReference(effects, ok, nok) { + var self = this + var size = 0 + var max + var test + + return start + + function start(code) { + assert(code === codes.ampersand, 'expected `&`') + effects.enter(types.characterReference) + effects.enter(types.characterReferenceMarker) + effects.consume(code) + effects.exit(types.characterReferenceMarker) + return open + } + + function open(code) { + if (code === codes.numberSign) { + effects.enter(types.characterReferenceMarkerNumeric) + effects.consume(code) + effects.exit(types.characterReferenceMarkerNumeric) + return numeric + } + + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceNamedSizeMax + test = asciiAlphanumeric + return value(code) + } + + function numeric(code) { + if (code === codes.uppercaseX || code === codes.lowercaseX) { + effects.enter(types.characterReferenceMarkerHexadecimal) + effects.consume(code) + effects.exit(types.characterReferenceMarkerHexadecimal) + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceHexadecimalSizeMax + test = asciiHexDigit + return value + } + + effects.enter(types.characterReferenceValue) + max = constants.characterReferenceDecimalSizeMax + test = asciiDigit + return value(code) + } + + function value(code) { + var token + + if (code === codes.semicolon && size) { + token = effects.exit(types.characterReferenceValue) + + if (test === asciiAlphanumeric && !decode(self.sliceSerialize(token))) { + return nok(code) + } + + effects.enter(types.characterReferenceMarker) + effects.consume(code) + effects.exit(types.characterReferenceMarker) + effects.exit(types.characterReference) + return ok + } + + if (test(code) && size++ < max) { + effects.consume(code) + return value + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.js new file mode 100644 index 00000000000000..f73583584c37cc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.js @@ -0,0 +1,185 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var prefixSize = require('../util/prefix-size.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var codeFenced = { + name: 'codeFenced', + tokenize: tokenizeCodeFenced, + concrete: true +} + +function tokenizeCodeFenced(effects, ok, nok) { + var self = this + var closingFenceConstruct = {tokenize: tokenizeClosingFence, partial: true} + var initialPrefix = prefixSize(this.events, types.linePrefix) + var sizeOpen = 0 + var marker + + return start + + function start(code) { + assert__default['default']( + code === codes.graveAccent || code === codes.tilde, + 'expected `` ` `` or `~`' + ) + effects.enter(types.codeFenced) + effects.enter(types.codeFencedFence) + effects.enter(types.codeFencedFenceSequence) + marker = code + return sequenceOpen(code) + } + + function sequenceOpen(code) { + if (code === marker) { + effects.consume(code) + sizeOpen++ + return sequenceOpen + } + + effects.exit(types.codeFencedFenceSequence) + return sizeOpen < constants.codeFencedSequenceSizeMin + ? nok(code) + : factorySpace(effects, infoOpen, types.whitespace)(code) + } + + function infoOpen(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter(types.codeFencedFenceInfo) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return info(code) + } + + function info(code) { + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + effects.exit(types.chunkString) + effects.exit(types.codeFencedFenceInfo) + return factorySpace(effects, infoAfter, types.whitespace)(code) + } + + if (code === codes.graveAccent && code === marker) return nok(code) + effects.consume(code) + return info + } + + function infoAfter(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter(types.codeFencedFenceMeta) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return meta(code) + } + + function meta(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.chunkString) + effects.exit(types.codeFencedFenceMeta) + return openAfter(code) + } + + if (code === codes.graveAccent && code === marker) return nok(code) + effects.consume(code) + return meta + } + + function openAfter(code) { + effects.exit(types.codeFencedFence) + return self.interrupt ? ok(code) : content(code) + } + + function content(code) { + if (code === codes.eof) { + return after(code) + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return effects.attempt( + closingFenceConstruct, + after, + initialPrefix + ? factorySpace(effects, content, types.linePrefix, initialPrefix + 1) + : content + ) + } + + effects.enter(types.codeFlowValue) + return contentContinue(code) + } + + function contentContinue(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFlowValue) + return content(code) + } + + effects.consume(code) + return contentContinue + } + + function after(code) { + effects.exit(types.codeFenced) + return ok(code) + } + + function tokenizeClosingFence(effects, ok, nok) { + var size = 0 + + return factorySpace( + effects, + closingSequenceStart, + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) + + function closingSequenceStart(code) { + effects.enter(types.codeFencedFence) + effects.enter(types.codeFencedFenceSequence) + return closingSequence(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return closingSequence + } + + if (size < sizeOpen) return nok(code) + effects.exit(types.codeFencedFenceSequence) + return factorySpace(effects, closingSequenceEnd, types.whitespace)(code) + } + + function closingSequenceEnd(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFencedFence) + return ok(code) + } + + return nok(code) + } + } +} + +module.exports = codeFenced diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.mjs new file mode 100644 index 00000000000000..14f83b1fdd470a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-fenced.mjs @@ -0,0 +1,176 @@ +var codeFenced = { + name: 'codeFenced', + tokenize: tokenizeCodeFenced, + concrete: true +} +export default codeFenced + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import prefixSize from '../util/prefix-size.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizeCodeFenced(effects, ok, nok) { + var self = this + var closingFenceConstruct = {tokenize: tokenizeClosingFence, partial: true} + var initialPrefix = prefixSize(this.events, types.linePrefix) + var sizeOpen = 0 + var marker + + return start + + function start(code) { + assert( + code === codes.graveAccent || code === codes.tilde, + 'expected `` ` `` or `~`' + ) + effects.enter(types.codeFenced) + effects.enter(types.codeFencedFence) + effects.enter(types.codeFencedFenceSequence) + marker = code + return sequenceOpen(code) + } + + function sequenceOpen(code) { + if (code === marker) { + effects.consume(code) + sizeOpen++ + return sequenceOpen + } + + effects.exit(types.codeFencedFenceSequence) + return sizeOpen < constants.codeFencedSequenceSizeMin + ? nok(code) + : spaceFactory(effects, infoOpen, types.whitespace)(code) + } + + function infoOpen(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter(types.codeFencedFenceInfo) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return info(code) + } + + function info(code) { + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + effects.exit(types.chunkString) + effects.exit(types.codeFencedFenceInfo) + return spaceFactory(effects, infoAfter, types.whitespace)(code) + } + + if (code === codes.graveAccent && code === marker) return nok(code) + effects.consume(code) + return info + } + + function infoAfter(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return openAfter(code) + } + + effects.enter(types.codeFencedFenceMeta) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return meta(code) + } + + function meta(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.chunkString) + effects.exit(types.codeFencedFenceMeta) + return openAfter(code) + } + + if (code === codes.graveAccent && code === marker) return nok(code) + effects.consume(code) + return meta + } + + function openAfter(code) { + effects.exit(types.codeFencedFence) + return self.interrupt ? ok(code) : content(code) + } + + function content(code) { + if (code === codes.eof) { + return after(code) + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return effects.attempt( + closingFenceConstruct, + after, + initialPrefix + ? spaceFactory(effects, content, types.linePrefix, initialPrefix + 1) + : content + ) + } + + effects.enter(types.codeFlowValue) + return contentContinue(code) + } + + function contentContinue(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFlowValue) + return content(code) + } + + effects.consume(code) + return contentContinue + } + + function after(code) { + effects.exit(types.codeFenced) + return ok(code) + } + + function tokenizeClosingFence(effects, ok, nok) { + var size = 0 + + return spaceFactory( + effects, + closingSequenceStart, + types.linePrefix, + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) + + function closingSequenceStart(code) { + effects.enter(types.codeFencedFence) + effects.enter(types.codeFencedFenceSequence) + return closingSequence(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return closingSequence + } + + if (size < sizeOpen) return nok(code) + effects.exit(types.codeFencedFenceSequence) + return spaceFactory(effects, closingSequenceEnd, types.whitespace)(code) + } + + function closingSequenceEnd(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFencedFence) + return ok(code) + } + + return nok(code) + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.js new file mode 100644 index 00000000000000..8725366d26fd4e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.js @@ -0,0 +1,91 @@ +'use strict' + +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var chunkedSplice = require('../util/chunked-splice.js') +var prefixSize = require('../util/prefix-size.js') +var factorySpace = require('./factory-space.js') + +var codeIndented = { + name: 'codeIndented', + tokenize: tokenizeCodeIndented, + resolve: resolveCodeIndented +} + +var indentedContentConstruct = { + tokenize: tokenizeIndentedContent, + partial: true +} + +function resolveCodeIndented(events, context) { + var code = { + type: types.codeIndented, + start: events[0][1].start, + end: events[events.length - 1][1].end + } + + chunkedSplice(events, 0, 0, [['enter', code, context]]) + chunkedSplice(events, events.length, 0, [['exit', code, context]]) + + return events +} + +function tokenizeCodeIndented(effects, ok, nok) { + return effects.attempt(indentedContentConstruct, afterPrefix, nok) + + function afterPrefix(code) { + if (code === codes.eof) { + return ok(code) + } + + if (markdownLineEnding(code)) { + return effects.attempt(indentedContentConstruct, afterPrefix, ok)(code) + } + + effects.enter(types.codeFlowValue) + return content(code) + } + + function content(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFlowValue) + return afterPrefix(code) + } + + effects.consume(code) + return content + } +} + +function tokenizeIndentedContent(effects, ok, nok) { + var self = this + + return factorySpace( + effects, + afterPrefix, + types.linePrefix, + constants.tabSize + 1 + ) + + function afterPrefix(code) { + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace( + effects, + afterPrefix, + types.linePrefix, + constants.tabSize + 1 + ) + } + + return prefixSize(self.events, types.linePrefix) < constants.tabSize + ? nok(code) + : ok(code) + } +} + +module.exports = codeIndented diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.mjs new file mode 100644 index 00000000000000..91919141418475 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-indented.mjs @@ -0,0 +1,88 @@ +var codeIndented = { + name: 'codeIndented', + tokenize: tokenizeCodeIndented, + resolve: resolveCodeIndented +} +export default codeIndented + +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import chunkedSplice from '../util/chunked-splice.mjs' +import prefixSize from '../util/prefix-size.mjs' +import spaceFactory from './factory-space.mjs' + +var indentedContentConstruct = { + tokenize: tokenizeIndentedContent, + partial: true +} + +function resolveCodeIndented(events, context) { + var code = { + type: types.codeIndented, + start: events[0][1].start, + end: events[events.length - 1][1].end + } + + chunkedSplice(events, 0, 0, [['enter', code, context]]) + chunkedSplice(events, events.length, 0, [['exit', code, context]]) + + return events +} + +function tokenizeCodeIndented(effects, ok, nok) { + return effects.attempt(indentedContentConstruct, afterPrefix, nok) + + function afterPrefix(code) { + if (code === codes.eof) { + return ok(code) + } + + if (markdownLineEnding(code)) { + return effects.attempt(indentedContentConstruct, afterPrefix, ok)(code) + } + + effects.enter(types.codeFlowValue) + return content(code) + } + + function content(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.codeFlowValue) + return afterPrefix(code) + } + + effects.consume(code) + return content + } +} + +function tokenizeIndentedContent(effects, ok, nok) { + var self = this + + return spaceFactory( + effects, + afterPrefix, + types.linePrefix, + constants.tabSize + 1 + ) + + function afterPrefix(code) { + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory( + effects, + afterPrefix, + types.linePrefix, + constants.tabSize + 1 + ) + } + + return prefixSize(self.events, types.linePrefix) < constants.tabSize + ? nok(code) + : ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.js new file mode 100644 index 00000000000000..0eb1db81f1bb0f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.js @@ -0,0 +1,191 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var codeText = { + name: 'codeText', + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous: previous +} + +function resolveCodeText(events) { + var tailExitIndex = events.length - 4 + var headEnterIndex = 3 + var index + var enter + + // If we start and end with an EOL or a space. + if ( + (events[headEnterIndex][1].type === types.lineEnding || + events[headEnterIndex][1].type === 'space') && + (events[tailExitIndex][1].type === types.lineEnding || + events[tailExitIndex][1].type === 'space') + ) { + index = headEnterIndex + + // And we have data. + while (++index < tailExitIndex) { + if (events[index][1].type === types.codeTextData) { + // Then we have padding. + events[tailExitIndex][1].type = events[headEnterIndex][1].type = + types.codeTextPadding + headEnterIndex += 2 + tailExitIndex -= 2 + break + } + } + } + + // Merge adjacent spaces and data. + index = headEnterIndex - 1 + tailExitIndex++ + + while (++index <= tailExitIndex) { + if (enter === undefined) { + if ( + index !== tailExitIndex && + events[index][1].type !== types.lineEnding + ) { + enter = index + } + } else if ( + index === tailExitIndex || + events[index][1].type === types.lineEnding + ) { + events[enter][1].type = types.codeTextData + + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + tailExitIndex -= index - enter - 2 + index = enter + 2 + } + + enter = undefined + } + } + + return events +} + +function previous(code) { + // If there is a previous code, there will always be a tail. + return ( + code !== codes.graveAccent || + this.events[this.events.length - 1][1].type === types.characterEscape + ) +} + +function tokenizeCodeText(effects, ok, nok) { + var self = this + var sizeOpen = 0 + var size + var token + + return start + + function start(code) { + assert__default['default'](code === codes.graveAccent, 'expected `` ` ``') + assert__default['default']( + previous.call(self, self.previous), + 'expected correct previous' + ) + effects.enter(types.codeText) + effects.enter(types.codeTextSequence) + return openingSequence(code) + } + + function openingSequence(code) { + if (code === codes.graveAccent) { + effects.consume(code) + sizeOpen++ + return openingSequence + } + + effects.exit(types.codeTextSequence) + return gap(code) + } + + function gap(code) { + // EOF. + if (code === codes.eof) { + return nok(code) + } + + // Closing fence? + // Could also be data. + if (code === codes.graveAccent) { + token = effects.enter(types.codeTextSequence) + size = 0 + return closingSequence(code) + } + + // Tabs don’t work, and virtual spaces don’t make sense. + if (code === codes.space) { + effects.enter('space') + effects.consume(code) + effects.exit('space') + return gap + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return gap + } + + // Data. + effects.enter(types.codeTextData) + return data(code) + } + + // In code. + function data(code) { + if ( + code === codes.eof || + code === codes.space || + code === codes.graveAccent || + markdownLineEnding(code) + ) { + effects.exit(types.codeTextData) + return gap(code) + } + + effects.consume(code) + return data + } + + // Closing fence. + function closingSequence(code) { + // More. + if (code === codes.graveAccent) { + effects.consume(code) + size++ + return closingSequence + } + + // Done! + if (size === sizeOpen) { + effects.exit(types.codeTextSequence) + effects.exit(types.codeText) + return ok(code) + } + + // More or less accents: mark as data. + token.type = types.codeTextData + return data(code) + } +} + +module.exports = codeText diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.mjs new file mode 100644 index 00000000000000..7c44b65949bb8c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/code-text.mjs @@ -0,0 +1,179 @@ +var codeText = { + name: 'codeText', + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous: previous +} +export default codeText + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' + +function resolveCodeText(events) { + var tailExitIndex = events.length - 4 + var headEnterIndex = 3 + var index + var enter + + // If we start and end with an EOL or a space. + if ( + (events[headEnterIndex][1].type === types.lineEnding || + events[headEnterIndex][1].type === 'space') && + (events[tailExitIndex][1].type === types.lineEnding || + events[tailExitIndex][1].type === 'space') + ) { + index = headEnterIndex + + // And we have data. + while (++index < tailExitIndex) { + if (events[index][1].type === types.codeTextData) { + // Then we have padding. + events[tailExitIndex][1].type = events[headEnterIndex][1].type = + types.codeTextPadding + headEnterIndex += 2 + tailExitIndex -= 2 + break + } + } + } + + // Merge adjacent spaces and data. + index = headEnterIndex - 1 + tailExitIndex++ + + while (++index <= tailExitIndex) { + if (enter === undefined) { + if ( + index !== tailExitIndex && + events[index][1].type !== types.lineEnding + ) { + enter = index + } + } else if ( + index === tailExitIndex || + events[index][1].type === types.lineEnding + ) { + events[enter][1].type = types.codeTextData + + if (index !== enter + 2) { + events[enter][1].end = events[index - 1][1].end + events.splice(enter + 2, index - enter - 2) + tailExitIndex -= index - enter - 2 + index = enter + 2 + } + + enter = undefined + } + } + + return events +} + +function previous(code) { + // If there is a previous code, there will always be a tail. + return ( + code !== codes.graveAccent || + this.events[this.events.length - 1][1].type === types.characterEscape + ) +} + +function tokenizeCodeText(effects, ok, nok) { + var self = this + var sizeOpen = 0 + var size + var token + + return start + + function start(code) { + assert(code === codes.graveAccent, 'expected `` ` ``') + assert(previous.call(self, self.previous), 'expected correct previous') + effects.enter(types.codeText) + effects.enter(types.codeTextSequence) + return openingSequence(code) + } + + function openingSequence(code) { + if (code === codes.graveAccent) { + effects.consume(code) + sizeOpen++ + return openingSequence + } + + effects.exit(types.codeTextSequence) + return gap(code) + } + + function gap(code) { + // EOF. + if (code === codes.eof) { + return nok(code) + } + + // Closing fence? + // Could also be data. + if (code === codes.graveAccent) { + token = effects.enter(types.codeTextSequence) + size = 0 + return closingSequence(code) + } + + // Tabs don’t work, and virtual spaces don’t make sense. + if (code === codes.space) { + effects.enter('space') + effects.consume(code) + effects.exit('space') + return gap + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return gap + } + + // Data. + effects.enter(types.codeTextData) + return data(code) + } + + // In code. + function data(code) { + if ( + code === codes.eof || + code === codes.space || + code === codes.graveAccent || + markdownLineEnding(code) + ) { + effects.exit(types.codeTextData) + return gap(code) + } + + effects.consume(code) + return data + } + + // Closing fence. + function closingSequence(code) { + // More. + if (code === codes.graveAccent) { + effects.consume(code) + size++ + return closingSequence + } + + // Done! + if (size === sizeOpen) { + effects.exit(types.codeTextSequence) + effects.exit(types.codeText) + return ok(code) + } + + // More or less accents: mark as data. + token.type = types.codeTextData + return data(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.js new file mode 100644 index 00000000000000..cb763ec50f7514 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.js @@ -0,0 +1,121 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var prefixSize = require('../util/prefix-size.js') +var subtokenize = require('../util/subtokenize.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +// No name because it must not be turned off. +var content = { + tokenize: tokenizeContent, + resolve: resolveContent, + interruptible: true, + lazy: true +} + +var continuationConstruct = {tokenize: tokenizeContinuation, partial: true} + +// Content is transparent: it’s parsed right now. That way, definitions are also +// parsed right now: before text in paragraphs (specifically, media) are parsed. +function resolveContent(events) { + subtokenize(events) + return events +} + +function tokenizeContent(effects, ok) { + var previous + + return start + + function start(code) { + assert__default['default']( + code !== codes.eof && !markdownLineEnding(code), + 'expected no eof or eol' + ) + + effects.enter(types.content) + previous = effects.enter(types.chunkContent, { + contentType: constants.contentTypeContent + }) + return data(code) + } + + function data(code) { + if (code === codes.eof) { + return contentEnd(code) + } + + if (markdownLineEnding(code)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code) + } + + // Data. + effects.consume(code) + return data + } + + function contentEnd(code) { + effects.exit(types.chunkContent) + effects.exit(types.content) + return ok(code) + } + + function contentContinue(code) { + assert__default['default'](markdownLineEnding(code), 'expected eol') + effects.consume(code) + effects.exit(types.chunkContent) + previous = previous.next = effects.enter(types.chunkContent, { + contentType: constants.contentTypeContent, + previous: previous + }) + return data + } +} + +function tokenizeContinuation(effects, ok, nok) { + var self = this + + return startLookahead + + function startLookahead(code) { + assert__default['default']( + markdownLineEnding(code), + 'expected a line ending' + ) + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace(effects, prefixed, types.linePrefix) + } + + function prefixed(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return nok(code) + } + + if ( + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 || + prefixSize(self.events, types.linePrefix) < constants.tabSize + ) { + return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) + } + + return ok(code) + } +} + +module.exports = content diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.mjs new file mode 100644 index 00000000000000..ca9c2e15b610a4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/content.mjs @@ -0,0 +1,109 @@ +// No name because it must not be turned off. +var content = { + tokenize: tokenizeContent, + resolve: resolveContent, + interruptible: true, + lazy: true +} +export default content + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import prefixSize from '../util/prefix-size.mjs' +import subtokenize from '../util/subtokenize.mjs' +import spaceFactory from './factory-space.mjs' + +var continuationConstruct = {tokenize: tokenizeContinuation, partial: true} + +// Content is transparent: it’s parsed right now. That way, definitions are also +// parsed right now: before text in paragraphs (specifically, media) are parsed. +function resolveContent(events) { + subtokenize(events) + return events +} + +function tokenizeContent(effects, ok) { + var previous + + return start + + function start(code) { + assert( + code !== codes.eof && !markdownLineEnding(code), + 'expected no eof or eol' + ) + + effects.enter(types.content) + previous = effects.enter(types.chunkContent, { + contentType: constants.contentTypeContent + }) + return data(code) + } + + function data(code) { + if (code === codes.eof) { + return contentEnd(code) + } + + if (markdownLineEnding(code)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code) + } + + // Data. + effects.consume(code) + return data + } + + function contentEnd(code) { + effects.exit(types.chunkContent) + effects.exit(types.content) + return ok(code) + } + + function contentContinue(code) { + assert(markdownLineEnding(code), 'expected eol') + effects.consume(code) + effects.exit(types.chunkContent) + previous = previous.next = effects.enter(types.chunkContent, { + contentType: constants.contentTypeContent, + previous: previous + }) + return data + } +} + +function tokenizeContinuation(effects, ok, nok) { + var self = this + + return startLookahead + + function startLookahead(code) { + assert(markdownLineEnding(code), 'expected a line ending') + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory(effects, prefixed, types.linePrefix) + } + + function prefixed(code) { + if (code === codes.eof || markdownLineEnding(code)) { + return nok(code) + } + + if ( + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 || + prefixSize(self.events, types.linePrefix) < constants.tabSize + ) { + return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) + } + + return ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.js new file mode 100644 index 00000000000000..c4604d578372e3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.js @@ -0,0 +1,129 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var types = require('../constant/types.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var factoryDestination = require('./factory-destination.js') +var factoryLabel = require('./factory-label.js') +var factorySpace = require('./factory-space.js') +var factoryWhitespace = require('./factory-whitespace.js') +var factoryTitle = require('./factory-title.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var definition = { + name: 'definition', + tokenize: tokenizeDefinition +} + +var titleConstruct = {tokenize: tokenizeTitle, partial: true} + +function tokenizeDefinition(effects, ok, nok) { + var self = this + var identifier + + return start + + function start(code) { + assert__default['default'](code === codes.leftSquareBracket, 'expected `[`') + effects.enter(types.definition) + return factoryLabel.call( + self, + effects, + labelAfter, + nok, + types.definitionLabel, + types.definitionLabelMarker, + types.definitionLabelString + )(code) + } + + function labelAfter(code) { + identifier = normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + + if (code === codes.colon) { + effects.enter(types.definitionMarker) + effects.consume(code) + effects.exit(types.definitionMarker) + + // Note: blank lines can’t exist in content. + return factoryWhitespace( + effects, + factoryDestination( + effects, + effects.attempt( + titleConstruct, + factorySpace(effects, after, types.whitespace), + factorySpace(effects, after, types.whitespace) + ), + nok, + types.definitionDestination, + types.definitionDestinationLiteral, + types.definitionDestinationLiteralMarker, + types.definitionDestinationRaw, + types.definitionDestinationString + ) + ) + } + + return nok(code) + } + + function after(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.definition) + + if (self.parser.defined.indexOf(identifier) < 0) { + self.parser.defined.push(identifier) + } + + return ok(code) + } + + return nok(code) + } +} + +function tokenizeTitle(effects, ok, nok) { + return start + + function start(code) { + return markdownLineEndingOrSpace(code) + ? factoryWhitespace(effects, before)(code) + : nok(code) + } + + function before(code) { + if ( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis + ) { + return factoryTitle( + effects, + factorySpace(effects, after, types.whitespace), + nok, + types.definitionTitle, + types.definitionTitleMarker, + types.definitionTitleString + )(code) + } + + return nok(code) + } + + function after(code) { + return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code) + } +} + +module.exports = definition diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.mjs new file mode 100644 index 00000000000000..5cc0dde8066d9e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/definition.mjs @@ -0,0 +1,120 @@ +var definition = { + name: 'definition', + tokenize: tokenizeDefinition +} +export default definition + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import types from '../constant/types.mjs' +import normalizeIdentifier from '../util/normalize-identifier.mjs' +import destinationFactory from './factory-destination.mjs' +import labelFactory from './factory-label.mjs' +import spaceFactory from './factory-space.mjs' +import whitespaceFactory from './factory-whitespace.mjs' +import titleFactory from './factory-title.mjs' + +var titleConstruct = {tokenize: tokenizeTitle, partial: true} + +function tokenizeDefinition(effects, ok, nok) { + var self = this + var identifier + + return start + + function start(code) { + assert(code === codes.leftSquareBracket, 'expected `[`') + effects.enter(types.definition) + return labelFactory.call( + self, + effects, + labelAfter, + nok, + types.definitionLabel, + types.definitionLabelMarker, + types.definitionLabelString + )(code) + } + + function labelAfter(code) { + identifier = normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + + if (code === codes.colon) { + effects.enter(types.definitionMarker) + effects.consume(code) + effects.exit(types.definitionMarker) + + // Note: blank lines can’t exist in content. + return whitespaceFactory( + effects, + destinationFactory( + effects, + effects.attempt( + titleConstruct, + spaceFactory(effects, after, types.whitespace), + spaceFactory(effects, after, types.whitespace) + ), + nok, + types.definitionDestination, + types.definitionDestinationLiteral, + types.definitionDestinationLiteralMarker, + types.definitionDestinationRaw, + types.definitionDestinationString + ) + ) + } + + return nok(code) + } + + function after(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.definition) + + if (self.parser.defined.indexOf(identifier) < 0) { + self.parser.defined.push(identifier) + } + + return ok(code) + } + + return nok(code) + } +} + +function tokenizeTitle(effects, ok, nok) { + return start + + function start(code) { + return markdownLineEndingOrSpace(code) + ? whitespaceFactory(effects, before)(code) + : nok(code) + } + + function before(code) { + if ( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis + ) { + return titleFactory( + effects, + spaceFactory(effects, after, types.whitespace), + nok, + types.definitionTitle, + types.definitionTitleMarker, + types.definitionTitleString + )(code) + } + + return nok(code) + } + + function after(code) { + return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.js new file mode 100644 index 00000000000000..d746cd01d2395d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.js @@ -0,0 +1,145 @@ +'use strict' + +var asciiControl = require('../character/ascii-control.js') +var codes = require('../character/codes.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') + +// eslint-disable-next-line max-params +function destinationFactory( + effects, + ok, + nok, + type, + literalType, + literalMarkerType, + rawType, + stringType, + max +) { + var limit = max || Infinity + var balance = 0 + + return start + + function start(code) { + if (code === codes.lessThan) { + effects.enter(type) + effects.enter(literalType) + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + return destinationEnclosedBefore + } + + if (asciiControl(code) || code === codes.rightParenthesis) { + return nok(code) + } + + effects.enter(type) + effects.enter(rawType) + effects.enter(stringType) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return destinationRaw(code) + } + + function destinationEnclosedBefore(code) { + if (code === codes.greaterThan) { + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + effects.exit(literalType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return destinationEnclosed(code) + } + + function destinationEnclosed(code) { + if (code === codes.greaterThan) { + effects.exit(types.chunkString) + effects.exit(stringType) + return destinationEnclosedBefore(code) + } + + if ( + code === codes.eof || + code === codes.lessThan || + markdownLineEnding(code) + ) { + return nok(code) + } + + effects.consume(code) + return code === codes.backslash + ? destinationEnclosedEscape + : destinationEnclosed + } + + function destinationEnclosedEscape(code) { + if ( + code === codes.lessThan || + code === codes.greaterThan || + code === codes.backslash + ) { + effects.consume(code) + return destinationEnclosed + } + + return destinationEnclosed(code) + } + + function destinationRaw(code) { + if (code === codes.leftParenthesis) { + if (++balance > limit) return nok(code) + effects.consume(code) + return destinationRaw + } + + if (code === codes.rightParenthesis) { + if (!balance--) { + effects.exit(types.chunkString) + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + effects.consume(code) + return destinationRaw + } + + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + if (balance) return nok(code) + effects.exit(types.chunkString) + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + if (asciiControl(code)) return nok(code) + effects.consume(code) + return code === codes.backslash ? destinationRawEscape : destinationRaw + } + + function destinationRawEscape(code) { + if ( + code === codes.leftParenthesis || + code === codes.rightParenthesis || + code === codes.backslash + ) { + effects.consume(code) + return destinationRaw + } + + return destinationRaw(code) + } +} + +module.exports = destinationFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.mjs new file mode 100644 index 00000000000000..be8cf2bd89b17c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-destination.mjs @@ -0,0 +1,143 @@ +export default destinationFactory + +import asciiControl from '../character/ascii-control.mjs' +import codes from '../character/codes.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' + +// eslint-disable-next-line max-params +function destinationFactory( + effects, + ok, + nok, + type, + literalType, + literalMarkerType, + rawType, + stringType, + max +) { + var limit = max || Infinity + var balance = 0 + + return start + + function start(code) { + if (code === codes.lessThan) { + effects.enter(type) + effects.enter(literalType) + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + return destinationEnclosedBefore + } + + if (asciiControl(code) || code === codes.rightParenthesis) { + return nok(code) + } + + effects.enter(type) + effects.enter(rawType) + effects.enter(stringType) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return destinationRaw(code) + } + + function destinationEnclosedBefore(code) { + if (code === codes.greaterThan) { + effects.enter(literalMarkerType) + effects.consume(code) + effects.exit(literalMarkerType) + effects.exit(literalType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return destinationEnclosed(code) + } + + function destinationEnclosed(code) { + if (code === codes.greaterThan) { + effects.exit(types.chunkString) + effects.exit(stringType) + return destinationEnclosedBefore(code) + } + + if ( + code === codes.eof || + code === codes.lessThan || + markdownLineEnding(code) + ) { + return nok(code) + } + + effects.consume(code) + return code === codes.backslash + ? destinationEnclosedEscape + : destinationEnclosed + } + + function destinationEnclosedEscape(code) { + if ( + code === codes.lessThan || + code === codes.greaterThan || + code === codes.backslash + ) { + effects.consume(code) + return destinationEnclosed + } + + return destinationEnclosed(code) + } + + function destinationRaw(code) { + if (code === codes.leftParenthesis) { + if (++balance > limit) return nok(code) + effects.consume(code) + return destinationRaw + } + + if (code === codes.rightParenthesis) { + if (!balance--) { + effects.exit(types.chunkString) + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + effects.consume(code) + return destinationRaw + } + + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + if (balance) return nok(code) + effects.exit(types.chunkString) + effects.exit(stringType) + effects.exit(rawType) + effects.exit(type) + return ok(code) + } + + if (asciiControl(code)) return nok(code) + effects.consume(code) + return code === codes.backslash ? destinationRawEscape : destinationRaw + } + + function destinationRawEscape(code) { + if ( + code === codes.leftParenthesis || + code === codes.rightParenthesis || + code === codes.backslash + ) { + effects.consume(code) + return destinationRaw + } + + return destinationRaw(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.js new file mode 100644 index 00000000000000..64d96d78eae094 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.js @@ -0,0 +1,102 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +// eslint-disable-next-line max-params +function labelFactory(effects, ok, nok, type, markerType, stringType) { + var self = this + var size = 0 + var data + + return start + + function start(code) { + assert__default['default'](code === codes.leftSquareBracket, 'expected `[`') + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.enter(stringType) + return atBreak + } + + function atBreak(code) { + if ( + code === codes.eof || + code === codes.leftSquareBracket || + (code === codes.rightSquareBracket && !data) || + /* c8 ignore next */ + (code === codes.caret && + /* c8 ignore next */ + !size && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs) || + size > constants.linkReferenceSizeMax + ) { + return nok(code) + } + + if (code === codes.rightSquareBracket) { + effects.exit(stringType) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return atBreak + } + + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return label(code) + } + + function label(code) { + if ( + code === codes.eof || + code === codes.leftSquareBracket || + code === codes.rightSquareBracket || + markdownLineEnding(code) || + size++ > constants.linkReferenceSizeMax + ) { + effects.exit(types.chunkString) + return atBreak(code) + } + + effects.consume(code) + data = data || !markdownSpace(code) + return code === codes.backslash ? labelEscape : label + } + + function labelEscape(code) { + if ( + code === codes.leftSquareBracket || + code === codes.backslash || + code === codes.rightSquareBracket + ) { + effects.consume(code) + size++ + return label + } + + return label(code) + } +} + +module.exports = labelFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.mjs new file mode 100644 index 00000000000000..eccdbd5b38ee3d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-label.mjs @@ -0,0 +1,94 @@ +export default labelFactory + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' + +// eslint-disable-next-line max-params +function labelFactory(effects, ok, nok, type, markerType, stringType) { + var self = this + var size = 0 + var data + + return start + + function start(code) { + assert(code === codes.leftSquareBracket, 'expected `[`') + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.enter(stringType) + return atBreak + } + + function atBreak(code) { + if ( + code === codes.eof || + code === codes.leftSquareBracket || + (code === codes.rightSquareBracket && !data) || + /* c8 ignore next */ + (code === codes.caret && + /* c8 ignore next */ + !size && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs) || + size > constants.linkReferenceSizeMax + ) { + return nok(code) + } + + if (code === codes.rightSquareBracket) { + effects.exit(stringType) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return atBreak + } + + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return label(code) + } + + function label(code) { + if ( + code === codes.eof || + code === codes.leftSquareBracket || + code === codes.rightSquareBracket || + markdownLineEnding(code) || + size++ > constants.linkReferenceSizeMax + ) { + effects.exit(types.chunkString) + return atBreak(code) + } + + effects.consume(code) + data = data || !markdownSpace(code) + return code === codes.backslash ? labelEscape : label + } + + function labelEscape(code) { + if ( + code === codes.leftSquareBracket || + code === codes.backslash || + code === codes.rightSquareBracket + ) { + effects.consume(code) + size++ + return label + } + + return label(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.js new file mode 100644 index 00000000000000..d907c5dca8ee94 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.js @@ -0,0 +1,31 @@ +'use strict' + +var markdownSpace = require('../character/markdown-space.js') + +function spaceFactory(effects, ok, type, max) { + var limit = max ? max - 1 : Infinity + var size = 0 + + return start + + function start(code) { + if (markdownSpace(code)) { + effects.enter(type) + return prefix(code) + } + + return ok(code) + } + + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code) + return prefix + } + + effects.exit(type) + return ok(code) + } +} + +module.exports = spaceFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.mjs new file mode 100644 index 00000000000000..9668400d30f44d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-space.mjs @@ -0,0 +1,29 @@ +export default spaceFactory + +import markdownSpace from '../character/markdown-space.mjs' + +function spaceFactory(effects, ok, type, max) { + var limit = max ? max - 1 : Infinity + var size = 0 + + return start + + function start(code) { + if (markdownSpace(code)) { + effects.enter(type) + return prefix(code) + } + + return ok(code) + } + + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code) + return prefix + } + + effects.exit(type) + return ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.js new file mode 100644 index 00000000000000..a5d6349b9cec29 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.js @@ -0,0 +1,92 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +// eslint-disable-next-line max-params +function titleFactory(effects, ok, nok, type, markerType, stringType) { + var marker + + return start + + function start(code) { + assert__default['default']( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis, + 'expected `"`, `\'`, or `(`' + ) + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + marker = code === codes.leftParenthesis ? codes.rightParenthesis : code + return atFirstTitleBreak + } + + function atFirstTitleBreak(code) { + if (code === marker) { + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + return atTitleBreak(code) + } + + function atTitleBreak(code) { + if (code === marker) { + effects.exit(stringType) + return atFirstTitleBreak(marker) + } + + if (code === codes.eof) { + return nok(code) + } + + // Note: blank lines can’t exist in content. + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace(effects, atTitleBreak, types.linePrefix) + } + + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return title(code) + } + + function title(code) { + if (code === marker || code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.chunkString) + return atTitleBreak(code) + } + + effects.consume(code) + return code === codes.backslash ? titleEscape : title + } + + function titleEscape(code) { + if (code === marker || code === codes.backslash) { + effects.consume(code) + return title + } + + return title(code) + } +} + +module.exports = titleFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.mjs new file mode 100644 index 00000000000000..5ac4405e4a7f3b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-title.mjs @@ -0,0 +1,84 @@ +export default titleFactory + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +// eslint-disable-next-line max-params +function titleFactory(effects, ok, nok, type, markerType, stringType) { + var marker + + return start + + function start(code) { + assert( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis, + 'expected `"`, `\'`, or `(`' + ) + effects.enter(type) + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + marker = code === codes.leftParenthesis ? codes.rightParenthesis : code + return atFirstTitleBreak + } + + function atFirstTitleBreak(code) { + if (code === marker) { + effects.enter(markerType) + effects.consume(code) + effects.exit(markerType) + effects.exit(type) + return ok + } + + effects.enter(stringType) + return atTitleBreak(code) + } + + function atTitleBreak(code) { + if (code === marker) { + effects.exit(stringType) + return atFirstTitleBreak(marker) + } + + if (code === codes.eof) { + return nok(code) + } + + // Note: blank lines can’t exist in content. + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory(effects, atTitleBreak, types.linePrefix) + } + + effects.enter(types.chunkString, {contentType: constants.contentTypeString}) + return title(code) + } + + function title(code) { + if (code === marker || code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.chunkString) + return atTitleBreak(code) + } + + effects.consume(code) + return code === codes.backslash ? titleEscape : title + } + + function titleEscape(code) { + if (code === marker || code === codes.backslash) { + effects.consume(code) + return title + } + + return title(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.js new file mode 100644 index 00000000000000..ae0ce966794469 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.js @@ -0,0 +1,34 @@ +'use strict' + +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +function whitespaceFactory(effects, ok) { + var seen + + return start + + function start(code) { + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + seen = true + return start + } + + if (markdownSpace(code)) { + return factorySpace( + effects, + start, + seen ? types.linePrefix : types.lineSuffix + )(code) + } + + return ok(code) + } +} + +module.exports = whitespaceFactory diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.mjs new file mode 100644 index 00000000000000..8bea8fd224b019 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/factory-whitespace.mjs @@ -0,0 +1,32 @@ +export default whitespaceFactory + +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function whitespaceFactory(effects, ok) { + var seen + + return start + + function start(code) { + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + seen = true + return start + } + + if (markdownSpace(code)) { + return spaceFactory( + effects, + start, + seen ? types.linePrefix : types.lineSuffix + )(code) + } + + return ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.js new file mode 100644 index 00000000000000..38955ecabc898e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.js @@ -0,0 +1,41 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var hardBreakEscape = { + name: 'hardBreakEscape', + tokenize: tokenizeHardBreakEscape +} + +function tokenizeHardBreakEscape(effects, ok, nok) { + return start + + function start(code) { + assert__default['default'](code === codes.backslash, 'expected `\\`') + effects.enter(types.hardBreakEscape) + effects.enter(types.escapeMarker) + effects.consume(code) + return open + } + + function open(code) { + if (markdownLineEnding(code)) { + effects.exit(types.escapeMarker) + effects.exit(types.hardBreakEscape) + return ok(code) + } + + return nok(code) + } +} + +module.exports = hardBreakEscape diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.mjs new file mode 100644 index 00000000000000..0b23062d17d420 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/hard-break-escape.mjs @@ -0,0 +1,32 @@ +var hardBreakEscape = { + name: 'hardBreakEscape', + tokenize: tokenizeHardBreakEscape +} +export default hardBreakEscape + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' + +function tokenizeHardBreakEscape(effects, ok, nok) { + return start + + function start(code) { + assert(code === codes.backslash, 'expected `\\`') + effects.enter(types.hardBreakEscape) + effects.enter(types.escapeMarker) + effects.consume(code) + return open + } + + function open(code) { + if (markdownLineEnding(code)) { + effects.exit(types.escapeMarker) + effects.exit(types.hardBreakEscape) + return ok(code) + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.js new file mode 100644 index 00000000000000..a3bfd060948d2a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.js @@ -0,0 +1,151 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var chunkedSplice = require('../util/chunked-splice.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var headingAtx = { + name: 'headingAtx', + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +} + +function resolveHeadingAtx(events, context) { + var contentEnd = events.length - 2 + var contentStart = 3 + var content + var text + + // Prefix whitespace, part of the opening. + if (events[contentStart][1].type === types.whitespace) { + contentStart += 2 + } + + // Suffix whitespace, part of the closing. + if ( + contentEnd - 2 > contentStart && + events[contentEnd][1].type === types.whitespace + ) { + contentEnd -= 2 + } + + if ( + events[contentEnd][1].type === types.atxHeadingSequence && + (contentStart === contentEnd - 1 || + (contentEnd - 4 > contentStart && + events[contentEnd - 2][1].type === types.whitespace)) + ) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4 + } + + if (contentEnd > contentStart) { + content = { + type: types.atxHeadingText, + start: events[contentStart][1].start, + end: events[contentEnd][1].end + } + text = { + type: types.chunkText, + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: constants.contentTypeText + } + + chunkedSplice(events, contentStart, contentEnd - contentStart + 1, [ + ['enter', content, context], + ['enter', text, context], + ['exit', text, context], + ['exit', content, context] + ]) + } + + return events +} + +function tokenizeHeadingAtx(effects, ok, nok) { + var self = this + var size = 0 + + return start + + function start(code) { + assert__default['default'](code === codes.numberSign, 'expected `#`') + effects.enter(types.atxHeading) + effects.enter(types.atxHeadingSequence) + return fenceOpenInside(code) + } + + function fenceOpenInside(code) { + if ( + code === codes.numberSign && + size++ < constants.atxHeadingOpeningFenceSizeMax + ) { + effects.consume(code) + return fenceOpenInside + } + + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + effects.exit(types.atxHeadingSequence) + return self.interrupt ? ok(code) : headingBreak(code) + } + + return nok(code) + } + + function headingBreak(code) { + if (code === codes.numberSign) { + effects.enter(types.atxHeadingSequence) + return sequence(code) + } + + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.atxHeading) + return ok(code) + } + + if (markdownSpace(code)) { + return factorySpace(effects, headingBreak, types.whitespace)(code) + } + + effects.enter(types.atxHeadingText) + return data(code) + } + + function sequence(code) { + if (code === codes.numberSign) { + effects.consume(code) + return sequence + } + + effects.exit(types.atxHeadingSequence) + return headingBreak(code) + } + + function data(code) { + if ( + code === codes.eof || + code === codes.numberSign || + markdownLineEndingOrSpace(code) + ) { + effects.exit(types.atxHeadingText) + return headingBreak(code) + } + + effects.consume(code) + return data + } +} + +module.exports = headingAtx diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.mjs new file mode 100644 index 00000000000000..1a5ed07f42cbe0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/heading-atx.mjs @@ -0,0 +1,142 @@ +var headingAtx = { + name: 'headingAtx', + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +} +export default headingAtx + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import chunkedSplice from '../util/chunked-splice.mjs' +import spaceFactory from './factory-space.mjs' + +function resolveHeadingAtx(events, context) { + var contentEnd = events.length - 2 + var contentStart = 3 + var content + var text + + // Prefix whitespace, part of the opening. + if (events[contentStart][1].type === types.whitespace) { + contentStart += 2 + } + + // Suffix whitespace, part of the closing. + if ( + contentEnd - 2 > contentStart && + events[contentEnd][1].type === types.whitespace + ) { + contentEnd -= 2 + } + + if ( + events[contentEnd][1].type === types.atxHeadingSequence && + (contentStart === contentEnd - 1 || + (contentEnd - 4 > contentStart && + events[contentEnd - 2][1].type === types.whitespace)) + ) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4 + } + + if (contentEnd > contentStart) { + content = { + type: types.atxHeadingText, + start: events[contentStart][1].start, + end: events[contentEnd][1].end + } + text = { + type: types.chunkText, + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: constants.contentTypeText + } + + chunkedSplice(events, contentStart, contentEnd - contentStart + 1, [ + ['enter', content, context], + ['enter', text, context], + ['exit', text, context], + ['exit', content, context] + ]) + } + + return events +} + +function tokenizeHeadingAtx(effects, ok, nok) { + var self = this + var size = 0 + + return start + + function start(code) { + assert(code === codes.numberSign, 'expected `#`') + effects.enter(types.atxHeading) + effects.enter(types.atxHeadingSequence) + return fenceOpenInside(code) + } + + function fenceOpenInside(code) { + if ( + code === codes.numberSign && + size++ < constants.atxHeadingOpeningFenceSizeMax + ) { + effects.consume(code) + return fenceOpenInside + } + + if (code === codes.eof || markdownLineEndingOrSpace(code)) { + effects.exit(types.atxHeadingSequence) + return self.interrupt ? ok(code) : headingBreak(code) + } + + return nok(code) + } + + function headingBreak(code) { + if (code === codes.numberSign) { + effects.enter(types.atxHeadingSequence) + return sequence(code) + } + + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.atxHeading) + return ok(code) + } + + if (markdownSpace(code)) { + return spaceFactory(effects, headingBreak, types.whitespace)(code) + } + + effects.enter(types.atxHeadingText) + return data(code) + } + + function sequence(code) { + if (code === codes.numberSign) { + effects.consume(code) + return sequence + } + + effects.exit(types.atxHeadingSequence) + return headingBreak(code) + } + + function data(code) { + if ( + code === codes.eof || + code === codes.numberSign || + markdownLineEndingOrSpace(code) + ) { + effects.exit(types.atxHeadingText) + return headingBreak(code) + } + + effects.consume(code) + return data + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.js new file mode 100644 index 00000000000000..c6a894ff9c00bc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.js @@ -0,0 +1,513 @@ +'use strict' + +var assert = require('assert') +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var fromCharCode = require('../constant/from-char-code.js') +var htmlBlockNames = require('../constant/html-block-names.js') +var htmlRawNames = require('../constant/html-raw-names.js') +var types = require('../constant/types.js') +var partialBlankLine = require('./partial-blank-line.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var htmlFlow = { + name: 'htmlFlow', + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +} + +var nextBlankConstruct = {tokenize: tokenizeNextBlank, partial: true} + +function resolveToHtmlFlow(events) { + var index = events.length + + while (index--) { + if ( + events[index][0] === 'enter' && + events[index][1].type === types.htmlFlow + ) { + break + } + } + + if (index > 1 && events[index - 2][1].type === types.linePrefix) { + // Add the prefix start to the HTML token. + events[index][1].start = events[index - 2][1].start + // Add the prefix start to the HTML line token. + events[index + 1][1].start = events[index - 2][1].start + // Remove the line prefix. + events.splice(index - 2, 2) + } + + return events +} + +function tokenizeHtmlFlow(effects, ok, nok) { + var self = this + var kind + var startTag + var buffer + var index + var marker + + return start + + function start(code) { + assert__default['default'](code === codes.lessThan, 'expected `<`') + effects.enter(types.htmlFlow) + effects.enter(types.htmlFlowData) + effects.consume(code) + return open + } + + function open(code) { + if (code === codes.exclamationMark) { + effects.consume(code) + return declarationStart + } + + if (code === codes.slash) { + effects.consume(code) + return tagCloseStart + } + + if (code === codes.questionMark) { + effects.consume(code) + kind = constants.htmlInstruction + // While we’re in an instruction instead of a declaration, we’re on a `?` + // right now, so we do need to search for `>`, similar to declarations. + return self.interrupt ? ok : continuationDeclarationInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + startTag = true + return tagName + } + + return nok(code) + } + + function declarationStart(code) { + if (code === codes.dash) { + effects.consume(code) + kind = constants.htmlComment + return commentOpenInside + } + + if (code === codes.leftSquareBracket) { + effects.consume(code) + kind = constants.htmlCdata + buffer = constants.cdataOpeningString + index = 0 + return cdataOpenInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + kind = constants.htmlDeclaration + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function commentOpenInside(code) { + if (code === codes.dash) { + effects.consume(code) + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function cdataOpenInside(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length + ? self.interrupt + ? ok + : continuation + : cdataOpenInside + } + + return nok(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + return tagName + } + + return nok(code) + } + + function tagName(code) { + if ( + code === codes.eof || + code === codes.slash || + code === codes.greaterThan || + markdownLineEndingOrSpace(code) + ) { + if ( + code !== codes.slash && + startTag && + htmlRawNames.indexOf(buffer.toLowerCase()) > -1 + ) { + kind = constants.htmlRaw + return self.interrupt ? ok(code) : continuation(code) + } + + if (htmlBlockNames.indexOf(buffer.toLowerCase()) > -1) { + kind = constants.htmlBasic + + if (code === codes.slash) { + effects.consume(code) + return basicSelfClosing + } + + return self.interrupt ? ok(code) : continuation(code) + } + + kind = constants.htmlComplete + // Do not support complete HTML when interrupting. + return self.interrupt + ? nok(code) + : startTag + ? completeAttributeNameBefore(code) + : completeClosingTagAfter(code) + } + + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + buffer += fromCharCode(code) + return tagName + } + + return nok(code) + } + + function basicSelfClosing(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return self.interrupt ? ok : continuation + } + + return nok(code) + } + + function completeClosingTagAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeClosingTagAfter + } + + return completeEnd(code) + } + + function completeAttributeNameBefore(code) { + if (code === codes.slash) { + effects.consume(code) + return completeEnd + } + + if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) { + effects.consume(code) + return completeAttributeName + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameBefore + } + + return completeEnd(code) + } + + function completeAttributeName(code) { + if ( + code === codes.dash || + code === codes.dot || + code === codes.colon || + code === codes.underscore || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return completeAttributeName + } + + return completeAttributeNameAfter(code) + } + + function completeAttributeNameAfter(code) { + if (code === codes.equalsTo) { + effects.consume(code) + return completeAttributeValueBefore + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameAfter + } + + return completeAttributeNameBefore(code) + } + + function completeAttributeValueBefore(code) { + if ( + code === codes.eof || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.quotationMark || code === codes.apostrophe) { + effects.consume(code) + marker = code + return completeAttributeValueQuoted + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeValueBefore + } + + marker = undefined + return completeAttributeValueUnquoted(code) + } + + function completeAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return completeAttributeValueQuotedAfter + } + + if (code === codes.eof || markdownLineEnding(code)) { + return nok(code) + } + + effects.consume(code) + return completeAttributeValueQuoted + } + + function completeAttributeValueUnquoted(code) { + if ( + code === codes.eof || + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent || + markdownLineEndingOrSpace(code) + ) { + return completeAttributeNameAfter(code) + } + + effects.consume(code) + return completeAttributeValueUnquoted + } + + function completeAttributeValueQuotedAfter(code) { + if ( + code === codes.slash || + code === codes.greaterThan || + markdownSpace(code) + ) { + return completeAttributeNameBefore(code) + } + + return nok(code) + } + + function completeEnd(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return completeAfter + } + + return nok(code) + } + + function completeAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeAfter + } + + return code === codes.eof || markdownLineEnding(code) + ? continuation(code) + : nok(code) + } + + function continuation(code) { + if (code === codes.dash && kind === constants.htmlComment) { + effects.consume(code) + return continuationCommentInside + } + + if (code === codes.lessThan && kind === constants.htmlRaw) { + effects.consume(code) + return continuationRawTagOpen + } + + if (code === codes.greaterThan && kind === constants.htmlDeclaration) { + effects.consume(code) + return continuationClose + } + + if (code === codes.questionMark && kind === constants.htmlInstruction) { + effects.consume(code) + return continuationDeclarationInside + } + + if (code === codes.rightSquareBracket && kind === constants.htmlCdata) { + effects.consume(code) + return continuationCharacterDataInside + } + + if ( + markdownLineEnding(code) && + (kind === constants.htmlBasic || kind === constants.htmlComplete) + ) { + return effects.check( + nextBlankConstruct, + continuationClose, + continuationAtLineEnding + )(code) + } + + if (code === codes.eof || markdownLineEnding(code)) { + return continuationAtLineEnding(code) + } + + effects.consume(code) + return continuation + } + + function continuationAtLineEnding(code) { + effects.exit(types.htmlFlowData) + return htmlContinueStart(code) + } + + function htmlContinueStart(code) { + if (code === codes.eof) { + return done(code) + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return htmlContinueStart + } + + effects.enter(types.htmlFlowData) + return continuation(code) + } + + function continuationCommentInside(code) { + if (code === codes.dash) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationRawTagOpen(code) { + if (code === codes.slash) { + effects.consume(code) + buffer = '' + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationRawEndTag(code) { + if ( + code === codes.greaterThan && + htmlRawNames.indexOf(buffer.toLowerCase()) > -1 + ) { + effects.consume(code) + return continuationClose + } + + if (asciiAlpha(code) && buffer.length < constants.htmlRawSizeMax) { + effects.consume(code) + buffer += fromCharCode(code) + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationCharacterDataInside(code) { + if (code === codes.rightSquareBracket) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationDeclarationInside(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return continuationClose + } + + return continuation(code) + } + + function continuationClose(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.htmlFlowData) + return done(code) + } + + effects.consume(code) + return continuationClose + } + + function done(code) { + effects.exit(types.htmlFlow) + return ok(code) + } +} + +function tokenizeNextBlank(effects, ok, nok) { + return start + + function start(code) { + assert__default['default']( + markdownLineEnding(code), + 'expected a line ending' + ) + effects.exit(types.htmlFlowData) + effects.enter(types.lineEndingBlank) + effects.consume(code) + effects.exit(types.lineEndingBlank) + return effects.attempt(partialBlankLine, ok, nok) + } +} + +module.exports = htmlFlow diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.mjs new file mode 100644 index 00000000000000..5dda6d749339b7 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-flow.mjs @@ -0,0 +1,498 @@ +var htmlFlow = { + name: 'htmlFlow', + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +} +export default htmlFlow + +import assert from 'assert' +import asciiAlpha from '../character/ascii-alpha.mjs' +import asciiAlphanumeric from '../character/ascii-alphanumeric.mjs' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import fromCharCode from '../constant/from-char-code.mjs' +import basics from '../constant/html-block-names.mjs' +import raws from '../constant/html-raw-names.mjs' +import types from '../constant/types.mjs' +import blank from './partial-blank-line.mjs' + +var nextBlankConstruct = {tokenize: tokenizeNextBlank, partial: true} + +function resolveToHtmlFlow(events) { + var index = events.length + + while (index--) { + if ( + events[index][0] === 'enter' && + events[index][1].type === types.htmlFlow + ) { + break + } + } + + if (index > 1 && events[index - 2][1].type === types.linePrefix) { + // Add the prefix start to the HTML token. + events[index][1].start = events[index - 2][1].start + // Add the prefix start to the HTML line token. + events[index + 1][1].start = events[index - 2][1].start + // Remove the line prefix. + events.splice(index - 2, 2) + } + + return events +} + +function tokenizeHtmlFlow(effects, ok, nok) { + var self = this + var kind + var startTag + var buffer + var index + var marker + + return start + + function start(code) { + assert(code === codes.lessThan, 'expected `<`') + effects.enter(types.htmlFlow) + effects.enter(types.htmlFlowData) + effects.consume(code) + return open + } + + function open(code) { + if (code === codes.exclamationMark) { + effects.consume(code) + return declarationStart + } + + if (code === codes.slash) { + effects.consume(code) + return tagCloseStart + } + + if (code === codes.questionMark) { + effects.consume(code) + kind = constants.htmlInstruction + // While we’re in an instruction instead of a declaration, we’re on a `?` + // right now, so we do need to search for `>`, similar to declarations. + return self.interrupt ? ok : continuationDeclarationInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + startTag = true + return tagName + } + + return nok(code) + } + + function declarationStart(code) { + if (code === codes.dash) { + effects.consume(code) + kind = constants.htmlComment + return commentOpenInside + } + + if (code === codes.leftSquareBracket) { + effects.consume(code) + kind = constants.htmlCdata + buffer = constants.cdataOpeningString + index = 0 + return cdataOpenInside + } + + if (asciiAlpha(code)) { + effects.consume(code) + kind = constants.htmlDeclaration + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function commentOpenInside(code) { + if (code === codes.dash) { + effects.consume(code) + return self.interrupt ? ok : continuationDeclarationInside + } + + return nok(code) + } + + function cdataOpenInside(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length + ? self.interrupt + ? ok + : continuation + : cdataOpenInside + } + + return nok(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + buffer = fromCharCode(code) + return tagName + } + + return nok(code) + } + + function tagName(code) { + if ( + code === codes.eof || + code === codes.slash || + code === codes.greaterThan || + markdownLineEndingOrSpace(code) + ) { + if ( + code !== codes.slash && + startTag && + raws.indexOf(buffer.toLowerCase()) > -1 + ) { + kind = constants.htmlRaw + return self.interrupt ? ok(code) : continuation(code) + } + + if (basics.indexOf(buffer.toLowerCase()) > -1) { + kind = constants.htmlBasic + + if (code === codes.slash) { + effects.consume(code) + return basicSelfClosing + } + + return self.interrupt ? ok(code) : continuation(code) + } + + kind = constants.htmlComplete + // Do not support complete HTML when interrupting. + return self.interrupt + ? nok(code) + : startTag + ? completeAttributeNameBefore(code) + : completeClosingTagAfter(code) + } + + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + buffer += fromCharCode(code) + return tagName + } + + return nok(code) + } + + function basicSelfClosing(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return self.interrupt ? ok : continuation + } + + return nok(code) + } + + function completeClosingTagAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeClosingTagAfter + } + + return completeEnd(code) + } + + function completeAttributeNameBefore(code) { + if (code === codes.slash) { + effects.consume(code) + return completeEnd + } + + if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) { + effects.consume(code) + return completeAttributeName + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameBefore + } + + return completeEnd(code) + } + + function completeAttributeName(code) { + if ( + code === codes.dash || + code === codes.dot || + code === codes.colon || + code === codes.underscore || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return completeAttributeName + } + + return completeAttributeNameAfter(code) + } + + function completeAttributeNameAfter(code) { + if (code === codes.equalsTo) { + effects.consume(code) + return completeAttributeValueBefore + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeNameAfter + } + + return completeAttributeNameBefore(code) + } + + function completeAttributeValueBefore(code) { + if ( + code === codes.eof || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.quotationMark || code === codes.apostrophe) { + effects.consume(code) + marker = code + return completeAttributeValueQuoted + } + + if (markdownSpace(code)) { + effects.consume(code) + return completeAttributeValueBefore + } + + marker = undefined + return completeAttributeValueUnquoted(code) + } + + function completeAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return completeAttributeValueQuotedAfter + } + + if (code === codes.eof || markdownLineEnding(code)) { + return nok(code) + } + + effects.consume(code) + return completeAttributeValueQuoted + } + + function completeAttributeValueUnquoted(code) { + if ( + code === codes.eof || + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent || + markdownLineEndingOrSpace(code) + ) { + return completeAttributeNameAfter(code) + } + + effects.consume(code) + return completeAttributeValueUnquoted + } + + function completeAttributeValueQuotedAfter(code) { + if ( + code === codes.slash || + code === codes.greaterThan || + markdownSpace(code) + ) { + return completeAttributeNameBefore(code) + } + + return nok(code) + } + + function completeEnd(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return completeAfter + } + + return nok(code) + } + + function completeAfter(code) { + if (markdownSpace(code)) { + effects.consume(code) + return completeAfter + } + + return code === codes.eof || markdownLineEnding(code) + ? continuation(code) + : nok(code) + } + + function continuation(code) { + if (code === codes.dash && kind === constants.htmlComment) { + effects.consume(code) + return continuationCommentInside + } + + if (code === codes.lessThan && kind === constants.htmlRaw) { + effects.consume(code) + return continuationRawTagOpen + } + + if (code === codes.greaterThan && kind === constants.htmlDeclaration) { + effects.consume(code) + return continuationClose + } + + if (code === codes.questionMark && kind === constants.htmlInstruction) { + effects.consume(code) + return continuationDeclarationInside + } + + if (code === codes.rightSquareBracket && kind === constants.htmlCdata) { + effects.consume(code) + return continuationCharacterDataInside + } + + if ( + markdownLineEnding(code) && + (kind === constants.htmlBasic || kind === constants.htmlComplete) + ) { + return effects.check( + nextBlankConstruct, + continuationClose, + continuationAtLineEnding + )(code) + } + + if (code === codes.eof || markdownLineEnding(code)) { + return continuationAtLineEnding(code) + } + + effects.consume(code) + return continuation + } + + function continuationAtLineEnding(code) { + effects.exit(types.htmlFlowData) + return htmlContinueStart(code) + } + + function htmlContinueStart(code) { + if (code === codes.eof) { + return done(code) + } + + if (markdownLineEnding(code)) { + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return htmlContinueStart + } + + effects.enter(types.htmlFlowData) + return continuation(code) + } + + function continuationCommentInside(code) { + if (code === codes.dash) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationRawTagOpen(code) { + if (code === codes.slash) { + effects.consume(code) + buffer = '' + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationRawEndTag(code) { + if (code === codes.greaterThan && raws.indexOf(buffer.toLowerCase()) > -1) { + effects.consume(code) + return continuationClose + } + + if (asciiAlpha(code) && buffer.length < constants.htmlRawSizeMax) { + effects.consume(code) + buffer += fromCharCode(code) + return continuationRawEndTag + } + + return continuation(code) + } + + function continuationCharacterDataInside(code) { + if (code === codes.rightSquareBracket) { + effects.consume(code) + return continuationDeclarationInside + } + + return continuation(code) + } + + function continuationDeclarationInside(code) { + if (code === codes.greaterThan) { + effects.consume(code) + return continuationClose + } + + return continuation(code) + } + + function continuationClose(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.htmlFlowData) + return done(code) + } + + effects.consume(code) + return continuationClose + } + + function done(code) { + effects.exit(types.htmlFlow) + return ok(code) + } +} + +function tokenizeNextBlank(effects, ok, nok) { + return start + + function start(code) { + assert(markdownLineEnding(code), 'expected a line ending') + effects.exit(types.htmlFlowData) + effects.enter(types.lineEndingBlank) + effects.consume(code) + effects.exit(types.lineEndingBlank) + return effects.attempt(blank, ok, nok) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.js new file mode 100644 index 00000000000000..eda4db2d07b2d2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.js @@ -0,0 +1,458 @@ +'use strict' + +var assert = require('assert') +var asciiAlpha = require('../character/ascii-alpha.js') +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var htmlText = { + name: 'htmlText', + tokenize: tokenizeHtmlText +} + +function tokenizeHtmlText(effects, ok, nok) { + var self = this + var marker + var buffer + var index + var returnState + + return start + + function start(code) { + assert__default['default'](code === codes.lessThan, 'expected `<`') + effects.enter(types.htmlText) + effects.enter(types.htmlTextData) + effects.consume(code) + return open + } + + function open(code) { + if (code === codes.exclamationMark) { + effects.consume(code) + return declarationOpen + } + + if (code === codes.slash) { + effects.consume(code) + return tagCloseStart + } + + if (code === codes.questionMark) { + effects.consume(code) + return instruction + } + + if (asciiAlpha(code)) { + effects.consume(code) + return tagOpen + } + + return nok(code) + } + + function declarationOpen(code) { + if (code === codes.dash) { + effects.consume(code) + return commentOpen + } + + if (code === codes.leftSquareBracket) { + effects.consume(code) + buffer = constants.cdataOpeningString + index = 0 + return cdataOpen + } + + if (asciiAlpha(code)) { + effects.consume(code) + return declaration + } + + return nok(code) + } + + function commentOpen(code) { + if (code === codes.dash) { + effects.consume(code) + return commentStart + } + + return nok(code) + } + + function commentStart(code) { + if (code === codes.eof || code === codes.greaterThan) { + return nok(code) + } + + if (code === codes.dash) { + effects.consume(code) + return commentStartDash + } + + return comment(code) + } + + function commentStartDash(code) { + if (code === codes.eof || code === codes.greaterThan) { + return nok(code) + } + + return comment(code) + } + + function comment(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.dash) { + effects.consume(code) + return commentClose + } + + if (markdownLineEnding(code)) { + returnState = comment + return atLineEnding(code) + } + + effects.consume(code) + return comment + } + + function commentClose(code) { + if (code === codes.dash) { + effects.consume(code) + return end + } + + return comment(code) + } + + function cdataOpen(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length ? cdata : cdataOpen + } + + return nok(code) + } + + function cdata(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataClose + } + + if (markdownLineEnding(code)) { + returnState = cdata + return atLineEnding(code) + } + + effects.consume(code) + return cdata + } + + function cdataClose(code) { + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function cdataEnd(code) { + if (code === codes.greaterThan) { + return end(code) + } + + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function declaration(code) { + if (code === codes.eof || code === codes.greaterThan) { + return end(code) + } + + if (markdownLineEnding(code)) { + returnState = declaration + return atLineEnding(code) + } + + effects.consume(code) + return declaration + } + + function instruction(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.questionMark) { + effects.consume(code) + return instructionClose + } + + if (markdownLineEnding(code)) { + returnState = instruction + return atLineEnding(code) + } + + effects.consume(code) + return instruction + } + + function instructionClose(code) { + return code === codes.greaterThan ? end(code) : instruction(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return tagClose + } + + return nok(code) + } + + function tagClose(code) { + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + return tagClose + } + + return tagCloseBetween(code) + } + + function tagCloseBetween(code) { + if (markdownLineEnding(code)) { + returnState = tagCloseBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagCloseBetween + } + + return end(code) + } + + function tagOpen(code) { + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + return tagOpen + } + + if ( + code === codes.slash || + code === codes.greaterThan || + markdownLineEndingOrSpace(code) + ) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenBetween(code) { + if (code === codes.slash) { + effects.consume(code) + return end + } + + if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) { + effects.consume(code) + return tagOpenAttributeName + } + + if (markdownLineEnding(code)) { + returnState = tagOpenBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenBetween + } + + return end(code) + } + + function tagOpenAttributeName(code) { + if ( + code === codes.dash || + code === codes.dot || + code === codes.colon || + code === codes.underscore || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return tagOpenAttributeName + } + + return tagOpenAttributeNameAfter(code) + } + + function tagOpenAttributeNameAfter(code) { + if (code === codes.equalsTo) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeNameAfter + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeNameAfter + } + + return tagOpenBetween(code) + } + + function tagOpenAttributeValueBefore(code) { + if ( + code === codes.eof || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.quotationMark || code === codes.apostrophe) { + effects.consume(code) + marker = code + return tagOpenAttributeValueQuoted + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueBefore + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + effects.consume(code) + marker = undefined + return tagOpenAttributeValueUnquoted + } + + function tagOpenAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return tagOpenAttributeValueQuotedAfter + } + + if (code === codes.eof) { + return nok(code) + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueQuoted + return atLineEnding(code) + } + + effects.consume(code) + return tagOpenAttributeValueQuoted + } + + function tagOpenAttributeValueQuotedAfter(code) { + if ( + code === codes.greaterThan || + code === codes.slash || + markdownLineEndingOrSpace(code) + ) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenAttributeValueUnquoted(code) { + if ( + code === codes.eof || + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.greaterThan || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code) + } + + effects.consume(code) + return tagOpenAttributeValueUnquoted + } + + // We can’t have blank lines in content, so no need to worry about empty + // tokens. + function atLineEnding(code) { + assert__default['default'](returnState, 'expected return state') + assert__default['default'](markdownLineEnding(code), 'expected eol') + effects.exit(types.htmlTextData) + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace( + effects, + afterPrefix, + types.linePrefix, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) + } + + function afterPrefix(code) { + effects.enter(types.htmlTextData) + return returnState(code) + } + + function end(code) { + if (code === codes.greaterThan) { + effects.consume(code) + effects.exit(types.htmlTextData) + effects.exit(types.htmlText) + return ok + } + + return nok(code) + } +} + +module.exports = htmlText diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.mjs new file mode 100644 index 00000000000000..2f571a0f4f936d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/html-text.mjs @@ -0,0 +1,449 @@ +var htmlText = { + name: 'htmlText', + tokenize: tokenizeHtmlText +} +export default htmlText + +import assert from 'assert' +import asciiAlpha from '../character/ascii-alpha.mjs' +import asciiAlphanumeric from '../character/ascii-alphanumeric.mjs' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizeHtmlText(effects, ok, nok) { + var self = this + var marker + var buffer + var index + var returnState + + return start + + function start(code) { + assert(code === codes.lessThan, 'expected `<`') + effects.enter(types.htmlText) + effects.enter(types.htmlTextData) + effects.consume(code) + return open + } + + function open(code) { + if (code === codes.exclamationMark) { + effects.consume(code) + return declarationOpen + } + + if (code === codes.slash) { + effects.consume(code) + return tagCloseStart + } + + if (code === codes.questionMark) { + effects.consume(code) + return instruction + } + + if (asciiAlpha(code)) { + effects.consume(code) + return tagOpen + } + + return nok(code) + } + + function declarationOpen(code) { + if (code === codes.dash) { + effects.consume(code) + return commentOpen + } + + if (code === codes.leftSquareBracket) { + effects.consume(code) + buffer = constants.cdataOpeningString + index = 0 + return cdataOpen + } + + if (asciiAlpha(code)) { + effects.consume(code) + return declaration + } + + return nok(code) + } + + function commentOpen(code) { + if (code === codes.dash) { + effects.consume(code) + return commentStart + } + + return nok(code) + } + + function commentStart(code) { + if (code === codes.eof || code === codes.greaterThan) { + return nok(code) + } + + if (code === codes.dash) { + effects.consume(code) + return commentStartDash + } + + return comment(code) + } + + function commentStartDash(code) { + if (code === codes.eof || code === codes.greaterThan) { + return nok(code) + } + + return comment(code) + } + + function comment(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.dash) { + effects.consume(code) + return commentClose + } + + if (markdownLineEnding(code)) { + returnState = comment + return atLineEnding(code) + } + + effects.consume(code) + return comment + } + + function commentClose(code) { + if (code === codes.dash) { + effects.consume(code) + return end + } + + return comment(code) + } + + function cdataOpen(code) { + if (code === buffer.charCodeAt(index++)) { + effects.consume(code) + return index === buffer.length ? cdata : cdataOpen + } + + return nok(code) + } + + function cdata(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataClose + } + + if (markdownLineEnding(code)) { + returnState = cdata + return atLineEnding(code) + } + + effects.consume(code) + return cdata + } + + function cdataClose(code) { + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function cdataEnd(code) { + if (code === codes.greaterThan) { + return end(code) + } + + if (code === codes.rightSquareBracket) { + effects.consume(code) + return cdataEnd + } + + return cdata(code) + } + + function declaration(code) { + if (code === codes.eof || code === codes.greaterThan) { + return end(code) + } + + if (markdownLineEnding(code)) { + returnState = declaration + return atLineEnding(code) + } + + effects.consume(code) + return declaration + } + + function instruction(code) { + if (code === codes.eof) { + return nok(code) + } + + if (code === codes.questionMark) { + effects.consume(code) + return instructionClose + } + + if (markdownLineEnding(code)) { + returnState = instruction + return atLineEnding(code) + } + + effects.consume(code) + return instruction + } + + function instructionClose(code) { + return code === codes.greaterThan ? end(code) : instruction(code) + } + + function tagCloseStart(code) { + if (asciiAlpha(code)) { + effects.consume(code) + return tagClose + } + + return nok(code) + } + + function tagClose(code) { + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + return tagClose + } + + return tagCloseBetween(code) + } + + function tagCloseBetween(code) { + if (markdownLineEnding(code)) { + returnState = tagCloseBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagCloseBetween + } + + return end(code) + } + + function tagOpen(code) { + if (code === codes.dash || asciiAlphanumeric(code)) { + effects.consume(code) + return tagOpen + } + + if ( + code === codes.slash || + code === codes.greaterThan || + markdownLineEndingOrSpace(code) + ) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenBetween(code) { + if (code === codes.slash) { + effects.consume(code) + return end + } + + if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) { + effects.consume(code) + return tagOpenAttributeName + } + + if (markdownLineEnding(code)) { + returnState = tagOpenBetween + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenBetween + } + + return end(code) + } + + function tagOpenAttributeName(code) { + if ( + code === codes.dash || + code === codes.dot || + code === codes.colon || + code === codes.underscore || + asciiAlphanumeric(code) + ) { + effects.consume(code) + return tagOpenAttributeName + } + + return tagOpenAttributeNameAfter(code) + } + + function tagOpenAttributeNameAfter(code) { + if (code === codes.equalsTo) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeNameAfter + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeNameAfter + } + + return tagOpenBetween(code) + } + + function tagOpenAttributeValueBefore(code) { + if ( + code === codes.eof || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.greaterThan || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.quotationMark || code === codes.apostrophe) { + effects.consume(code) + marker = code + return tagOpenAttributeValueQuoted + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueBefore + return atLineEnding(code) + } + + if (markdownSpace(code)) { + effects.consume(code) + return tagOpenAttributeValueBefore + } + + effects.consume(code) + marker = undefined + return tagOpenAttributeValueUnquoted + } + + function tagOpenAttributeValueQuoted(code) { + if (code === marker) { + effects.consume(code) + return tagOpenAttributeValueQuotedAfter + } + + if (code === codes.eof) { + return nok(code) + } + + if (markdownLineEnding(code)) { + returnState = tagOpenAttributeValueQuoted + return atLineEnding(code) + } + + effects.consume(code) + return tagOpenAttributeValueQuoted + } + + function tagOpenAttributeValueQuotedAfter(code) { + if ( + code === codes.greaterThan || + code === codes.slash || + markdownLineEndingOrSpace(code) + ) { + return tagOpenBetween(code) + } + + return nok(code) + } + + function tagOpenAttributeValueUnquoted(code) { + if ( + code === codes.eof || + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.lessThan || + code === codes.equalsTo || + code === codes.graveAccent + ) { + return nok(code) + } + + if (code === codes.greaterThan || markdownLineEndingOrSpace(code)) { + return tagOpenBetween(code) + } + + effects.consume(code) + return tagOpenAttributeValueUnquoted + } + + // We can’t have blank lines in content, so no need to worry about empty + // tokens. + function atLineEnding(code) { + assert(returnState, 'expected return state') + assert(markdownLineEnding(code), 'expected eol') + effects.exit(types.htmlTextData) + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory( + effects, + afterPrefix, + types.linePrefix, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + ) + } + + function afterPrefix(code) { + effects.enter(types.htmlTextData) + return returnState(code) + } + + function end(code) { + if (code === codes.greaterThan) { + effects.consume(code) + effects.exit(types.htmlTextData) + effects.exit(types.htmlText) + return ok + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.js new file mode 100644 index 00000000000000..51ee2366c81d10 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.js @@ -0,0 +1,374 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var chunkedPush = require('../util/chunked-push.js') +var chunkedSplice = require('../util/chunked-splice.js') +var normalizeIdentifier = require('../util/normalize-identifier.js') +var resolveAll = require('../util/resolve-all.js') +var shallow = require('../util/shallow.js') +var factoryDestination = require('./factory-destination.js') +var factoryLabel = require('./factory-label.js') +var factoryTitle = require('./factory-title.js') +var factoryWhitespace = require('./factory-whitespace.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var labelEnd = { + name: 'labelEnd', + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +} + +var resourceConstruct = {tokenize: tokenizeResource} +var fullReferenceConstruct = {tokenize: tokenizeFullReference} +var collapsedReferenceConstruct = {tokenize: tokenizeCollapsedReference} + +function resolveAllLabelEnd(events) { + var index = -1 + var token + + while (++index < events.length) { + token = events[index][1] + + if ( + !token._used && + (token.type === types.labelImage || + token.type === types.labelLink || + token.type === types.labelEnd) + ) { + // Remove the marker. + events.splice(index + 1, token.type === types.labelImage ? 4 : 2) + token.type = types.data + index++ + } + } + + return events +} + +function resolveToLabelEnd(events, context) { + var index = events.length + var offset = 0 + var group + var label + var text + var token + var open + var close + var media + + // Find an opening. + while (index--) { + token = events[index][1] + + if (open) { + // If we see another link, or inactive link label, we’ve been here before. + if ( + token.type === types.link || + (token.type === types.labelLink && token._inactive) + ) { + break + } + + // Mark other link openings as inactive, as we can’t have links in + // links. + if (events[index][0] === 'enter' && token.type === types.labelLink) { + token._inactive = true + } + } else if (close) { + if ( + events[index][0] === 'enter' && + (token.type === types.labelImage || token.type === types.labelLink) && + !token._balanced + ) { + open = index + + if (token.type !== types.labelLink) { + offset = 2 + break + } + } + } else if (token.type === types.labelEnd) { + close = index + } + } + + group = { + type: events[open][1].type === types.labelLink ? types.link : types.image, + start: shallow(events[open][1].start), + end: shallow(events[events.length - 1][1].end) + } + + label = { + type: types.label, + start: shallow(events[open][1].start), + end: shallow(events[close][1].end) + } + + text = { + type: types.labelText, + start: shallow(events[open + offset + 2][1].end), + end: shallow(events[close - 2][1].start) + } + + media = [ + ['enter', group, context], + ['enter', label, context] + ] + + // Opening marker. + media = chunkedPush(media, events.slice(open + 1, open + offset + 3)) + + // Text open. + media = chunkedPush(media, [['enter', text, context]]) + + // Between. + media = chunkedPush( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset + 4, close - 3), + context + ) + ) + + // Text close, marker close, label close. + media = chunkedPush(media, [ + ['exit', text, context], + events[close - 2], + events[close - 1], + ['exit', label, context] + ]) + + // Reference, resource, or so. + media = chunkedPush(media, events.slice(close + 1)) + + // Media close. + media = chunkedPush(media, [['exit', group, context]]) + + chunkedSplice(events, open, events.length, media) + + return events +} + +function tokenizeLabelEnd(effects, ok, nok) { + var self = this + var index = self.events.length + var labelStart + var defined + + // Find an opening. + while (index--) { + if ( + (self.events[index][1].type === types.labelImage || + self.events[index][1].type === types.labelLink) && + !self.events[index][1]._balanced + ) { + labelStart = self.events[index][1] + break + } + } + + return start + + function start(code) { + assert__default['default']( + code === codes.rightSquareBracket, + 'expected `]`' + ) + + if (!labelStart) { + return nok(code) + } + + // It’s a balanced bracket, but contains a link. + if (labelStart._inactive) return balanced(code) + defined = + self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize({start: labelStart.end, end: self.now()}) + ) + ) > -1 + effects.enter(types.labelEnd) + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelEnd) + return afterLabelEnd + } + + function afterLabelEnd(code) { + // Resource: `[asd](fgh)`. + if (code === codes.leftParenthesis) { + return effects.attempt( + resourceConstruct, + ok, + defined ? ok : balanced + )(code) + } + + // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? + if (code === codes.leftSquareBracket) { + return effects.attempt( + fullReferenceConstruct, + ok, + defined + ? effects.attempt(collapsedReferenceConstruct, ok, balanced) + : balanced + )(code) + } + + // Shortcut reference: `[asd]`? + return defined ? ok(code) : balanced(code) + } + + function balanced(code) { + labelStart._balanced = true + return nok(code) + } +} + +function tokenizeResource(effects, ok, nok) { + return start + + function start(code) { + assert__default['default'].equal( + code, + codes.leftParenthesis, + 'expected left paren' + ) + effects.enter(types.resource) + effects.enter(types.resourceMarker) + effects.consume(code) + effects.exit(types.resourceMarker) + return factoryWhitespace(effects, open) + } + + function open(code) { + if (code === codes.rightParenthesis) { + return end(code) + } + + return factoryDestination( + effects, + destinationAfter, + nok, + types.resourceDestination, + types.resourceDestinationLiteral, + types.resourceDestinationLiteralMarker, + types.resourceDestinationRaw, + types.resourceDestinationString, + constants.linkResourceDestinationBalanceMax + )(code) + } + + function destinationAfter(code) { + return markdownLineEndingOrSpace(code) + ? factoryWhitespace(effects, between)(code) + : end(code) + } + + function between(code) { + if ( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis + ) { + return factoryTitle( + effects, + factoryWhitespace(effects, end), + nok, + types.resourceTitle, + types.resourceTitleMarker, + types.resourceTitleString + )(code) + } + + return end(code) + } + + function end(code) { + if (code === codes.rightParenthesis) { + effects.enter(types.resourceMarker) + effects.consume(code) + effects.exit(types.resourceMarker) + effects.exit(types.resource) + return ok + } + + return nok(code) + } +} + +function tokenizeFullReference(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert__default['default'].equal( + code, + codes.leftSquareBracket, + 'expected left bracket' + ) + return factoryLabel.call( + self, + effects, + afterLabel, + nok, + types.reference, + types.referenceMarker, + types.referenceString + )(code) + } + + function afterLabel(code) { + return self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + ) < 0 + ? nok(code) + : ok(code) + } +} + +function tokenizeCollapsedReference(effects, ok, nok) { + return start + + function start(code) { + assert__default['default'].equal( + code, + codes.leftSquareBracket, + 'expected left bracket' + ) + effects.enter(types.reference) + effects.enter(types.referenceMarker) + effects.consume(code) + effects.exit(types.referenceMarker) + return open + } + + function open(code) { + if (code === codes.rightSquareBracket) { + effects.enter(types.referenceMarker) + effects.consume(code) + effects.exit(types.referenceMarker) + effects.exit(types.reference) + return ok + } + + return nok(code) + } +} + +module.exports = labelEnd diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.mjs new file mode 100644 index 00000000000000..16beeb0782df37 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-end.mjs @@ -0,0 +1,350 @@ +var labelEnd = { + name: 'labelEnd', + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +} +export default labelEnd + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import chunkedPush from '../util/chunked-push.mjs' +import chunkedSplice from '../util/chunked-splice.mjs' +import normalizeIdentifier from '../util/normalize-identifier.mjs' +import resolveAll from '../util/resolve-all.mjs' +import shallow from '../util/shallow.mjs' +import destinationFactory from './factory-destination.mjs' +import labelFactory from './factory-label.mjs' +import titleFactory from './factory-title.mjs' +import whitespaceFactory from './factory-whitespace.mjs' + +var resourceConstruct = {tokenize: tokenizeResource} +var fullReferenceConstruct = {tokenize: tokenizeFullReference} +var collapsedReferenceConstruct = {tokenize: tokenizeCollapsedReference} + +function resolveAllLabelEnd(events) { + var index = -1 + var token + + while (++index < events.length) { + token = events[index][1] + + if ( + !token._used && + (token.type === types.labelImage || + token.type === types.labelLink || + token.type === types.labelEnd) + ) { + // Remove the marker. + events.splice(index + 1, token.type === types.labelImage ? 4 : 2) + token.type = types.data + index++ + } + } + + return events +} + +function resolveToLabelEnd(events, context) { + var index = events.length + var offset = 0 + var group + var label + var text + var token + var open + var close + var media + + // Find an opening. + while (index--) { + token = events[index][1] + + if (open) { + // If we see another link, or inactive link label, we’ve been here before. + if ( + token.type === types.link || + (token.type === types.labelLink && token._inactive) + ) { + break + } + + // Mark other link openings as inactive, as we can’t have links in + // links. + if (events[index][0] === 'enter' && token.type === types.labelLink) { + token._inactive = true + } + } else if (close) { + if ( + events[index][0] === 'enter' && + (token.type === types.labelImage || token.type === types.labelLink) && + !token._balanced + ) { + open = index + + if (token.type !== types.labelLink) { + offset = 2 + break + } + } + } else if (token.type === types.labelEnd) { + close = index + } + } + + group = { + type: events[open][1].type === types.labelLink ? types.link : types.image, + start: shallow(events[open][1].start), + end: shallow(events[events.length - 1][1].end) + } + + label = { + type: types.label, + start: shallow(events[open][1].start), + end: shallow(events[close][1].end) + } + + text = { + type: types.labelText, + start: shallow(events[open + offset + 2][1].end), + end: shallow(events[close - 2][1].start) + } + + media = [ + ['enter', group, context], + ['enter', label, context] + ] + + // Opening marker. + media = chunkedPush(media, events.slice(open + 1, open + offset + 3)) + + // Text open. + media = chunkedPush(media, [['enter', text, context]]) + + // Between. + media = chunkedPush( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset + 4, close - 3), + context + ) + ) + + // Text close, marker close, label close. + media = chunkedPush(media, [ + ['exit', text, context], + events[close - 2], + events[close - 1], + ['exit', label, context] + ]) + + // Reference, resource, or so. + media = chunkedPush(media, events.slice(close + 1)) + + // Media close. + media = chunkedPush(media, [['exit', group, context]]) + + chunkedSplice(events, open, events.length, media) + + return events +} + +function tokenizeLabelEnd(effects, ok, nok) { + var self = this + var index = self.events.length + var labelStart + var defined + + // Find an opening. + while (index--) { + if ( + (self.events[index][1].type === types.labelImage || + self.events[index][1].type === types.labelLink) && + !self.events[index][1]._balanced + ) { + labelStart = self.events[index][1] + break + } + } + + return start + + function start(code) { + assert(code === codes.rightSquareBracket, 'expected `]`') + + if (!labelStart) { + return nok(code) + } + + // It’s a balanced bracket, but contains a link. + if (labelStart._inactive) return balanced(code) + defined = + self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize({start: labelStart.end, end: self.now()}) + ) + ) > -1 + effects.enter(types.labelEnd) + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelEnd) + return afterLabelEnd + } + + function afterLabelEnd(code) { + // Resource: `[asd](fgh)`. + if (code === codes.leftParenthesis) { + return effects.attempt( + resourceConstruct, + ok, + defined ? ok : balanced + )(code) + } + + // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? + if (code === codes.leftSquareBracket) { + return effects.attempt( + fullReferenceConstruct, + ok, + defined + ? effects.attempt(collapsedReferenceConstruct, ok, balanced) + : balanced + )(code) + } + + // Shortcut reference: `[asd]`? + return defined ? ok(code) : balanced(code) + } + + function balanced(code) { + labelStart._balanced = true + return nok(code) + } +} + +function tokenizeResource(effects, ok, nok) { + return start + + function start(code) { + assert.equal(code, codes.leftParenthesis, 'expected left paren') + effects.enter(types.resource) + effects.enter(types.resourceMarker) + effects.consume(code) + effects.exit(types.resourceMarker) + return whitespaceFactory(effects, open) + } + + function open(code) { + if (code === codes.rightParenthesis) { + return end(code) + } + + return destinationFactory( + effects, + destinationAfter, + nok, + types.resourceDestination, + types.resourceDestinationLiteral, + types.resourceDestinationLiteralMarker, + types.resourceDestinationRaw, + types.resourceDestinationString, + constants.linkResourceDestinationBalanceMax + )(code) + } + + function destinationAfter(code) { + return markdownLineEndingOrSpace(code) + ? whitespaceFactory(effects, between)(code) + : end(code) + } + + function between(code) { + if ( + code === codes.quotationMark || + code === codes.apostrophe || + code === codes.leftParenthesis + ) { + return titleFactory( + effects, + whitespaceFactory(effects, end), + nok, + types.resourceTitle, + types.resourceTitleMarker, + types.resourceTitleString + )(code) + } + + return end(code) + } + + function end(code) { + if (code === codes.rightParenthesis) { + effects.enter(types.resourceMarker) + effects.consume(code) + effects.exit(types.resourceMarker) + effects.exit(types.resource) + return ok + } + + return nok(code) + } +} + +function tokenizeFullReference(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert.equal(code, codes.leftSquareBracket, 'expected left bracket') + return labelFactory.call( + self, + effects, + afterLabel, + nok, + types.reference, + types.referenceMarker, + types.referenceString + )(code) + } + + function afterLabel(code) { + return self.parser.defined.indexOf( + normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + ) < 0 + ? nok(code) + : ok(code) + } +} + +function tokenizeCollapsedReference(effects, ok, nok) { + return start + + function start(code) { + assert.equal(code, codes.leftSquareBracket, 'expected left bracket') + effects.enter(types.reference) + effects.enter(types.referenceMarker) + effects.consume(code) + effects.exit(types.referenceMarker) + return open + } + + function open(code) { + if (code === codes.rightSquareBracket) { + effects.enter(types.referenceMarker) + effects.consume(code) + effects.exit(types.referenceMarker) + effects.exit(types.reference) + return ok + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.js new file mode 100644 index 00000000000000..727a4687bbe5bc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.js @@ -0,0 +1,56 @@ +'use strict' + +var labelEnd = require('./label-end.js') +var assert = require('assert') +var codes = require('../character/codes.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var labelStartImage = { + name: 'labelStartImage', + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +} + +function tokenizeLabelStartImage(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert__default['default'](code === codes.exclamationMark, 'expected `!`') + effects.enter(types.labelImage) + effects.enter(types.labelImageMarker) + effects.consume(code) + effects.exit(types.labelImageMarker) + return open + } + + function open(code) { + if (code === codes.leftSquareBracket) { + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelImage) + return after + } + + return nok(code) + } + + function after(code) { + /* c8 ignore next */ + return code === codes.caret && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ nok(code) + : ok(code) + } +} + +module.exports = labelStartImage diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.mjs new file mode 100644 index 00000000000000..a5bef6e88ac600 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-image.mjs @@ -0,0 +1,48 @@ +import labelEnd from './label-end.mjs' + +var labelStartImage = { + name: 'labelStartImage', + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +} +export default labelStartImage + +import assert from 'assert' +import codes from '../character/codes.mjs' +import types from '../constant/types.mjs' + +function tokenizeLabelStartImage(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert(code === codes.exclamationMark, 'expected `!`') + effects.enter(types.labelImage) + effects.enter(types.labelImageMarker) + effects.consume(code) + effects.exit(types.labelImageMarker) + return open + } + + function open(code) { + if (code === codes.leftSquareBracket) { + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelImage) + return after + } + + return nok(code) + } + + function after(code) { + /* c8 ignore next */ + return code === codes.caret && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ nok(code) + : ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.js new file mode 100644 index 00000000000000..a31a1a3d6f3b74 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.js @@ -0,0 +1,46 @@ +'use strict' + +var labelEnd = require('./label-end.js') +var assert = require('assert') +var codes = require('../character/codes.js') +var types = require('../constant/types.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var labelStartLink = { + name: 'labelStartLink', + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +} + +function tokenizeLabelStartLink(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert__default['default'](code === codes.leftSquareBracket, 'expected `[`') + effects.enter(types.labelLink) + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelLink) + return after + } + + function after(code) { + /* c8 ignore next */ + return code === codes.caret && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) + : ok(code) + } +} + +module.exports = labelStartLink diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.mjs new file mode 100644 index 00000000000000..7e92c6d1afd035 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/label-start-link.mjs @@ -0,0 +1,38 @@ +import labelEnd from './label-end.mjs' + +var labelStartLink = { + name: 'labelStartLink', + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +} +export default labelStartLink + +import assert from 'assert' +import codes from '../character/codes.mjs' +import types from '../constant/types.mjs' + +function tokenizeLabelStartLink(effects, ok, nok) { + var self = this + + return start + + function start(code) { + assert(code === codes.leftSquareBracket, 'expected `[`') + effects.enter(types.labelLink) + effects.enter(types.labelMarker) + effects.consume(code) + effects.exit(types.labelMarker) + effects.exit(types.labelLink) + return after + } + + function after(code) { + /* c8 ignore next */ + return code === codes.caret && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) + : ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.js new file mode 100644 index 00000000000000..e56215c9b889e4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.js @@ -0,0 +1,31 @@ +'use strict' + +var assert = require('assert') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var lineEnding = { + name: 'lineEnding', + tokenize: tokenizeLineEnding +} + +function tokenizeLineEnding(effects, ok) { + return start + + function start(code) { + assert__default['default'](markdownLineEnding(code), 'expected eol') + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return factorySpace(effects, ok, types.linePrefix) + } +} + +module.exports = lineEnding diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.mjs new file mode 100644 index 00000000000000..63029268f175e6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/line-ending.mjs @@ -0,0 +1,22 @@ +var lineEnding = { + name: 'lineEnding', + tokenize: tokenizeLineEnding +} +export default lineEnding + +import assert from 'assert' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizeLineEnding(effects, ok) { + return start + + function start(code) { + assert(markdownLineEnding(code), 'expected eol') + effects.enter(types.lineEnding) + effects.consume(code) + effects.exit(types.lineEnding) + return spaceFactory(effects, ok, types.linePrefix) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.js new file mode 100644 index 00000000000000..44f7615f5266e0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.js @@ -0,0 +1,219 @@ +'use strict' + +var asciiDigit = require('../character/ascii-digit.js') +var codes = require('../character/codes.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var prefixSize = require('../util/prefix-size.js') +var sizeChunks = require('../util/size-chunks.js') +var factorySpace = require('./factory-space.js') +var partialBlankLine = require('./partial-blank-line.js') +var thematicBreak = require('./thematic-break.js') + +var list = { + name: 'list', + tokenize: tokenizeListStart, + continuation: {tokenize: tokenizeListContinuation}, + exit: tokenizeListEnd +} + +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +} +var indentConstruct = {tokenize: tokenizeIndent, partial: true} + +function tokenizeListStart(effects, ok, nok) { + var self = this + var initialSize = prefixSize(self.events, types.linePrefix) + var size = 0 + + return start + + function start(code) { + var kind = + self.containerState.type || + (code === codes.asterisk || code === codes.plusSign || code === codes.dash + ? types.listUnordered + : types.listOrdered) + + if ( + kind === types.listUnordered + ? !self.containerState.marker || code === self.containerState.marker + : asciiDigit(code) + ) { + if (!self.containerState.type) { + self.containerState.type = kind + effects.enter(kind, {_container: true}) + } + + if (kind === types.listUnordered) { + effects.enter(types.listItemPrefix) + return code === codes.asterisk || code === codes.dash + ? effects.check(thematicBreak, nok, atMarker)(code) + : atMarker(code) + } + + if (!self.interrupt || code === codes.digit1) { + effects.enter(types.listItemPrefix) + effects.enter(types.listItemValue) + return inside(code) + } + } + + return nok(code) + } + + function inside(code) { + if (asciiDigit(code) && ++size < constants.listItemValueSizeMax) { + effects.consume(code) + return inside + } + + if ( + (!self.interrupt || size < 2) && + (self.containerState.marker + ? code === self.containerState.marker + : code === codes.rightParenthesis || code === codes.dot) + ) { + effects.exit(types.listItemValue) + return atMarker(code) + } + + return nok(code) + } + + function atMarker(code) { + effects.enter(types.listItemMarker) + effects.consume(code) + effects.exit(types.listItemMarker) + self.containerState.marker = self.containerState.marker || code + return effects.check( + partialBlankLine, + // Can’t be empty when interrupting. + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ) + } + + function onBlank(code) { + self.containerState.initialBlankLine = true + initialSize++ + return endOfPrefix(code) + } + + function otherPrefix(code) { + if (markdownSpace(code)) { + effects.enter(types.listItemPrefixWhitespace) + effects.consume(code) + effects.exit(types.listItemPrefixWhitespace) + return endOfPrefix + } + + return nok(code) + } + + function endOfPrefix(code) { + self.containerState.size = + initialSize + + sizeChunks(self.sliceStream(effects.exit(types.listItemPrefix))) + return ok(code) + } +} + +function tokenizeListContinuation(effects, ok, nok) { + var self = this + + self.containerState._closeFlow = undefined + + return effects.check(partialBlankLine, onBlank, notBlank) + + function onBlank(code) { + self.containerState.furtherBlankLines = + self.containerState.furtherBlankLines || + self.containerState.initialBlankLine + + // We have a blank line. + // Still, try to consume at most the items size. + return factorySpace( + effects, + ok, + types.listItemIndent, + self.containerState.size + 1 + )(code) + } + + function notBlank(code) { + if (self.containerState.furtherBlankLines || !markdownSpace(code)) { + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return notInCurrentItem(code) + } + + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) + } + + function notInCurrentItem(code) { + // While we do continue, we signal that the flow should be closed. + self.containerState._closeFlow = true + // As we’re closing flow, we’re no longer interrupting. + self.interrupt = undefined + return factorySpace( + effects, + effects.attempt(list, ok, nok), + types.linePrefix, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + )(code) + } +} + +function tokenizeIndent(effects, ok, nok) { + var self = this + + return factorySpace( + effects, + afterPrefix, + types.listItemIndent, + self.containerState.size + 1 + ) + + function afterPrefix(code) { + return prefixSize(self.events, types.listItemIndent) === + self.containerState.size + ? ok(code) + : nok(code) + } +} + +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type) +} + +function tokenizeListItemPrefixWhitespace(effects, ok, nok) { + var self = this + + return factorySpace( + effects, + afterPrefix, + types.listItemPrefixWhitespace, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + 1 + ) + + function afterPrefix(code) { + return markdownSpace(code) || + !prefixSize(self.events, types.listItemPrefixWhitespace) + ? nok(code) + : ok(code) + } +} + +module.exports = list diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.mjs new file mode 100644 index 00000000000000..017a6eabac97d0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/list.mjs @@ -0,0 +1,216 @@ +var list = { + name: 'list', + tokenize: tokenizeListStart, + continuation: {tokenize: tokenizeListContinuation}, + exit: tokenizeListEnd +} +export default list + +import asciiDigit from '../character/ascii-digit.mjs' +import codes from '../character/codes.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import prefixSize from '../util/prefix-size.mjs' +import sizeChunks from '../util/size-chunks.mjs' +import spaceFactory from './factory-space.mjs' +import blank from './partial-blank-line.mjs' +import thematicBreak from './thematic-break.mjs' + +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +} +var indentConstruct = {tokenize: tokenizeIndent, partial: true} + +function tokenizeListStart(effects, ok, nok) { + var self = this + var initialSize = prefixSize(self.events, types.linePrefix) + var size = 0 + + return start + + function start(code) { + var kind = + self.containerState.type || + (code === codes.asterisk || code === codes.plusSign || code === codes.dash + ? types.listUnordered + : types.listOrdered) + + if ( + kind === types.listUnordered + ? !self.containerState.marker || code === self.containerState.marker + : asciiDigit(code) + ) { + if (!self.containerState.type) { + self.containerState.type = kind + effects.enter(kind, {_container: true}) + } + + if (kind === types.listUnordered) { + effects.enter(types.listItemPrefix) + return code === codes.asterisk || code === codes.dash + ? effects.check(thematicBreak, nok, atMarker)(code) + : atMarker(code) + } + + if (!self.interrupt || code === codes.digit1) { + effects.enter(types.listItemPrefix) + effects.enter(types.listItemValue) + return inside(code) + } + } + + return nok(code) + } + + function inside(code) { + if (asciiDigit(code) && ++size < constants.listItemValueSizeMax) { + effects.consume(code) + return inside + } + + if ( + (!self.interrupt || size < 2) && + (self.containerState.marker + ? code === self.containerState.marker + : code === codes.rightParenthesis || code === codes.dot) + ) { + effects.exit(types.listItemValue) + return atMarker(code) + } + + return nok(code) + } + + function atMarker(code) { + effects.enter(types.listItemMarker) + effects.consume(code) + effects.exit(types.listItemMarker) + self.containerState.marker = self.containerState.marker || code + return effects.check( + blank, + // Can’t be empty when interrupting. + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ) + } + + function onBlank(code) { + self.containerState.initialBlankLine = true + initialSize++ + return endOfPrefix(code) + } + + function otherPrefix(code) { + if (markdownSpace(code)) { + effects.enter(types.listItemPrefixWhitespace) + effects.consume(code) + effects.exit(types.listItemPrefixWhitespace) + return endOfPrefix + } + + return nok(code) + } + + function endOfPrefix(code) { + self.containerState.size = + initialSize + + sizeChunks(self.sliceStream(effects.exit(types.listItemPrefix))) + return ok(code) + } +} + +function tokenizeListContinuation(effects, ok, nok) { + var self = this + + self.containerState._closeFlow = undefined + + return effects.check(blank, onBlank, notBlank) + + function onBlank(code) { + self.containerState.furtherBlankLines = + self.containerState.furtherBlankLines || + self.containerState.initialBlankLine + + // We have a blank line. + // Still, try to consume at most the items size. + return spaceFactory( + effects, + ok, + types.listItemIndent, + self.containerState.size + 1 + )(code) + } + + function notBlank(code) { + if (self.containerState.furtherBlankLines || !markdownSpace(code)) { + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return notInCurrentItem(code) + } + + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined + return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) + } + + function notInCurrentItem(code) { + // While we do continue, we signal that the flow should be closed. + self.containerState._closeFlow = true + // As we’re closing flow, we’re no longer interrupting. + self.interrupt = undefined + return spaceFactory( + effects, + effects.attempt(list, ok, nok), + types.linePrefix, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + )(code) + } +} + +function tokenizeIndent(effects, ok, nok) { + var self = this + + return spaceFactory( + effects, + afterPrefix, + types.listItemIndent, + self.containerState.size + 1 + ) + + function afterPrefix(code) { + return prefixSize(self.events, types.listItemIndent) === + self.containerState.size + ? ok(code) + : nok(code) + } +} + +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type) +} + +function tokenizeListItemPrefixWhitespace(effects, ok, nok) { + var self = this + + return spaceFactory( + effects, + afterPrefix, + types.listItemPrefixWhitespace, + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : constants.tabSize + 1 + ) + + function afterPrefix(code) { + return markdownSpace(code) || + !prefixSize(self.events, types.listItemPrefixWhitespace) + ? nok(code) + : ok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.js new file mode 100644 index 00000000000000..073824b3b6a18f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.js @@ -0,0 +1,21 @@ +'use strict' + +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +var partialBlankLine = { + tokenize: tokenizePartialBlankLine, + partial: true +} + +function tokenizePartialBlankLine(effects, ok, nok) { + return factorySpace(effects, afterWhitespace, types.linePrefix) + + function afterWhitespace(code) { + return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code) + } +} + +module.exports = partialBlankLine diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.mjs new file mode 100644 index 00000000000000..de85658576fea3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/partial-blank-line.mjs @@ -0,0 +1,18 @@ +var partialBlankLine = { + tokenize: tokenizePartialBlankLine, + partial: true +} +export default partialBlankLine + +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizePartialBlankLine(effects, ok, nok) { + return spaceFactory(effects, afterWhitespace, types.linePrefix) + + function afterWhitespace(code) { + return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.js new file mode 100644 index 00000000000000..9ac1e5c4e951c9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.js @@ -0,0 +1,138 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var types = require('../constant/types.js') +var shallow = require('../util/shallow.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var setextUnderline = { + name: 'setextUnderline', + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +} + +function resolveToSetextUnderline(events, context) { + var index = events.length + var content + var text + var definition + var heading + + // Find the opening of the content. + // It’ll always exist: we don’t tokenize if it isn’t there. + while (index--) { + if (events[index][0] === 'enter') { + if (events[index][1].type === types.content) { + content = index + break + } + + if (events[index][1].type === types.paragraph) { + text = index + } + } + // Exit + else { + if (events[index][1].type === types.content) { + // Remove the content end (if needed we’ll add it later) + events.splice(index, 1) + } + + if (!definition && events[index][1].type === types.definition) { + definition = index + } + } + } + + heading = { + type: types.setextHeading, + start: shallow(events[text][1].start), + end: shallow(events[events.length - 1][1].end) + } + + // Change the paragraph to setext heading text. + events[text][1].type = types.setextHeadingText + + // If we have definitions in the content, we’ll keep on having content, + // but we need move it. + if (definition) { + events.splice(text, 0, ['enter', heading, context]) + events.splice(definition + 1, 0, ['exit', events[content][1], context]) + events[content][1].end = shallow(events[definition][1].end) + } else { + events[content][1] = heading + } + + // Add the heading exit at the end. + events.push(['exit', heading, context]) + + return events +} + +function tokenizeSetextUnderline(effects, ok, nok) { + var self = this + var index = self.events.length + var marker + var paragraph + + // Find an opening. + while (index--) { + // Skip enter/exit of line ending, line prefix, and content. + // We can now either have a definition or a paragraph. + if ( + self.events[index][1].type !== types.lineEnding && + self.events[index][1].type !== types.linePrefix && + self.events[index][1].type !== types.content + ) { + paragraph = self.events[index][1].type === types.paragraph + break + } + } + + return start + + function start(code) { + assert__default['default']( + code === codes.dash || code === codes.equalsTo, + 'expected `=` or `-`' + ) + + if (!self.lazy && (self.interrupt || paragraph)) { + effects.enter(types.setextHeadingLine) + effects.enter(types.setextHeadingLineSequence) + marker = code + return closingSequence(code) + } + + return nok(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + return closingSequence + } + + effects.exit(types.setextHeadingLineSequence) + return factorySpace(effects, closingSequenceEnd, types.lineSuffix)(code) + } + + function closingSequenceEnd(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.setextHeadingLine) + return ok(code) + } + + return nok(code) + } +} + +module.exports = setextUnderline diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.mjs new file mode 100644 index 00000000000000..6724846b688806 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/setext-underline.mjs @@ -0,0 +1,129 @@ +var setextUnderline = { + name: 'setextUnderline', + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +} +export default setextUnderline + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import types from '../constant/types.mjs' +import shallow from '../util/shallow.mjs' +import spaceFactory from './factory-space.mjs' + +function resolveToSetextUnderline(events, context) { + var index = events.length + var content + var text + var definition + var heading + + // Find the opening of the content. + // It’ll always exist: we don’t tokenize if it isn’t there. + while (index--) { + if (events[index][0] === 'enter') { + if (events[index][1].type === types.content) { + content = index + break + } + + if (events[index][1].type === types.paragraph) { + text = index + } + } + // Exit + else { + if (events[index][1].type === types.content) { + // Remove the content end (if needed we’ll add it later) + events.splice(index, 1) + } + + if (!definition && events[index][1].type === types.definition) { + definition = index + } + } + } + + heading = { + type: types.setextHeading, + start: shallow(events[text][1].start), + end: shallow(events[events.length - 1][1].end) + } + + // Change the paragraph to setext heading text. + events[text][1].type = types.setextHeadingText + + // If we have definitions in the content, we’ll keep on having content, + // but we need move it. + if (definition) { + events.splice(text, 0, ['enter', heading, context]) + events.splice(definition + 1, 0, ['exit', events[content][1], context]) + events[content][1].end = shallow(events[definition][1].end) + } else { + events[content][1] = heading + } + + // Add the heading exit at the end. + events.push(['exit', heading, context]) + + return events +} + +function tokenizeSetextUnderline(effects, ok, nok) { + var self = this + var index = self.events.length + var marker + var paragraph + + // Find an opening. + while (index--) { + // Skip enter/exit of line ending, line prefix, and content. + // We can now either have a definition or a paragraph. + if ( + self.events[index][1].type !== types.lineEnding && + self.events[index][1].type !== types.linePrefix && + self.events[index][1].type !== types.content + ) { + paragraph = self.events[index][1].type === types.paragraph + break + } + } + + return start + + function start(code) { + assert( + code === codes.dash || code === codes.equalsTo, + 'expected `=` or `-`' + ) + + if (!self.lazy && (self.interrupt || paragraph)) { + effects.enter(types.setextHeadingLine) + effects.enter(types.setextHeadingLineSequence) + marker = code + return closingSequence(code) + } + + return nok(code) + } + + function closingSequence(code) { + if (code === marker) { + effects.consume(code) + return closingSequence + } + + effects.exit(types.setextHeadingLineSequence) + return spaceFactory(effects, closingSequenceEnd, types.lineSuffix)(code) + } + + function closingSequenceEnd(code) { + if (code === codes.eof || markdownLineEnding(code)) { + effects.exit(types.setextHeadingLine) + return ok(code) + } + + return nok(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.js new file mode 100644 index 00000000000000..a927a51cb17c22 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.js @@ -0,0 +1,74 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var markdownSpace = require('../character/markdown-space.js') +var constants = require('../constant/constants.js') +var types = require('../constant/types.js') +var factorySpace = require('./factory-space.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +var thematicBreak = { + name: 'thematicBreak', + tokenize: tokenizeThematicBreak +} + +function tokenizeThematicBreak(effects, ok, nok) { + var size = 0 + var marker + + return start + + function start(code) { + assert__default['default']( + code === codes.asterisk || + code === codes.dash || + code === codes.underscore, + 'expected `*`, `-`, or `_`' + ) + + effects.enter(types.thematicBreak) + marker = code + return atBreak(code) + } + + function atBreak(code) { + if (code === marker) { + effects.enter(types.thematicBreakSequence) + return sequence(code) + } + + if (markdownSpace(code)) { + return factorySpace(effects, atBreak, types.whitespace)(code) + } + + if ( + size < constants.thematicBreakMarkerCountMin || + (code !== codes.eof && !markdownLineEnding(code)) + ) { + return nok(code) + } + + effects.exit(types.thematicBreak) + return ok(code) + } + + function sequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return sequence + } + + effects.exit(types.thematicBreakSequence) + return atBreak(code) + } +} + +module.exports = thematicBreak diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.mjs new file mode 100644 index 00000000000000..58c4d7824de8cd --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/tokenize/thematic-break.mjs @@ -0,0 +1,65 @@ +var thematicBreak = { + name: 'thematicBreak', + tokenize: tokenizeThematicBreak +} +export default thematicBreak + +import assert from 'assert' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import markdownSpace from '../character/markdown-space.mjs' +import constants from '../constant/constants.mjs' +import types from '../constant/types.mjs' +import spaceFactory from './factory-space.mjs' + +function tokenizeThematicBreak(effects, ok, nok) { + var size = 0 + var marker + + return start + + function start(code) { + assert( + code === codes.asterisk || + code === codes.dash || + code === codes.underscore, + 'expected `*`, `-`, or `_`' + ) + + effects.enter(types.thematicBreak) + marker = code + return atBreak(code) + } + + function atBreak(code) { + if (code === marker) { + effects.enter(types.thematicBreakSequence) + return sequence(code) + } + + if (markdownSpace(code)) { + return spaceFactory(effects, atBreak, types.whitespace)(code) + } + + if ( + size < constants.thematicBreakMarkerCountMin || + (code !== codes.eof && !markdownLineEnding(code)) + ) { + return nok(code) + } + + effects.exit(types.thematicBreak) + return ok(code) + } + + function sequence(code) { + if (code === marker) { + effects.consume(code) + size++ + return sequence + } + + effects.exit(types.thematicBreakSequence) + return atBreak(code) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.js new file mode 100644 index 00000000000000..77689779959fbb --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.js @@ -0,0 +1,14 @@ +'use strict' + +var chunkedSplice = require('./chunked-splice.js') + +function chunkedPush(list, items) { + if (list.length) { + chunkedSplice(list, list.length, 0, items) + return list + } + + return items +} + +module.exports = chunkedPush diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.mjs new file mode 100644 index 00000000000000..3c84d8b7e17d5b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-push.mjs @@ -0,0 +1,12 @@ +export default chunkedPush + +import chunkedSplice from './chunked-splice.mjs' + +function chunkedPush(list, items) { + if (list.length) { + chunkedSplice(list, list.length, 0, items) + return list + } + + return items +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.js new file mode 100644 index 00000000000000..5a3246d8bc350d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.js @@ -0,0 +1,46 @@ +'use strict' + +var constants = require('../constant/constants.js') +var splice = require('../constant/splice.js') + +// `Array#splice` takes all items to be inserted as individual argument which +// causes a stack overflow in V8 when trying to insert 100k items for instance. +function chunkedSplice(list, start, remove, items) { + var end = list.length + var chunkStart = 0 + var parameters + + // Make start between zero and `end` (included). + if (start < 0) { + start = -start > end ? 0 : end + start + } else { + start = start > end ? end : start + } + + remove = remove > 0 ? remove : 0 + + // No need to chunk the items if there’s only a couple (10k) items. + if (items.length < constants.v8MaxSafeChunkSize) { + parameters = Array.from(items) + parameters.unshift(start, remove) + splice.apply(list, parameters) + } else { + // Delete `remove` items starting from `start` + if (remove) splice.apply(list, [start, remove]) + + // Insert the items in chunks to not cause stack overflows. + while (chunkStart < items.length) { + parameters = items.slice( + chunkStart, + chunkStart + constants.v8MaxSafeChunkSize + ) + parameters.unshift(start, 0) + splice.apply(list, parameters) + + chunkStart += constants.v8MaxSafeChunkSize + start += constants.v8MaxSafeChunkSize + } + } +} + +module.exports = chunkedSplice diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.mjs new file mode 100644 index 00000000000000..0bda9533bbaf91 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/chunked-splice.mjs @@ -0,0 +1,44 @@ +export default chunkedSplice + +import constants from '../constant/constants.mjs' +import splice from '../constant/splice.mjs' + +// `Array#splice` takes all items to be inserted as individual argument which +// causes a stack overflow in V8 when trying to insert 100k items for instance. +function chunkedSplice(list, start, remove, items) { + var end = list.length + var chunkStart = 0 + var parameters + + // Make start between zero and `end` (included). + if (start < 0) { + start = -start > end ? 0 : end + start + } else { + start = start > end ? end : start + } + + remove = remove > 0 ? remove : 0 + + // No need to chunk the items if there’s only a couple (10k) items. + if (items.length < constants.v8MaxSafeChunkSize) { + parameters = Array.from(items) + parameters.unshift(start, remove) + splice.apply(list, parameters) + } else { + // Delete `remove` items starting from `start` + if (remove) splice.apply(list, [start, remove]) + + // Insert the items in chunks to not cause stack overflows. + while (chunkStart < items.length) { + parameters = items.slice( + chunkStart, + chunkStart + constants.v8MaxSafeChunkSize + ) + parameters.unshift(start, 0) + splice.apply(list, parameters) + + chunkStart += constants.v8MaxSafeChunkSize + start += constants.v8MaxSafeChunkSize + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.js new file mode 100644 index 00000000000000..3c73c41f57f5f4 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.js @@ -0,0 +1,27 @@ +'use strict' + +var codes = require('../character/codes.js') +var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js') +var unicodePunctuation = require('../character/unicode-punctuation.js') +var unicodeWhitespace = require('../character/unicode-whitespace.js') +var constants = require('../constant/constants.js') + +// Classify whether a character is unicode whitespace, unicode punctuation, or +// anything else. +// Used for attention (emphasis, strong), whose sequences can open or close +// based on the class of surrounding characters. +function classifyCharacter(code) { + if ( + code === codes.eof || + markdownLineEndingOrSpace(code) || + unicodeWhitespace(code) + ) { + return constants.characterGroupWhitespace + } + + if (unicodePunctuation(code)) { + return constants.characterGroupPunctuation + } +} + +module.exports = classifyCharacter diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.mjs new file mode 100644 index 00000000000000..f701c8e0d02315 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/classify-character.mjs @@ -0,0 +1,25 @@ +export default classifyCharacter + +import codes from '../character/codes.mjs' +import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs' +import unicodePunctuation from '../character/unicode-punctuation.mjs' +import unicodeWhitespace from '../character/unicode-whitespace.mjs' +import constants from '../constant/constants.mjs' + +// Classify whether a character is unicode whitespace, unicode punctuation, or +// anything else. +// Used for attention (emphasis, strong), whose sequences can open or close +// based on the class of surrounding characters. +function classifyCharacter(code) { + if ( + code === codes.eof || + markdownLineEndingOrSpace(code) || + unicodeWhitespace(code) + ) { + return constants.characterGroupWhitespace + } + + if (unicodePunctuation(code)) { + return constants.characterGroupPunctuation + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.js new file mode 100644 index 00000000000000..830ec3bf258683 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.js @@ -0,0 +1,50 @@ +'use strict' + +var hasOwnProperty = require('../constant/has-own-property.js') +var chunkedSplice = require('./chunked-splice.js') +var miniflat = require('./miniflat.js') + +// Combine several syntax extensions into one. +function combineExtensions(extensions) { + var all = {} + var index = -1 + + while (++index < extensions.length) { + extension(all, extensions[index]) + } + + return all +} + +function extension(all, extension) { + var hook + var left + var right + var code + + for (hook in extension) { + left = hasOwnProperty.call(all, hook) ? all[hook] : (all[hook] = {}) + right = extension[hook] + + for (code in right) { + left[code] = constructs( + miniflat(right[code]), + hasOwnProperty.call(left, code) ? left[code] : [] + ) + } + } +} + +function constructs(list, existing) { + var index = -1 + var before = [] + + while (++index < list.length) { + ;(list[index].add === 'after' ? existing : before).push(list[index]) + } + + chunkedSplice(existing, 0, 0, before) + return existing +} + +module.exports = combineExtensions diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.mjs new file mode 100644 index 00000000000000..605652a8c8296e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-extensions.mjs @@ -0,0 +1,48 @@ +export default combineExtensions + +import own from '../constant/has-own-property.mjs' +import chunkedSplice from './chunked-splice.mjs' +import miniflat from './miniflat.mjs' + +// Combine several syntax extensions into one. +function combineExtensions(extensions) { + var all = {} + var index = -1 + + while (++index < extensions.length) { + extension(all, extensions[index]) + } + + return all +} + +function extension(all, extension) { + var hook + var left + var right + var code + + for (hook in extension) { + left = own.call(all, hook) ? all[hook] : (all[hook] = {}) + right = extension[hook] + + for (code in right) { + left[code] = constructs( + miniflat(right[code]), + own.call(left, code) ? left[code] : [] + ) + } + } +} + +function constructs(list, existing) { + var index = -1 + var before = [] + + while (++index < list.length) { + ;(list[index].add === 'after' ? existing : before).push(list[index]) + } + + chunkedSplice(existing, 0, 0, before) + return existing +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.js new file mode 100644 index 00000000000000..c4fdadaf070721 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.js @@ -0,0 +1,35 @@ +'use strict' + +var hasOwnProperty = require('../constant/has-own-property.js') + +// Combine several HTML extensions into one. +function combineHtmlExtensions(extensions) { + var handlers = {} + var index = -1 + + while (++index < extensions.length) { + extension(handlers, extensions[index]) + } + + return handlers +} + +function extension(handlers, extension) { + var hook + var left + var right + var type + + for (hook in extension) { + left = hasOwnProperty.call(handlers, hook) + ? handlers[hook] + : (handlers[hook] = {}) + right = extension[hook] + + for (type in right) { + left[type] = right[type] + } + } +} + +module.exports = combineHtmlExtensions diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.mjs new file mode 100644 index 00000000000000..d7e54e75dc5388 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/combine-html-extensions.mjs @@ -0,0 +1,31 @@ +export default combineHtmlExtensions + +import own from '../constant/has-own-property.mjs' + +// Combine several HTML extensions into one. +function combineHtmlExtensions(extensions) { + var handlers = {} + var index = -1 + + while (++index < extensions.length) { + extension(handlers, extensions[index]) + } + + return handlers +} + +function extension(handlers, extension) { + var hook + var left + var right + var type + + for (hook in extension) { + left = own.call(handlers, hook) ? handlers[hook] : (handlers[hook] = {}) + right = extension[hook] + + for (type in right) { + left[type] = right[type] + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.js new file mode 100644 index 00000000000000..dac8901405bccc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.js @@ -0,0 +1,440 @@ +'use strict' + +var assert = require('assert') +var createDebug = require('debug') +var assign = require('../constant/assign.js') +var codes = require('../character/codes.js') +var markdownLineEnding = require('../character/markdown-line-ending.js') +var chunkedPush = require('./chunked-push.js') +var chunkedSplice = require('./chunked-splice.js') +var miniflat = require('./miniflat.js') +var resolveAll = require('./resolve-all.js') +var serializeChunks = require('./serialize-chunks.js') +var shallow = require('./shallow.js') +var sliceChunks = require('./slice-chunks.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) +var createDebug__default = /*#__PURE__*/ _interopDefaultLegacy(createDebug) + +var debug = createDebug__default['default']('micromark') + +// Create a tokenizer. +// Tokenizers deal with one type of data (e.g., containers, flow, text). +// The parser is the object dealing with it all. +// `initialize` works like other constructs, except that only its `tokenize` +// function is used, in which case it doesn’t receive an `ok` or `nok`. +// `from` can be given to set the point before the first character, although +// when further lines are indented, they must be set with `defineSkip`. +function createTokenizer(parser, initialize, from) { + var point = from ? shallow(from) : {line: 1, column: 1, offset: 0} + var columnStart = {} + var resolveAllConstructs = [] + var chunks = [] + var stack = [] + var consumed = true + + // Tools used for tokenizing. + var effects = { + consume: consume, + enter: enter, + exit: exit, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, {interrupt: true}), + lazy: constructFactory(onsuccessfulcheck, {lazy: true}) + } + + // State and tools for resolving and serializing. + var context = { + previous: codes.eof, + events: [], + parser: parser, + sliceStream: sliceStream, + sliceSerialize: sliceSerialize, + now: now, + defineSkip: skip, + write: write + } + + // The state function. + var state = initialize.tokenize.call(context, effects) + + // Track which character we expect to be consumed, to catch bugs. + var expectedCode + + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize) + } + + // Store where we are in the input stream. + point._index = 0 + point._bufferIndex = -1 + + return context + + function write(slice) { + chunks = chunkedPush(chunks, slice) + + main() + + // Exit if we’re not done, resolve might change stuff. + if (chunks[chunks.length - 1] !== codes.eof) { + return [] + } + + addResult(initialize, 0) + + // Otherwise, resolve, and exit. + context.events = resolveAll(resolveAllConstructs, context.events, context) + + return context.events + } + + // + // Tools. + // + + function sliceSerialize(token) { + return serializeChunks(sliceStream(token)) + } + + function sliceStream(token) { + return sliceChunks(chunks, token) + } + + function now() { + return shallow(point) + } + + function skip(value) { + columnStart[value.line] = value.column + accountForPotentialSkip() + debug('position: define skip: `%j`', point) + } + + // + // State management. + // + + // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by + // `consume`). + // Here is where we walk through the chunks, which either include strings of + // several characters, or numerical character codes. + // The reason to do this in a loop instead of a call is so the stack can + // drain. + function main() { + var chunkIndex + var chunk + + while (point._index < chunks.length) { + chunk = chunks[point._index] + + // If we’re in a buffer chunk, loop through it. + if (typeof chunk === 'string') { + chunkIndex = point._index + + if (point._bufferIndex < 0) { + point._bufferIndex = 0 + } + + while ( + point._index === chunkIndex && + point._bufferIndex < chunk.length + ) { + go(chunk.charCodeAt(point._bufferIndex)) + } + } else { + go(chunk) + } + } + } + + // Deal with one code. + function go(code) { + assert__default['default'].equal( + consumed, + true, + 'expected character to be consumed' + ) + consumed = undefined + debug('main: passing `%s` to %s', code, state.name) + expectedCode = code + state = state(code) + } + + // Move a character forward. + function consume(code) { + assert__default['default'].equal( + code, + expectedCode, + 'expected given code to equal expected code' + ) + + debug('consume: `%s`', code) + + assert__default['default'].equal( + consumed, + undefined, + 'expected code to not have been consumed' + ) + assert__default['default']( + code === null + ? !context.events.length || + context.events[context.events.length - 1][0] === 'exit' + : context.events[context.events.length - 1][0] === 'enter', + 'expected last token to be open' + ) + + if (markdownLineEnding(code)) { + point.line++ + point.column = 1 + point.offset += code === codes.carriageReturnLineFeed ? 2 : 1 + accountForPotentialSkip() + debug('position: after eol: `%j`', point) + } else if (code !== codes.virtualSpace) { + point.column++ + point.offset++ + } + + // Not in a string chunk. + if (point._bufferIndex < 0) { + point._index++ + } else { + point._bufferIndex++ + + // At end of string chunk. + if (point._bufferIndex === chunks[point._index].length) { + point._bufferIndex = -1 + point._index++ + } + } + + // Expose the previous character. + context.previous = code + + // Mark as consumed. + consumed = true + } + + // Start a token. + function enter(type, fields) { + var token = fields || {} + token.type = type + token.start = now() + + assert__default['default'].equal( + typeof type, + 'string', + 'expected string type' + ) + assert__default['default'].notEqual( + type.length, + 0, + 'expected non-empty string' + ) + debug('enter: `%s`', type) + + context.events.push(['enter', token, context]) + + stack.push(token) + + return token + } + + // Stop a token. + function exit(type) { + assert__default['default'].equal( + typeof type, + 'string', + 'expected string type' + ) + assert__default['default'].notEqual( + type.length, + 0, + 'expected non-empty string' + ) + assert__default['default'].notEqual( + stack.length, + 0, + 'cannot close w/o open tokens' + ) + + var token = stack.pop() + token.end = now() + + assert__default['default'].equal( + type, + token.type, + 'expected exit token to match current token' + ) + + assert__default['default']( + !( + token.start._index === token.end._index && + token.start._bufferIndex === token.end._bufferIndex + ), + 'expected non-empty token (`' + type + '`)' + ) + + debug('exit: `%s`', token.type) + context.events.push(['exit', token, context]) + + return token + } + + // Use results. + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from) + } + + // Discard results. + function onsuccessfulcheck(construct, info) { + info.restore() + } + + // Factory to attempt/check/interrupt. + function constructFactory(onreturn, fields) { + return hook + + // Handle either an object mapping codes to constructs, a list of + // constructs, or a single construct. + function hook(constructs, returnState, bogusState) { + var listOfConstructs + var constructIndex + var currentConstruct + var info + + return constructs.tokenize || 'length' in constructs + ? handleListOfConstructs(miniflat(constructs)) + : handleMapOfConstructs + + function handleMapOfConstructs(code) { + if (code in constructs || codes.eof in constructs) { + return handleListOfConstructs( + constructs.null + ? /* c8 ignore next */ + miniflat(constructs[code]).concat(miniflat(constructs.null)) + : constructs[code] + )(code) + } + + return bogusState(code) + } + + function handleListOfConstructs(list) { + listOfConstructs = list + constructIndex = 0 + return handleConstruct(list[constructIndex]) + } + + function handleConstruct(construct) { + return start + + function start(code) { + // To do: not nede to store if there is no bogus state, probably? + // Currently doesn’t work because `inspect` in document does a check + // w/o a bogus, which doesn’t make sense. But it does seem to help perf + // by not storing. + info = store() + currentConstruct = construct + + if (!construct.partial) { + context.currentConstruct = construct + } + + if ( + construct.name && + context.parser.constructs.disable.null.indexOf(construct.name) > -1 + ) { + return nok(code) + } + + return construct.tokenize.call( + fields ? assign({}, context, fields) : context, + effects, + ok, + nok + )(code) + } + } + + function ok(code) { + assert__default['default'].equal(code, expectedCode, 'expected code') + consumed = true + onreturn(currentConstruct, info) + return returnState + } + + function nok(code) { + assert__default['default'].equal(code, expectedCode, 'expected code') + consumed = true + info.restore() + + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]) + } + + return bogusState + } + } + } + + function addResult(construct, from) { + if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) { + resolveAllConstructs.push(construct) + } + + if (construct.resolve) { + chunkedSplice( + context.events, + from, + context.events.length - from, + construct.resolve(context.events.slice(from), context) + ) + } + + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context) + } + + assert__default['default']( + construct.partial || + !context.events.length || + context.events[context.events.length - 1][0] === 'exit', + 'expected last token to end' + ) + } + + function store() { + var startPoint = now() + var startPrevious = context.previous + var startCurrentConstruct = context.currentConstruct + var startEventsIndex = context.events.length + var startStack = Array.from(stack) + + return {restore: restore, from: startEventsIndex} + + function restore() { + point = startPoint + context.previous = startPrevious + context.currentConstruct = startCurrentConstruct + context.events.length = startEventsIndex + stack = startStack + accountForPotentialSkip() + debug('position: restore: `%j`', point) + } + } + + function accountForPotentialSkip() { + if (point.line in columnStart && point.column < 2) { + point.column = columnStart[point.line] + point.offset += columnStart[point.line] - 1 + } + } +} + +module.exports = createTokenizer diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.mjs new file mode 100644 index 00000000000000..6e8808ea767bd8 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/create-tokenizer.mjs @@ -0,0 +1,399 @@ +export default createTokenizer + +import assert from 'assert' +import createDebug from 'debug' +import assign from '../constant/assign.mjs' +import codes from '../character/codes.mjs' +import markdownLineEnding from '../character/markdown-line-ending.mjs' +import chunkedPush from './chunked-push.mjs' +import chunkedSplice from './chunked-splice.mjs' +import miniflat from './miniflat.mjs' +import resolveAll from './resolve-all.mjs' +import serializeChunks from './serialize-chunks.mjs' +import shallow from './shallow.mjs' +import sliceChunks from './slice-chunks.mjs' + +var debug = createDebug('micromark') + +// Create a tokenizer. +// Tokenizers deal with one type of data (e.g., containers, flow, text). +// The parser is the object dealing with it all. +// `initialize` works like other constructs, except that only its `tokenize` +// function is used, in which case it doesn’t receive an `ok` or `nok`. +// `from` can be given to set the point before the first character, although +// when further lines are indented, they must be set with `defineSkip`. +function createTokenizer(parser, initialize, from) { + var point = from ? shallow(from) : {line: 1, column: 1, offset: 0} + var columnStart = {} + var resolveAllConstructs = [] + var chunks = [] + var stack = [] + var consumed = true + + // Tools used for tokenizing. + var effects = { + consume: consume, + enter: enter, + exit: exit, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, {interrupt: true}), + lazy: constructFactory(onsuccessfulcheck, {lazy: true}) + } + + // State and tools for resolving and serializing. + var context = { + previous: codes.eof, + events: [], + parser: parser, + sliceStream: sliceStream, + sliceSerialize: sliceSerialize, + now: now, + defineSkip: skip, + write: write + } + + // The state function. + var state = initialize.tokenize.call(context, effects) + + // Track which character we expect to be consumed, to catch bugs. + var expectedCode + + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize) + } + + // Store where we are in the input stream. + point._index = 0 + point._bufferIndex = -1 + + return context + + function write(slice) { + chunks = chunkedPush(chunks, slice) + + main() + + // Exit if we’re not done, resolve might change stuff. + if (chunks[chunks.length - 1] !== codes.eof) { + return [] + } + + addResult(initialize, 0) + + // Otherwise, resolve, and exit. + context.events = resolveAll(resolveAllConstructs, context.events, context) + + return context.events + } + + // + // Tools. + // + + function sliceSerialize(token) { + return serializeChunks(sliceStream(token)) + } + + function sliceStream(token) { + return sliceChunks(chunks, token) + } + + function now() { + return shallow(point) + } + + function skip(value) { + columnStart[value.line] = value.column + accountForPotentialSkip() + debug('position: define skip: `%j`', point) + } + + // + // State management. + // + + // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by + // `consume`). + // Here is where we walk through the chunks, which either include strings of + // several characters, or numerical character codes. + // The reason to do this in a loop instead of a call is so the stack can + // drain. + function main() { + var chunkIndex + var chunk + + while (point._index < chunks.length) { + chunk = chunks[point._index] + + // If we’re in a buffer chunk, loop through it. + if (typeof chunk === 'string') { + chunkIndex = point._index + + if (point._bufferIndex < 0) { + point._bufferIndex = 0 + } + + while ( + point._index === chunkIndex && + point._bufferIndex < chunk.length + ) { + go(chunk.charCodeAt(point._bufferIndex)) + } + } else { + go(chunk) + } + } + } + + // Deal with one code. + function go(code) { + assert.equal(consumed, true, 'expected character to be consumed') + consumed = undefined + debug('main: passing `%s` to %s', code, state.name) + expectedCode = code + state = state(code) + } + + // Move a character forward. + function consume(code) { + assert.equal( + code, + expectedCode, + 'expected given code to equal expected code' + ) + + debug('consume: `%s`', code) + + assert.equal(consumed, undefined, 'expected code to not have been consumed') + assert( + code === null + ? !context.events.length || + context.events[context.events.length - 1][0] === 'exit' + : context.events[context.events.length - 1][0] === 'enter', + 'expected last token to be open' + ) + + if (markdownLineEnding(code)) { + point.line++ + point.column = 1 + point.offset += code === codes.carriageReturnLineFeed ? 2 : 1 + accountForPotentialSkip() + debug('position: after eol: `%j`', point) + } else if (code !== codes.virtualSpace) { + point.column++ + point.offset++ + } + + // Not in a string chunk. + if (point._bufferIndex < 0) { + point._index++ + } else { + point._bufferIndex++ + + // At end of string chunk. + if (point._bufferIndex === chunks[point._index].length) { + point._bufferIndex = -1 + point._index++ + } + } + + // Expose the previous character. + context.previous = code + + // Mark as consumed. + consumed = true + } + + // Start a token. + function enter(type, fields) { + var token = fields || {} + token.type = type + token.start = now() + + assert.equal(typeof type, 'string', 'expected string type') + assert.notEqual(type.length, 0, 'expected non-empty string') + debug('enter: `%s`', type) + + context.events.push(['enter', token, context]) + + stack.push(token) + + return token + } + + // Stop a token. + function exit(type) { + assert.equal(typeof type, 'string', 'expected string type') + assert.notEqual(type.length, 0, 'expected non-empty string') + assert.notEqual(stack.length, 0, 'cannot close w/o open tokens') + + var token = stack.pop() + token.end = now() + + assert.equal(type, token.type, 'expected exit token to match current token') + + assert( + !( + token.start._index === token.end._index && + token.start._bufferIndex === token.end._bufferIndex + ), + 'expected non-empty token (`' + type + '`)' + ) + + debug('exit: `%s`', token.type) + context.events.push(['exit', token, context]) + + return token + } + + // Use results. + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from) + } + + // Discard results. + function onsuccessfulcheck(construct, info) { + info.restore() + } + + // Factory to attempt/check/interrupt. + function constructFactory(onreturn, fields) { + return hook + + // Handle either an object mapping codes to constructs, a list of + // constructs, or a single construct. + function hook(constructs, returnState, bogusState) { + var listOfConstructs + var constructIndex + var currentConstruct + var info + + return constructs.tokenize || 'length' in constructs + ? handleListOfConstructs(miniflat(constructs)) + : handleMapOfConstructs + + function handleMapOfConstructs(code) { + if (code in constructs || codes.eof in constructs) { + return handleListOfConstructs( + constructs.null + ? /* c8 ignore next */ + miniflat(constructs[code]).concat(miniflat(constructs.null)) + : constructs[code] + )(code) + } + + return bogusState(code) + } + + function handleListOfConstructs(list) { + listOfConstructs = list + constructIndex = 0 + return handleConstruct(list[constructIndex]) + } + + function handleConstruct(construct) { + return start + + function start(code) { + // To do: not nede to store if there is no bogus state, probably? + // Currently doesn’t work because `inspect` in document does a check + // w/o a bogus, which doesn’t make sense. But it does seem to help perf + // by not storing. + info = store() + currentConstruct = construct + + if (!construct.partial) { + context.currentConstruct = construct + } + + if ( + construct.name && + context.parser.constructs.disable.null.indexOf(construct.name) > -1 + ) { + return nok(code) + } + + return construct.tokenize.call( + fields ? assign({}, context, fields) : context, + effects, + ok, + nok + )(code) + } + } + + function ok(code) { + assert.equal(code, expectedCode, 'expected code') + consumed = true + onreturn(currentConstruct, info) + return returnState + } + + function nok(code) { + assert.equal(code, expectedCode, 'expected code') + consumed = true + info.restore() + + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]) + } + + return bogusState + } + } + } + + function addResult(construct, from) { + if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) { + resolveAllConstructs.push(construct) + } + + if (construct.resolve) { + chunkedSplice( + context.events, + from, + context.events.length - from, + construct.resolve(context.events.slice(from), context) + ) + } + + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context) + } + + assert( + construct.partial || + !context.events.length || + context.events[context.events.length - 1][0] === 'exit', + 'expected last token to end' + ) + } + + function store() { + var startPoint = now() + var startPrevious = context.previous + var startCurrentConstruct = context.currentConstruct + var startEventsIndex = context.events.length + var startStack = Array.from(stack) + + return {restore: restore, from: startEventsIndex} + + function restore() { + point = startPoint + context.previous = startPrevious + context.currentConstruct = startCurrentConstruct + context.events.length = startEventsIndex + stack = startStack + accountForPotentialSkip() + debug('position: restore: `%j`', point) + } + } + + function accountForPotentialSkip() { + if (point.line in columnStart && point.column < 2) { + point.column = columnStart[point.line] + point.offset += columnStart[point.line] - 1 + } + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.js new file mode 100644 index 00000000000000..39c5dd4f6435fc --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.js @@ -0,0 +1,11 @@ +'use strict' + +function miniflat(value) { + return value === null || value === undefined + ? [] + : 'length' in value + ? value + : [value] +} + +module.exports = miniflat diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.mjs new file mode 100644 index 00000000000000..7fad196c63931d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/miniflat.mjs @@ -0,0 +1,9 @@ +export default miniflat + +function miniflat(value) { + return value === null || value === undefined + ? [] + : 'length' in value + ? value + : [value] +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.js new file mode 100644 index 00000000000000..830807fbba5f73 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.js @@ -0,0 +1,12 @@ +'use strict' + +// Note! `move` only works inside lines! It’s not possible to move past other +// chunks (replacement characters, tabs, or line endings). +function movePoint(point, offset) { + point.column += offset + point.offset += offset + point._bufferIndex += offset + return point +} + +module.exports = movePoint diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.mjs new file mode 100644 index 00000000000000..8192df49aa6048 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/move-point.mjs @@ -0,0 +1,10 @@ +export default movePoint + +// Note! `move` only works inside lines! It’s not possible to move past other +// chunks (replacement characters, tabs, or line endings). +function movePoint(point, offset) { + point.column += offset + point.offset += offset + point._bufferIndex += offset + return point +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.js new file mode 100644 index 00000000000000..0d9d7c0e18d7f8 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.js @@ -0,0 +1,23 @@ +'use strict' + +var values = require('../character/values.js') + +function normalizeIdentifier(value) { + return ( + value + // Collapse Markdown whitespace. + .replace(/[\t\n\r ]+/g, values.space) + // Trim. + .replace(/^ | $/g, '') + // Some characters are considered “uppercase”, but if their lowercase + // counterpart is uppercased will result in a different uppercase + // character. + // Hence, to get that form, we perform both lower- and uppercase. + // Upper case makes sure keys will not interact with default prototypal + // methods: no object method is uppercase. + .toLowerCase() + .toUpperCase() + ) +} + +module.exports = normalizeIdentifier diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.mjs new file mode 100644 index 00000000000000..2a383ae1156464 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-identifier.mjs @@ -0,0 +1,21 @@ +export default normalizeIdentifier + +import values from '../character/values.mjs' + +function normalizeIdentifier(value) { + return ( + value + // Collapse Markdown whitespace. + .replace(/[\t\n\r ]+/g, values.space) + // Trim. + .replace(/^ | $/g, '') + // Some characters are considered “uppercase”, but if their lowercase + // counterpart is uppercased will result in a different uppercase + // character. + // Hence, to get that form, we perform both lower- and uppercase. + // Upper case makes sure keys will not interact with default prototypal + // methods: no object method is uppercase. + .toLowerCase() + .toUpperCase() + ) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.js new file mode 100644 index 00000000000000..e4a07c1df66bba --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.js @@ -0,0 +1,70 @@ +'use strict' + +var asciiAlphanumeric = require('../character/ascii-alphanumeric.js') +var codes = require('../character/codes.js') +var values = require('../character/values.js') +var fromCharCode = require('../constant/from-char-code.js') + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +function normalizeUri(value) { + var index = -1 + var result = [] + var start = 0 + var skip = 0 + var code + var next + var replace + + while (++index < value.length) { + code = value.charCodeAt(index) + + // A correct percent encoded value. + if ( + code === codes.percentSign && + asciiAlphanumeric(value.charCodeAt(index + 1)) && + asciiAlphanumeric(value.charCodeAt(index + 2)) + ) { + skip = 2 + } + // ASCII. + else if (code < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(fromCharCode(code))) { + replace = fromCharCode(code) + } + } + // Astral. + else if (code > 55295 && code < 57344) { + next = value.charCodeAt(index + 1) + + // A correct surrogate pair. + if (code < 56320 && next > 56319 && next < 57344) { + replace = fromCharCode(code, next) + skip = 1 + } + // Lone surrogate. + else { + replace = values.replacementCharacter + } + } + // Unicode. + else { + replace = fromCharCode(code) + } + + if (replace) { + result.push(value.slice(start, index), encodeURIComponent(replace)) + start = index + skip + 1 + replace = undefined + } + + if (skip) { + index += skip + skip = 0 + } + } + + return result.join('') + value.slice(start) +} + +module.exports = normalizeUri diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.mjs new file mode 100644 index 00000000000000..3102243354dab5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/normalize-uri.mjs @@ -0,0 +1,68 @@ +export default normalizeUri + +import asciiAlphanumeric from '../character/ascii-alphanumeric.mjs' +import codes from '../character/codes.mjs' +import values from '../character/values.mjs' +import fromCharCode from '../constant/from-char-code.mjs' + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +function normalizeUri(value) { + var index = -1 + var result = [] + var start = 0 + var skip = 0 + var code + var next + var replace + + while (++index < value.length) { + code = value.charCodeAt(index) + + // A correct percent encoded value. + if ( + code === codes.percentSign && + asciiAlphanumeric(value.charCodeAt(index + 1)) && + asciiAlphanumeric(value.charCodeAt(index + 2)) + ) { + skip = 2 + } + // ASCII. + else if (code < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(fromCharCode(code))) { + replace = fromCharCode(code) + } + } + // Astral. + else if (code > 55295 && code < 57344) { + next = value.charCodeAt(index + 1) + + // A correct surrogate pair. + if (code < 56320 && next > 56319 && next < 57344) { + replace = fromCharCode(code, next) + skip = 1 + } + // Lone surrogate. + else { + replace = values.replacementCharacter + } + } + // Unicode. + else { + replace = fromCharCode(code) + } + + if (replace) { + result.push(value.slice(start, index), encodeURIComponent(replace)) + start = index + skip + 1 + replace = undefined + } + + if (skip) { + index += skip + skip = 0 + } + } + + return result.join('') + value.slice(start) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.js new file mode 100644 index 00000000000000..a560e3e83a9215 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.js @@ -0,0 +1,11 @@ +'use strict' + +var sizeChunks = require('./size-chunks.js') + +function prefixSize(events, type) { + var tail = events[events.length - 1] + if (!tail || tail[1].type !== type) return 0 + return sizeChunks(tail[2].sliceStream(tail[1])) +} + +module.exports = prefixSize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.mjs new file mode 100644 index 00000000000000..473e18a29c22d2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/prefix-size.mjs @@ -0,0 +1,9 @@ +export default prefixSize + +import sizeChunks from './size-chunks.mjs' + +function prefixSize(events, type) { + var tail = events[events.length - 1] + if (!tail || tail[1].type !== type) return 0 + return sizeChunks(tail[2].sliceStream(tail[1])) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.js new file mode 100644 index 00000000000000..895772e67d9219 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.js @@ -0,0 +1,12 @@ +'use strict' + +var fromCharCode = require('../constant/from-char-code.js') + +function regexCheck(regex) { + return check + function check(code) { + return regex.test(fromCharCode(code)) + } +} + +module.exports = regexCheck diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.mjs new file mode 100644 index 00000000000000..f4bc0fd61ab00a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/regex-check.mjs @@ -0,0 +1,10 @@ +export default regexCheck + +import fromCharCode from '../constant/from-char-code.mjs' + +function regexCheck(regex) { + return check + function check(code) { + return regex.test(fromCharCode(code)) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.js new file mode 100644 index 00000000000000..3e8d76b4a460a2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.js @@ -0,0 +1,20 @@ +'use strict' + +function resolveAll(constructs, events, context) { + var called = [] + var index = -1 + var resolve + + while (++index < constructs.length) { + resolve = constructs[index].resolveAll + + if (resolve && called.indexOf(resolve) < 0) { + events = resolve(events, context) + called.push(resolve) + } + } + + return events +} + +module.exports = resolveAll diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.mjs new file mode 100644 index 00000000000000..1a70eebe9bef2f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/resolve-all.mjs @@ -0,0 +1,18 @@ +export default resolveAll + +function resolveAll(constructs, events, context) { + var called = [] + var index = -1 + var resolve + + while (++index < constructs.length) { + resolve = constructs[index].resolveAll + + if (resolve && called.indexOf(resolve) < 0) { + events = resolve(events, context) + called.push(resolve) + } + } + + return events +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.js new file mode 100644 index 00000000000000..e5e642892abb1c --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.js @@ -0,0 +1,32 @@ +'use strict' + +var codes = require('../character/codes.js') +var values = require('../character/values.js') +var fromCharCode = require('../constant/from-char-code.js') + +function safeFromInt(value, base) { + var code = parseInt(value, base) + + if ( + // C0 except for HT, LF, FF, CR, space + code < codes.ht || + code === codes.vt || + (code > codes.cr && code < codes.space) || + // Control character (DEL) of the basic block and C1 controls. + (code > codes.tilde && code < 160) || + // Lone high surrogates and low surrogates. + (code > 55295 && code < 57344) || + // Noncharacters. + (code > 64975 && code < 65008) || + (code & 65535) === 65535 || + (code & 65535) === 65534 || + // Out of range + code > 1114111 + ) { + return values.replacementCharacter + } + + return fromCharCode(code) +} + +module.exports = safeFromInt diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.mjs new file mode 100644 index 00000000000000..e218d4715685b8 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/safe-from-int.mjs @@ -0,0 +1,30 @@ +export default safeFromInt + +import codes from '../character/codes.mjs' +import values from '../character/values.mjs' +import fromCharCode from '../constant/from-char-code.mjs' + +function safeFromInt(value, base) { + var code = parseInt(value, base) + + if ( + // C0 except for HT, LF, FF, CR, space + code < codes.ht || + code === codes.vt || + (code > codes.cr && code < codes.space) || + // Control character (DEL) of the basic block and C1 controls. + (code > codes.tilde && code < 160) || + // Lone high surrogates and low surrogates. + (code > 55295 && code < 57344) || + // Noncharacters. + (code > 64975 && code < 65008) || + (code & 65535) === 65535 || + (code & 65535) === 65534 || + // Out of range + code > 1114111 + ) { + return values.replacementCharacter + } + + return fromCharCode(code) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.js new file mode 100644 index 00000000000000..4d01d915561ee5 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.js @@ -0,0 +1,54 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var values = require('../character/values.js') +var fromCharCode = require('../constant/from-char-code.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +function serializeChunks(chunks) { + var index = -1 + var result = [] + var chunk + var value + var atTab + + while (++index < chunks.length) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + value = chunk + } else if (chunk === codes.carriageReturn) { + value = values.cr + } else if (chunk === codes.lineFeed) { + value = values.lf + } else if (chunk === codes.carriageReturnLineFeed) { + value = values.cr + values.lf + } else if (chunk === codes.horizontalTab) { + value = values.ht + } else if (chunk === codes.virtualSpace) { + if (atTab) continue + value = values.space + } else { + assert__default['default'].equal( + typeof chunk, + 'number', + 'expected number' + ) + // Currently only replacement character. + value = fromCharCode(chunk) + } + + atTab = chunk === codes.horizontalTab + result.push(value) + } + + return result.join('') +} + +module.exports = serializeChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.mjs new file mode 100644 index 00000000000000..42ab3a9a6b3ad6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/serialize-chunks.mjs @@ -0,0 +1,42 @@ +export default serializeChunks + +import assert from 'assert' +import codes from '../character/codes.mjs' +import values from '../character/values.mjs' +import fromCharCode from '../constant/from-char-code.mjs' + +function serializeChunks(chunks) { + var index = -1 + var result = [] + var chunk + var value + var atTab + + while (++index < chunks.length) { + chunk = chunks[index] + + if (typeof chunk === 'string') { + value = chunk + } else if (chunk === codes.carriageReturn) { + value = values.cr + } else if (chunk === codes.lineFeed) { + value = values.lf + } else if (chunk === codes.carriageReturnLineFeed) { + value = values.cr + values.lf + } else if (chunk === codes.horizontalTab) { + value = values.ht + } else if (chunk === codes.virtualSpace) { + if (atTab) continue + value = values.space + } else { + assert.equal(typeof chunk, 'number', 'expected number') + // Currently only replacement character. + value = fromCharCode(chunk) + } + + atTab = chunk === codes.horizontalTab + result.push(value) + } + + return result.join('') +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.js new file mode 100644 index 00000000000000..f980ab99e4c090 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.js @@ -0,0 +1,9 @@ +'use strict' + +var assign = require('../constant/assign.js') + +function shallow(object) { + return assign({}, object) +} + +module.exports = shallow diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.mjs new file mode 100644 index 00000000000000..e121ccaa4a1095 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/shallow.mjs @@ -0,0 +1,7 @@ +export default shallow + +import assign from '../constant/assign.mjs' + +function shallow(object) { + return assign({}, object) +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.js new file mode 100644 index 00000000000000..6b2f5ec792e12a --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.js @@ -0,0 +1,16 @@ +'use strict' + +// Measure the number of character codes in chunks. +// Counts tabs based on their expanded size, and CR+LF as one character. +function sizeChunks(chunks) { + var index = -1 + var size = 0 + + while (++index < chunks.length) { + size += typeof chunks[index] === 'string' ? chunks[index].length : 1 + } + + return size +} + +module.exports = sizeChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.mjs new file mode 100644 index 00000000000000..d3305bbb61b8c3 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/size-chunks.mjs @@ -0,0 +1,14 @@ +export default sizeChunks + +// Measure the number of character codes in chunks. +// Counts tabs based on their expanded size, and CR+LF as one character. +function sizeChunks(chunks) { + var index = -1 + var size = 0 + + while (++index < chunks.length) { + size += typeof chunks[index] === 'string' ? chunks[index].length : 1 + } + + return size +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.js new file mode 100644 index 00000000000000..b52c8dcc9ee186 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.js @@ -0,0 +1,43 @@ +'use strict' + +var assert = require('assert') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +function sliceChunks(chunks, token) { + var startIndex = token.start._index + var startBufferIndex = token.start._bufferIndex + var endIndex = token.end._index + var endBufferIndex = token.end._bufferIndex + var view + + if (startIndex === endIndex) { + assert__default['default']( + endBufferIndex > -1, + 'expected non-negative end buffer index' + ) + assert__default['default']( + startBufferIndex > -1, + 'expected non-negative start buffer index' + ) + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] + } else { + view = chunks.slice(startIndex, endIndex) + + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex) + } + + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)) + } + } + + return view +} + +module.exports = sliceChunks diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.mjs new file mode 100644 index 00000000000000..987bbe1db526d9 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/slice-chunks.mjs @@ -0,0 +1,29 @@ +export default sliceChunks + +import assert from 'assert' + +function sliceChunks(chunks, token) { + var startIndex = token.start._index + var startBufferIndex = token.start._bufferIndex + var endIndex = token.end._index + var endBufferIndex = token.end._bufferIndex + var view + + if (startIndex === endIndex) { + assert(endBufferIndex > -1, 'expected non-negative end buffer index') + assert(startBufferIndex > -1, 'expected non-negative start buffer index') + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] + } else { + view = chunks.slice(startIndex, endIndex) + + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex) + } + + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)) + } + } + + return view +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.js new file mode 100644 index 00000000000000..9e7648c00fe79f --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.js @@ -0,0 +1,219 @@ +'use strict' + +var assert = require('assert') +var codes = require('../character/codes.js') +var assign = require('../constant/assign.js') +var types = require('../constant/types.js') +var chunkedSplice = require('./chunked-splice.js') +var shallow = require('./shallow.js') + +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} +} + +var assert__default = /*#__PURE__*/ _interopDefaultLegacy(assert) + +function subtokenize(events) { + var jumps = {} + var index = -1 + var event + var lineIndex + var otherIndex + var otherEvent + var parameters + var subevents + var more + + while (++index < events.length) { + while (index in jumps) { + index = jumps[index] + } + + event = events[index] + + // Add a hook for the GFM tasklist extension, which needs to know if text + // is in the first content of a list item. + if ( + index && + event[1].type === types.chunkFlow && + events[index - 1][1].type === types.listItemPrefix + ) { + subevents = event[1]._tokenizer.events + otherIndex = 0 + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === types.lineEndingBlank + ) { + otherIndex += 2 + } + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === types.content + ) { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === types.content) { + break + } + + if (subevents[otherIndex][1].type === types.chunkText) { + subevents[otherIndex][1].isInFirstContentOfListItem = true + otherIndex++ + } + } + } + } + + // Enter. + if (event[0] === 'enter') { + if (event[1].contentType) { + assign(jumps, subcontent(events, index)) + index = jumps[index] + more = true + } + } + // Exit. + else if (event[1]._container || event[1]._movePreviousLineEndings) { + otherIndex = index + lineIndex = undefined + + while (otherIndex--) { + otherEvent = events[otherIndex] + + if ( + otherEvent[1].type === types.lineEnding || + otherEvent[1].type === types.lineEndingBlank + ) { + if (otherEvent[0] === 'enter') { + if (lineIndex) { + events[lineIndex][1].type = types.lineEndingBlank + } + + otherEvent[1].type = types.lineEnding + lineIndex = otherIndex + } + } else { + break + } + } + + if (lineIndex) { + // Fix position. + event[1].end = shallow(events[lineIndex][1].start) + + // Switch container exit w/ line endings. + parameters = events.slice(lineIndex, index) + parameters.unshift(event) + chunkedSplice(events, lineIndex, index - lineIndex + 1, parameters) + } + } + } + + return !more +} + +function subcontent(events, eventIndex) { + var token = events[eventIndex][1] + var context = events[eventIndex][2] + var startPosition = eventIndex - 1 + var startPositions = [] + var tokenizer = + token._tokenizer || context.parser[token.contentType](token.start) + var childEvents = tokenizer.events + var jumps = [] + var gaps = {} + var stream + var previous + var index + var entered + var end + var adjust + + // Loop forward through the linked tokens to pass them in order to the + // subtokenizer. + while (token) { + // Find the position of the event for this token. + while (events[++startPosition][1] !== token) { + // Empty. + } + + startPositions.push(startPosition) + + if (!token._tokenizer) { + stream = context.sliceStream(token) + + if (!token.next) { + stream.push(codes.eof) + } + + if (previous) { + tokenizer.defineSkip(token.start) + } + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = true + } + + tokenizer.write(stream) + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = undefined + } + } + + // Unravel the next token. + previous = token + token = token.next + } + + // Now, loop back through all events (and linked tokens), to figure out which + // parts belong where. + token = previous + index = childEvents.length + + while (index--) { + // Make sure we’ve at least seen something (final eol is part of the last + // token). + if (childEvents[index][0] === 'enter') { + entered = true + } else if ( + // Find a void token that includes a break. + entered && + childEvents[index][1].type === childEvents[index - 1][1].type && + childEvents[index][1].start.line !== childEvents[index][1].end.line + ) { + add(childEvents.slice(index + 1, end)) + assert__default['default'](token.previous, 'expected a previous token') + // Help GC. + token._tokenizer = token.next = undefined + token = token.previous + end = index + 1 + } + } + + assert__default['default'](!token.previous, 'expected no previous token') + // Help GC. + tokenizer.events = token._tokenizer = token.next = undefined + + // Do head: + add(childEvents.slice(0, end)) + + index = -1 + adjust = 0 + + while (++index < jumps.length) { + gaps[adjust + jumps[index][0]] = adjust + jumps[index][1] + adjust += jumps[index][1] - jumps[index][0] - 1 + } + + return gaps + + function add(slice) { + var start = startPositions.pop() + jumps.unshift([start, start + slice.length - 1]) + chunkedSplice(events, start, 2, slice) + } +} + +module.exports = subtokenize diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.mjs new file mode 100644 index 00000000000000..7844130de419d2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/lib/util/subtokenize.mjs @@ -0,0 +1,211 @@ +export default subtokenize + +import assert from 'assert' +import codes from '../character/codes.mjs' +import assign from '../constant/assign.mjs' +import types from '../constant/types.mjs' +import chunkedSplice from './chunked-splice.mjs' +import shallow from './shallow.mjs' + +function subtokenize(events) { + var jumps = {} + var index = -1 + var event + var lineIndex + var otherIndex + var otherEvent + var parameters + var subevents + var more + + while (++index < events.length) { + while (index in jumps) { + index = jumps[index] + } + + event = events[index] + + // Add a hook for the GFM tasklist extension, which needs to know if text + // is in the first content of a list item. + if ( + index && + event[1].type === types.chunkFlow && + events[index - 1][1].type === types.listItemPrefix + ) { + subevents = event[1]._tokenizer.events + otherIndex = 0 + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === types.lineEndingBlank + ) { + otherIndex += 2 + } + + if ( + otherIndex < subevents.length && + subevents[otherIndex][1].type === types.content + ) { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === types.content) { + break + } + + if (subevents[otherIndex][1].type === types.chunkText) { + subevents[otherIndex][1].isInFirstContentOfListItem = true + otherIndex++ + } + } + } + } + + // Enter. + if (event[0] === 'enter') { + if (event[1].contentType) { + assign(jumps, subcontent(events, index)) + index = jumps[index] + more = true + } + } + // Exit. + else if (event[1]._container || event[1]._movePreviousLineEndings) { + otherIndex = index + lineIndex = undefined + + while (otherIndex--) { + otherEvent = events[otherIndex] + + if ( + otherEvent[1].type === types.lineEnding || + otherEvent[1].type === types.lineEndingBlank + ) { + if (otherEvent[0] === 'enter') { + if (lineIndex) { + events[lineIndex][1].type = types.lineEndingBlank + } + + otherEvent[1].type = types.lineEnding + lineIndex = otherIndex + } + } else { + break + } + } + + if (lineIndex) { + // Fix position. + event[1].end = shallow(events[lineIndex][1].start) + + // Switch container exit w/ line endings. + parameters = events.slice(lineIndex, index) + parameters.unshift(event) + chunkedSplice(events, lineIndex, index - lineIndex + 1, parameters) + } + } + } + + return !more +} + +function subcontent(events, eventIndex) { + var token = events[eventIndex][1] + var context = events[eventIndex][2] + var startPosition = eventIndex - 1 + var startPositions = [] + var tokenizer = + token._tokenizer || context.parser[token.contentType](token.start) + var childEvents = tokenizer.events + var jumps = [] + var gaps = {} + var stream + var previous + var index + var entered + var end + var adjust + + // Loop forward through the linked tokens to pass them in order to the + // subtokenizer. + while (token) { + // Find the position of the event for this token. + while (events[++startPosition][1] !== token) { + // Empty. + } + + startPositions.push(startPosition) + + if (!token._tokenizer) { + stream = context.sliceStream(token) + + if (!token.next) { + stream.push(codes.eof) + } + + if (previous) { + tokenizer.defineSkip(token.start) + } + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = true + } + + tokenizer.write(stream) + + if (token.isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = undefined + } + } + + // Unravel the next token. + previous = token + token = token.next + } + + // Now, loop back through all events (and linked tokens), to figure out which + // parts belong where. + token = previous + index = childEvents.length + + while (index--) { + // Make sure we’ve at least seen something (final eol is part of the last + // token). + if (childEvents[index][0] === 'enter') { + entered = true + } else if ( + // Find a void token that includes a break. + entered && + childEvents[index][1].type === childEvents[index - 1][1].type && + childEvents[index][1].start.line !== childEvents[index][1].end.line + ) { + add(childEvents.slice(index + 1, end)) + assert(token.previous, 'expected a previous token') + // Help GC. + token._tokenizer = token.next = undefined + token = token.previous + end = index + 1 + } + } + + assert(!token.previous, 'expected no previous token') + // Help GC. + tokenizer.events = token._tokenizer = token.next = undefined + + // Do head: + add(childEvents.slice(0, end)) + + index = -1 + adjust = 0 + + while (++index < jumps.length) { + gaps[adjust + jumps[index][0]] = adjust + jumps[index][1] + adjust += jumps[index][1] - jumps[index][0] - 1 + } + + return gaps + + function add(slice) { + var start = startPositions.pop() + jumps.unshift([start, start + slice.length - 1]) + chunkedSplice(events, start, 2, slice) + } +} diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/license b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/license similarity index 94% rename from tools/node_modules/eslint/node_modules/unist-util-visit-parents/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/micromark/license index 8d8660d36ef2ec..39372356c47d0f 100644 --- a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/license +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/license @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2016 Titus Wormer +Copyright (c) 2020 Titus Wormer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/package.json new file mode 100644 index 00000000000000..b1b3941c2d1cd0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/package.json @@ -0,0 +1,208 @@ +{ + "name": "micromark", + "version": "2.11.4", + "description": "small commonmark compliant markdown parser with positional info and concrete tokens", + "license": "MIT", + "keywords": [ + "commonmark", + "compiler", + "gfm", + "html", + "lexer", + "markdown", + "markup", + "md", + "unified", + "parse", + "parser", + "plugin", + "process", + "remark", + "render", + "renderer", + "token", + "tokenizer" + ], + "repository": "micromark/micromark", + "bugs": "https://github.com/micromark/micromark/issues", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Bogdan Chadkin ", + "Christian Murphy ", + "Marouane Fazouane ", + "John Otander (https://johno.com)", + "Stephan Schneider ", + "Victor Felder (https://draft.li)", + "Mudit Ameta (https://mudit.xyz)", + "Merlijn Vos " + ], + "files": [ + "dist/", + "lib/", + "buffer.d.ts", + "buffer.js", + "buffer.mjs", + "index.js", + "index.mjs", + "index.d.ts", + "stream.d.ts", + "stream.js", + "stream.mjs" + ], + "main": "./index.js", + "types": "index.d.ts", + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "@rollup/plugin-babel": "^5.0.0", + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "@types/events": "^3.0.0", + "@unicode/unicode-13.0.0": "^1.0.0", + "babel-plugin-inline-constants": "^1.0.0", + "babel-plugin-unassert": "^3.0.0", + "babel-plugin-undebug": "^1.0.0", + "c8": "^7.0.0", + "character-entities": "^1.0.0", + "commonmark.json": "^0.29.0", + "concat-stream": "^2.0.0", + "cross-env": "^7.0.0", + "dtslint": "^4.0.0", + "eslint-plugin-es": "^4.0.0", + "eslint-plugin-security": "^1.0.0", + "esm": "^3.0.0", + "glob": "^7.0.0", + "gzip-size-cli": "^4.0.0", + "jsfuzz": "1.0.14", + "ms": "^2.0.0", + "patch-package": "^6.0.0", + "prettier": "^2.0.0", + "regenerate": "^1.0.0", + "remark-cli": "^9.0.0", + "remark-preset-wooorm": "^8.0.0", + "resolve-from": "^5.0.0", + "rollup": "^2.0.0", + "rollup-plugin-terser": "^7.0.0", + "tape": "^5.0.0", + "xo": "^0.37.0" + }, + "scripts": { + "generate-lib-types": "node --experimental-modules script/generate-constant-typings.mjs", + "generate-lib-expressions": "node --experimental-modules script/generate-expressions.mjs", + "generate-lib-cjs": "rollup -c --silent", + "generate-lib": "npm run generate-lib-types && npm run generate-lib-expressions && npm run generate-lib-cjs", + "generate-dist-types": "node --experimental-modules script/copy-dict.mjs", + "generate-dist-js": "cross-env BUILD=dist rollup -c --silent", + "generate-dist": "npm run generate-dist-types && npm run generate-dist-js", + "generate-size": "cross-env BUILD=size rollup -c --silent && gzip-size micromark.min.js && gzip-size --raw micromark.min.js", + "generate": "npm run generate-lib && npm run generate-dist && npm run generate-size", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "pretest-fuzz": "patch-package --patch-dir script/patches && node script/generate-fixtures.mjs", + "test-fuzz": "cross-env NODE_OPTIONS=\"-r esm\" timeout 15m jsfuzz test/fuzz.js test/fixtures", + "test-api": "node --experimental-modules test/index.mjs", + "test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov node --experimental-modules test/index.mjs", + "test-types": "dtslint .", + "test": "npm run generate && npm run format && npm run test-coverage && npm run test-types" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "esnext": false, + "extensions": [ + "mjs" + ], + "prettier": true, + "envs": [ + "shared-node-browser" + ], + "rules": { + "import/extensions": [ + "error", + "always" + ] + }, + "overrides": [ + { + "files": [ + "lib/**/*.{js,mjs}" + ], + "plugin": [ + "es" + ], + "extends": [ + "plugin:es/no-new-in-es2015", + "plugin:security/recommended" + ], + "rules": { + "complexity": "off", + "es/no-array-from": "off", + "es/no-object-assign": "off", + "es/no-modules": "off", + "import/no-mutable-exports": "off", + "import/no-anonymous-default-export": "off", + "guard-for-in": "off", + "max-depth": "off", + "no-multi-assign": "off", + "no-unmodified-loop-condition": "off", + "security/detect-object-injection": "off", + "unicorn/explicit-length-check": "off", + "unicorn/prefer-includes": "off", + "unicorn/prefer-number-properties": "off" + } + }, + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "import/extensions": [ + "error", + "never" + ] + } + }, + { + "files": [ + "test/**/*.{js,mjs}" + ], + "rules": { + "import/no-unassigned-import": "off" + } + } + ], + "ignores": [ + "dist/", + "lib/**/*.js", + "micromark.test.ts" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm", + [ + "lint-no-html", + false + ] + ] + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/readme.md new file mode 100644 index 00000000000000..db7931df812739 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/readme.md @@ -0,0 +1,737 @@ +

    + micromark +

    + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][bundle-size-badge]][bundle-size] +[![Sponsors][sponsors-badge]][opencollective] +[![Backers][backers-badge]][opencollective] +[![Chat][chat-badge]][chat] + +The smallest CommonMark compliant markdown parser with positional info and +concrete tokens. + +* [x] **[compliant][commonmark]** (100% to CommonMark) +* [x] **[extensions][]** ([GFM][], [directives][], [footnotes][], + [frontmatter][], [math][], [MDX.js][mdxjs]) +* [x] **[safe][security]** (by default) +* [x] **[small][size]** (smallest CM parser that exists) +* [x] **[robust][test]** (1800+ tests, 100% coverage, fuzz testing) + +## Intro + +micromark is a long awaited markdown parser. +It uses a [state machine][cmsm] to parse the entirety of markdown into concrete +tokens. +It’s the smallest 100% [CommonMark][] compliant markdown parser in JavaScript. +It was made to replace the internals of [`remark-parse`][remark-parse], the most +[popular][] markdown parser. +Its API compiles to HTML, but its parts are made to be used separately, so as to +generate syntax trees ([`mdast-util-from-markdown`][from-markdown]) or compile +to other output formats. +It’s in open beta: up next are [CMSM][] and CSTs. + +* for updates, see [Twitter][] +* for more about us, see [`unifiedjs.com`][site] +* for questions, see [Discussions][chat] +* to help, see [contribute][] or [sponsor][] below + +## Contents + +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`micromark(doc[, encoding][, options])`](#micromarkdoc-encoding-options) + * [`micromarkStream(options?)`](#micromarkstreamoptions) +* [Extensions](#extensions) + * [`SyntaxExtension`](#syntaxextension) + * [`HtmlExtension`](#htmlextension) + * [List of extensions](#list-of-extensions) +* [Syntax tree](#syntax-tree) +* [CommonMark](#commonmark) +* [Grammar](#grammar) +* [Test](#test) +* [Size & debug](#size--debug) +* [Comparison](#comparison) +* [Version](#version) +* [Security](#security) +* [Contribute](#contribute) +* [Sponsor](#sponsor) +* [Origin story](#origin-story) +* [License](#license) + +## Install + +[npm][]: + +```sh +npm install micromark +``` + +## Use + +Typical use (buffering): + +```js +var micromark = require('micromark') + +console.log(micromark('## Hello, *world*!')) +``` + +Yields: + +```html +

    Hello, world!

    +``` + +The same can be done with ESM (in Node 10+, browsers that support it, or with a +bundler), in an `example.mjs` file, like so: + +```js +import micromark from 'micromark' + +console.log(micromark('## Hello, *world*!')) +``` + +You can pass extensions (in this case [`micromark-extension-gfm`][gfm]): + +```js +var micromark = require('micromark') +var gfmSyntax = require('micromark-extension-gfm') +var gfmHtml = require('micromark-extension-gfm/html') + +var doc = '* [x] contact@example.com ~~strikethrough~~' + +var result = micromark(doc, { + extensions: [gfmSyntax()], + htmlExtensions: [gfmHtml] +}) + +console.log(result) +``` + +Yields: + +```html + +``` + +Streaming interface: + +```js +var fs = require('fs') +var micromarkStream = require('micromark/stream') + +fs.createReadStream('example.md') + .on('error', handleError) + .pipe(micromarkStream()) + .pipe(process.stdout) + +function handleError(err) { + // Handle your error here! + throw err +} +``` + +## API + +This section documents the API. +The parts can be used separately, but this isn’t documented yet. + +### `micromark(doc[, encoding][, options])` + +Compile markdown to HTML. + +##### Parameters + +###### `doc` + +Markdown to parse (`string` or `Buffer`) + +###### `encoding` + +[Character encoding][encoding] to understand `doc` as when it’s a +[`Buffer`][buffer] (`string`, default: `'utf8'`). + +###### `options.defaultLineEnding` + +Value to use for line endings not in `doc` (`string`, default: first line +ending or `'\n'`). + +Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the +markdown document over to the compiled HTML. +In some cases, such as `> a`, CommonMark requires that extra line endings are +added: `
    \n

    a

    \n
    `. + +###### `options.allowDangerousHtml` + +Whether to allow embedded HTML (`boolean`, default: `false`). + +###### `options.allowDangerousProtocol` + +Whether to allow potentially dangerous protocols in links and images (`boolean`, +default: `false`). +URLs relative to the current protocol are always allowed (such as, `image.jpg`). +For links, the allowed protocols are `http`, `https`, `irc`, `ircs`, `mailto`, +and `xmpp`. +For images, the allowed protocols are `http` and `https`. + +###### `options.extensions` + +Array of syntax extensions ([`Array.`][syntax-extension], +default: `[]`). + +###### `options.htmlExtensions` + +Array of HTML extensions ([`Array.`][html-extension], default: +`[]`). + +##### Returns + +`string` — Compiled HTML. + +### `micromarkStream(options?)` + +Streaming interface of micromark. +Compiles markdown to HTML. +`options` are the same as the buffering API above. +Available at `require('micromark/stream')`. +Note that some of the work to parse markdown can be done streaming, but in the +end buffering is required. + +micromark does not handle errors for you, so you must handle errors on whatever +streams you pipe into it. +As markdown does not know errors, `micromark` itself does not emit errors. + +## Extensions + +There are two types of extensions for micromark: +[`SyntaxExtension`][syntax-extension] and [`HtmlExtension`][html-extension]. +They can be passed in [`extensions`][option-extensions] or +[`htmlExtensions`][option-htmlextensions], respectively. + +### `SyntaxExtension` + +A syntax extension is an object whose fields are the names of hooks, referring +to where constructs “hook” into. +`content` (a block of, well, content: definitions and paragraphs), `document` +(containers such as block quotes and lists), `flow` (block constructs such as +ATX and setext headings, HTML, indented and fenced code, thematic breaks), +`string` (things that work in a few places such as destinations, fenced code +info, etc: character escapes and -references), or `text` (rich inline text: +autolinks, character escapes and -references, code, hard breaks, HTML, images, +links, emphasis, strong). + +The fields at such objects are character codes, mapping to constructs as values. +The built in [constructs][] are an extension. +See it and the [existing extensions][extensions] for inspiration. + +### `HtmlExtension` + +An HTML extension is an object whose fields are either `enter` or `exit` +(reflecting whether a token is entered or exited). +The values at such objects are names of tokens mapping to handlers. +See the [existing extensions][extensions] for inspiration. + +### List of extensions + +* [`micromark/micromark-extension-directive`][directives] + — support directives (generic extensions) +* [`micromark/micromark-extension-footnote`][footnotes] + — support footnotes +* [`micromark/micromark-extension-frontmatter`][frontmatter] + — support frontmatter (YAML, TOML, etc) +* [`micromark/micromark-extension-gfm`][gfm] + — support GFM (GitHub Flavored Markdown) +* [`micromark/micromark-extension-gfm-autolink-literal`](https://github.com/micromark/micromark-extension-gfm-autolink-literal) + — support GFM autolink literals +* [`micromark/micromark-extension-gfm-strikethrough`](https://github.com/micromark/micromark-extension-gfm-strikethrough) + — support GFM strikethrough +* [`micromark/micromark-extension-gfm-table`](https://github.com/micromark/micromark-extension-gfm-table) + — support GFM tables +* [`micromark/micromark-extension-gfm-tagfilter`](https://github.com/micromark/micromark-extension-gfm-tagfilter) + — support GFM tagfilter +* [`micromark/micromark-extension-gfm-task-list-item`](https://github.com/micromark/micromark-extension-gfm-task-list-item) + — support GFM tasklists +* [`micromark/micromark-extension-math`][math] + — support math +* [`micromark/micromark-extension-mdx`](https://github.com/micromark/micromark-extension-mdx) + — support MDX +* [`micromark/micromark-extension-mdxjs`][mdxjs] + — support MDX.js +* [`micromark/micromark-extension-mdx-expression`](https://github.com/micromark/micromark-extension-mdx-expression) + — support MDX (or MDX.js) expressions +* [`micromark/micromark-extension-mdx-jsx`](https://github.com/micromark/micromark-extension-mdx-jsx) + — support MDX (or MDX.js) JSX +* [`micromark/micromark-extension-mdx-md`](https://github.com/micromark/micromark-extension-mdx-md) + — support misc MDX changes +* [`micromark/micromark-extension-mdxjs-esm`](https://github.com/micromark/micromark-extension-mdxjs-esm) + — support MDX.js import/exports + +## Syntax tree + +A higher level project, [`mdast-util-from-markdown`][from-markdown], can give +you an AST. + +```js +var fromMarkdown = require('mdast-util-from-markdown') + +var result = fromMarkdown('## Hello, *world*!') + +console.log(result.children[0]) +``` + +Yields: + +```js +{ + type: 'heading', + depth: 2, + children: [ + {type: 'text', value: 'Hello, ', position: [Object]}, + {type: 'emphasis', children: [Array], position: [Object]}, + {type: 'text', value: '!', position: [Object]} + ], + position: { + start: {line: 1, column: 1, offset: 0}, + end: {line: 1, column: 19, offset: 18} + } +} +``` + +Another level up is [**remark**][remark], which provides a nice interface and +hundreds of plugins. + +## CommonMark + +The first definition of “Markdown” gave several examples of how it worked, +showing input Markdown and output HTML, and came with a reference implementation +(`Markdown.pl`). +When new implementations followed, they mostly followed the first definition, +but deviated from the first implementation, and added extensions, thus making +the format a family of formats. + +Some years later, an attempt was made to standardize the differences between +implementations, by specifying how several edge cases should be handled, through +more input and output examples. +This is known as [CommonMark][commonmark-spec], and many implementations now +work towards some degree of CommonMark compliancy. +Still, CommonMark describes what the output in HTML should be given some +input, which leaves many edge cases up for debate, and does not answer what +should happen for other output formats. + +micromark passes all tests from CommonMark and has many more tests to match the +CommonMark reference parsers. +Finally, it comes with [CMSM][], which describes how to parse markup, instead +of documenting input and output examples. + +## Grammar + +The syntax of markdown can be described in Backus–Naur form (BNF) as: + +```bnf +markdown = .* +``` + +No, that’s not a [typo](http://trevorjim.com/a-specification-for-markdown/): +markdown has no syntax errors; anything thrown at it renders *something*. + +## Test + +micromark is tested with the \~650 CommonMark tests and more than 1.2k extra +tests confirmed with CM reference parsers. +These tests reach all branches in the code, thus this project has 100% coverage. +Finally, we use fuzz testing to ensure micromark is stable, reliable, and +secure. + +To build, format, and test the codebase, use `$ npm test` after clone and +install. +The `$ npm run test-api` and `$ npm run test-coverage` scripts check the unit +tests and their coverage, respectively. +The `$ npm run test-types` script checks TypeScript definitions. + +The `$ npm run test-fuzz` script does fuzz testing for 15 minutes. +The timeout is provided by GNU coreutils **timeout(1)**, which might not be +available on your system. +Either install it or remove it from the script. + +## Size & debug + +micromark is really small. +A ton of time went into making sure it minifies well, by the way code is written +but also through custom build scripts to pre-evaluate certain expressions. +Furthermore, care went into making it compress well with GZip and Brotli. + +Normally, you’ll use the pre-evaluated version of micromark, which is published +in the `dist/` folder and has entries in the root. +While developing or debugging, you can switch to use the source, which is +published in the `lib/` folder, and comes instrumented with assertions and debug +messages. +To see debug messages, run your script with a `DEBUG` env variable, such as with +`DEBUG="micromark" node script.js`. + +To generate the codebase, use `$ npm run generate` after clone and install. +The `$ npm run generate-dist` script specifically takes `lib/` and generates +`dist/`. +The `$ npm run generate-size` script checks the bundle size of `dist/`. + +## Comparison + +There are many other markdown parsers out there, and maybe they’re better suited +to your use case! +Here is a short comparison of a couple of ’em in JavaScript. +Note that this list is made by the folks who make `micromark` and `remark`, so +there is some bias. + +**Note**: these are, in fact, not really comparable: micromark (and remark) +focus on completely different things than other markdown parsers do. +Sure, you can generate HTML from markdown with them, but micromark (and remark) +are created for (abstract or concrete) syntax trees—to inspect, transform, and +generate content, so that you can make things like [MDX][], [Prettier][], or +[Gatsby][]. + +###### micromark + +micromark can be used in two different ways. +It can either be used, optionally with existing extensions, to get HTML pretty +easily. +Or, it can give tremendous power, such as access to all tokens with positional +info, at the cost of being hard to get into. +It’s super small, pretty fast, and has 100% CommonMark compliance. +It has syntax extensions, such as supporting 100% GFM compliance (with +`micromark-extension-gfm`), but they’re rather complex to write. +It’s the newest parser on the block. + +If you’re looking for fine grained control, use micromark. + +###### remark + +[remark][] is the most popular markdown parser. +It’s built on top of `micromark` and boasts syntax trees. +For an analogy, it’s like if Babel, ESLint, and more, were one project. +It supports the syntax extensions that micromark has (so it’s 100% CM compliant +and can be 100% GFM compliant), but most of the work is done in plugins that +transform or inspect the tree. +Transforming the tree is relatively easy: it’s a JSON object that can be +manipulated directly. +remark is stable, widely used, and extremely powerful for handling complex data. + +If you’re looking to inspect or transform lots of content, use [remark][]. + +###### marked + +[marked][] is the oldest markdown parser on the block. +It’s been around for ages, is battle tested, small, popular, and has a bunch of +extensions, but doesn’t match CommonMark or GFM, and is unsafe by default. + +If you have markdown you trust and want to turn it into HTML without a fuss, use +[marked][]. + +###### markdown-it + +[markdown-it][] is a good, stable, and essentially CommonMark compliant markdown +parser, with (optional) support for some GFM features as well. +It’s used a lot as a direct dependency in packages, but is rather big. +It shines at syntax extensions, where you want to support not just markdown, but +*your* (company’s) version of markdown. + +If you’re in Node and have CommonMark-compliant (or funky) markdown and want to +turn it into HTML, use [markdown-it][]. + +###### Others + +There are lots of other markdown parsers! +Some say they’re small, or fast, or that they’re CommonMark compliant — but +that’s not always true. +This list is not supposed to be exhaustive. +This list of markdown parsers is a snapshot in time of why (not) to use +(alternatives to) `micromark`: they’re all good choices, depending on what your +goals are. + +## Version + +The open beta of micromark starts at version `2.0.0` (there was a different +package published on npm as `micromark` before). +micromark will adhere to semver at `3.0.0`. +Use tilde ranges for now: `"micromark": "~2.10.1"`. + +## Security + +The typical security aspect discussed for markdown is [cross-site scripting +(XSS)][xss] attacks. +It’s safe to compile markdown to HTML if it does not include embedded HTML nor +uses dangerous protocols in links (such as `javascript:` or `data:`). +micromark is safe by default when embedded HTML or dangerous protocols are used +too, as it encodes or drops them. +Turning on the `allowDangerousHtml` or `allowDangerousProtocol` options for +user-provided markdown opens you up to XSS attacks. + +Another aspect is DDoS attacks. +For example, an attacker could throw a 100mb file at micromark, in which case +the JavaScript engine will run out of memory and crash. +It is also possible to crash micromark with smaller payloads, notably when +thousands of links, images, emphasis, or strong are opened but not closed. +It is wise to cap the accepted size of input (500kb can hold a big book) and to +process content in a different thread or worker so that it can be stopped when +needed. + +Using extensions might also be unsafe, refer to their documentation for more +information. + +For more information on markdown sanitation, see +[`improper-markup-sanitization.md`][improper] by [**@chalker**][chalker]. + +See [`security.md`][securitymd] in [`micromark/.github`][health] for how to +submit a security report. + +## Contribute + +See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organisation, or community you agree to +abide by its terms. + +## Sponsor + +Support this effort and give back by sponsoring on [OpenCollective][]! + + + + + + + + + + + + + + + + + +
    +
    + Salesforce 🏅

    + +
    + Gatsby 🥇

    + +
    + Vercel 🥇

    + +
    + Netlify

    + + +
    + Holloway

    + +
    + ThemeIsle

    + +
    + Boost Hub

    + +
    + Expo

    + +
    +
    + You? +

    +
    + +## Origin story + +Over the summer of 2018, micromark was planned, and the idea shared in August +with a couple of friends and potential sponsors. +The problem I (**[@wooorm][]**) had was that issues were piling up in remark and +other repos, but my day job (teaching) was fun, fulfilling, and deserved time +too. +It was getting hard to combine the two. +The thought was to feed two birds with one scone: fix the issues in remark with +a new markdown parser (codename marydown) while being financially supported by +sponsors building fancy stuff on top, such as Gatsby, Contentful, and Vercel +(ZEIT at the time). +**[@johno][]** was making MDX on top of remark at the time (important historical +note: several other folks were working on JSX + markdown too). +We bundled our strengths: MDX was getting some traction and we thought together +we could perhaps make something sustainable. + +In November 2018, we launched with the idea for micromark to solve all existing +bugs, sustaining the existing hundreds of projects, and furthering the exciting +high-level project MDX. +We pushed a single name: unified (which back then was a small but essential +part of the chain). +Gatsby and Vercel were immediate sponsors. +We didn’t know whether it would work, and it worked. +But now you have a new problem: you are getting some financial support (much +more than other open source projects) but it’s not enough money for rent, and +too much money to print stickers with. +You still have your job and issues are still piling up. + +At the start of summer 2019, after a couple months of saving up donations, I +quit my job and worked on unified through fall. +That got the number of open issues down significantly and set up a strong +governance and maintenance system for the collective. +But when the time came to work on micromark, the money was gone again, so I +contracted through winter 2019, and in spring 2020 I could do about half open +source, half contracting. +One of the contracting gigs was to write a new MDX parser, for which I also +documented how to do that with a state machine [in prose][mdx-cmsm]. +That gave me the insight into how the same could be done for markdown: I drafted +[CMSM][], which was some of the core ideas for micromark, but in prose. + +In May 2020, Salesforce reached out: they saw the bugs in remark, how micromark +could help, and the initial work on CMSM. +And they had thousands of Markdown files. +In a for open source uncharacteristic move, they decided to fund my work on +micromark. +A large part of what maintaining open source means, is putting out fires, +triaging issues, and making sure users and sponsors are happy, so it was +amazing to get several months to just focus and make something new. +I remember feeling that this project would probably be the hardest thing I’d +work on: yeah, parsers are pretty difficult, but markdown is on another level. +Markdown is such a giant stack of edge cases on edge cases on even more +weirdness, what a mess. +On August 20, 2020, I released [2.0.0][200], the first working version of +micromark. +And it’s hard to describe how that moment felt. +It was great. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg + +[build]: https://github.com/micromark/micromark/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg + +[coverage]: https://codecov.io/github/micromark/micromark + +[downloads-badge]: https://img.shields.io/npm/dm/micromark.svg + +[downloads]: https://www.npmjs.com/package/micromark + +[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/micromark.svg + +[bundle-size]: https://bundlephobia.com/result?p=micromark + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[opencollective]: https://opencollective.com/unified + +[npm]: https://docs.npmjs.com/cli/install + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/micromark/micromark/discussions + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/micromark/.github + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[securitymd]: https://github.com/micromark/.github/blob/HEAD/security.md + +[contributing]: https://github.com/micromark/.github/blob/HEAD/contributing.md + +[support]: https://github.com/micromark/.github/blob/HEAD/support.md + +[coc]: https://github.com/micromark/.github/blob/HEAD/code-of-conduct.md + +[twitter]: https://twitter.com/unifiedjs + +[remark]: https://github.com/remarkjs/remark + +[site]: https://unifiedjs.com + +[contribute]: #contribute + +[encoding]: https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + +[buffer]: https://nodejs.org/api/buffer.html + +[commonmark-spec]: https://commonmark.org + +[popular]: https://www.npmtrends.com/remark-parse-vs-marked-vs-markdown-it + +[remark-parse]: https://unifiedjs.com/explore/package/remark-parse/ + +[improper]: https://github.com/ChALkeR/notes/blob/master/Improper-markup-sanitization.md + +[chalker]: https://github.com/ChALkeR + +[cmsm]: https://github.com/micromark/common-markup-state-machine + +[mdx-cmsm]: https://github.com/micromark/mdx-state-machine + +[from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[directives]: https://github.com/micromark/micromark-extension-directive + +[footnotes]: https://github.com/micromark/micromark-extension-footnote + +[frontmatter]: https://github.com/micromark/micromark-extension-frontmatter + +[gfm]: https://github.com/micromark/micromark-extension-gfm + +[math]: https://github.com/micromark/micromark-extension-math + +[mdxjs]: https://github.com/micromark/micromark-extension-mdxjs + +[constructs]: lib/constructs.mjs + +[extensions]: #list-of-extensions + +[syntax-extension]: #syntaxextension + +[html-extension]: #htmlextension + +[option-extensions]: #optionsextensions + +[option-htmlextensions]: #optionshtmlextensions + +[marked]: https://github.com/markedjs/marked + +[markdown-it]: https://github.com/markdown-it/markdown-it + +[mdx]: https://github.com/mdx-js/mdx + +[prettier]: https://github.com/prettier/prettier + +[gatsby]: https://github.com/gatsbyjs/gatsby + +[commonmark]: #commonmark + +[size]: #size--debug + +[test]: #test + +[security]: #security + +[sponsor]: #sponsor + +[@wooorm]: https://github.com/wooorm + +[@johno]: https://github.com/johno + +[200]: https://github.com/micromark/micromark/releases/tag/2.0.0 diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.js b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.js new file mode 100644 index 00000000000000..e90ff8f6c656ef --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = require('./dist/stream.js') diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.mjs b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.mjs new file mode 100644 index 00000000000000..e33b22880b736b --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/micromark/stream.mjs @@ -0,0 +1 @@ +export {default} from './dist/stream.js' diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/ms/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/index.js new file mode 100644 index 00000000000000..c4498bcc212589 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/tools/node_modules/eslint/node_modules/xtend/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/license.md similarity index 88% rename from tools/node_modules/eslint/node_modules/xtend/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/ms/license.md index 0099f4f6c77f40..69b61253a38926 100644 --- a/tools/node_modules/eslint/node_modules/xtend/LICENSE +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/license.md @@ -1,5 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012-2014 Raynos. + +Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -8,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/ms/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/package.json new file mode 100644 index 00000000000000..eea666e1fb03d6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.1.2", + "description": "Tiny millisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/ms/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/readme.md new file mode 100644 index 00000000000000..9a1996b17e0de6 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/ms/readme.md @@ -0,0 +1,60 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/tools/node_modules/eslint/node_modules/parse-entities/decode-entity.browser.js b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/decode-entity.browser.js similarity index 100% rename from tools/node_modules/eslint/node_modules/parse-entities/decode-entity.browser.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/decode-entity.browser.js diff --git a/tools/node_modules/eslint/node_modules/parse-entities/decode-entity.js b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/decode-entity.js similarity index 100% rename from tools/node_modules/eslint/node_modules/parse-entities/decode-entity.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/decode-entity.js diff --git a/tools/node_modules/eslint/node_modules/parse-entities/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/index.js similarity index 97% rename from tools/node_modules/eslint/node_modules/parse-entities/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/index.js index 1606d02f6590c5..106d6d86d4ce5e 100644 --- a/tools/node_modules/eslint/node_modules/parse-entities/index.js +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/index.js @@ -30,15 +30,15 @@ var defaults = { // Characters. var tab = 9 // '\t' var lineFeed = 10 // '\n' -var formFeed = 12 // '\f' +var formFeed = 12 // '\f' var space = 32 // ' ' -var ampersand = 38 // '&' -var semicolon = 59 // ';' -var lessThan = 60 // '<' -var equalsTo = 61 // '=' -var numberSign = 35 // '#' -var uppercaseX = 88 // 'X' -var lowercaseX = 120 // 'x' +var ampersand = 38 // '&' +var semicolon = 59 // ';' +var lessThan = 60 // '<' +var equalsTo = 61 // '=' +var numberSign = 35 // '#' +var uppercaseX = 88 // 'X' +var lowercaseX = 120 // 'x' var replacementCharacter = 65533 // '�' // Reference types. @@ -160,7 +160,8 @@ function parse(value, settings) { // Wrap `handleWarning`. warning = handleWarning ? parseError : noop - // Ensure the algorithm walks over the first character and the end (inclusive). + // Ensure the algorithm walks over the first character and the end + // (inclusive). index-- length++ @@ -393,7 +394,7 @@ function parse(value, settings) { } } - // Return the reduced nodes, and any possible warnings. + // Return the reduced nodes. return result.join('') // Get current position. diff --git a/tools/node_modules/eslint/node_modules/parse-entities/license b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/license similarity index 100% rename from tools/node_modules/eslint/node_modules/parse-entities/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/license diff --git a/tools/node_modules/eslint/node_modules/parse-entities/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json similarity index 65% rename from tools/node_modules/eslint/node_modules/parse-entities/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json index f2eee3452e6f79..60e191fff0a2fc 100644 --- a/tools/node_modules/eslint/node_modules/parse-entities/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/package.json @@ -1,23 +1,39 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, + "name": "parse-entities", + "version": "2.0.0", + "description": "Parse HTML character references: fast, spec-compliant, positional information", + "license": "MIT", + "keywords": [ + "parse", + "html", + "character", + "reference", + "entity", + "entities" + ], + "repository": "wooorm/parse-entities", + "bugs": "https://github.com/wooorm/parse-entities/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], "browser": { "./decode-entity.js": "./decode-entity.browser.js" }, - "bugs": { - "url": "https://github.com/wooorm/parse-entities/issues" + "react-native": { + "./decode-entity.js": "./decode-entity.js" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "files": [ + "index.js", + "decode-entity.js", + "decode-entity.browser.js", + "types/index.d.ts" ], + "types": "types/index.d.ts", "dependencies": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -26,35 +42,29 @@ "is-decimal": "^1.0.0", "is-hexadecimal": "^1.0.0" }, - "deprecated": false, - "description": "Parse HTML character references: fast, spec-compliant, positional information", "devDependencies": { "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.12.1", - "remark-cli": "^6.0.0", - "remark-preset-wooorm": "^4.0.0", - "tape": "^4.2.0", + "dtslint": "^2.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", "tape-run": "^6.0.0", - "tinyify": "^2.4.3", - "xo": "^0.24.0" + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "build-bundle": "browserify . -s parseEntities > parse-entities.js", + "build-mangle": "browserify . -s parseEntities -p tinyify > parse-entities.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-browser": "browserify test.js | tape-run", + "test-types": "dtslint types", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types" }, - "files": [ - "index.js", - "decode-entity.js", - "decode-entity.browser.js" - ], - "homepage": "https://github.com/wooorm/parse-entities#readme", - "keywords": [ - "parse", - "html", - "character", - "reference", - "entity", - "entities" - ], - "license": "MIT", - "name": "parse-entities", "nyc": { "check-coverage": true, "lines": 100, @@ -69,29 +79,6 @@ "semi": false, "trailingComma": "none" }, - "react-native": { - "./decode-entity.js": "./decode-entity.js" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/parse-entities.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s parseEntities > parse-entities.js", - "build-mangle": "browserify . -s parseEntities -p tinyify > parse-entities.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage && npm run test-browser", - "test-api": "node test", - "test-browser": "browserify test.js | tape-run", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.2.2", "xo": { "prettier": true, "esnext": false, @@ -103,5 +90,10 @@ "ignores": [ "parse-entities.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/parse-entities/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/readme.md similarity index 99% rename from tools/node_modules/eslint/node_modules/parse-entities/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/readme.md index e9cc0f037ff16f..5ca60e7a87b9a8 100644 --- a/tools/node_modules/eslint/node_modules/parse-entities/readme.md +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/parse-entities/readme.md @@ -8,15 +8,15 @@ Parse HTML character references: fast, spec-compliant, positional information. -## Installation +## Install [npm][]: -```bash +```sh npm install parse-entities ``` -## Usage +## Use ```js var decode = require('parse-entities') diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/index.js new file mode 100644 index 00000000000000..9719b7976517ea --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/index.js @@ -0,0 +1,24 @@ +'use strict' + +module.exports = parse + +var fromMarkdown = require('mdast-util-from-markdown') + +function parse(options) { + var self = this + + this.Parser = parse + + function parse(doc) { + return fromMarkdown( + doc, + Object.assign({}, self.data('settings'), options, { + // Note: these options are not in the readme. + // The goal is for them to be set by plugins on `data` instead of being + // passed by users. + extensions: self.data('micromarkExtensions') || [], + mdastExtensions: self.data('fromMarkdownExtensions') || [] + }) + ) + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json new file mode 100644 index 00000000000000..3b9c19d81786c0 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/package.json @@ -0,0 +1,46 @@ +{ + "name": "remark-parse", + "version": "9.0.0", + "description": "remark plugin to parse Markdown", + "license": "MIT", + "keywords": [ + "unified", + "remark", + "remark-plugin", + "plugin", + "markdown", + "mdast", + "abstract", + "syntax", + "tree", + "ast", + "parse" + ], + "types": "types/index.d.ts", + "homepage": "https://remark.js.org", + "repository": "https://github.com/remarkjs/remark/tree/main/packages/remark-parse", + "bugs": "https://github.com/remarkjs/remark/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Eugene Sharygin ", + "Junyoung Choi ", + "Elijah Hamovitz ", + "Ika " + ], + "files": [ + "index.js", + "types/index.d.ts" + ], + "dependencies": { + "mdast-util-from-markdown": "^0.8.0" + }, + "scripts": { + "test": "tape test.js" + }, + "xo": false +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/readme.md new file mode 100644 index 00000000000000..13f4501f2e506e --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/remark-parse/readme.md @@ -0,0 +1,197 @@ +# remark-parse + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[Parser][] for [**unified**][unified]. +Parses Markdown to [**mdast**][mdast] syntax trees. +Built on [`micromark`][micromark] and +[`mdast-util-from-markdown`][from-markdown]. +Used in the [**remark** processor][remark] but can be used on its own as well. +Can be [extended][extend] to change how Markdown is parsed. + +## Install + +[npm][]: + +```sh +npm install remark-parse +``` + +## Use + +```js +var unified = require('unified') +var createStream = require('unified-stream') +var markdown = require('remark-parse') +var remark2rehype = require('remark-rehype') +var html = require('rehype-stringify') + +var processor = unified().use(markdown).use(remark2rehype).use(html) + +process.stdin.pipe(createStream(processor)).pipe(process.stdout) +``` + +[See **unified** for more examples »][unified] + +## API + +[See **unified** for API docs »][unified] + +### `processor().use(parse)` + +Configure the `processor` to read Markdown as input and process +[**mdast**][mdast] syntax trees. + +## Extending the parser + +See [`micromark`][micromark] and [`mdast-util-from-markdown`][from-markdown]. +Then create a wrapper plugin such as [`remark-gfm`][gfm]. + +## Security + +As Markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][xss] attack, use of remark can also be unsafe. +When going to HTML, use remark in combination with the [**rehype**][rehype] +ecosystem, and use [`rehype-sanitize`][sanitize] to make the tree safe. + +Use of remark plugins could also open you up to other attacks. +Carefully assess each plugin and the risks involved in using them. + +## Contribute + +See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. +Ideas for new plugins and tools can be posted in [`remarkjs/ideas`][ideas]. + +A curated list of awesome remark resources can be found in [**awesome +remark**][awesome]. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## Sponsor + +Support this effort and give back by sponsoring on [OpenCollective][collective]! + + + + + + + + + + + + + + + + +
    + Gatsby 🥇

    + +
    + Vercel 🥇

    + +
    + Netlify

    + + +
    + Holloway

    + +
    + ThemeIsle

    + +
    + Boost Hub

    + +
    + Expo

    + +
    +
    + You? +

    +
    + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/remarkjs/remark.svg + +[build]: https://travis-ci.org/remarkjs/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark.svg + +[coverage]: https://codecov.io/github/remarkjs/remark + +[downloads-badge]: https://img.shields.io/npm/dm/remark-parse.svg + +[downloads]: https://www.npmjs.com/package/remark-parse + +[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-parse.svg + +[size]: https://bundlephobia.com/result?p=remark-parse + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/remarkjs/remark/discussions + +[health]: https://github.com/remarkjs/.github + +[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md + +[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md + +[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md + +[ideas]: https://github.com/remarkjs/ideas + +[awesome]: https://github.com/remarkjs/awesome-remark + +[license]: https://github.com/remarkjs/remark/blob/main/license + +[author]: https://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[unified]: https://github.com/unifiedjs/unified + +[remark]: https://github.com/remarkjs/remark/tree/main/packages/remark + +[mdast]: https://github.com/syntax-tree/mdast + +[parser]: https://github.com/unifiedjs/unified#processorparser + +[extend]: #extending-the-parser + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[rehype]: https://github.com/rehypejs/rehype + +[sanitize]: https://github.com/rehypejs/rehype-sanitize + +[micromark]: https://github.com/micromark/micromark + +[from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[gfm]: https://github.com/remarkjs/remark-gfm diff --git a/tools/node_modules/eslint/node_modules/replace-ext/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/replace-ext/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/LICENSE diff --git a/tools/node_modules/eslint/node_modules/replace-ext/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/replace-ext/README.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/README.md diff --git a/tools/node_modules/eslint/node_modules/replace-ext/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/replace-ext/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/index.js diff --git a/tools/node_modules/eslint/node_modules/replace-ext/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json similarity index 53% rename from tools/node_modules/eslint/node_modules/replace-ext/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json index e616e7c2258223..27dbe31042d0ff 100644 --- a/tools/node_modules/eslint/node_modules/replace-ext/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/replace-ext/package.json @@ -1,26 +1,30 @@ { - "author": { - "name": "Gulp Team", - "email": "team@gulpjs.com", - "url": "http://gulpjs.com/" - }, - "bugs": { - "url": "https://github.com/gulpjs/replace-ext/issues" - }, - "bundleDependencies": false, + "name": "replace-ext", + "version": "1.0.0", + "description": "Replaces a file extension with another one", + "author": "Gulp Team (http://gulpjs.com/)", "contributors": [ - { - "name": "Eric Schoffstall", - "email": "yo@contra.io" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com" - } + "Eric Schoffstall ", + "Blaine Bublitz " + ], + "repository": "gulpjs/replace-ext", + "license": "MIT", + "engines": { + "node": ">= 0.10" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" ], + "scripts": { + "lint": "eslint . && jscs index.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only", + "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls" + }, "dependencies": {}, - "deprecated": false, - "description": "Replaces a file extension with another one", "devDependencies": { "eslint": "^1.10.3", "eslint-config-gulp": "^2.0.0", @@ -31,33 +35,10 @@ "jscs-preset-gulp": "^1.0.0", "mocha": "^2.4.5" }, - "engines": { - "node": ">= 0.10" - }, - "files": [ - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/gulpjs/replace-ext#readme", "keywords": [ "gulp", "extensions", "filepath", "basename" - ], - "license": "MIT", - "main": "index.js", - "name": "replace-ext", - "repository": { - "type": "git", - "url": "git+https://github.com/gulpjs/replace-ext.git" - }, - "scripts": { - "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly", - "coveralls": "npm run cover && istanbul-coveralls", - "lint": "eslint . && jscs index.js test/", - "pretest": "npm run lint", - "test": "mocha --async-only" - }, - "version": "1.0.0" -} \ No newline at end of file + ] +} diff --git a/tools/node_modules/eslint/node_modules/trough/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/trough/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/trough/index.js diff --git a/tools/node_modules/eslint/node_modules/trough/license b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/license similarity index 100% rename from tools/node_modules/eslint/node_modules/trough/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/trough/license diff --git a/tools/node_modules/eslint/node_modules/trough/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json similarity index 73% rename from tools/node_modules/eslint/node_modules/trough/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json index d4203f3a15d71f..cbf7782f89a445 100644 --- a/tools/node_modules/eslint/node_modules/trough/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/package.json @@ -1,23 +1,27 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/trough/issues" + "name": "trough", + "version": "1.0.5", + "description": "Middleware: a channel used to convey a liquid", + "license": "MIT", + "keywords": [ + "middleware", + "ware" + ], + "repository": "wooorm/trough", + "bugs": "https://github.com/wooorm/trough/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" }, - "bundleDependencies": false, + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js", + "wrap.js" ], "dependencies": {}, - "deprecated": false, - "description": "Middleware: a channel used to convey a liquid", "devDependencies": { "browserify": "^16.0.0", "nyc": "^15.0.0", @@ -28,26 +32,14 @@ "tinyify": "^2.0.0", "xo": "^0.25.0" }, - "files": [ - "index.js", - "wrap.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/trough#readme", - "keywords": [ - "middleware", - "ware" - ], - "license": "MIT", - "name": "trough", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "build-bundle": "browserify index.js -s trough > trough.js", + "build-mangle": "browserify index.js -s trough -p tinyify > trough.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" }, "prettier": { "tabWidth": 2, @@ -57,25 +49,6 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/trough.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js -s trough > trough.js", - "build-mangle": "browserify index.js -s trough -p tinyify > trough.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.5", "xo": { "prettier": true, "esnext": false, @@ -87,5 +60,16 @@ "ignores": [ "trough.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/trough/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/trough/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/trough/readme.md diff --git a/tools/node_modules/eslint/node_modules/trough/wrap.js b/tools/node_modules/eslint-plugin-markdown/node_modules/trough/wrap.js similarity index 100% rename from tools/node_modules/eslint/node_modules/trough/wrap.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/trough/wrap.js diff --git a/tools/node_modules/eslint/node_modules/unified/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/unified/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/unified/LICENSE diff --git a/tools/node_modules/eslint/node_modules/unified/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/unified/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/unified/index.js diff --git a/tools/node_modules/eslint/node_modules/unified/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json similarity index 74% rename from tools/node_modules/eslint/node_modules/unified/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json index 5142140ddfdf9c..21777216934520 100644 --- a/tools/node_modules/eslint/node_modules/unified/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/package.json @@ -1,19 +1,27 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - "bugs": { - "url": "https://github.com/unifiedjs/unified/issues" - }, - "bundleDependencies": false, + "name": "unified", + "version": "6.2.0", + "description": "Pluggable text processing interface", + "license": "MIT", + "keywords": [ + "process", + "parse", + "transform", + "compile", + "stringify", + "rehype", + "retext", + "remark" + ], + "repository": "unifiedjs/unified", + "bugs": "https://github.com/unifiedjs/unified/issues", + "author": "Titus Wormer (http://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - } + "Titus Wormer (http://wooorm.com)" + ], + "files": [ + "index.js", + "lib" ], "dependencies": { "bail": "^1.0.0", @@ -23,8 +31,6 @@ "vfile": "^2.0.0", "x-is-string": "^0.1.0" }, - "deprecated": false, - "description": "Pluggable text processing interface", "devDependencies": { "browserify": "^16.0.0", "esmangle": "^1.0.0", @@ -35,23 +41,15 @@ "tape": "^4.4.0", "xo": "^0.20.0" }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/unifiedjs/unified#readme", - "keywords": [ - "process", - "parse", - "transform", - "compile", - "stringify", - "rehype", - "retext", - "remark" - ], - "license": "MIT", - "name": "unified", + "scripts": { + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "build-bundle": "browserify index.js -s unified > unified.js", + "build-mangle": "esmangle unified.js > unified.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test", + "test": "npm run format && npm run build && npm run test-coverage" + }, "nyc": { "check-coverage": true, "lines": 100, @@ -66,25 +64,6 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/unifiedjs/unified.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js -s unified > unified.js", - "build-mangle": "esmangle unified.js > unified.min.js", - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test" - }, - "version": "6.2.0", "xo": { "prettier": true, "esnext": false, @@ -98,5 +77,10 @@ "ignores": [ "unified.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/unified/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/unified/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/unified/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/unified/readme.md diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 00000000000000..3d78a4442f72be --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/index.js @@ -0,0 +1,50 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = stringify + +function stringify(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } + + // Node. + if (own.call(value, 'position') || own.call(value, 'type')) { + return position(value.position) + } + + // Position. + if (own.call(value, 'start') || own.call(value, 'end')) { + return position(value) + } + + // Point. + if (own.call(value, 'line') || own.call(value, 'column')) { + return point(value) + } + + // ? + return '' +} + +function point(point) { + if (!point || typeof point !== 'object') { + point = {} + } + + return index(point.line) + ':' + index(point.column) +} + +function position(pos) { + if (!pos || typeof pos !== 'object') { + pos = {} + } + + return point(pos.start) + '-' + point(pos.end) +} + +function index(value) { + return value && typeof value === 'number' ? value : 1 +} diff --git a/tools/node_modules/eslint/node_modules/is-whitespace-character/license b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/license similarity index 100% rename from tools/node_modules/eslint/node_modules/is-whitespace-character/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/license diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 00000000000000..0f35015de95ea2 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,84 @@ +{ + "name": "unist-util-stringify-position", + "version": "2.0.3", + "description": "unist utility to serialize a node, position, or point as a human readable location", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "position", + "location", + "point", + "node", + "stringify", + "tostring" + ], + "repository": "syntax-tree/unist-util-stringify-position", + "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "types": "types/index.d.ts", + "files": [ + "types/index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^2.0.2" + }, + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "typescript": "^3.0.0", + "xo": "^0.27.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "build-bundle": "browserify . -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "browserify . -s unistUtilStringifyPosition -p tinyify > unist-util-stringify-position.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-stringify-position.js" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 00000000000000..bb565149bb3815 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,140 @@ +# unist-util-stringify-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to pretty print the positional information of a node. + +## Install + +[npm][]: + +```sh +npm install unist-util-stringify-position +``` + +## Use + +```js +var stringify = require('unist-util-stringify-position') + +// Point +stringify({line: 2, column: 3}) // => '2:3' + +// Position +stringify({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' + +// Node +stringify({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}) // => '5:11-5:12' +``` + +## API + +### `stringifyPosition(node|position|point)` + +Stringify one [point][], a [position][] (start and end [point][]s), or a node’s +[positional information][positional-information]. + +###### Parameters + +* `node` ([`Node`][node]) + — Node whose `'position'` property to stringify +* `position` ([`Position`][position]) + — Position whose `'start'` and `'end'` points to stringify +* `point` ([`Point`][point]) + — Point whose `'line'` and `'column'` to stringify + +###### Returns + +`string?` — A range `ls:cs-le:ce` (when given `node` or `position`) or a point +`l:c` (when given `point`), where `l` stands for line, `c` for column, `s` for +`start`, and `e` for end. +An empty string (`''`) is returned if the given value is neither `node`, +`position`, nor `point`. + +## Related + +* [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated) + — Check if a node is generated +* [`unist-util-position`](https://github.com/syntax-tree/unist-util-position) + — Get positional info of nodes +* [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position) + — Remove positional info from trees +* [`unist-util-source`](https://github.com/syntax-tree/unist-util-source) + — Get the source of a value (node or position) in a file + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-stringify-position + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-stringify-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-stringify-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-stringify-position + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-stringify-position.svg + +[size]: https://bundlephobia.com/result?p=unist-util-stringify-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[positional-information]: https://github.com/syntax-tree/unist#positional-information diff --git a/tools/node_modules/eslint/node_modules/vfile-message/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile-message/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/index.js diff --git a/tools/node_modules/eslint/node_modules/vfile-message/license b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/license similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile-message/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/license diff --git a/tools/node_modules/eslint/node_modules/unist-util-stringify-position/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/unist-util-stringify-position/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/LICENSE diff --git a/tools/node_modules/eslint/node_modules/unist-util-stringify-position/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/unist-util-stringify-position/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js diff --git a/tools/node_modules/eslint/node_modules/unist-util-stringify-position/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/unist-util-stringify-position/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/package.json index fe85a400cb8590..2e20b672051031 100644 --- a/tools/node_modules/eslint/node_modules/unist-util-stringify-position/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/package.json @@ -1,23 +1,29 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - "bugs": { - "url": "https://github.com/syntax-tree/unist-util-stringify-position/issues" - }, - "bundleDependencies": false, + "name": "unist-util-stringify-position", + "version": "1.1.2", + "description": "Stringify a Unist node, position, or point", + "license": "MIT", + "keywords": [ + "unist", + "position", + "location", + "point", + "node", + "stringify", + "tostring", + "util", + "utility" + ], + "repository": "syntax-tree/unist-util-stringify-position", + "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", + "author": "Titus Wormer (http://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - } + "Titus Wormer (http://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": {}, - "deprecated": false, - "description": "Stringify a Unist node, position, or point", "devDependencies": { "browserify": "^16.0.0", "esmangle": "^1.0.0", @@ -28,23 +34,15 @@ "tape": "^4.5.1", "xo": "^0.20.0" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/syntax-tree/unist-util-stringify-position#readme", - "keywords": [ - "unist", - "position", - "location", - "point", - "node", - "stringify", - "tostring", - "util", - "utility" - ], - "license": "MIT", - "name": "unist-util-stringify-position", + "scripts": { + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, "nyc": { "check-coverage": true, "lines": 100, @@ -59,25 +57,6 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/syntax-tree/unist-util-stringify-position.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js", - "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js", - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.1.2", "xo": { "prettier": true, "esnext": false, @@ -89,5 +68,10 @@ "ignores": [ "unist-util-stringify-position.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/unist-util-stringify-position/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/unist-util-stringify-position/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/node_modules/unist-util-stringify-position/readme.md diff --git a/tools/node_modules/eslint/node_modules/vfile-message/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json similarity index 71% rename from tools/node_modules/eslint/node_modules/vfile-message/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json index 4a7b5a9867ff74..7396bb68e54f70 100644 --- a/tools/node_modules/eslint/node_modules/vfile-message/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/package.json @@ -1,25 +1,25 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/vfile/vfile-message/issues" - }, - "bundleDependencies": false, + "name": "vfile-message", + "version": "1.1.1", + "description": "Create a virtual message", + "license": "MIT", + "keywords": [ + "vfile", + "virtual", + "message" + ], + "repository": "vfile/vfile-message", + "bugs": "https://github.com/vfile/vfile-message/issues", + "author": "Titus Wormer (https://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } + "Titus Wormer (https://wooorm.com)" + ], + "files": [ + "index.js" ], "dependencies": { "unist-util-stringify-position": "^1.1.1" }, - "deprecated": false, - "description": "Create a virtual message", "devDependencies": { "browserify": "^16.0.0", "nyc": "^13.0.0", @@ -30,17 +30,15 @@ "tinyify": "^2.4.3", "xo": "^0.23.0" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/vfile/vfile-message#readme", - "keywords": [ - "vfile", - "virtual", - "message" - ], - "license": "MIT", - "name": "vfile-message", + "scripts": { + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "build-bundle": "browserify . -s vfileMessage > vfile-message.js", + "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, "nyc": { "check-coverage": true, "lines": 100, @@ -55,25 +53,6 @@ "semi": false, "trailingComma": "none" }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vfile/vfile-message.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s vfileMessage > vfile-message.js", - "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", - "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.1.1", "xo": { "prettier": true, "esnext": false, @@ -85,5 +64,10 @@ "ignores": [ "vfile-message.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/vfile-message/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile-message/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile-message/readme.md diff --git a/tools/node_modules/eslint/node_modules/vfile/LICENSE b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile/LICENSE rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/LICENSE diff --git a/tools/node_modules/eslint/node_modules/vfile/core.js b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/core.js similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile/core.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/core.js diff --git a/tools/node_modules/eslint/node_modules/vfile/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/index.js diff --git a/tools/node_modules/eslint/node_modules/is-word-character/license b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/is-word-character/license rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/LICENSE diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 00000000000000..3be1e14276cf79 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/index.js @@ -0,0 +1,50 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = stringify + +function stringify(value) { + /* Nothing. */ + if (!value || typeof value !== 'object') { + return null + } + + /* Node. */ + if (own.call(value, 'position') || own.call(value, 'type')) { + return position(value.position) + } + + /* Position. */ + if (own.call(value, 'start') || own.call(value, 'end')) { + return position(value) + } + + /* Point. */ + if (own.call(value, 'line') || own.call(value, 'column')) { + return point(value) + } + + /* ? */ + return null +} + +function point(point) { + if (!point || typeof point !== 'object') { + point = {} + } + + return index(point.line) + ':' + index(point.column) +} + +function position(pos) { + if (!pos || typeof pos !== 'object') { + pos = {} + } + + return point(pos.start) + '-' + point(pos.end) +} + +function index(value) { + return value && typeof value === 'number' ? value : 1 +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 00000000000000..2e20b672051031 --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,77 @@ +{ + "name": "unist-util-stringify-position", + "version": "1.1.2", + "description": "Stringify a Unist node, position, or point", + "license": "MIT", + "keywords": [ + "unist", + "position", + "location", + "point", + "node", + "stringify", + "tostring", + "util", + "utility" + ], + "repository": "syntax-tree/unist-util-stringify-position", + "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", + "author": "Titus Wormer (http://wooorm.com)", + "contributors": [ + "Titus Wormer (http://wooorm.com)" + ], + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": { + "browserify": "^16.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "prettier": "^1.12.1", + "remark-cli": "^5.0.0", + "remark-preset-wooorm": "^4.0.0", + "tape": "^4.5.1", + "xo": "^0.20.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", + "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run format && npm run build && npm run test-coverage" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "guard-for-in": "off", + "no-var": "off", + "prefer-arrow-callback": "off" + }, + "ignores": [ + "unist-util-stringify-position.js" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 00000000000000..85c753b5e1b47d --- /dev/null +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,100 @@ +# unist-util-stringify-position [![Build Status][build-badge]][build-page] [![Coverage Status][coverage-badge]][coverage-page] + +Stringify a [**Unist**][unist] [`Position`][position] or [`Point`][point]. + +## Installation + +[npm][]: + +```bash +npm install unist-util-stringify-position +``` + +## Usage + +```javascript +var stringify = require('unist-util-stringify-position') + +// Point +stringify({line: 2, column: 3}) // => '2:3' + +// Position +stringify({ + start: {line: 2}, + end: {line: 3} +}) // => '2:1-3:1' + +// Node +stringify({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}) // => '5:11-5:12' +``` + +## API + +### `stringifyPosition(node|position|point)` + +Stringify one point, a position (start and end points), or +a node’s position. + +###### Parameters + +* `node` ([`Node`][node]) + — Node whose `'position'` property to stringify +* `position` ([`Position`][position]) + — Position whose `'start'` and `'end'` points to stringify +* `point` ([`Point`][point]) + — Point whose `'line'` and `'column'` to stringify + +###### Returns + +`string?` — A range `ls:cs-le:ce` (when given `node` or +`position`) or a point `l:c` (when given `point`), where `l` stands +for line, `c` for column, `s` for `start`, and `e` for +end. `null` is returned if the given value is neither `node`, +`position`, nor `point`. + +## Contribute + +See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get +started. + +This organisation has a [Code of Conduct][coc]. By interacting with this +repository, organisation, or community you agree to abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg + +[build-page]: https://travis-ci.org/syntax-tree/unist-util-stringify-position + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg + +[coverage-page]: https://codecov.io/github/syntax-tree/unist-util-stringify-position?branch=master + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md + +[coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md diff --git a/tools/node_modules/eslint/node_modules/vfile/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json similarity index 58% rename from tools/node_modules/eslint/node_modules/vfile/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json index 98a004f48b3ce3..aba5f34dd9d5ab 100644 --- a/tools/node_modules/eslint/node_modules/vfile/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/package.json @@ -1,39 +1,33 @@ { - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - "bugs": { - "url": "https://github.com/vfile/vfile/issues" - }, - "bundleDependencies": false, + "name": "vfile", + "version": "2.3.0", + "description": "Virtual file format for text processing", + "license": "MIT", + "keywords": [ + "virtual", + "file", + "text", + "processing", + "message", + "warning", + "error", + "remark", + "retext" + ], + "repository": "vfile/vfile", + "bugs": "https://github.com/vfile/vfile/issues", + "author": "Titus Wormer (http://wooorm.com)", "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - { - "name": "Brendan Abbott", - "email": "brendan.abbott@temando.com" - }, - { - "name": "Denys Dovhan", - "email": "email@denysdovhan.com" - }, - { - "name": "Kyle Mathews", - "email": "mathews.kyle@gmail.com" - }, - { - "name": "Shinnosuke Watanabe", - "email": "snnskwtnb@gmail.com" - }, - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com" - } + "Titus Wormer (http://wooorm.com)", + "Brendan Abbott ", + "Denys Dovhan ", + "Kyle Mathews ", + "Shinnosuke Watanabe ", + "Sindre Sorhus " + ], + "files": [ + "core.js", + "index.js" ], "dependencies": { "is-buffer": "^1.1.4", @@ -41,8 +35,6 @@ "unist-util-stringify-position": "^1.0.0", "vfile-message": "^1.0.0" }, - "deprecated": false, - "description": "Virtual file format for text processing", "devDependencies": { "browserify": "^14.0.0", "esmangle": "^1.0.0", @@ -52,50 +44,22 @@ "tape": "^4.4.0", "xo": "^0.18.0" }, - "files": [ - "core.js", - "index.js" - ], - "homepage": "https://github.com/vfile/vfile#readme", - "keywords": [ - "virtual", - "file", - "text", - "processing", - "message", - "warning", - "error", - "remark", - "retext" - ], - "license": "MIT", - "name": "vfile", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vfile/vfile.git" - }, "scripts": { - "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-md": "remark . -qfo", "build-bundle": "browserify index.js -s VFile > vfile.js", "build-mangle": "esmangle vfile.js > vfile.min.js", - "build-md": "remark . -qfo", + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", "lint": "xo", - "test": "npm run build && npm run lint && npm run test-coverage", "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" + "test-coverage": "nyc --reporter lcov tape test.js", + "test": "npm run build && npm run lint && npm run test-coverage" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 }, - "version": "2.3.0", "xo": { "space": true, "esnext": false, @@ -105,5 +69,10 @@ "ignores": [ "vfile.js" ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/vfile/readme.md b/tools/node_modules/eslint-plugin-markdown/node_modules/vfile/readme.md similarity index 100% rename from tools/node_modules/eslint/node_modules/vfile/readme.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/vfile/readme.md diff --git a/tools/node_modules/eslint/node_modules/x-is-string/LICENCE b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/LICENCE similarity index 100% rename from tools/node_modules/eslint/node_modules/x-is-string/LICENCE rename to tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/LICENCE diff --git a/tools/node_modules/eslint/node_modules/x-is-string/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/x-is-string/README.md rename to tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/README.md diff --git a/tools/node_modules/eslint/node_modules/x-is-string/index.js b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/x-is-string/index.js rename to tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/index.js diff --git a/tools/node_modules/eslint/node_modules/x-is-string/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json similarity index 78% rename from tools/node_modules/eslint/node_modules/x-is-string/package.json rename to tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json index 95f98fc9577d31..ea267ce35112e1 100644 --- a/tools/node_modules/eslint/node_modules/x-is-string/package.json +++ b/tools/node_modules/eslint-plugin-markdown/node_modules/x-is-string/package.json @@ -1,47 +1,40 @@ { - "author": { - "name": "Matt-Esch", - "email": "matt@mattesch.info" - }, - "bugs": { - "url": "https://github.com/Matt-Esch/x-is-string/issues", - "email": "matt@mattesch.info" - }, - "bundleDependencies": false, + "name": "x-is-string", + "version": "0.1.0", + "description": "Simple string test", + "keywords": [], + "author": "Matt-Esch ", + "repository": "git://github.com/Matt-Esch/x-is-string.git", + "main": "index", + "homepage": "https://github.com/Matt-Esch/x-is-string", "contributors": [ { "name": "Matt-Esch" } ], + "bugs": { + "url": "https://github.com/Matt-Esch/x-is-string/issues", + "email": "matt@mattesch.info" + }, "dependencies": {}, - "deprecated": false, - "description": "Simple string test", "devDependencies": { "tape": "^2.12.2" }, - "homepage": "https://github.com/Matt-Esch/x-is-string", - "keywords": [], "licenses": [ { "type": "MIT", "url": "http://github.com/Matt-Esch/x-is-string/raw/master/LICENSE" } ], - "main": "index", - "name": "x-is-string", - "repository": { - "type": "git", - "url": "git://github.com/Matt-Esch/x-is-string.git" - }, "scripts": { - "cover": "istanbul cover --report none --print detail ./test/index.js", - "start": "node ./index.js", "test": "node ./test/index.js", - "test-browser": "testem-browser ./test/browser/index.js", - "testem": "testem-both -b=./test/browser/index.js", + "start": "node ./index.js", + "watch": "nodemon -w ./index.js index.js", "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", + "cover": "istanbul cover --report none --print detail ./test/index.js", "view-cover": "istanbul report html && google-chrome ./coverage/index.html", - "watch": "nodemon -w ./index.js index.js" + "test-browser": "testem-browser ./test/browser/index.js", + "testem": "testem-both -b=./test/browser/index.js" }, "testling": { "files": "test/index.js", @@ -58,6 +51,5 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - }, - "version": "0.1.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json b/tools/node_modules/eslint-plugin-markdown/package.json similarity index 65% rename from tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json rename to tools/node_modules/eslint-plugin-markdown/package.json index 33ac8cbb18d4b0..82ed1d8ff5b8b7 100644 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/package.json +++ b/tools/node_modules/eslint-plugin-markdown/package.json @@ -1,36 +1,16 @@ { + "name": "eslint-plugin-markdown", + "version": "2.0.0-rc.2", + "description": "An ESLint plugin to lint JavaScript in Markdown code fences.", + "license": "MIT", "author": { "name": "Brandon Mills", "url": "https://github.com/btmills" }, + "repository": "eslint/eslint-plugin-markdown", "bugs": { "url": "https://github.com/eslint/eslint-plugin-markdown/issues" }, - "bundleDependencies": false, - "dependencies": { - "object-assign": "^4.0.1", - "remark-parse": "^5.0.0", - "unified": "^6.1.2" - }, - "deprecated": false, - "description": "An ESLint plugin to lint JavaScript in Markdown code fences.", - "devDependencies": { - "chai": "^4.2.0", - "eslint": "^5.16.0", - "eslint-config-eslint": "^5.0.1", - "eslint-plugin-node": "^6.0.1", - "eslint-release": "^1.2.0", - "mocha": "^6.2.2", - "nyc": "^14.1.1" - }, - "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" - }, - "files": [ - "index.js", - "lib/index.js", - "lib/processor.js" - ], "homepage": "https://github.com/eslint/eslint-plugin-markdown#readme", "keywords": [ "eslint", @@ -39,22 +19,41 @@ "lint", "linter" ], - "license": "MIT", - "main": "index.js", - "name": "eslint-plugin-markdown", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-plugin-markdown.git" - }, "scripts": { + "lint": "eslint --ext js,md .", + "prepare": "node ./npm-prepare.js", + "test": "npm run lint && npm run test-cov", + "test-cov": "nyc _mocha -- -c tests/{examples,lib}/**/*.js", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint .", - "publish-release": "eslint-publish-release", - "test": "npm run lint && npm run test-cov", - "test-cov": "nyc _mocha -- -c tests/lib/**/*.js" + "publish-release": "eslint-publish-release" }, - "version": "1.0.2" -} \ No newline at end of file + "main": "index.js", + "files": [ + "index.js", + "lib/index.js", + "lib/processor.js" + ], + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^6.8.0", + "eslint-config-eslint": "^6.0.0", + "eslint-plugin-jsdoc": "^15.9.5", + "eslint-plugin-node": "^9.0.0", + "eslint-release": "^3.1.2", + "mocha": "^6.2.2", + "nyc": "^14.1.1" + }, + "dependencies": { + "remark-parse": "^9.0.0", + "unified": "^6.1.2" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + }, + "engines": { + "node": "^8.10.0 || ^10.12.0 || >= 12.0.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js index 28d86f7bc1cc8a..5b2a57a7f7e820 100644 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js @@ -108,7 +108,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} | `; + const gutter = ` ${paddedNumber} |`; const hasMarker = markerLines[number]; const lastMarkerLine = !markerLines[number + 1]; @@ -118,16 +118,16 @@ function codeFrameColumns(rawLines, loc, opts = {}) { if (Array.isArray(hasMarker)) { const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); if (lastMarkerLine && opts.message) { markerLine += " " + maybeHighlight(defs.message, opts.message); } } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; } }).join("\n"); diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json index 213c1916a9ec81..0713a93547cf9b 100644 --- a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json @@ -1,33 +1,26 @@ { - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/highlight": "^7.10.4" - }, - "deprecated": false, + "name": "@babel/code-frame", + "version": "7.12.13", "description": "Generate errors that contain a code frame that point to source locations.", - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "homepage": "https://babeljs.io/", + "author": "Sebastian McKenzie ", + "homepage": "https://babel.dev/docs/en/next/babel-code-frame", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/code-frame", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-code-frame" }, - "version": "7.12.11" + "main": "lib/index.js", + "dependencies": { + "@babel/highlight": "^7.12.13" + }, + "devDependencies": { + "@types/chalk": "^2.0.0", + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + } } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json index e70625729dd6c3..464dbfa3aace49 100644 --- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json @@ -1,26 +1,20 @@ { - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "@babel/helper-validator-identifier", + "version": "7.12.11", "description": "Validate identifier/keywords name", - "devDependencies": { - "charcodes": "^0.2.0", - "unicode-13.0.0": "^0.8.0" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" }, - "exports": "./lib/index.js", - "homepage": "https://github.com/babel/babel#readme", "license": "MIT", - "main": "./lib/index.js", - "name": "@babel/helper-validator-identifier", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "version": "7.12.11" + "main": "./lib/index.js", + "exports": "./lib/index.js", + "devDependencies": { + "charcodes": "^0.2.0", + "unicode-13.0.0": "^0.8.0" + } } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md index 72dae6094590f3..f8887ad2ca470c 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md @@ -2,7 +2,7 @@ > Syntax highlight JavaScript strings for output in terminals. -See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information. +See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information. ## Install diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js index b0d1be7f553b64..3cd2aed36a98eb 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js @@ -7,7 +7,7 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(require("js-tokens")); +var jsTokensNs = _interopRequireWildcard(require("js-tokens")); var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); @@ -19,11 +19,13 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); + function getDefs(chalk) { return { keyword: chalk.cyan, capitalized: chalk.yellow, - jsx_tag: chalk.yellow, + jsxIdentifier: chalk.yellow, punctuator: chalk.yellow, number: chalk.magenta, string: chalk.green, @@ -34,49 +36,70 @@ function getDefs(chalk) { } const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const JSX_TAG = /^[a-z][\w-]*$/i; const BRACKET = /^[()[\]{}]$/; - -function getTokenType(match) { - const [offset, text] = match.slice(-2); - const token = (0, _jsTokens.matchToToken)(match); - - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { - return "keyword"; +let tokenize; +{ + const { + matchToToken + } = jsTokensNs; + const JSX_TAG = /^[a-z][\w-]*$/i; + + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } + + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n"); } else { - return args[0]; + highlighted += value; } - }); + } + + return highlighted; } function shouldHighlight(options) { diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js new file mode 100644 index 00000000000000..90a871c4d78f6f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json new file mode 100644 index 00000000000000..65edb48c399c5c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "3.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^1.9.0" + }, + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "ava": { + "require": "babel-polyfill" + } +} diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md similarity index 77% rename from tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md index 24883de808be6a..3158e2df59ce66 100644 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md @@ -1,10 +1,11 @@ # ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - + + ## Install @@ -12,6 +13,7 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) modul $ npm install ansi-styles ``` + ## Usage ```js @@ -27,13 +29,14 @@ console.log(`${style.green.open}Hello world!${style.green.close}`); // original color. console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); ``` ## API Each style has an `open` and `close` property. + ## Styles ### Modifiers @@ -57,7 +60,7 @@ Each style has an `open` and `close` property. - `magenta` - `cyan` - `white` -- `blackBright` (alias: `gray`, `grey`) +- `gray` ("bright black") - `redBright` - `greenBright` - `yellowBright` @@ -76,7 +79,7 @@ Each style has an `open` and `close` property. - `bgMagenta` - `bgCyan` - `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgBlackBright` - `bgRedBright` - `bgGreenBright` - `bgYellowBright` @@ -85,6 +88,7 @@ Each style has an `open` and `close` property. - `bgCyanBright` - `bgWhiteBright` + ## Advanced usage By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. @@ -108,21 +112,11 @@ console.log(style.codes.get(36)); //=> 39 ``` + ## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) `ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - To use these, call the associated conversion function with the intended output, for example: ```js @@ -136,17 +130,18 @@ style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code ``` + ## Related - [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Josh Junon](https://github.com/qix-) -## For enterprise -Available as part of the Tidelift Subscription. +## License -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) +MIT diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json index 270fecdc347d42..bc324685a7625f 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json @@ -1,80 +1,71 @@ { - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "deprecated": false, - "description": "Terminal string styling done right", - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "execa": "^0.9.0", - "flow-bin": "^0.68.0", - "import-fresh": "^2.0.0", - "matcha": "^0.7.0", - "nyc": "^11.0.2", - "resolve-from": "^4.0.0", - "typescript": "^2.5.3", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "templates.js", - "types/index.d.ts", - "index.js.flow" - ], - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "chalk", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" - }, - "types": "types/index.d.ts", - "version": "2.4.2", - "xo": { - "envs": [ - "node", - "mocha" - ], - "ignores": [ - "test/_flow.js" - ] - } -} \ No newline at end of file + "name": "chalk", + "version": "2.4.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "types": "types/index.d.ts", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/LICENSE rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/README.md rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js similarity index 51% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js index 2657f265c9e102..32172007ec0b17 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/conversions.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js @@ -1,17 +1,18 @@ /* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); +var cssKeywords = require('color-name'); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; +var reverseKeywords = {}; +for (var key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } } -const convert = { +var convert = module.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -29,38 +30,40 @@ const convert = { gray: {channels: 1, labels: ['gray']} }; -module.exports = convert; +// hide .channels and .labels properties +for (var model in convert) { + if (convert.hasOwnProperty(model)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); + var channels = convert[model].channels; + var labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); } convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + var l; if (max === min) { h = 0; @@ -78,7 +81,7 @@ convert.rgb.hsl = function (rgb) { h += 360; } - const l = (min + max) / 2; + l = (min + max) / 2; if (max === min) { s = 0; @@ -92,24 +95,23 @@ convert.rgb.hsl = function (rgb) { }; convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { + var rdif; + var gdif; + var bdif; + var h; + var s; + + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { - h = 0; - s = 0; + h = s = 0; } else { s = diff / v; rdif = diffc(r); @@ -123,7 +125,6 @@ convert.rgb.hsv = function (rgb) { } else if (b === v) { h = (2 / 3) + gdif - rdif; } - if (h < 0) { h += 1; } else if (h > 1) { @@ -139,11 +140,11 @@ convert.rgb.hsv = function (rgb) { }; convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -151,48 +152,54 @@ convert.rgb.hwb = function (rgb) { }; convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; + + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; +/** + * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + * */ function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) + Math.pow(x[0] - y[0], 2) + + Math.pow(x[1] - y[1], 2) + + Math.pow(x[2] - y[2], 2) ); } convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; + var reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } - let currentClosestDistance = Infinity; - let currentClosestKeyword; + var currentClosestDistance = Infinity; + var currentClosestKeyword; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; - // Compute comparative distance - const distance = comparativeDistance(rgb, value); + // Compute comparative distance + var distance = comparativeDistance(rgb, value); - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } } } @@ -204,50 +211,55 @@ convert.keyword.rgb = function (keyword) { }; convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); + // assume sRGB + r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); + g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); + b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; if (s === 0) { val = l * 255; @@ -260,15 +272,14 @@ convert.hsl.rgb = function (hsl) { t2 = l + s - l * s; } - const t1 = 2 * l - t2; + t1 = 2 * l - t2; - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } - if (t3 > 1) { t3--; } @@ -290,31 +301,33 @@ convert.hsl.rgb = function (hsl) { }; convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + v = (l + s) / 2; + sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - (s * f)); + var t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { @@ -334,15 +347,16 @@ convert.hsv.rgb = function (hsv) { }; convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; l = (2 - s) * v; - const lmin = (2 - s) * vmin; + lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; @@ -353,83 +367,87 @@ convert.hsv.hsl = function (hsv) { // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + + // wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } - const i = Math.floor(6 * h); - const v = 1 - bl; + i = Math.floor(6 * h); + v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } - const n = wh + f * (v - wh); // Linear interpolation + n = wh + f * (v - wh); // linear interpolation - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ + var r; + var g; + var b; switch (i) { default: case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } - /* eslint-enable max-statements-per-line,no-multi-spaces */ return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; + + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - // Assume sRGB + // assume sRGB r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); @@ -440,40 +458,43 @@ convert.xyz.rgb = function (xyz) { }; convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; @@ -486,38 +507,45 @@ convert.lab.xyz = function (lab) { }; convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; + + hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } - const c = Math.sqrt(a * a + b * b); + c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); return [l, a, b]; }; -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization +convert.rgb.ansi16 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); @@ -525,7 +553,7 @@ convert.rgb.ansi16 = function (args, saturation = null) { return 30; } - let ansi = 30 + var ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); @@ -538,17 +566,17 @@ convert.rgb.ansi16 = function (args, saturation = null) { }; convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get + // optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; + var r = args[0]; + var g = args[1]; + var b = args[2]; - // We use the extended greyscale palette here, with the exception of + // we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { @@ -562,7 +590,7 @@ convert.rgb.ansi256 = function (args) { return Math.round(((r - 8) / 247) * 24) + 232; } - const ansi = 16 + var ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); @@ -571,9 +599,9 @@ convert.rgb.ansi256 = function (args) { }; convert.ansi16.rgb = function (args) { - let color = args % 10; + var color = args % 10; - // Handle greyscale + // handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; @@ -584,71 +612,71 @@ convert.ansi16.rgb = function (args) { return [color, color, color]; } - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; + var mult = (~~(args > 50) + 1) * 0.5; + var r = ((color & 1) * mult) * 255; + var g = (((color >> 1) & 1) * mult) * 255; + var b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { - // Handle greyscale + // handle greyscale if (args >= 232) { - const c = (args - 232) * 10 + 8; + var c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) + var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); - const string = integer.toString(16).toUpperCase(); + var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } - let colorString = match[0]; + var colorString = match[0]; if (match[0].length === 3) { - colorString = colorString.split('').map(char => { + colorString = colorString.split('').map(function (char) { return char + char; }).join(''); } - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; + var integer = parseInt(colorString, 16); + var r = (integer >> 16) & 0xFF; + var g = (integer >> 8) & 0xFF; + var b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = (max - min); + var grayscale; + var hue; if (chroma < 1) { grayscale = min / (1 - chroma); @@ -665,7 +693,7 @@ convert.rgb.hcg = function (rgb) { if (max === g) { hue = 2 + (b - r) / chroma; } else { - hue = 4 + (r - g) / chroma; + hue = 4 + (r - g) / chroma + 4; } hue /= 6; @@ -675,12 +703,17 @@ convert.rgb.hcg = function (rgb) { }; convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + if (l < 0.5) { + c = 2.0 * s * l; + } else { + c = 2.0 * s * (1.0 - l); + } - let f = 0; if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } @@ -689,11 +722,11 @@ convert.hsl.hcg = function (hsl) { }; convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; + var s = hsv[1] / 100; + var v = hsv[2] / 100; - const c = s * v; - let f = 0; + var c = s * v; + var f = 0; if (c < 1.0) { f = (v - c) / (1 - c); @@ -703,21 +736,20 @@ convert.hsv.hcg = function (hsv) { }; convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; + var pure = [0, 0, 0]; + var hi = (h % 1) * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; - /* eslint-disable max-statements-per-line */ switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; @@ -732,7 +764,6 @@ convert.hcg.rgb = function (hcg) { default: pure[0] = 1; pure[1] = 0; pure[2] = w; } - /* eslint-enable max-statements-per-line */ mg = (1.0 - c) * g; @@ -744,11 +775,11 @@ convert.hcg.rgb = function (hcg) { }; convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var c = hcg[1] / 100; + var g = hcg[2] / 100; - const v = c + g * (1.0 - c); - let f = 0; + var v = c + g * (1.0 - c); + var f = 0; if (v > 0.0) { f = c / v; @@ -758,11 +789,11 @@ convert.hcg.hsv = function (hcg) { }; convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; + var c = hcg[1] / 100; + var g = hcg[2] / 100; - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); @@ -775,18 +806,18 @@ convert.hcg.hsl = function (hcg) { }; convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; if (c < 1) { g = (v - c) / (1 - c); @@ -807,12 +838,10 @@ convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert.gray.hsl = function (args) { +convert.gray.hsl = convert.gray.hsv = function (args) { return [0, 0, args[0]]; }; -convert.gray.hsv = convert.gray.hsl; - convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; @@ -826,14 +855,14 @@ convert.gray.lab = function (gray) { }; convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; - const string = integer.toString(16).toUpperCase(); + var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js new file mode 100644 index 00000000000000..e65b5d775da353 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js @@ -0,0 +1,78 @@ +var conversions = require('./conversions'); +var route = require('./route'); + +var convert = {}; + +var models = Object.keys(conversions); + +function wrapRaw(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + return fn(args); + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +function wrapRounded(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + var result = fn(args); + + // we're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (var len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +models.forEach(function (fromModel) { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + var routes = route(fromModel); + var routeModels = Object.keys(routes); + + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json similarity index 53% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json index 427616bd0587d8..dfbc471407ff4c 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json @@ -1,30 +1,14 @@ { - "author": { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - "bugs": { - "url": "https://github.com/Qix-/color-convert/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-name": "~1.1.4" - }, - "deprecated": false, + "name": "color-convert", "description": "Plain color conversion functions", - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=7.0.0" + "version": "1.9.3", + "author": "Heather Arthur ", + "license": "MIT", + "repository": "Qix-/color-convert", + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" }, - "files": [ - "index.js", - "conversions.js", - "route.js" - ], - "homepage": "https://github.com/Qix-/color-convert#readme", "keywords": [ "color", "colour", @@ -39,22 +23,24 @@ "ansi", "ansi16" ], - "license": "MIT", - "name": "color-convert", - "repository": { - "type": "git", - "url": "git+https://github.com/Qix-/color-convert.git" - }, - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "version": "2.0.1", + "files": [ + "index.js", + "conversions.js", + "css-keywords.js", + "route.js" + ], "xo": { "rules": { "default-case": 0, "no-inline-comments": 0, "operator-linebreak": 0 } + }, + "devDependencies": { + "chalk": "1.1.1", + "xo": "0.11.2" + }, + "dependencies": { + "color-name": "1.1.3" } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js similarity index 59% rename from tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js index 1a08521b5a0017..0a1fdea689e2a7 100644 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/route.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js @@ -1,7 +1,7 @@ -const conversions = require('./conversions'); +var conversions = require('./conversions'); /* - This function routes a model to all other models. + this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array @@ -12,11 +12,11 @@ const conversions = require('./conversions'); */ function buildGraph() { - const graph = {}; + var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); + var models = Object.keys(conversions); - for (let len = models.length, i = 0; i < len; i++) { + for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. @@ -30,18 +30,18 @@ function buildGraph() { // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop + var graph = buildGraph(); + var queue = [fromModel]; // unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; @@ -61,10 +61,10 @@ function link(from, to) { } function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; + var cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); @@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) { } module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; + var graph = deriveBFS(fromModel); + var conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; if (node.parent === null) { - // No possible conversion, or this node is the source model. + // no possible conversion, or this node is the source model. continue; } diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/LICENSE rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/README.md rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/index.js rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json new file mode 100644 index 00000000000000..d061123ef02f40 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json @@ -0,0 +1,25 @@ +{ + "name": "color-name", + "version": "1.1.3", + "description": "A list of color names and its values", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:dfcreative/color-name.git" + }, + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "author": "DY ", + "license": "MIT", + "bugs": { + "url": "https://github.com/dfcreative/color-name/issues" + }, + "homepage": "https://github.com/dfcreative/color-name" +} diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js new file mode 100644 index 00000000000000..5139728fba6a26 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/license rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json similarity index 53% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json index c71a95689f337f..e1eb17a15ed880 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json @@ -1,28 +1,23 @@ { + "name": "has-flag", + "version": "3.0.0", + "description": "Check if argv has a specific flag", + "license": "MIT", + "repository": "sindresorhus/has-flag", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/has-flag/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if argv has a specific flag", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, "engines": { - "node": ">=8" + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" }, "files": [ - "index.js", - "index.d.ts" + "index.js" ], - "homepage": "https://github.com/sindresorhus/has-flag#readme", "keywords": [ "has", "check", @@ -42,14 +37,8 @@ "minimist", "optimist" ], - "license": "MIT", - "name": "has-flag", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-flag.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "4.0.0" -} \ No newline at end of file + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md similarity index 61% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md index 3f72dff29a6961..677893c278a2e3 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/readme.md +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md @@ -4,20 +4,6 @@ Correctly stops looking after an `--` argument terminator. ---- - -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    - ---- - ## Install @@ -79,11 +65,6 @@ Default: `process.argv` CLI arguments. -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - ## License MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/browser.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/browser.js rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js similarity index 62% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js index 6fada390fb88d8..1704131bdf6c8f 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js @@ -1,31 +1,22 @@ 'use strict'; const os = require('os'); -const tty = require('tty'); const hasFlag = require('has-flag'); -const {env} = process; +const env = process.env; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; + hasFlag('color=false')) { + forceColor = false; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { - forceColor = 1; + forceColor = true; } - if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; } function translateLevel(level) { @@ -41,8 +32,8 @@ function translateLevel(level) { }; } -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { +function supportsColor(stream) { + if (forceColor === false) { return 0; } @@ -56,21 +47,22 @@ function supportsColor(haveStream, streamIsTTY) { return 2; } - if (haveStream && !streamIsTTY && forceColor === undefined) { + if (stream && !stream.isTTY && forceColor !== true) { return 0; } - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } + const min = forceColor ? 1 : 0; if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( + Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { @@ -81,7 +73,7 @@ function supportsColor(haveStream, streamIsTTY) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -120,16 +112,20 @@ function supportsColor(haveStream, streamIsTTY) { return 1; } + if (env.TERM === 'dumb') { + return min; + } + return min; } function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); + const level = supportsColor(stream); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) }; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license similarity index 100% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json new file mode 100644 index 00000000000000..ad199f5cdb0436 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "5.5.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^3.0.0" + }, + "devDependencies": { + "ava": "^0.25.0", + "import-fresh": "^2.0.0", + "xo": "^0.20.0" + }, + "browser": "browser.js" +} diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md similarity index 67% rename from tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md rename to tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md index 36542285863330..f6e40195730ae8 100644 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md @@ -44,7 +44,7 @@ The `stdout`/`stderr` objects specifies a level of support for color through a ` It obeys the `--color` and `--no-color` CLI flags. -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. @@ -61,16 +61,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= - [Josh Junon](https://github.com/qix-) ---- +## License -
    - - Get professional support for this package with a Tidelift subscription - -
    - - Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. -
    -
    - ---- +MIT diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json index f126bb84aadcc8..bacac3df436067 100644 --- a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json @@ -1,34 +1,25 @@ { - "author": { - "name": "suchipi", - "email": "me@suchipi.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "deprecated": false, + "name": "@babel/highlight", + "version": "7.12.13", "description": "Syntax highlight JavaScript strings for output in terminals.", - "devDependencies": { - "strip-ansi": "^4.0.0" - }, - "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", - "homepage": "https://babeljs.io/", + "author": "suchipi ", + "homepage": "https://babel.dev/docs/en/next/babel-highlight", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/highlight", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-highlight" }, - "version": "7.10.4" + "main": "lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "devDependencies": { + "strip-ansi": "^4.0.0" + } } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json index 20f43070c13d3e..97dfe4da2ea249 100644 --- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json +++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json @@ -1,25 +1,37 @@ { - "author": { - "name": "Nicholas C. Zakas" + "name": "@eslint/eslintrc", + "version": "0.3.0", + "description": "The legacy ESLintRC config file format for ESLint", + "main": "lib/index.js", + "files": [ + "lib", + "conf", + "LICENSE" + ], + "publishConfig": { + "access": "public" }, + "scripts": { + "lint": "eslint .", + "test": "mocha -R progress -c 'tests/lib/**/*.js'", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslintrc", + "keywords": [ + "ESLint", + "ESLintRC", + "Configuration" + ], + "author": "Nicholas C. Zakas", + "license": "MIT", "bugs": { "url": "https://github.com/eslint/eslintrc/issues" }, - "bundleDependencies": false, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "deprecated": false, - "description": "The legacy ESLintRC config file format for ESLint", + "homepage": "https://github.com/eslint/eslintrc#readme", "devDependencies": { "chai": "^4.2.0", "eslint": "^7.7.0", @@ -32,38 +44,19 @@ "sinon": "^9.2.0", "temp-dir": "^2.0.0" }, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, "engines": { "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "lib", - "conf", - "LICENSE" - ], - "homepage": "https://github.com/eslint/eslintrc#readme", - "keywords": [ - "ESLint", - "ESLintRC", - "Configuration" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "@eslint/eslintrc", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslintrc.git" - }, - "scripts": { - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint .", - "publish-release": "eslint-publish-release", - "test": "mocha -R progress -c 'tests/lib/**/*.js'" - }, - "version": "0.3.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json index e26bc863624eb8..f42a7ea1437c8c 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -1,32 +1,27 @@ { - "bugs": { - "url": "https://github.com/acornjs/acorn-jsx/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "acorn-jsx", "description": "Modern, fast React.js JSX parser", - "devDependencies": { - "acorn": "^8.0.1" - }, "homepage": "https://github.com/acornjs/acorn-jsx", - "license": "MIT", + "version": "5.3.1", "maintainers": [ { "name": "Ingvar Stepanyan", "email": "me@rreverser.com", - "url": "http://rreverser.com/" + "web": "http://rreverser.com/" } ], - "name": "acorn-jsx", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, "repository": { "type": "git", - "url": "git+https://github.com/acornjs/acorn-jsx.git" + "url": "https://github.com/acornjs/acorn-jsx" }, + "license": "MIT", "scripts": { "test": "node test/run.js" }, - "version": "5.3.1" -} \ No newline at end of file + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "devDependencies": { + "acorn": "^8.0.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/acorn/package.json b/tools/node_modules/eslint/node_modules/acorn/package.json index a0944f1372f605..10699306d369f8 100644 --- a/tools/node_modules/eslint/node_modules/acorn/package.json +++ b/tools/node_modules/eslint/node_modules/acorn/package.json @@ -1,44 +1,35 @@ { - "bin": { - "acorn": "bin/acorn" - }, - "bugs": { - "url": "https://github.com/acornjs/acorn/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "acorn", "description": "ECMAScript parser", - "engines": { - "node": ">=0.4.0" - }, "homepage": "https://github.com/acornjs/acorn", - "license": "MIT", "main": "dist/acorn.js", + "types": "dist/acorn.d.ts", + "module": "dist/acorn.mjs", + "version": "7.4.1", + "engines": {"node": ">=0.4.0"}, "maintainers": [ { "name": "Marijn Haverbeke", "email": "marijnh@gmail.com", - "url": "https://marijnhaverbeke.nl" + "web": "https://marijnhaverbeke.nl" }, { "name": "Ingvar Stepanyan", "email": "me@rreverser.com", - "url": "https://rreverser.com/" + "web": "https://rreverser.com/" }, { "name": "Adrian Heine", - "url": "http://adrianheine.de" + "web": "http://adrianheine.de" } ], - "module": "dist/acorn.mjs", - "name": "acorn", "repository": { "type": "git", - "url": "git+https://github.com/acornjs/acorn.git" + "url": "https://github.com/acornjs/acorn.git" }, + "license": "MIT", "scripts": { "prepare": "cd ..; npm run build:main && npm run build:bin" }, - "types": "dist/acorn.d.ts", - "version": "7.4.1" -} \ No newline at end of file + "bin": {"acorn": "./bin/acorn"} +} diff --git a/tools/node_modules/eslint/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/ajv/package.json index 6657aaf6c4ab24..559a933c8c1c03 100644 --- a/tools/node_modules/eslint/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/ajv/package.json @@ -1,23 +1,72 @@ { - "author": { - "name": "Evgeny Poberezkin" + "name": "ajv", + "version": "6.12.6", + "description": "Another JSON Schema Validator", + "main": "lib/ajv.js", + "typings": "lib/ajv.d.ts", + "files": [ + "lib/", + "dist/", + "scripts/", + "LICENSE", + ".tonic_example.js" + ], + "scripts": { + "eslint": "eslint lib/{compile/,}*.js spec/{**/,}*.js scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "jshint": "jshint lib/{compile/,}*.js", + "lint": "npm run jshint && npm run eslint", + "test-spec": "mocha spec/{**/,}*.spec.js -R spec", + "test-fast": "AJV_FAST_TEST=true npm run test-spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-cov": "nyc npm run test-spec", + "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts", + "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters", + "bundle-beautify": "node ./scripts/bundle.js js-beautify", + "build": "del-cli lib/dotjs/*.js \"!lib/dotjs/index.js\" && node scripts/compile-dots.js", + "test-karma": "karma start", + "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma", + "test-all": "npm run test-cov && if-node-version 10 npm run test-browser", + "test": "npm run lint && npm run build && npm run test-all", + "prepublish": "npm run build && npm run bundle", + "watch": "watch \"npm run build\" ./lib/dot" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/ajv-validator/ajv.git" }, + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", "bugs": { "url": "https://github.com/ajv-validator/ajv/issues" }, - "bundleDependencies": false, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, + "homepage": "https://github.com/ajv-validator/ajv", + "tonicExampleFilename": ".tonic_example.js", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, - "deprecated": false, - "description": "Another JSON Schema Validator", "devDependencies": { "ajv-async": "^1.0.0", "bluebird": "^3.5.3", @@ -46,65 +95,12 @@ "uglify-js": "^3.6.9", "watch": "^1.0.0" }, - "files": [ - "lib/", - "dist/", - "scripts/", - "LICENSE", - ".tonic_example.js" - ], + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" - }, - "homepage": "https://github.com/ajv-validator/ajv", - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "license": "MIT", - "main": "lib/ajv.js", - "name": "ajv", - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ajv-validator/ajv.git" - }, - "scripts": { - "build": "del-cli lib/dotjs/*.js \"!lib/dotjs/index.js\" && node scripts/compile-dots.js", - "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters", - "bundle-beautify": "node ./scripts/bundle.js js-beautify", - "eslint": "eslint lib/{compile/,}*.js spec/{**/,}*.js scripts --ignore-pattern spec/JSON-Schema-Test-Suite", - "jshint": "jshint lib/{compile/,}*.js", - "lint": "npm run jshint && npm run eslint", - "prepublish": "npm run build && npm run bundle", - "test": "npm run lint && npm run build && npm run test-all", - "test-all": "npm run test-cov && if-node-version 10 npm run test-browser", - "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma", - "test-cov": "nyc npm run test-spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-fast": "AJV_FAST_TEST=true npm run test-spec", - "test-karma": "karma start", - "test-spec": "mocha spec/{**/,}*.spec.js -R spec", - "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts", - "watch": "watch \"npm run build\" ./lib/dot" - }, - "tonicExampleFilename": ".tonic_example.js", - "typings": "lib/ajv.d.ts", - "version": "6.12.6" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/ansi-colors/package.json b/tools/node_modules/eslint/node_modules/ansi-colors/package.json index 8c23184218ac6b..e11093140b3277 100644 --- a/tools/node_modules/eslint/node_modules/ansi-colors/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-colors/package.json @@ -1,32 +1,33 @@ { - "author": { - "name": "Brian Woodward", - "url": "https://github.com/doowb" - }, + "name": "ansi-colors", + "description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", + "version": "4.1.1", + "homepage": "https://github.com/doowb/ansi-colors", + "author": "Brian Woodward (https://github.com/doowb)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Jason Schilling (https://sourecode.de)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Jordan (https://github.com/Silic0nS0ldier)" + ], + "repository": "doowb/ansi-colors", "bugs": { "url": "https://github.com/doowb/ansi-colors/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jason Schilling", - "url": "https://sourecode.de" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Jordan", - "url": "https://github.com/Silic0nS0ldier" - } + "license": "MIT", + "files": [ + "index.js", + "symbols.js", + "types/index.d.ts" ], - "deprecated": false, - "description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", + "main": "index.js", + "types": "./types/index.d.ts", + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "mocha" + }, "devDependencies": { "decache": "^4.5.1", "gulp-format-md": "^2.0.0", @@ -34,15 +35,6 @@ "mocha": "^6.1.4", "text-table": "^0.2.0" }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "symbols.js", - "types/index.d.ts" - ], - "homepage": "https://github.com/doowb/ansi-colors", "keywords": [ "ansi", "bgblack", @@ -83,17 +75,6 @@ "white", "yellow" ], - "license": "MIT", - "main": "index.js", - "name": "ansi-colors", - "repository": { - "type": "git", - "url": "git+https://github.com/doowb/ansi-colors.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "./types/index.d.ts", "verb": { "toc": false, "layout": "default", @@ -124,6 +105,5 @@ "colors", "kleur" ] - }, - "version": "4.1.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/ansi-regex/package.json index d0574afde48599..7af801f3522206 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-regex/package.json @@ -1,64 +1,55 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "5.0.0" -} \ No newline at end of file + "name": "ansi-regex", + "version": "5.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/ansi-styles/index.js index 90a871c4d78f6f..5d82581a13f990 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-styles/index.js @@ -1,21 +1,63 @@ 'use strict'; -const colorConvert = require('color-convert'); -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); return `\u001B[${code + offset}m`; }; -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); return `\u001B[${38 + offset};5;${code}m`; }; -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + function assembleStyles() { const codes = new Map(); const styles = { @@ -39,9 +81,9 @@ function assembleStyles() { magenta: [35, 39], cyan: [36, 39], white: [37, 39], - gray: [90, 39], // Bright color + blackBright: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], @@ -72,15 +114,14 @@ function assembleStyles() { } }; - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\u001B[${style[0]}m`, close: `\u001B[${style[1]}m` @@ -95,65 +136,22 @@ function assembleStyles() { value: group, enumerable: false }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); } - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); return styles; } diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/ansi-styles/package.json index 5663ace24b4607..75393284d7e474 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-styles/package.json @@ -1,65 +1,56 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "ava": { - "require": "babel-polyfill" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-convert": "^1.9.0" - }, - "deprecated": false, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "ava": "*", - "babel-polyfill": "^6.23.0", - "svg-term-cli": "^2.1.1", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "ansi-styles", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", - "test": "xo && ava" - }, - "version": "3.2.1" -} \ No newline at end of file + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md index 3158e2df59ce66..24883de808be6a 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md @@ -1,11 +1,10 @@ # ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - + ## Install @@ -13,7 +12,6 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) modul $ npm install ansi-styles ``` - ## Usage ```js @@ -29,14 +27,13 @@ console.log(`${style.green.open}Hello world!${style.green.close}`); // original color. console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); ``` ## API Each style has an `open` and `close` property. - ## Styles ### Modifiers @@ -60,7 +57,7 @@ Each style has an `open` and `close` property. - `magenta` - `cyan` - `white` -- `gray` ("bright black") +- `blackBright` (alias: `gray`, `grey`) - `redBright` - `greenBright` - `yellowBright` @@ -79,7 +76,7 @@ Each style has an `open` and `close` property. - `bgMagenta` - `bgCyan` - `bgWhite` -- `bgBlackBright` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) - `bgRedBright` - `bgGreenBright` - `bgYellowBright` @@ -88,7 +85,6 @@ Each style has an `open` and `close` property. - `bgCyanBright` - `bgWhiteBright` - ## Advanced usage By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. @@ -112,11 +108,21 @@ console.log(style.codes.get(36)); //=> 39 ``` - ## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) `ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + To use these, call the associated conversion function with the intended output, for example: ```js @@ -130,18 +136,17 @@ style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code ``` - ## Related - [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Josh Junon](https://github.com/qix-) +## For enterprise -## License +Available as part of the Tidelift Subscription. -MIT +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/argparse/package.json b/tools/node_modules/eslint/node_modules/argparse/package.json index 12f9cf1395b90e..62fba0a9fcfc87 100644 --- a/tools/node_modules/eslint/node_modules/argparse/package.json +++ b/tools/node_modules/eslint/node_modules/argparse/package.json @@ -1,32 +1,7 @@ { - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "dependencies": { - "sprintf-js": "~1.0.2" - }, - "deprecated": false, + "name": "argparse", "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "devDependencies": { - "eslint": "^2.13.1", - "istanbul": "^0.4.5", - "mocha": "^3.1.0", - "ndoc": "^5.0.1" - }, - "files": [ - "index.js", - "lib/" - ], - "homepage": "https://github.com/nodeca/argparse#readme", + "version": "1.0.10", "keywords": [ "cli", "parser", @@ -34,14 +9,26 @@ "option", "args" ], + "contributors": [ + "Eugene Shkuropat", + "Paul Jacobson" + ], + "files": [ + "index.js", + "lib/" + ], "license": "MIT", - "name": "argparse", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/argparse.git" - }, + "repository": "nodeca/argparse", "scripts": { "test": "make test" }, - "version": "1.0.10" -} \ No newline at end of file + "dependencies": { + "sprintf-js": "~1.0.2" + }, + "devDependencies": { + "eslint": "^2.13.1", + "istanbul": "^0.4.5", + "mocha": "^3.1.0", + "ndoc": "^5.0.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/astral-regex/package.json b/tools/node_modules/eslint/node_modules/astral-regex/package.json index 50ad84da9d6243..d1ceea7f3add66 100644 --- a/tools/node_modules/eslint/node_modules/astral-regex/package.json +++ b/tools/node_modules/eslint/node_modules/astral-regex/package.json @@ -1,42 +1,33 @@ { - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "bugs": { - "url": "https://github.com/kevva/astral-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching astral symbols", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/kevva/astral-regex#readme", - "keywords": [ - "astral", - "emoji", - "regex", - "surrogate" - ], - "license": "MIT", - "name": "astral-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/kevva/astral-regex.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.0.0" -} \ No newline at end of file + "name": "astral-regex", + "version": "2.0.0", + "description": "Regular expression for matching astral symbols", + "license": "MIT", + "repository": "kevva/astral-regex", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "astral", + "emoji", + "regex", + "surrogate" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/balanced-match/package.json b/tools/node_modules/eslint/node_modules/balanced-match/package.json index 354df6cf2f70da..61349c6edad627 100644 --- a/tools/node_modules/eslint/node_modules/balanced-match/package.json +++ b/tools/node_modules/eslint/node_modules/balanced-match/package.json @@ -1,21 +1,22 @@ { - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test", + "bench": "make bench" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, - "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", "regexp", @@ -23,17 +24,12 @@ "balanced", "parse" ], - "license": "MIT", - "main": "index.js", - "name": "balanced-match", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "bench": "make bench", - "test": "make test" + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" }, + "license": "MIT", "testling": { "files": "test/*.js", "browsers": [ @@ -49,6 +45,5 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - }, - "version": "1.0.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/brace-expansion/package.json b/tools/node_modules/eslint/node_modules/brace-expansion/package.json index af3bc67cac86e1..a18faa8fd67b82 100644 --- a/tools/node_modules/eslint/node_modules/brace-expansion/package.json +++ b/tools/node_modules/eslint/node_modules/brace-expansion/package.json @@ -1,37 +1,33 @@ { - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.11", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" }, - "bundleDependencies": false, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" }, - "deprecated": false, - "description": "Brace expansion as known from sh/bash", "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, - "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], - "license": "MIT", - "main": "index.js", - "name": "brace-expansion", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "bench": "matcha test/perf/bench.js", - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" }, + "license": "MIT", "testling": { "files": "test/*.js", "browsers": [ @@ -47,6 +43,5 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] - }, - "version": "1.1.11" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/callsites/package.json b/tools/node_modules/eslint/node_modules/callsites/package.json index b36dc6b150f396..93463c34b25dab 100644 --- a/tools/node_modules/eslint/node_modules/callsites/package.json +++ b/tools/node_modules/eslint/node_modules/callsites/package.json @@ -1,48 +1,39 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/callsites/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get callsites from the V8 stack trace API", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/callsites#readme", - "keywords": [ - "stacktrace", - "v8", - "callsite", - "callsites", - "stack", - "trace", - "function", - "file", - "line", - "debug" - ], - "license": "MIT", - "name": "callsites", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/callsites.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "3.1.0" -} \ No newline at end of file + "name": "callsites", + "version": "3.1.0", + "description": "Get callsites from the V8 stack trace API", + "license": "MIT", + "repository": "sindresorhus/callsites", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581a13f990..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index d276e03d2549c8..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-convert": "^2.0.1" - }, - "deprecated": false, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "ansi-styles", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", - "test": "xo && ava && tsd" - }, - "version": "4.3.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de808be6a..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js deleted file mode 100644 index b648e5737be616..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/index.js +++ /dev/null @@ -1,81 +0,0 @@ -const conversions = require('./conversions'); -const route = require('./route'); - -const convert = {}; - -const models = Object.keys(conversions); - -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - return fn(args); - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - const result = fn(args); - - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - const routes = route(fromModel); - const routeModels = Object.keys(routes); - - routeModels.forEach(toModel => { - const fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js deleted file mode 100644 index 1a08521b5a0017..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-convert/route.js +++ /dev/null @@ -1,97 +0,0 @@ -const conversions = require('./conversions'); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - - conversions that are not possible simply are not included. -*/ - -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); - - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - - return graph; -} - -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} - -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - - fn.conversion = path; - return fn; -} - -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } - - conversion[toModel] = wrapConversion(toModel, graph); - } - - return conversion; -}; - diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json deleted file mode 100644 index 07b8f6ece8170a..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/color-name/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": { - "name": "DY", - "email": "dfcreative@gmail.com" - }, - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A list of color names and its values", - "files": [ - "index.js" - ], - "homepage": "https://github.com/colorjs/color-name", - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "license": "MIT", - "main": "index.js", - "name": "color-name", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/colorjs/color-name.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.1.4" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1f8ffd76..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json deleted file mode 100644 index 5f90dfc93a7936..00000000000000 --- a/tools/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "bundleDependencies": false, - "dependencies": { - "has-flag": "^4.0.0" - }, - "deprecated": false, - "description": "Detect whether a terminal supports color", - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "browser.js" - ], - "homepage": "https://github.com/chalk/supports-color#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "license": "MIT", - "name": "supports-color", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "7.2.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/chalk/package.json index fbb12850511d0e..0d99f0f28621f2 100644 --- a/tools/node_modules/eslint/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/package.json @@ -1,77 +1,68 @@ { - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "deprecated": false, - "description": "Terminal string styling done right", - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "source", - "index.d.ts" - ], - "funding": "https://github.com/chalk/chalk?sponsor=1", - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "main": "source", - "name": "chalk", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "test": "xo && nyc ava && tsd" - }, - "version": "4.1.0", - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} \ No newline at end of file + "name": "chalk", + "version": "4.1.0", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "funding": "https://github.com/chalk/chalk?sponsor=1", + "main": "source", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "source", + "index.d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off", + "@typescript-eslint/member-ordering": "off", + "no-redeclare": "off", + "unicorn/string-content": "off", + "unicorn/better-regex": "off" + } + } +} diff --git a/tools/node_modules/eslint/node_modules/collapse-white-space/index.js b/tools/node_modules/eslint/node_modules/collapse-white-space/index.js deleted file mode 100644 index 93d546695c7ae7..00000000000000 --- a/tools/node_modules/eslint/node_modules/collapse-white-space/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' - -module.exports = collapse - -// `collapse(' \t\nbar \nbaz\t') // ' bar baz '` -function collapse(value) { - return String(value).replace(/\s+/g, ' ') -} diff --git a/tools/node_modules/eslint/node_modules/collapse-white-space/package.json b/tools/node_modules/eslint/node_modules/collapse-white-space/package.json deleted file mode 100644 index fd02ee65e2ed13..00000000000000 --- a/tools/node_modules/eslint/node_modules/collapse-white-space/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/collapse-white-space/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Replace multiple white-space characters with a single space", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^15.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/collapse-white-space#readme", - "keywords": [ - "collapse", - "white", - "space" - ], - "license": "MIT", - "name": "collapse-white-space", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/collapse-white-space.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s collapseWhiteSpace -o collapse-white-space.js", - "build-mangle": "browserify . -s collapseWhiteSpace -p tinyify -o collapse-white-space.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.6", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "collapse-white-space.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/collapse-white-space/readme.md b/tools/node_modules/eslint/node_modules/collapse-white-space/readme.md deleted file mode 100644 index 5154c9fedc3024..00000000000000 --- a/tools/node_modules/eslint/node_modules/collapse-white-space/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# collapse-white-space - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Replace multiple whitespace characters with a single space. - -## Install - -[npm][]: - -```sh -npm install collapse-white-space -``` - -## Use - -```js -var collapse = require('collapse-white-space') - -collapse('\tfoo \n\tbar \t\r\nbaz') //=> ' foo bar baz' -``` - -## API - -### `collapse(value)` - -Replace multiple whitespace characters in value with a single space. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/collapse-white-space.svg - -[build]: https://travis-ci.org/wooorm/collapse-white-space - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/collapse-white-space.svg - -[coverage]: https://codecov.io/github/wooorm/collapse-white-space - -[downloads-badge]: https://img.shields.io/npm/dm/collapse-white-space.svg - -[downloads]: https://www.npmjs.com/package/collapse-white-space - -[size-badge]: https://img.shields.io/bundlephobia/minzip/collapse-white-space.svg - -[size]: https://bundlephobia.com/result?p=collapse-white-space - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/color-convert/conversions.js index 32172007ec0b17..2657f265c9e102 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/conversions.js +++ b/tools/node_modules/eslint/node_modules/color-convert/conversions.js @@ -1,18 +1,17 @@ /* MIT license */ -var cssKeywords = require('color-name'); +/* eslint-disable no-mixed-operators */ +const cssKeywords = require('color-name'); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) -var reverseKeywords = {}; -for (var key in cssKeywords) { - if (cssKeywords.hasOwnProperty(key)) { - reverseKeywords[cssKeywords[key]] = key; - } +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; } -var convert = module.exports = { +const convert = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -30,40 +29,38 @@ var convert = module.exports = { gray: {channels: 1, labels: ['gray']} }; -// hide .channels and .labels properties -for (var model in convert) { - if (convert.hasOwnProperty(model)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } +module.exports = convert; - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - var channels = convert[model].channels; - var labels = convert[model].labels; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); } + + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); } convert.rgb.hsl = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; - var h; - var s; - var l; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; if (max === min) { h = 0; @@ -81,7 +78,7 @@ convert.rgb.hsl = function (rgb) { h += 360; } - l = (min + max) / 2; + const l = (min + max) / 2; if (max === min) { s = 0; @@ -95,23 +92,24 @@ convert.rgb.hsl = function (rgb) { }; convert.rgb.hsv = function (rgb) { - var rdif; - var gdif; - var bdif; - var h; - var s; - - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var v = Math.max(r, g, b); - var diff = v - Math.min(r, g, b); - var diffc = function (c) { + let rdif; + let gdif; + let bdif; + let h; + let s; + + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { return (v - c) / 6 / diff + 1 / 2; }; if (diff === 0) { - h = s = 0; + h = 0; + s = 0; } else { s = diff / v; rdif = diffc(r); @@ -125,6 +123,7 @@ convert.rgb.hsv = function (rgb) { } else if (b === v) { h = (2 / 3) + gdif - rdif; } + if (h < 0) { h += 1; } else if (h > 1) { @@ -140,11 +139,11 @@ convert.rgb.hsv = function (rgb) { }; convert.rgb.hwb = function (rgb) { - var r = rgb[0]; - var g = rgb[1]; - var b = rgb[2]; - var h = convert.rgb.hsl(rgb)[0]; - var w = 1 / 255 * Math.min(r, Math.min(g, b)); + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -152,54 +151,48 @@ convert.rgb.hwb = function (rgb) { }; convert.rgb.cmyk = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var c; - var m; - var y; - var k; - - k = Math.min(1 - r, 1 - g, 1 - b); - c = (1 - r - k) / (1 - k) || 0; - m = (1 - g - k) / (1 - k) || 0; - y = (1 - b - k) / (1 - k) || 0; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; -/** - * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - * */ function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ return ( - Math.pow(x[0] - y[0], 2) + - Math.pow(x[1] - y[1], 2) + - Math.pow(x[2] - y[2], 2) + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) ); } convert.rgb.keyword = function (rgb) { - var reversed = reverseKeywords[rgb]; + const reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } - var currentClosestDistance = Infinity; - var currentClosestKeyword; + let currentClosestDistance = Infinity; + let currentClosestKeyword; - for (var keyword in cssKeywords) { - if (cssKeywords.hasOwnProperty(keyword)) { - var value = cssKeywords[keyword]; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; - // Compute comparative distance - var distance = comparativeDistance(rgb, value); + // Compute comparative distance + const distance = comparativeDistance(rgb, value); - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; } } @@ -211,55 +204,50 @@ convert.keyword.rgb = function (keyword) { }; convert.rgb.xyz = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; - // assume sRGB - r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); - g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); - b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { - var xyz = convert.rgb.xyz(rgb); - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { - var h = hsl[0] / 360; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var t1; - var t2; - var t3; - var rgb; - var val; + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; if (s === 0) { val = l * 255; @@ -272,14 +260,15 @@ convert.hsl.rgb = function (hsl) { t2 = l + s - l * s; } - t1 = 2 * l - t2; + const t1 = 2 * l - t2; - rgb = [0, 0, 0]; - for (var i = 0; i < 3; i++) { + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } + if (t3 > 1) { t3--; } @@ -301,33 +290,31 @@ convert.hsl.rgb = function (hsl) { }; convert.hsl.hsv = function (hsl) { - var h = hsl[0]; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var smin = s; - var lmin = Math.max(l, 0.01); - var sv; - var v; + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; - v = (l + s) / 2; - sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { - var h = hsv[0] / 60; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var hi = Math.floor(h) % 6; - - var f = h - Math.floor(h); - var p = 255 * v * (1 - s); - var q = 255 * v * (1 - (s * f)); - var t = 255 * v * (1 - (s * (1 - f))); + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { @@ -347,16 +334,15 @@ convert.hsv.rgb = function (hsv) { }; convert.hsv.hsl = function (hsv) { - var h = hsv[0]; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var vmin = Math.max(v, 0.01); - var lmin; - var sl; - var l; + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; l = (2 - s) * v; - lmin = (2 - s) * vmin; + const lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; @@ -367,87 +353,83 @@ convert.hsv.hsl = function (hsv) { // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { - var h = hwb[0] / 360; - var wh = hwb[1] / 100; - var bl = hwb[2] / 100; - var ratio = wh + bl; - var i; - var v; - var f; - var n; - - // wh + bl cant be > 1 + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + + // Wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } - i = Math.floor(6 * h); - v = 1 - bl; + const i = Math.floor(6 * h); + const v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } - n = wh + f * (v - wh); // linear interpolation + const n = wh + f * (v - wh); // Linear interpolation - var r; - var g; - var b; + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ switch (i) { default: case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } + /* eslint-enable max-statements-per-line,no-multi-spaces */ return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { - var c = cmyk[0] / 100; - var m = cmyk[1] / 100; - var y = cmyk[2] / 100; - var k = cmyk[3] / 100; - var r; - var g; - var b; - - r = 1 - Math.min(1, c * (1 - k) + k); - g = 1 - Math.min(1, m * (1 - k) + k); - b = 1 - Math.min(1, y * (1 - k) + k); + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { - var x = xyz[0] / 100; - var y = xyz[1] / 100; - var z = xyz[2] / 100; - var r; - var g; - var b; + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - // assume sRGB + // Assume sRGB r = r > 0.0031308 - ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) : r * 12.92; g = g > 0.0031308 - ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) : g * 12.92; b = b > 0.0031308 - ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); @@ -458,43 +440,40 @@ convert.xyz.rgb = function (xyz) { }; convert.xyz.lab = function (xyz) { - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; x /= 95.047; y /= 100; z /= 108.883; - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var x; - var y; - var z; + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; - var y2 = Math.pow(y, 3); - var x2 = Math.pow(x, 3); - var z2 = Math.pow(z, 3); + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; @@ -507,45 +486,38 @@ convert.lab.xyz = function (lab) { }; convert.lab.lch = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var hr; - var h; - var c; - - hr = Math.atan2(b, a); + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + + const hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } - c = Math.sqrt(a * a + b * b); + const c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { - var l = lch[0]; - var c = lch[1]; - var h = lch[2]; - var a; - var b; - var hr; + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; - hr = h / 360 * 2 * Math.PI; - a = c * Math.cos(hr); - b = c * Math.sin(hr); + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); return [l, a, b]; }; -convert.rgb.ansi16 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization value = Math.round(value / 50); @@ -553,7 +525,7 @@ convert.rgb.ansi16 = function (args) { return 30; } - var ansi = 30 + let ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); @@ -566,17 +538,17 @@ convert.rgb.ansi16 = function (args) { }; convert.hsv.ansi16 = function (args) { - // optimization here; we already know the value and don't need to get + // Optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; + const r = args[0]; + const g = args[1]; + const b = args[2]; - // we use the extended greyscale palette here, with the exception of + // We use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { @@ -590,7 +562,7 @@ convert.rgb.ansi256 = function (args) { return Math.round(((r - 8) / 247) * 24) + 232; } - var ansi = 16 + const ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); @@ -599,9 +571,9 @@ convert.rgb.ansi256 = function (args) { }; convert.ansi16.rgb = function (args) { - var color = args % 10; + let color = args % 10; - // handle greyscale + // Handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; @@ -612,71 +584,71 @@ convert.ansi16.rgb = function (args) { return [color, color, color]; } - var mult = (~~(args > 50) + 1) * 0.5; - var r = ((color & 1) * mult) * 255; - var g = (((color >> 1) & 1) * mult) * 255; - var b = (((color >> 2) & 1) * mult) * 255; + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { - // handle greyscale + // Handle greyscale if (args >= 232) { - var c = (args - 232) * 10 + 8; + const c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; - var rem; - var r = Math.floor(args / 36) / 5 * 255; - var g = Math.floor((rem = args % 36) / 6) / 5 * 255; - var b = (rem % 6) / 5 * 255; + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { - var integer = ((Math.round(args[0]) & 0xFF) << 16) + const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); - var string = integer.toString(16).toUpperCase(); + const string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } - var colorString = match[0]; + let colorString = match[0]; if (match[0].length === 3) { - colorString = colorString.split('').map(function (char) { + colorString = colorString.split('').map(char => { return char + char; }).join(''); } - var integer = parseInt(colorString, 16); - var r = (integer >> 16) & 0xFF; - var g = (integer >> 8) & 0xFF; - var b = integer & 0xFF; + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = (max - min); - var grayscale; - var hue; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; if (chroma < 1) { grayscale = min / (1 - chroma); @@ -693,7 +665,7 @@ convert.rgb.hcg = function (rgb) { if (max === g) { hue = 2 + (b - r) / chroma; } else { - hue = 4 + (r - g) / chroma + 4; + hue = 4 + (r - g) / chroma; } hue /= 6; @@ -703,17 +675,12 @@ convert.rgb.hcg = function (rgb) { }; convert.hsl.hcg = function (hsl) { - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var c = 1; - var f = 0; + const s = hsl[1] / 100; + const l = hsl[2] / 100; - if (l < 0.5) { - c = 2.0 * s * l; - } else { - c = 2.0 * s * (1.0 - l); - } + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + let f = 0; if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } @@ -722,11 +689,11 @@ convert.hsl.hcg = function (hsl) { }; convert.hsv.hcg = function (hsv) { - var s = hsv[1] / 100; - var v = hsv[2] / 100; + const s = hsv[1] / 100; + const v = hsv[2] / 100; - var c = s * v; - var f = 0; + const c = s * v; + let f = 0; if (c < 1.0) { f = (v - c) / (1 - c); @@ -736,20 +703,21 @@ convert.hsv.hcg = function (hsv) { }; convert.hcg.rgb = function (hcg) { - var h = hcg[0] / 360; - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } - var pure = [0, 0, 0]; - var hi = (h % 1) * 6; - var v = hi % 1; - var w = 1 - v; - var mg = 0; + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + /* eslint-disable max-statements-per-line */ switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; @@ -764,6 +732,7 @@ convert.hcg.rgb = function (hcg) { default: pure[0] = 1; pure[1] = 0; pure[2] = w; } + /* eslint-enable max-statements-per-line */ mg = (1.0 - c) * g; @@ -775,11 +744,11 @@ convert.hcg.rgb = function (hcg) { }; convert.hcg.hsv = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - var v = c + g * (1.0 - c); - var f = 0; + const v = c + g * (1.0 - c); + let f = 0; if (v > 0.0) { f = c / v; @@ -789,11 +758,11 @@ convert.hcg.hsv = function (hcg) { }; convert.hcg.hsl = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - var l = g * (1.0 - c) + 0.5 * c; - var s = 0; + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); @@ -806,18 +775,18 @@ convert.hcg.hsl = function (hcg) { }; convert.hcg.hwb = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var v = c + g * (1.0 - c); + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { - var w = hwb[1] / 100; - var b = hwb[2] / 100; - var v = 1 - b; - var c = v - w; - var g = 0; + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; if (c < 1) { g = (v - c) / (1 - c); @@ -838,10 +807,12 @@ convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert.gray.hsl = convert.gray.hsv = function (args) { +convert.gray.hsl = function (args) { return [0, 0, args[0]]; }; +convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; @@ -855,14 +826,14 @@ convert.gray.lab = function (gray) { }; convert.gray.hex = function (gray) { - var val = Math.round(gray[0] / 100 * 255) & 0xFF; - var integer = (val << 16) + (val << 8) + val; + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; - var string = integer.toString(16).toUpperCase(); + const string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { - var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; diff --git a/tools/node_modules/eslint/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/color-convert/index.js index e65b5d775da353..b648e5737be616 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/index.js +++ b/tools/node_modules/eslint/node_modules/color-convert/index.js @@ -1,24 +1,25 @@ -var conversions = require('./conversions'); -var route = require('./route'); +const conversions = require('./conversions'); +const route = require('./route'); -var convert = {}; +const convert = {}; -var models = Object.keys(conversions); +const models = Object.keys(conversions); function wrapRaw(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; } - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); + if (arg0.length > 1) { + args = arg0; } return fn(args); }; - // preserve .conversion property if there is one + // Preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } @@ -27,22 +28,24 @@ function wrapRaw(fn) { } function wrapRounded(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; + const wrappedFn = function (...args) { + const arg0 = args[0]; + + if (arg0 === undefined || arg0 === null) { + return arg0; } - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); + if (arg0.length > 1) { + args = arg0; } - var result = fn(args); + const result = fn(args); - // we're assuming the result is an array here. + // We're assuming the result is an array here. // see notice in conversions.js; don't use box types // in conversion functions. if (typeof result === 'object') { - for (var len = result.length, i = 0; i < len; i++) { + for (let len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); } } @@ -50,7 +53,7 @@ function wrapRounded(fn) { return result; }; - // preserve .conversion property if there is one + // Preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } @@ -58,17 +61,17 @@ function wrapRounded(fn) { return wrappedFn; } -models.forEach(function (fromModel) { +models.forEach(fromModel => { convert[fromModel] = {}; Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - var routes = route(fromModel); - var routeModels = Object.keys(routes); + const routes = route(fromModel); + const routeModels = Object.keys(routes); - routeModels.forEach(function (toModel) { - var fn = routes[toModel]; + routeModels.forEach(toModel => { + const fn = routes[toModel]; convert[fromModel][toModel] = wrapRounded(fn); convert[fromModel][toModel].raw = wrapRaw(fn); diff --git a/tools/node_modules/eslint/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/color-convert/package.json index 991f69308c29f4..6e48000c7c98fd 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/package.json +++ b/tools/node_modules/eslint/node_modules/color-convert/package.json @@ -1,28 +1,17 @@ { - "author": { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - "bugs": { - "url": "https://github.com/Qix-/color-convert/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-name": "1.1.3" - }, - "deprecated": false, + "name": "color-convert", "description": "Plain color conversion functions", - "devDependencies": { - "chalk": "1.1.1", - "xo": "0.11.2" + "version": "2.0.1", + "author": "Heather Arthur ", + "license": "MIT", + "repository": "Qix-/color-convert", + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "engines": { + "node": ">=7.0.0" }, - "files": [ - "index.js", - "conversions.js", - "css-keywords.js", - "route.js" - ], - "homepage": "https://github.com/Qix-/color-convert#readme", "keywords": [ "color", "colour", @@ -37,22 +26,23 @@ "ansi", "ansi16" ], - "license": "MIT", - "name": "color-convert", - "repository": { - "type": "git", - "url": "git+https://github.com/Qix-/color-convert.git" - }, - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "version": "1.9.3", + "files": [ + "index.js", + "conversions.js", + "route.js" + ], "xo": { "rules": { "default-case": 0, "no-inline-comments": 0, "operator-linebreak": 0 } + }, + "devDependencies": { + "chalk": "^2.4.2", + "xo": "^0.24.0" + }, + "dependencies": { + "color-name": "~1.1.4" } -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/color-convert/route.js index 0a1fdea689e2a7..1a08521b5a0017 100644 --- a/tools/node_modules/eslint/node_modules/color-convert/route.js +++ b/tools/node_modules/eslint/node_modules/color-convert/route.js @@ -1,7 +1,7 @@ -var conversions = require('./conversions'); +const conversions = require('./conversions'); /* - this function routes a model to all other models. + This function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array @@ -12,11 +12,11 @@ var conversions = require('./conversions'); */ function buildGraph() { - var graph = {}; + const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - var models = Object.keys(conversions); + const models = Object.keys(conversions); - for (var len = models.length, i = 0; i < len; i++) { + for (let len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. @@ -30,18 +30,18 @@ function buildGraph() { // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { - var graph = buildGraph(); - var queue = [fromModel]; // unshift -> queue -> pop + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { - var current = queue.pop(); - var adjacents = Object.keys(conversions[current]); + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - for (var len = adjacents.length, i = 0; i < len; i++) { - var adjacent = adjacents[i]; - var node = graph[adjacent]; + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; @@ -61,10 +61,10 @@ function link(from, to) { } function wrapConversion(toModel, graph) { - var path = [graph[toModel].parent, toModel]; - var fn = conversions[graph[toModel].parent][toModel]; + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; - var cur = graph[toModel].parent; + let cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); @@ -76,16 +76,16 @@ function wrapConversion(toModel, graph) { } module.exports = function (fromModel) { - var graph = deriveBFS(fromModel); - var conversion = {}; + const graph = deriveBFS(fromModel); + const conversion = {}; - var models = Object.keys(graph); - for (var len = models.length, i = 0; i < len; i++) { - var toModel = models[i]; - var node = graph[toModel]; + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; if (node.parent === null) { - // no possible conversion, or this node is the source model. + // No possible conversion, or this node is the source model. continue; } diff --git a/tools/node_modules/eslint/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/color-name/package.json index 87d0e72ec56239..782dd82878030a 100644 --- a/tools/node_modules/eslint/node_modules/color-name/package.json +++ b/tools/node_modules/eslint/node_modules/color-name/package.json @@ -1,30 +1,28 @@ -{ - "author": { - "name": "DY", - "email": "dfcreative@gmail.com" - }, - "bugs": { - "url": "https://github.com/dfcreative/color-name/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A list of color names and its values", - "homepage": "https://github.com/dfcreative/color-name", - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "license": "MIT", - "main": "index.js", - "name": "color-name", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/dfcreative/color-name.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.1.3" -} \ No newline at end of file +{ + "name": "color-name", + "version": "1.1.4", + "description": "A list of color names and its values", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:colorjs/color-name.git" + }, + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "author": "DY ", + "license": "MIT", + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "homepage": "https://github.com/colorjs/color-name" +} diff --git a/tools/node_modules/eslint/node_modules/concat-map/package.json b/tools/node_modules/eslint/node_modules/concat-map/package.json index 4abe42193c4cc4..d3640e6b027b9e 100644 --- a/tools/node_modules/eslint/node_modules/concat-map/package.json +++ b/tools/node_modules/eslint/node_modules/concat-map/package.json @@ -1,65 +1,43 @@ { - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "homepage": "https://github.com/substack/node-concat-map#readme", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "license": "MIT", - "main": "index.js", - "name": "concat-map", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] + "name" : "concat-map", + "description" : "concatenative mapdashery", + "version" : "0.0.1", + "repository" : { + "type" : "git", + "url" : "git://github.com/substack/node-concat-map.git" + }, + "main" : "index.js", + "keywords" : [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories" : { + "example" : "example", + "test" : "test" + }, + "scripts" : { + "test" : "tape test/*.js" + }, + "devDependencies" : { + "tape" : "~2.4.0" + }, + "license" : "MIT", + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : { + "ie" : [ 6, 7, 8, 9 ], + "ff" : [ 3.5, 10, 15.0 ], + "chrome" : [ 10, 22 ], + "safari" : [ 5.1 ], + "opera" : [ 12 ] + } } - }, - "version": "0.0.1" -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/package.json b/tools/node_modules/eslint/node_modules/cross-spawn/package.json index 5ed16e25e312a4..232ff97e04b213 100644 --- a/tools/node_modules/eslint/node_modules/cross-spawn/package.json +++ b/tools/node_modules/eslint/node_modules/cross-spawn/package.json @@ -1,12 +1,47 @@ { - "author": { - "name": "André Cruz", - "email": "andre@moxy.studio" + "name": "cross-spawn", + "version": "7.0.3", + "description": "Cross platform child_process#spawn and child_process#spawnSync", + "keywords": [ + "spawn", + "spawnSync", + "windows", + "cross-platform", + "path-ext", + "shebang", + "cmd", + "execute" + ], + "author": "André Cruz ", + "homepage": "https://github.com/moxystudio/node-cross-spawn", + "repository": { + "type": "git", + "url": "git@github.com:moxystudio/node-cross-spawn.git" + }, + "license": "MIT", + "main": "index.js", + "files": [ + "lib" + ], + "scripts": { + "lint": "eslint .", + "test": "jest --env node --coverage", + "prerelease": "npm t && npm run lint", + "release": "standard-version", + "postrelease": "git push --follow-tags origin HEAD && npm publish" }, - "bugs": { - "url": "https://github.com/moxystudio/node-cross-spawn/issues" + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ] }, - "bundleDependencies": false, "commitlint": { "extends": [ "@commitlint/config-conventional" @@ -17,8 +52,6 @@ "shebang-command": "^2.0.0", "which": "^2.0.1" }, - "deprecated": false, - "description": "Cross platform child_process#spawn and child_process#spawnSync", "devDependencies": { "@commitlint/cli": "^8.1.0", "@commitlint/config-conventional": "^8.1.0", @@ -36,46 +69,5 @@ }, "engines": { "node": ">= 8" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/moxystudio/node-cross-spawn", - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, - "keywords": [ - "spawn", - "spawnSync", - "windows", - "cross-platform", - "path-ext", - "shebang", - "cmd", - "execute" - ], - "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] - }, - "main": "index.js", - "name": "cross-spawn", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/moxystudio/node-cross-spawn.git" - }, - "scripts": { - "lint": "eslint .", - "postrelease": "git push --follow-tags origin HEAD && npm publish", - "prerelease": "npm t && npm run lint", - "release": "standard-version", - "test": "jest --env node --coverage" - }, - "version": "7.0.3" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/debug/package.json b/tools/node_modules/eslint/node_modules/debug/package.json index 2b1dece47b8c9d..da809d2b8d28b2 100644 --- a/tools/node_modules/eslint/node_modules/debug/package.json +++ b/tools/node_modules/eslint/node_modules/debug/package.json @@ -1,33 +1,38 @@ { - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" + "name": "debug", + "version": "4.3.1", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" }, - "bundleDependencies": false, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - }, - { - "name": "Josh Junon", - "email": "josh@junon.me" - } + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne ", + "Josh Junon " ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, "dependencies": { "ms": "2.1.2" }, - "deprecated": false, - "description": "small debugging utility", "devDependencies": { "brfs": "^2.0.1", "browserify": "^16.2.3", @@ -41,38 +46,14 @@ "mocha-lcov-reporter": "^1.2.0", "xo": "^0.23.0" }, - "engines": { - "node": ">=6.0" - }, - "files": [ - "src", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", "peerDependenciesMeta": { "supports-color": { "optional": true } }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "scripts": { - "lint": "xo", - "test": "npm run test:node && npm run test:browser && npm run lint", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls", - "test:node": "istanbul cover _mocha -- test.js" - }, - "version": "4.3.1" -} \ No newline at end of file + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/deep-is/package.json b/tools/node_modules/eslint/node_modules/deep-is/package.json index c921e8a0e8b105..63628f0d015c9e 100644 --- a/tools/node_modules/eslint/node_modules/deep-is/package.json +++ b/tools/node_modules/eslint/node_modules/deep-is/package.json @@ -1,42 +1,37 @@ { - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, - "bugs": { - "url": "https://github.com/thlorenz/deep-is/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "deep-is", + "version": "0.1.3", "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", - "devDependencies": { - "tape": "~1.0.2" - }, + "main": "index.js", "directories": { "lib": ".", "example": "example", "test": "test" }, - "homepage": "https://github.com/thlorenz/deep-is#readme", + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~1.0.2" + }, + "repository": { + "type": "git", + "url": "http://github.com/thlorenz/deep-is.git" + }, "keywords": [ "equality", "equal", "compare" ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, "license": { "type": "MIT", "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" }, - "main": "index.js", - "name": "deep-is", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/thlorenz/deep-is.git" - }, - "scripts": { - "test": "tape test/*.js" - }, "testling": { "files": "test/*.js", "browsers": { @@ -62,6 +57,5 @@ 12 ] } - }, - "version": "0.1.3" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/doctrine/package.json b/tools/node_modules/eslint/node_modules/doctrine/package.json index b9a378a090734c..b66099863d4479 100644 --- a/tools/node_modules/eslint/node_modules/doctrine/package.json +++ b/tools/node_modules/eslint/node_modules/doctrine/package.json @@ -1,66 +1,58 @@ { - "bugs": { - "url": "https://github.com/eslint/doctrine/issues" - }, - "bundleDependencies": false, - "dependencies": { - "esutils": "^2.0.2" - }, - "deprecated": false, + "name": "doctrine", "description": "JSDoc parser", - "devDependencies": { - "coveralls": "^3.0.1", - "dateformat": "^1.0.11", - "eslint": "^1.10.3", - "eslint-release": "^1.0.0", - "linefix": "^0.1.1", - "mocha": "^3.4.2", - "npm-license": "^0.3.1", - "nyc": "^10.3.2", - "semver": "^5.0.3", - "shelljs": "^0.5.3", - "shelljs-nodecli": "^0.1.1", - "should": "^5.0.1" + "homepage": "https://github.com/eslint/doctrine", + "main": "lib/doctrine.js", + "version": "3.0.0", + "engines": { + "node": ">=6.0.0" }, "directories": { "lib": "./lib" }, - "engines": { - "node": ">=6.0.0" - }, "files": [ "lib" ], - "homepage": "https://github.com/eslint/doctrine", - "license": "Apache-2.0", - "main": "lib/doctrine.js", "maintainers": [ { "name": "Nicholas C. Zakas", "email": "nicholas+npm@nczconsulting.com", - "url": "https://www.nczonline.net" + "web": "https://www.nczonline.net" }, { "name": "Yusuke Suzuki", "email": "utatane.tea@gmail.com", - "url": "https://github.com/Constellation" + "web": "https://github.com/Constellation" } ], - "name": "doctrine", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/doctrine.git" + "repository": "eslint/doctrine", + "devDependencies": { + "coveralls": "^3.0.1", + "dateformat": "^1.0.11", + "eslint": "^1.10.3", + "eslint-release": "^1.0.0", + "linefix": "^0.1.1", + "mocha": "^3.4.2", + "npm-license": "^0.3.1", + "nyc": "^10.3.2", + "semver": "^5.0.3", + "shelljs": "^0.5.3", + "shelljs-nodecli": "^0.1.1", + "should": "^5.0.1" }, + "license": "Apache-2.0", "scripts": { + "pretest": "npm run lint", + "test": "nyc mocha", "coveralls": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint lib/", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib/", - "pretest": "npm run lint", - "publish-release": "eslint-publish-release", - "test": "nyc mocha" + "publish-release": "eslint-publish-release" }, - "version": "3.0.0" -} \ No newline at end of file + "dependencies": { + "esutils": "^2.0.2" + } +} diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/package.json b/tools/node_modules/eslint/node_modules/emoji-regex/package.json index eecc5eb318cd0a..6d323528292b00 100644 --- a/tools/node_modules/eslint/node_modules/emoji-regex/package.json +++ b/tools/node_modules/eslint/node_modules/emoji-regex/package.json @@ -1,32 +1,10 @@ { - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/emoji-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "emoji-regex", + "version": "8.0.0", "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", - "devDependencies": { - "@babel/cli": "^7.2.3", - "@babel/core": "^7.3.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", - "@babel/preset-env": "^7.3.4", - "mocha": "^6.0.2", - "regexgen": "^1.3.0", - "unicode-12.0.0": "^0.7.9" - }, - "files": [ - "LICENSE-MIT.txt", - "index.js", - "index.d.ts", - "text.js", - "es2015/index.js", - "es2015/text.js" - ], "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", "keywords": [ "unicode", "regex", @@ -38,17 +16,35 @@ "emoji" ], "license": "MIT", - "main": "index.js", - "name": "emoji-regex", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/emoji-regex.git" + "url": "https://github.com/mathiasbynens/emoji-regex.git" }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], "scripts": { "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", "test": "mocha", "test:watch": "npm run test -- --watch" }, - "types": "index.d.ts", - "version": "8.0.0" -} \ No newline at end of file + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/tools/node_modules/eslint/node_modules/enquirer/package.json b/tools/node_modules/eslint/node_modules/enquirer/package.json index c6d3a5ae0b8d7c..1d986c735661ab 100644 --- a/tools/node_modules/eslint/node_modules/enquirer/package.json +++ b/tools/node_modules/eslint/node_modules/enquirer/package.json @@ -1,27 +1,34 @@ { - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, + "name": "enquirer", + "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", + "version": "2.3.6", + "homepage": "https://github.com/enquirer/enquirer", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "enquirer/enquirer", "bugs": { "url": "https://github.com/enquirer/enquirer/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } + "license": "MIT", + "files": [ + "index.js", + "index.d.ts", + "lib" ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "test": "mocha && tsc -p ./test/types", + "cover": "nyc --reporter=text --reporter=html mocha" + }, "dependencies": { "ansi-colors": "^4.1.1" }, - "deprecated": false, - "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", "devDependencies": { "@types/node": "^8", "gulp-format-md": "^2.0.0", @@ -32,15 +39,6 @@ "time-require": "github:jonschlinkert/time-require", "typescript": "^3.1.6" }, - "engines": { - "node": ">=8.6" - }, - "files": [ - "index.js", - "index.d.ts", - "lib" - ], - "homepage": "https://github.com/enquirer/enquirer", "keywords": [ "answer", "answers", @@ -79,7 +77,6 @@ "yo", "zsh" ], - "license": "MIT", "lintDeps": { "devDependencies": { "files": { @@ -91,16 +88,6 @@ } } }, - "main": "index.js", - "name": "enquirer", - "repository": { - "type": "git", - "url": "git+https://github.com/enquirer/enquirer.git" - }, - "scripts": { - "cover": "nyc --reporter=text --reporter=html mocha", - "test": "mocha && tsc -p ./test/types" - }, "verb": { "toc": false, "layout": false, @@ -120,6 +107,5 @@ "inquirer", "prompt-skeleton" ] - }, - "version": "2.3.6" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json b/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json index ced6973347e903..f307df34a232c0 100644 --- a/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json +++ b/tools/node_modules/eslint/node_modules/escape-string-regexp/package.json @@ -1,26 +1,27 @@ { + "name": "escape-string-regexp", + "version": "1.0.5", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/escape-string-regexp/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Escape RegExp special characters", - "devDependencies": { - "ava": "*", - "xo": "*" - }, + "maintainers": [ + "Sindre Sorhus (sindresorhus.com)", + "Joshua Boy Nicolai Appelman (jbna.nl)" + ], "engines": { "node": ">=0.8.0" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", "keywords": [ "escape", "regex", @@ -33,26 +34,8 @@ "special", "characters" ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Boy Nicolai Appelman", - "email": "joshua@jbna.nl", - "url": "jbna.nl" - } - ], - "name": "escape-string-regexp", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.5" -} \ No newline at end of file + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md deleted file mode 100644 index 22f5099b65cccd..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md +++ /dev/null @@ -1,230 +0,0 @@ -# eslint-plugin-markdown - -![Screenshot](screenshot.png) - -An [ESLint](http://eslint.org/) plugin to lint JavaScript in Markdown. - -Supported extensions are `.markdown`, `.mdown`, `.mkdn`, and `.md`. - -## Usage - -Install the plugin: - -```sh -npm install --save-dev eslint eslint-plugin-markdown -``` - -Add it to your `.eslintrc`: - -```json -{ - "plugins": [ - "markdown" - ] -} -``` - -Run ESLint on `.md` files: - -```sh -eslint --ext md . -``` - -It will lint `js`, `javascript`, `jsx`, or `node` [fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks) in your Markdown documents: - -````markdown -```js -// This gets linted -var answer = 6 * 7; -console.log(answer); -``` - -```JavaScript -// This also gets linted - -/* eslint quotes: [2, "double"] */ - -function hello() { - console.log("Hello, world!"); -} -hello(); -``` - -```jsx -// This gets linted too -var div =
    ; -``` - -```node -// And this -console.log(process.version); -``` -```` - -Blocks that don't specify either `js`, `javascript`, `jsx`, or `node` syntax are ignored: - -````markdown -``` -This is plain text and doesn't get linted. -``` - -```python -print("This doesn't get linted either.") -``` -```` - -## Configuration Comments - -The processor will convert HTML comments immediately preceding a code block into JavaScript block comments and insert them at the beginning of the source code that it passes to ESLint. This permits configuring ESLint via configuration comments while keeping the configuration comments themselves hidden when the markdown is rendered. Comment bodies are passed through unmodified, so the plugin supports any [configuration comments](http://eslint.org/docs/user-guide/configuring) supported by ESLint itself. - -This example enables the `browser` environment, disables the `no-alert` rule, and configures the `quotes` rule to prefer single quotes: - -````markdown - - - - -```js -alert('Hello, world!'); -``` -```` - -Each code block in a file is linted separately, so configuration comments apply only to the code block that immediately follows. - -````markdown -Assuming `no-alert` is enabled in `.eslintrc`, the first code block will have no error from `no-alert`: - - - - -```js -alert("Hello, world!"); -``` - -But the next code block will have an error from `no-alert`: - - - -```js -alert("Hello, world!"); -``` -```` - -## Skipping Blocks - -Sometimes it can be useful to have code blocks marked with `js` even though they don't contain valid JavaScript syntax, such as commented JSON blobs that need `js` syntax highlighting. Standard `eslint-disable` comments only silence rule reporting, but ESLint still reports any syntax errors it finds. In cases where a code block should not even be parsed, insert a non-standard `` comment before the block, and this plugin will hide the following block from ESLint. Neither rule nor syntax errors will be reported. - -````markdown -There are comments in this JSON, so we use `js` syntax for better -highlighting. Skip the block to prevent warnings about invalid syntax. - - - -```js -{ - // This code block is hidden from ESLint. - "hello": "world" -} -``` - -```js -console.log("This code block is linted normally."); -``` -```` - -## Fix issues automatically - -This plugin can attempt to fix some of the issues automatically using [`fix` ESLint option](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems). This option instructs ESLint to try to fix as many issues as possible. To enable this option you can add `--fix` to your ESLint call, for example: - -```bash -eslint --fix --ext md . -``` - -## Unsatisfiable Rules - -Since code blocks are not files themselves but embedded inside a Markdown document, some rules do not apply to Markdown code blocks, and messages from these rules are automatically suppressed: - -- `eol-last` -- `unicode-bom` - -### Project or directory-wide overrides for code snippets - -Given that code snippets often lack full context, and adding full context -through configuration comments may be too cumbersome to apply for each snippet, -one may wish to instead set defaults for all one's JavaScript snippets in a -manner that applies to all Markdown files within your project (or a specific -directory). - -ESLint allows a configuration property `overrides` which has a `files` -property which accepts a -[glob pattern](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns), allowing you to designate files (such as all `md` files) whose rules will -be overridden. - -The following example shows the disabling of a few commonly problematic rules -for code snippets. It also points to the fact that some rules -(e.g., `padded-blocks`) may be more appealing for disabling given that -one may wish for documentation to be more liberal in providing padding for -readability. - -```js -// .eslintrc.json -{ - // ... - "overrides": [{ - "files": ["**/*.md"], - "rules": { - "no-undef": "off", - "no-unused-vars": "off", - "no-console": "off", - "padded-blocks": "off" - } - }] -} -``` - -#### Overriding `strict` - -The `strict` rule is technically satisfiable inside of Markdown code blocks, but writing a `"use strict"` directive at the top of every code block is tedious and distracting. We recommend a glob pattern for `.md` files to disable `strict` and enable the `impliedStrict` [parser option](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) so the code blocks still parse in strict mode: - -```js -// .eslintrc.json -{ - // ... - "overrides": [{ - "files": ["**/*.md"], - "parserOptions": { - "ecmaFeatures": { - "impliedStrict": true - } - }, - "rules": { - "strict": "off" - } - }] -} -``` - -## Tips for use with Atom linter-eslint - -The [linter-eslint](https://atom.io/packages/linter-eslint) package allows for -linting within the [Atom IDE](https://atom.io/). - -In order to see `eslint-plugin-markdown` work its magic within Markdown code -blocks in your Atom editor, you can go to `linter-eslint`'s settings and -within "List of scopes to run ESLint on...", add the cursor scope "source.gfm". - -However, this reports a problem when viewing Markdown which does not have -configuration, so you may wish to use the cursor scope "source.embedded.js", -but note that `eslint-plugin-markdown` configuration comments and skip -directives won't work in this context. - -## Contributing - -```sh -$ git clone https://github.com/eslint/eslint-plugin-markdown.git -$ cd eslint-plugin-markdown -$ npm install -$ npm test -``` - -This project follows the [ESLint contribution guidelines](http://eslint.org/docs/developer-guide/contributing/). diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js deleted file mode 100644 index e27aa162f98cb0..00000000000000 --- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/lib/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @fileoverview Enables the processor for Markdown file extensions. - * @author Brandon Mills - */ - -"use strict"; - -const processor = require("./processor"); - -module.exports = { - processors: { - ".markdown": processor, - ".mdown": processor, - ".mkdn": processor, - ".md": processor - } -}; diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/package.json b/tools/node_modules/eslint/node_modules/eslint-scope/package.json index bc425ebbd0bea4..b700b92afbea29 100644 --- a/tools/node_modules/eslint/node_modules/eslint-scope/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-scope/package.json @@ -1,14 +1,35 @@ { + "name": "eslint-scope", + "description": "ECMAScript scope analyzer for ESLint", + "homepage": "http://github.com/eslint/eslint-scope", + "main": "lib/index.js", + "version": "5.1.1", + "engines": { + "node": ">=8.0.0" + }, + "repository": "eslint/eslint-scope", "bugs": { "url": "https://github.com/eslint/eslint-scope/issues" }, - "bundleDependencies": false, + "license": "BSD-2-Clause", + "scripts": { + "test": "node Makefile.js test", + "lint": "node Makefile.js lint", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, - "deprecated": false, - "description": "ECMAScript scope analyzer for ESLint", "devDependencies": { "@typescript-eslint/parser": "^1.11.0", "chai": "^4.2.0", @@ -23,31 +44,5 @@ "npm-license": "^0.3.3", "shelljs": "^0.8.3", "typescript": "^3.5.2" - }, - "engines": { - "node": ">=8.0.0" - }, - "files": [ - "LICENSE", - "README.md", - "lib" - ], - "homepage": "http://github.com/eslint/eslint-scope", - "license": "BSD-2-Clause", - "main": "lib/index.js", - "name": "eslint-scope", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-scope.git" - }, - "scripts": { - "generate-alpharelease": "eslint-generate-prerelease alpha", - "generate-betarelease": "eslint-generate-prerelease beta", - "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "node Makefile.js lint", - "publish-release": "eslint-publish-release", - "test": "node Makefile.js test" - }, - "version": "5.1.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json index 2765f6d5537237..63267be6437e03 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "name": "eslint-visitor-keys", + "version": "1.3.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=4" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,31 +18,23 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, - "engines": { - "node": ">=4" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" - }, "scripts": { + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" }, - "version": "1.3.0" -} \ No newline at end of file + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/package.json index 38ea2a071cdf83..661a97fb097865 100644 --- a/tools/node_modules/eslint/node_modules/eslint-utils/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-utils/package.json @@ -1,16 +1,19 @@ { - "author": { - "name": "Toru Nagashima" - }, - "bugs": { - "url": "https://github.com/mysticatea/eslint-utils/issues" + "name": "eslint-utils", + "version": "2.1.0", + "description": "Utilities for ESLint plugins.", + "engines": { + "node": ">=6" }, - "bundleDependencies": false, + "sideEffects": false, + "main": "index", + "module": "index.mjs", + "files": [ + "index.*" + ], "dependencies": { "eslint-visitor-keys": "^1.1.0" }, - "deprecated": false, - "description": "Utilities for ESLint plugins.", "devDependencies": { "@mysticatea/eslint-plugin": "^12.0.0", "codecov": "^3.6.1", @@ -29,26 +32,8 @@ "vuepress": "^1.2.0", "warun": "^1.0.0" }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.*" - ], - "funding": "https://github.com/sponsors/mysticatea", - "homepage": "https://github.com/mysticatea/eslint-utils#readme", - "keywords": [ - "eslint" - ], - "license": "MIT", - "main": "index", - "module": "index.mjs", - "name": "eslint-utils", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/eslint-utils.git" - }, "scripts": { + "prebuild": "npm run -s clean", "build": "rollup -c", "clean": "rimraf .nyc_output coverage index.*", "codecov": "nyc report -r lcovonly && codecov", @@ -56,14 +41,25 @@ "docs:build": "vuepress build docs", "docs:watch": "vuepress dev docs", "lint": "eslint src test", - "postversion": "git push && git push --tags", - "prebuild": "npm run -s clean", - "preversion": "npm test && npm run -s build", - "prewatch": "npm run -s clean", "test": "run-s lint build test:mocha", "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" }, - "sideEffects": false, - "version": "2.1.0" -} \ No newline at end of file + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/eslint-utils.git" + }, + "keywords": [ + "eslint" + ], + "author": "Toru Nagashima", + "license": "MIT", + "bugs": { + "url": "https://github.com/mysticatea/eslint-utils/issues" + }, + "homepage": "https://github.com/mysticatea/eslint-utils#readme", + "funding": "https://github.com/sponsors/mysticatea" +} diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json index 5845760935ce9b..a3b8dd684ab145 100644 --- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "name": "eslint-visitor-keys", + "version": "2.0.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=10" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,30 +18,22 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, - "engines": { - "node": ">=10" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" - }, "scripts": { + "lint": "eslint lib tests/lib", + "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" }, - "version": "2.0.0" -} \ No newline at end of file + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} diff --git a/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json index 2765f6d5537237..63267be6437e03 100644 --- a/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "name": "eslint-visitor-keys", + "version": "1.3.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=4" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,31 +18,23 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, - "engines": { - "node": ">=4" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" - }, "scripts": { + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" }, - "version": "1.3.0" -} \ No newline at end of file + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} diff --git a/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json index 9fd6ee14a34c8f..724e6fcee72c3f 100644 --- a/tools/node_modules/eslint/node_modules/espree/package.json +++ b/tools/node_modules/eslint/node_modules/espree/package.json @@ -1,19 +1,27 @@ { - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" + "name": "espree", + "description": "An Esprima-compatible JavaScript parser built on Acorn", + "author": "Nicholas C. Zakas ", + "homepage": "https://github.com/eslint/espree", + "main": "espree.js", + "version": "7.3.1", + "files": [ + "lib", + "espree.js" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" }, + "repository": "eslint/espree", "bugs": { "url": "http://github.com/eslint/espree.git" }, - "bundleDependencies": false, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^1.3.0" }, - "deprecated": false, - "description": "An Esprima-compatible JavaScript parser built on Acorn", "devDependencies": { "browserify": "^16.5.0", "chai": "^4.2.0", @@ -32,14 +40,6 @@ "shelljs-nodecli": "^0.1.1", "unicode-6.3.0": "^0.7.5" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "lib", - "espree.js" - ], - "homepage": "https://github.com/eslint/espree", "keywords": [ "ast", "ecmascript", @@ -48,25 +48,17 @@ "syntax", "acorn" ], - "license": "BSD-2-Clause", - "main": "espree.js", - "name": "espree", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/espree.git" - }, "scripts": { - "browserify": "node Makefile.js browserify", + "generate-regex": "node tools/generate-identifier-regex.js", + "test": "npm run-script lint && node Makefile.js test", + "lint": "node Makefile.js lint", "fixlint": "node Makefile.js lint --fix", + "sync-docs": "node Makefile.js docs", + "browserify": "node Makefile.js browserify", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-regex": "node tools/generate-identifier-regex.js", - "generate-release": "eslint-generate-release", - "lint": "node Makefile.js lint", - "publish-release": "eslint-publish-release", - "sync-docs": "node Makefile.js docs", - "test": "npm run-script lint && node Makefile.js test" - }, - "version": "7.3.1" -} \ No newline at end of file + "publish-release": "eslint-publish-release" + } +} diff --git a/tools/node_modules/eslint/node_modules/esprima/package.json b/tools/node_modules/eslint/node_modules/esprima/package.json index 4dfb4a142e7aa5..4148b8ce4f4fa7 100644 --- a/tools/node_modules/eslint/node_modules/esprima/package.json +++ b/tools/node_modules/eslint/node_modules/esprima/package.json @@ -1,18 +1,39 @@ { + "name": "esprima", + "description": "ECMAScript parsing infrastructure for multipurpose analysis", + "homepage": "http://esprima.org", + "main": "dist/esprima.js", + "bin": { + "esparse": "./bin/esparse.js", + "esvalidate": "./bin/esvalidate.js" + }, + "version": "4.0.1", + "files": [ + "bin", + "dist/esprima.js" + ], + "engines": { + "node": ">=4" + }, "author": { "name": "Ariya Hidayat", "email": "ariya.hidayat@gmail.com" }, - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" + "maintainers": [ + { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com", + "web": "http://ariya.ofilabs.com" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/jquery/esprima.git" }, "bugs": { "url": "https://github.com/jquery/esprima/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "ECMAScript parsing infrastructure for multipurpose analysis", + "license": "BSD-2-Clause", "devDependencies": { "codecov.io": "~0.1.6", "escomplex-js": "1.2.0", @@ -41,14 +62,6 @@ "unicode-8.0.0": "~0.7.0", "webpack": "~1.14.0" }, - "engines": { - "node": ">=4" - }, - "files": [ - "bin", - "dist/esprima.js" - ], - "homepage": "http://esprima.org", "keywords": [ "ast", "ecmascript", @@ -57,58 +70,43 @@ "parser", "syntax" ], - "license": "BSD-2-Clause", - "main": "dist/esprima.js", - "maintainers": [ - { - "name": "Ariya Hidayat", - "email": "ariya.hidayat@gmail.com", - "url": "http://ariya.ofilabs.com" - } - ], - "name": "esprima", - "repository": { - "type": "git", - "url": "git+https://github.com/jquery/esprima.git" - }, "scripts": { - "all-tests": "npm run verify-line-ending && npm run generate-fixtures && npm run unit-tests && npm run api-tests && npm run grammar-tests && npm run regression-tests && npm run hostile-env-tests", - "analyze-coverage": "istanbul cover test/unit-tests.js", - "api-tests": "mocha -R dot test/api-tests.js", - "appveyor": "npm run compile && npm run all-tests && npm run browser-tests", - "benchmark": "npm run benchmark-parser && npm run benchmark-tokenizer", - "benchmark-parser": "node -expose_gc test/benchmark-parser.js", - "benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js", - "browser-tests": "npm run compile && npm run generate-fixtures && cd test && karma start --single-run", - "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", "check-version": "node test/check-version.js", - "circleci": "npm test && npm run codecov && npm run downstream", + "tslint": "tslint src/*.ts", "code-style": "tsfmt --verify src/*.ts && tsfmt --verify test/*.js", - "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", - "compile": "tsc -p src/ && webpack && node tools/fixupbundle.js", - "complexity": "node test/check-complexity.js", - "downstream": "node test/downstream.js", - "droneio": "npm run compile && npm run all-tests && npm run saucelabs", - "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", "format-code": "tsfmt -r src/*.ts && tsfmt -r test/*.js", - "generate-fixtures": "node tools/generate-fixtures.js", - "generate-regex": "node tools/generate-identifier-regex.js", - "generate-xhtml-entities": "node tools/generate-xhtml-entities.js", - "grammar-tests": "node test/grammar-tests.js", + "complexity": "node test/check-complexity.js", + "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity", "hostile-env-tests": "node test/hostile-environment-tests.js", - "prepublish": "npm run compile", - "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", + "unit-tests": "node test/unit-tests.js", + "api-tests": "mocha -R dot test/api-tests.js", + "grammar-tests": "node test/grammar-tests.js", "regression-tests": "node test/regression-tests.js", - "saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", + "all-tests": "npm run verify-line-ending && npm run generate-fixtures && npm run unit-tests && npm run api-tests && npm run grammar-tests && npm run regression-tests && npm run hostile-env-tests", + "verify-line-ending": "node test/verify-line-ending.js", + "generate-fixtures": "node tools/generate-fixtures.js", + "browser-tests": "npm run compile && npm run generate-fixtures && cd test && karma start --single-run", "saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js", - "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", - "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity", + "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", + "saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", + "analyze-coverage": "istanbul cover test/unit-tests.js", + "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", + "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", + "compile": "tsc -p src/ && webpack && node tools/fixupbundle.js", "test": "npm run compile && npm run all-tests && npm run static-analysis && npm run dynamic-analysis", + "prepublish": "npm run compile", + "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", + "benchmark-parser": "node -expose_gc test/benchmark-parser.js", + "benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js", + "benchmark": "npm run benchmark-parser && npm run benchmark-tokenizer", + "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", + "downstream": "node test/downstream.js", "travis": "npm test", - "tslint": "tslint src/*.ts", - "unit-tests": "node test/unit-tests.js", - "verify-line-ending": "node test/verify-line-ending.js" - }, - "version": "4.0.1" -} \ No newline at end of file + "circleci": "npm test && npm run codecov && npm run downstream", + "appveyor": "npm run compile && npm run all-tests && npm run browser-tests", + "droneio": "npm run compile && npm run all-tests && npm run saucelabs", + "generate-regex": "node tools/generate-identifier-regex.js", + "generate-xhtml-entities": "node tools/generate-xhtml-entities.js" + } +} diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js index 88abe0ffb91100..7a62b8b39ada4e 100644 --- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js +++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js @@ -66,7 +66,7 @@ function _unsupportedIterableToArray(o, minLen) { if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -86,6 +86,63 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _createForOfIteratorHelper(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + + var F = function () {}; + + return { + s: F, + n: function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = o[Symbol.iterator](); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; +} + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { @@ -182,6 +239,7 @@ var estraverse = createCommonjsModule(function (module, exports) { BreakStatement: 'BreakStatement', CallExpression: 'CallExpression', CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', ClassBody: 'ClassBody', ClassDeclaration: 'ClassDeclaration', ClassExpression: 'ClassExpression', @@ -260,6 +318,7 @@ var estraverse = createCommonjsModule(function (module, exports) { BreakStatement: ['label'], CallExpression: ['callee', 'arguments'], CatchClause: ['param', 'body'], + ChainExpression: ['expression'], ClassBody: ['body'], ClassDeclaration: ['id', 'superClass', 'body'], ClassExpression: ['id', 'superClass', 'body'], @@ -1126,7 +1185,10 @@ var parser = createCommonjsModule(function (module) { peg$c41 = peg$classExpectation([">", "<"], false, false), peg$c42 = ".", peg$c43 = peg$literalExpectation(".", false), - peg$c44 = function peg$c44(name, op, value) { + peg$c44 = function peg$c44(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c45 = function peg$c45(name, op, value) { return { type: 'attribute', name: name, @@ -1134,35 +1196,35 @@ var parser = createCommonjsModule(function (module) { value: value }; }, - peg$c45 = function peg$c45(name) { + peg$c46 = function peg$c46(name) { return { type: 'attribute', name: name }; }, - peg$c46 = "\"", - peg$c47 = peg$literalExpectation("\"", false), - peg$c48 = /^[^\\"]/, - peg$c49 = peg$classExpectation(["\\", "\""], true, false), - peg$c50 = "\\", - peg$c51 = peg$literalExpectation("\\", false), - peg$c52 = peg$anyExpectation(), - peg$c53 = function peg$c53(a, b) { + peg$c47 = "\"", + peg$c48 = peg$literalExpectation("\"", false), + peg$c49 = /^[^\\"]/, + peg$c50 = peg$classExpectation(["\\", "\""], true, false), + peg$c51 = "\\", + peg$c52 = peg$literalExpectation("\\", false), + peg$c53 = peg$anyExpectation(), + peg$c54 = function peg$c54(a, b) { return a + b; }, - peg$c54 = function peg$c54(d) { + peg$c55 = function peg$c55(d) { return { type: 'literal', value: strUnescape(d.join('')) }; }, - peg$c55 = "'", - peg$c56 = peg$literalExpectation("'", false), - peg$c57 = /^[^\\']/, - peg$c58 = peg$classExpectation(["\\", "'"], true, false), - peg$c59 = /^[0-9]/, - peg$c60 = peg$classExpectation([["0", "9"]], false, false), - peg$c61 = function peg$c61(a, b) { + peg$c56 = "'", + peg$c57 = peg$literalExpectation("'", false), + peg$c58 = /^[^\\']/, + peg$c59 = peg$classExpectation(["\\", "'"], true, false), + peg$c60 = /^[0-9]/, + peg$c61 = peg$classExpectation([["0", "9"]], false, false), + peg$c62 = function peg$c62(a, b) { // Can use `a.flat().join('')` once supported var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; return { @@ -1170,37 +1232,37 @@ var parser = createCommonjsModule(function (module) { value: parseFloat(leadingDecimals + b.join('')) }; }, - peg$c62 = function peg$c62(i) { + peg$c63 = function peg$c63(i) { return { type: 'literal', value: i }; }, - peg$c63 = "type(", - peg$c64 = peg$literalExpectation("type(", false), - peg$c65 = /^[^ )]/, - peg$c66 = peg$classExpectation([" ", ")"], true, false), - peg$c67 = ")", - peg$c68 = peg$literalExpectation(")", false), - peg$c69 = function peg$c69(t) { + peg$c64 = "type(", + peg$c65 = peg$literalExpectation("type(", false), + peg$c66 = /^[^ )]/, + peg$c67 = peg$classExpectation([" ", ")"], true, false), + peg$c68 = ")", + peg$c69 = peg$literalExpectation(")", false), + peg$c70 = function peg$c70(t) { return { type: 'type', value: t.join('') }; }, - peg$c70 = /^[imsu]/, - peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false), - peg$c72 = "/", - peg$c73 = peg$literalExpectation("/", false), - peg$c74 = /^[^\/]/, - peg$c75 = peg$classExpectation(["/"], true, false), - peg$c76 = function peg$c76(d, flgs) { + peg$c71 = /^[imsu]/, + peg$c72 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c73 = "/", + peg$c74 = peg$literalExpectation("/", false), + peg$c75 = /^[^\/]/, + peg$c76 = peg$classExpectation(["/"], true, false), + peg$c77 = function peg$c77(d, flgs) { return { type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') }; }, - peg$c77 = function peg$c77(i, is) { + peg$c78 = function peg$c78(i, is) { return { type: 'field', name: is.reduce(function (memo, p) { @@ -1208,63 +1270,63 @@ var parser = createCommonjsModule(function (module) { }, i) }; }, - peg$c78 = ":not(", - peg$c79 = peg$literalExpectation(":not(", false), - peg$c80 = function peg$c80(ss) { + peg$c79 = ":not(", + peg$c80 = peg$literalExpectation(":not(", false), + peg$c81 = function peg$c81(ss) { return { type: 'not', selectors: ss }; }, - peg$c81 = ":matches(", - peg$c82 = peg$literalExpectation(":matches(", false), - peg$c83 = function peg$c83(ss) { + peg$c82 = ":matches(", + peg$c83 = peg$literalExpectation(":matches(", false), + peg$c84 = function peg$c84(ss) { return { type: 'matches', selectors: ss }; }, - peg$c84 = ":has(", - peg$c85 = peg$literalExpectation(":has(", false), - peg$c86 = function peg$c86(ss) { + peg$c85 = ":has(", + peg$c86 = peg$literalExpectation(":has(", false), + peg$c87 = function peg$c87(ss) { return { type: 'has', selectors: ss }; }, - peg$c87 = ":first-child", - peg$c88 = peg$literalExpectation(":first-child", false), - peg$c89 = function peg$c89() { + peg$c88 = ":first-child", + peg$c89 = peg$literalExpectation(":first-child", false), + peg$c90 = function peg$c90() { return nth(1); }, - peg$c90 = ":last-child", - peg$c91 = peg$literalExpectation(":last-child", false), - peg$c92 = function peg$c92() { + peg$c91 = ":last-child", + peg$c92 = peg$literalExpectation(":last-child", false), + peg$c93 = function peg$c93() { return nthLast(1); }, - peg$c93 = ":nth-child(", - peg$c94 = peg$literalExpectation(":nth-child(", false), - peg$c95 = function peg$c95(n) { + peg$c94 = ":nth-child(", + peg$c95 = peg$literalExpectation(":nth-child(", false), + peg$c96 = function peg$c96(n) { return nth(parseInt(n.join(''), 10)); }, - peg$c96 = ":nth-last-child(", - peg$c97 = peg$literalExpectation(":nth-last-child(", false), - peg$c98 = function peg$c98(n) { + peg$c97 = ":nth-last-child(", + peg$c98 = peg$literalExpectation(":nth-last-child(", false), + peg$c99 = function peg$c99(n) { return nthLast(parseInt(n.join(''), 10)); }, - peg$c99 = ":", - peg$c100 = peg$literalExpectation(":", false), - peg$c101 = "statement", - peg$c102 = peg$literalExpectation("statement", true), - peg$c103 = "expression", - peg$c104 = peg$literalExpectation("expression", true), - peg$c105 = "declaration", - peg$c106 = peg$literalExpectation("declaration", true), - peg$c107 = "function", - peg$c108 = peg$literalExpectation("function", true), - peg$c109 = "pattern", - peg$c110 = peg$literalExpectation("pattern", true), - peg$c111 = function peg$c111(c) { + peg$c100 = ":", + peg$c101 = peg$literalExpectation(":", false), + peg$c102 = "statement", + peg$c103 = peg$literalExpectation("statement", true), + peg$c104 = "expression", + peg$c105 = peg$literalExpectation("expression", true), + peg$c106 = "declaration", + peg$c107 = peg$literalExpectation("declaration", true), + peg$c108 = "function", + peg$c109 = peg$literalExpectation("function", true), + peg$c110 = "pattern", + peg$c111 = peg$literalExpectation("pattern", true), + peg$c112 = function peg$c112(c) { return { type: 'class', name: c @@ -2295,7 +2357,7 @@ var parser = createCommonjsModule(function (module) { } function peg$parseattrName() { - var s0, s1, s2; + var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 30 + 13, cached = peg$resultsCache[key]; @@ -2305,49 +2367,81 @@ var parser = createCommonjsModule(function (module) { } s0 = peg$currPos; - s1 = []; - s2 = peg$parseidentifierName(); + s1 = peg$parseidentifierName(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; - if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; + s4 = peg$c42; peg$currPos++; } else { - s2 = peg$FAILED; + s4 = peg$FAILED; { peg$fail(peg$c43); } } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parseidentifierName(); + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; - peg$currPos++; - } else { - s2 = peg$FAILED; + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } - { - peg$fail(peg$c43); - } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c42; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c43); } } + + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s1 = peg$c6(s1); + if (s2 !== peg$FAILED) { + s1 = peg$c44(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 @@ -2385,7 +2479,7 @@ var parser = createCommonjsModule(function (module) { } if (s5 !== peg$FAILED) { - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -2433,7 +2527,7 @@ var parser = createCommonjsModule(function (module) { } if (s5 !== peg$FAILED) { - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -2461,7 +2555,7 @@ var parser = createCommonjsModule(function (module) { s1 = peg$parseattrName(); if (s1 !== peg$FAILED) { - s1 = peg$c45(s1); + s1 = peg$c46(s1); } s0 = s1; @@ -2488,27 +2582,27 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c46; + s1 = peg$c47; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c47); + peg$fail(peg$c48); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c49); + peg$fail(peg$c50); } } @@ -2516,13 +2610,13 @@ var parser = createCommonjsModule(function (module) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2534,12 +2628,12 @@ var parser = createCommonjsModule(function (module) { s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2554,14 +2648,14 @@ var parser = createCommonjsModule(function (module) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c49); + peg$fail(peg$c50); } } @@ -2569,13 +2663,13 @@ var parser = createCommonjsModule(function (module) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2587,12 +2681,12 @@ var parser = createCommonjsModule(function (module) { s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2607,18 +2701,18 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c46; + s3 = peg$c47; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c47); + peg$fail(peg$c48); } } if (s3 !== peg$FAILED) { - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -2637,27 +2731,27 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s1 = peg$c55; + s1 = peg$c56; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c56); + peg$fail(peg$c57); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c58); + peg$fail(peg$c59); } } @@ -2665,13 +2759,13 @@ var parser = createCommonjsModule(function (module) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2683,12 +2777,12 @@ var parser = createCommonjsModule(function (module) { s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2703,14 +2797,14 @@ var parser = createCommonjsModule(function (module) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c58); + peg$fail(peg$c59); } } @@ -2718,13 +2812,13 @@ var parser = createCommonjsModule(function (module) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2736,12 +2830,12 @@ var parser = createCommonjsModule(function (module) { s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2756,18 +2850,18 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s3 = peg$c55; + s3 = peg$c56; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c56); + peg$fail(peg$c57); } } if (s3 !== peg$FAILED) { - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -2804,28 +2898,28 @@ var parser = createCommonjsModule(function (module) { s1 = peg$currPos; s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -2861,14 +2955,14 @@ var parser = createCommonjsModule(function (module) { if (s1 !== peg$FAILED) { s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -2876,14 +2970,14 @@ var parser = createCommonjsModule(function (module) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -2892,7 +2986,7 @@ var parser = createCommonjsModule(function (module) { } if (s2 !== peg$FAILED) { - s1 = peg$c61(s1, s2); + s1 = peg$c62(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -2924,7 +3018,7 @@ var parser = createCommonjsModule(function (module) { s1 = peg$parseidentifierName(); if (s1 !== peg$FAILED) { - s1 = peg$c62(s1); + s1 = peg$c63(s1); } s0 = s1; @@ -2947,14 +3041,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c63) { - s1 = peg$c63; + if (input.substr(peg$currPos, 5) === peg$c64) { + s1 = peg$c64; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c64); + peg$fail(peg$c65); } } @@ -2964,14 +3058,14 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { s3 = []; - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c66); + peg$fail(peg$c67); } } @@ -2979,14 +3073,14 @@ var parser = createCommonjsModule(function (module) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c66); + peg$fail(peg$c67); } } } @@ -2999,18 +3093,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c69(s3); + s1 = peg$c70(s3); s0 = s1; } else { peg$currPos = s0; @@ -3052,14 +3146,14 @@ var parser = createCommonjsModule(function (module) { s0 = []; - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c71); + peg$fail(peg$c72); } } @@ -3067,14 +3161,14 @@ var parser = createCommonjsModule(function (module) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c71); + peg$fail(peg$c72); } } } @@ -3102,27 +3196,27 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c72; + s1 = peg$c73; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c73); + peg$fail(peg$c74); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c75); + peg$fail(peg$c76); } } @@ -3130,14 +3224,14 @@ var parser = createCommonjsModule(function (module) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c75); + peg$fail(peg$c76); } } } @@ -3147,13 +3241,13 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s3 = peg$c72; + s3 = peg$c73; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c73); + peg$fail(peg$c74); } } @@ -3165,7 +3259,7 @@ var parser = createCommonjsModule(function (module) { } if (s4 !== peg$FAILED) { - s1 = peg$c76(s2, s4); + s1 = peg$c77(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -3279,7 +3373,7 @@ var parser = createCommonjsModule(function (module) { } if (s3 !== peg$FAILED) { - s1 = peg$c77(s2, s3); + s1 = peg$c78(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -3313,14 +3407,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c78) { - s1 = peg$c78; + if (input.substr(peg$currPos, 5) === peg$c79) { + s1 = peg$c79; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c79); + peg$fail(peg$c80); } } @@ -3335,18 +3429,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c80(s3); + s1 = peg$c81(s3); s0 = s1; } else { peg$currPos = s0; @@ -3388,14 +3482,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 9) === peg$c81) { - s1 = peg$c81; + if (input.substr(peg$currPos, 9) === peg$c82) { + s1 = peg$c82; peg$currPos += 9; } else { s1 = peg$FAILED; { - peg$fail(peg$c82); + peg$fail(peg$c83); } } @@ -3410,18 +3504,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c83(s3); + s1 = peg$c84(s3); s0 = s1; } else { peg$currPos = s0; @@ -3463,14 +3557,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c84) { - s1 = peg$c84; + if (input.substr(peg$currPos, 5) === peg$c85) { + s1 = peg$c85; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c85); + peg$fail(peg$c86); } } @@ -3485,18 +3579,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c86(s3); + s1 = peg$c87(s3); s0 = s1; } else { peg$currPos = s0; @@ -3538,19 +3632,19 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 12) === peg$c87) { - s1 = peg$c87; + if (input.substr(peg$currPos, 12) === peg$c88) { + s1 = peg$c88; peg$currPos += 12; } else { s1 = peg$FAILED; { - peg$fail(peg$c88); + peg$fail(peg$c89); } } if (s1 !== peg$FAILED) { - s1 = peg$c89(); + s1 = peg$c90(); } s0 = s1; @@ -3573,19 +3667,19 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c90) { - s1 = peg$c90; + if (input.substr(peg$currPos, 11) === peg$c91) { + s1 = peg$c91; peg$currPos += 11; } else { s1 = peg$FAILED; { - peg$fail(peg$c91); + peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { - s1 = peg$c92(); + s1 = peg$c93(); } s0 = s1; @@ -3608,14 +3702,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c93) { - s1 = peg$c93; + if (input.substr(peg$currPos, 11) === peg$c94) { + s1 = peg$c94; peg$currPos += 11; } else { s1 = peg$FAILED; { - peg$fail(peg$c94); + peg$fail(peg$c95); } } @@ -3625,14 +3719,14 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -3640,14 +3734,14 @@ var parser = createCommonjsModule(function (module) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -3660,18 +3754,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c95(s3); + s1 = peg$c96(s3); s0 = s1; } else { peg$currPos = s0; @@ -3713,14 +3807,14 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; - if (input.substr(peg$currPos, 16) === peg$c96) { - s1 = peg$c96; + if (input.substr(peg$currPos, 16) === peg$c97) { + s1 = peg$c97; peg$currPos += 16; } else { s1 = peg$FAILED; { - peg$fail(peg$c97); + peg$fail(peg$c98); } } @@ -3730,14 +3824,14 @@ var parser = createCommonjsModule(function (module) { if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -3745,14 +3839,14 @@ var parser = createCommonjsModule(function (module) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -3765,18 +3859,18 @@ var parser = createCommonjsModule(function (module) { if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c98(s3); + s1 = peg$c99(s3); s0 = s1; } else { peg$currPos = s0; @@ -3819,73 +3913,73 @@ var parser = createCommonjsModule(function (module) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c99; + s1 = peg$c100; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c100); + peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c102) { s2 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s2 = peg$FAILED; { - peg$fail(peg$c102); + peg$fail(peg$c103); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c104) { s2 = input.substr(peg$currPos, 10); peg$currPos += 10; } else { s2 = peg$FAILED; { - peg$fail(peg$c104); + peg$fail(peg$c105); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c106) { s2 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s2 = peg$FAILED; { - peg$fail(peg$c106); + peg$fail(peg$c107); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c108) { s2 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s2 = peg$FAILED; { - peg$fail(peg$c108); + peg$fail(peg$c109); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c110) { s2 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s2 = peg$FAILED; { - peg$fail(peg$c110); + peg$fail(peg$c111); } } } @@ -3894,7 +3988,7 @@ var parser = createCommonjsModule(function (module) { } if (s2 !== peg$FAILED) { - s1 = peg$c111(s2); + s1 = peg$c112(s2); s0 = s1; } else { peg$currPos = s0; @@ -4020,12 +4114,23 @@ var RIGHT_SIDE = 'RIGHT_SIDE'; function getPath(obj, key) { var keys = key.split('.'); - for (var i = 0; i < keys.length; i++) { - if (obj == null) { - return obj; - } + var _iterator = _createForOfIteratorHelper(keys), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var _key = _step.value; + + if (obj == null) { + return obj; + } - obj = obj[keys[i]]; + obj = obj[_key]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } return obj; @@ -4053,10 +4158,21 @@ function inPath(node, ancestor, path) { var remainingPath = path.slice(1); if (Array.isArray(field)) { - for (var i = 0, l = field.length; i < l; ++i) { - if (inPath(node, field[i], remainingPath)) { - return true; + var _iterator2 = _createForOfIteratorHelper(field), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var component = _step2.value; + + if (inPath(node, component, remainingPath)) { + return true; + } } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } return false; @@ -4064,19 +4180,32 @@ function inPath(node, ancestor, path) { return inPath(node, field, remainingPath); } } +/** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + +/** + * @typedef {object} ESQueryOptions + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + */ + /** * Given a `node` and its ancestors, determine if `node` is matched * by `selector`. * @param {?external:AST} node * @param {?SelectorAST} selector * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] * @throws {Error} Unknowns (operator, class name, selector type, or * selector value type) * @returns {boolean} */ -function matches(node, selector, ancestry) { +function matches(node, selector, ancestry, options) { if (!selector) { return true; } @@ -4104,28 +4233,61 @@ function matches(node, selector, ancestry) { } case 'matches': - for (var i = 0, l = selector.selectors.length; i < l; ++i) { - if (matches(node, selector.selectors[i], ancestry)) { - return true; + var _iterator3 = _createForOfIteratorHelper(selector.selectors), + _step3; + + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var sel = _step3.value; + + if (matches(node, sel, ancestry, options)) { + return true; + } } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); } return false; case 'compound': - for (var _i = 0, _l = selector.selectors.length; _i < _l; ++_i) { - if (!matches(node, selector.selectors[_i], ancestry)) { - return false; + var _iterator4 = _createForOfIteratorHelper(selector.selectors), + _step4; + + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var _sel = _step4.value; + + if (!matches(node, _sel, ancestry, options)) { + return false; + } } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); } return true; case 'not': - for (var _i2 = 0, _l2 = selector.selectors.length; _i2 < _l2; ++_i2) { - if (matches(node, selector.selectors[_i2], ancestry)) { - return false; + var _iterator5 = _createForOfIteratorHelper(selector.selectors), + _step5; + + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var _sel2 = _step5.value; + + if (matches(node, _sel2, ancestry, options)) { + return false; + } } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); } return true; @@ -4135,27 +4297,38 @@ function matches(node, selector, ancestry) { var _ret = function () { var collector = []; - var _loop = function _loop(_i3, _l3) { - var a = []; - estraverse.traverse(node, { - enter: function enter(node, parent) { - if (parent != null) { - a.unshift(parent); - } - - if (matches(node, selector.selectors[_i3], a)) { - collector.push(node); - } - }, - leave: function leave() { - a.shift(); - }, - fallback: 'iteration' - }); - }; + var _iterator6 = _createForOfIteratorHelper(selector.selectors), + _step6; + + try { + var _loop = function _loop() { + var sel = _step6.value; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } - for (var _i3 = 0, _l3 = selector.selectors.length; _i3 < _l3; ++_i3) { - _loop(_i3); + if (matches(node, sel, a, options)) { + collector.push(node); + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + }; + + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + _loop(); + } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); } return { @@ -4167,16 +4340,16 @@ function matches(node, selector, ancestry) { } case 'child': - if (matches(node, selector.right, ancestry)) { - return matches(ancestry[0], selector.left, ancestry.slice(1)); + if (matches(node, selector.right, ancestry, options)) { + return matches(ancestry[0], selector.left, ancestry.slice(1), options); } return false; case 'descendant': - if (matches(node, selector.right, ancestry)) { - for (var _i4 = 0, _l4 = ancestry.length; _i4 < _l4; ++_i4) { - if (matches(ancestry[_i4], selector.left, ancestry.slice(_i4 + 1))) { + if (matches(node, selector.right, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (matches(ancestry[i], selector.left, ancestry.slice(i + 1), options)) { return true; } } @@ -4237,20 +4410,20 @@ function matches(node, selector, ancestry) { } case 'sibling': - return matches(node, selector.right, ancestry) && sibling(node, selector.left, ancestry, LEFT_SIDE) || selector.left.subject && matches(node, selector.left, ancestry) && sibling(node, selector.right, ancestry, RIGHT_SIDE); + return matches(node, selector.right, ancestry, options) && sibling(node, selector.left, ancestry, LEFT_SIDE, options) || selector.left.subject && matches(node, selector.left, ancestry, options) && sibling(node, selector.right, ancestry, RIGHT_SIDE, options); case 'adjacent': - return matches(node, selector.right, ancestry) && adjacent(node, selector.left, ancestry, LEFT_SIDE) || selector.right.subject && matches(node, selector.left, ancestry) && adjacent(node, selector.right, ancestry, RIGHT_SIDE); + return matches(node, selector.right, ancestry, options) && adjacent(node, selector.left, ancestry, LEFT_SIDE, options) || selector.right.subject && matches(node, selector.left, ancestry, options) && adjacent(node, selector.right, ancestry, RIGHT_SIDE, options); case 'nth-child': - return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function () { + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function () { return selector.index.value - 1; - }); + }, options); case 'nth-last-child': - return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function (length) { + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function (length) { return length - selector.index.value; - }); + }, options); case 'class': switch (selector.name.toLowerCase()) { @@ -4277,6 +4450,44 @@ function matches(node, selector, ancestry) { throw new Error("Unknown selector type: ".concat(selector.type)); } +/** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ + + +function getVisitorKeys(node, options) { + var nodeType = node.type; + + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } // 'iteration' fallback + + + return Object.keys(node).filter(function (key) { + return key !== 'type'; + }); +} +/** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ + + +function isNode(node) { + return node !== null && _typeof(node) === 'object' && typeof node.type === 'string'; +} /** * Determines if the given node has a sibling that matches the * given selector. @@ -4284,11 +4495,12 @@ function matches(node, selector, ancestry) { * @param {SelectorSequenceAST} selector * @param {external:AST[]} ancestry * @param {Side} side + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ -function sibling(node, selector, ancestry, side) { +function sibling(node, selector, ancestry, side, options) { var _ancestry = _slicedToArray(ancestry, 1), parent = _ancestry[0]; @@ -4296,35 +4508,45 @@ function sibling(node, selector, ancestry, side) { return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator7 = _createForOfIteratorHelper(keys), + _step7; - if (Array.isArray(listProp)) { - var startIndex = listProp.indexOf(node); + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var key = _step7.value; + var listProp = parent[key]; - if (startIndex < 0) { - continue; - } + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); - var lowerBound = void 0, - upperBound = void 0; + if (startIndex < 0) { + continue; + } - if (side === LEFT_SIDE) { - lowerBound = 0; - upperBound = startIndex; - } else { - lowerBound = startIndex + 1; - upperBound = listProp.length; - } + var lowerBound = void 0, + upperBound = void 0; - for (var k = lowerBound; k < upperBound; ++k) { - if (matches(listProp[k], selector, ancestry)) { - return true; + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k]) && matches(listProp[k], selector, ancestry, options)) { + return true; + } } } } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); } return false; @@ -4336,11 +4558,12 @@ function sibling(node, selector, ancestry, side) { * @param {SelectorSequenceAST} selector * @param {external:AST[]} ancestry * @param {Side} side + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ -function adjacent(node, selector, ancestry, side) { +function adjacent(node, selector, ancestry, side, options) { var _ancestry2 = _slicedToArray(ancestry, 1), parent = _ancestry2[0]; @@ -4348,26 +4571,36 @@ function adjacent(node, selector, ancestry, side) { return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator8 = _createForOfIteratorHelper(keys), + _step8; - if (Array.isArray(listProp)) { - var idx = listProp.indexOf(node); + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var key = _step8.value; + var listProp = parent[key]; - if (idx < 0) { - continue; - } + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); - if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) { - return true; - } + if (idx < 0) { + continue; + } - if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) { - return true; + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1]) && matches(listProp[idx - 1], selector, ancestry, options)) { + return true; + } + + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1]) && matches(listProp[idx + 1], selector, ancestry, options)) { + return true; + } } } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); } return false; @@ -4384,11 +4617,12 @@ function adjacent(node, selector, ancestry, side) { * @param {external:AST} node * @param {external:AST[]} ancestry * @param {IndexFunction} idxFn + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ -function nthChild(node, ancestry, idxFn) { +function nthChild(node, ancestry, idxFn, options) { var _ancestry3 = _slicedToArray(ancestry, 1), parent = _ancestry3[0]; @@ -4396,18 +4630,28 @@ function nthChild(node, ancestry, idxFn) { return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator9 = _createForOfIteratorHelper(keys), + _step9; - if (Array.isArray(listProp)) { - var idx = listProp.indexOf(node); + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var key = _step9.value; + var listProp = parent[key]; - if (idx >= 0 && idx === idxFn(listProp.length)) { - return true; + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + + if (idx >= 0 && idx === idxFn(listProp.length)) { + return true; + } } } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); } return false; @@ -4432,8 +4676,8 @@ function subjects(selector, ancestor) { var results = selector.subject ? [ancestor] : []; - for (var _i5 = 0, _Object$entries = _objectEntries(selector); _i5 < _Object$entries.length; _i5++) { - var _Object$entries$_i = _slicedToArray(_Object$entries[_i5], 2), + for (var _i = 0, _Object$entries = _objectEntries(selector); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), p = _Object$entries$_i[0], sel = _Object$entries$_i[1]; @@ -4455,11 +4699,12 @@ function subjects(selector, ancestor) { * @param {external:AST} ast * @param {?SelectorAST} selector * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ -function traverse(ast, selector, visitor) { +function traverse(ast, selector, visitor, options) { if (!selector) { return; } @@ -4472,17 +4717,17 @@ function traverse(ast, selector, visitor) { ancestry.unshift(parent); } - if (matches(node, selector, ancestry)) { + if (matches(node, selector, ancestry, options)) { if (altSubjects.length) { for (var i = 0, l = altSubjects.length; i < l; ++i) { - if (matches(node, altSubjects[i], ancestry)) { + if (matches(node, altSubjects[i], ancestry, options)) { visitor(node, parent, ancestry); } for (var k = 0, m = ancestry.length; k < m; ++k) { var succeedingAncestry = ancestry.slice(k + 1); - if (matches(ancestry[k], altSubjects[i], succeedingAncestry)) { + if (matches(ancestry[k], altSubjects[i], succeedingAncestry, options)) { visitor(ancestry[k], parent, succeedingAncestry); } } @@ -4495,7 +4740,8 @@ function traverse(ast, selector, visitor) { leave: function leave() { ancestry.shift(); }, - fallback: 'iteration' + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' }); } /** @@ -4503,15 +4749,16 @@ function traverse(ast, selector, visitor) { * match the selector. * @param {external:AST} ast * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ -function match(ast, selector) { +function match(ast, selector, options) { var results = []; traverse(ast, selector, function (node) { results.push(node); - }); + }, options); return results; } /** @@ -4528,12 +4775,13 @@ function parse(selector) { * Query the code AST using the selector string. * @param {external:AST} ast * @param {string} selector + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ -function query(ast, selector) { - return match(ast, parse(selector)); +function query(ast, selector, options) { + return match(ast, parse(selector), options); } query.parse = parse; diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js index 474e093dcc8c93..cd5ac34bd428d3 100644 --- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js +++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js @@ -1,2 +1,2 @@ -function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--r)if(e[r].node===t)return!0;return!1}function y(e,t){return(new p).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:s={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(g=i[p=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]&&!d(n,g[m])){if(h(l,x[y]))o=new c(g[m],[p,m],"Property",null);else{if(!f(g[m]))continue;o=new c(g[m],[p,m],null,null)}r.push(o)}}else if(f(g)){if(d(n,g))continue;r.push(new c(g,p,null,null))}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},p.prototype.replace=function(e,t){var r,n,o,l,p,d,y,m,x,g,v,A,b;function E(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key=0;)if(g=o[b=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,x[y]))d=new c(g[m],[b,m],"Property",new u(g,m));else{if(!f(g[m]))continue;d=new c(g[m],[b,m],null,new u(g,m))}r.push(d)}}else f(g)&&r.push(new c(g,b,null,new u(o,b)))}}else if(d=n.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==a&&p!==s&&p!==i&&d.ref.replace(p),this.__state!==i&&p!==i||E(d),this.__state===a||p===a)return A.root;return A.root},t.Syntax=r,t.traverse=y,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,r){var o,a,s,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(s=0,a=t.length;se.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,y(e,{leave:function(e){for(var t;ie.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)})),i=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,f=xe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),y=me("~",!1),m=me("+",!1),x=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),b=me("[",!1),E=me("]",!1),S=/^[>","<","!"],!1,!1),w=me("=",!1),C=function(e){return(e||"")+"="},P=/^[><]/,k=xe([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=me('"',!1),F=/^[^\\"]/,T=xe(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=xe(["\\","'"],!0,!1),q=/^[0-9]/,N=xe([["0","9"]],!1,!1),W=me("type(",!1),G=/^[^ )]/,z=xe([" ",")"],!0,!1),K=me(")",!1),H=/^[imsu]/,Y=xe(["i","m","s","u"],!1,!1),$=me("/",!1),J=/^[^\/]/,Q=xe(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),oe=me(":nth-last-child(",!1),ae=me(":",!1),se=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),pe=0,fe=[{line:1,column:1}],he=0,de=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function xe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};rhe&&(he=pe,de=[]),de.push(e))}function be(){var e,t,r,n,o=30*pe+0,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,(t=Ee())!==i&&(r=we())!==i&&Ee()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(pe=e,e=i),e===i&&(e=pe,(t=Ee())!==i&&(t=void 0),e=t),ye[o]={nextPos:pe,result:e},e)}function Ee(){var e,r,n=30*pe+1,o=ye[n];if(o)return pe=o.nextPos,o.result;for(e=[],32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));return ye[n]={nextPos:pe,result:e},e}function Se(){var e,r,n,o=30*pe+2,a=ye[o];if(a)return pe=a.nextPos,a.result;if(r=[],p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f)),n!==i)for(;n!==i;)r.push(n),p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:pe,result:e},e}function _e(){var e,r,n,o=30*pe+3,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,(r=Ee())!==i?(62===t.charCodeAt(pe)?(n=">",pe++):(n=i,Ae(d)),n!==i&&Ee()!==i?e=r="child":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Ee())!==i?(126===t.charCodeAt(pe)?(n="~",pe++):(n=i,Ae(y)),n!==i&&Ee()!==i?e=r="sibling":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Ee())!==i?(43===t.charCodeAt(pe)?(n="+",pe++):(n=i,Ae(m)),n!==i&&Ee()!==i?e=r="adjacent":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c)),r!==i&&(n=Ee())!==i?e=r="descendant":(pe=e,e=i)))),ye[o]={nextPos:pe,result:e},e)}function we(){var e,r,n,o,a,s,l,u,c=30*pe+4,p=ye[c];if(p)return pe=p.nextPos,p.result;if(e=pe,(r=Ce())!==i){for(n=[],o=pe,(a=Ee())!==i?(44===t.charCodeAt(pe)?(s=",",pe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,(a=Ee())!==i?(44===t.charCodeAt(pe)?(s=",",pe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(pe=e,e=i)}else pe=e,e=i;return ye[c]={nextPos:pe,result:e},e}function Ce(){var e,t,r,n,o,a,s,l=30*pe+5,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,(t=Pe())!==i){for(r=[],n=pe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(pe=n,n=i);n!==i;)r.push(n),n=pe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(pe=n,n=i);r!==i?(s=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),s)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}function Pe(){var e,r,n,o,a,s,l,u=30*pe+6,c=ye[u];if(c)return pe=c.nextPos,c.result;if(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(o=ke())!==i)for(;o!==i;)n.push(o),o=ke();else n=i;n!==i?(a=r,l=1===(s=n).length?s[0]:{type:"compound",selectors:s},a&&(l.subject=!0),e=r=l):(pe=e,e=i)}else pe=e,e=i;return ye[u]={nextPos:pe,result:e},e}function ke(){var e,r=30*pe+7,n=ye[r];return n?(pe=n.nextPos,n.result):((e=function(){var e,r,n=30*pe+8,o=ye[n];return o?(pe=o.nextPos,o.result):(42===t.charCodeAt(pe)?(r="*",pe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o=30*pe+9,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,35===t.charCodeAt(pe)?(r="#",pe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=Se())!==i?e=r={type:"identifier",value:n}:(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+10,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,91===t.charCodeAt(pe)?(r="[",pe++):(r=i,Ae(b)),r!==i&&Ee()!==i&&(n=function(){var e,r,n,o,a=30*pe+14,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*pe+12,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(pe=e,e=i)):(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s=30*pe+18,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,"type("===t.substr(pe,5)?(r="type(",pe+=5):(r=i,Ae(W)),r!==i)if(Ee()!==i){if(n=[],G.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(z)),o!==i)for(;o!==i;)n.push(o),G.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(z));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r={type:"type",value:n.join("")},e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l=30*pe+20,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,47===t.charCodeAt(pe)?(r="/",pe++):(r=i,Ae($)),r!==i){if(n=[],J.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(Q)),o!==i)for(;o!==i;)n.push(o),J.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(pe)?(o="/",pe++):(o=i,Ae($)),o!==i?((a=function(){var e,r,n=30*pe+19,o=ye[n];if(o)return pe=o.nextPos,o.result;if(e=[],H.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(Y)),r!==i)for(;r!==i;)e.push(r),H.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(Y));else e=i;return ye[n]={nextPos:pe,result:e},e}())===i&&(a=null),a!==i?(s=a,r={type:"regexp",value:new RegExp(n.join(""),s?s.join(""):"")},e=r):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}()),o!==i?(r=I(r,n,o),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*pe+11,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,S.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(_)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(P.test(t.charAt(pe))?(e=t.charAt(pe),pe++):(e=i,Ae(k))),ye[o]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s,l=30*pe+15,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,34===t.charCodeAt(pe)?(r='"',pe++):(r=i,Ae(j)),r!==i){for(n=[],F.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(T)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));o!==i;)n.push(o),F.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(T)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));n!==i?(34===t.charCodeAt(pe)?(o='"',pe++):(o=i,Ae(j)),o!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;if(e===i)if(e=pe,39===t.charCodeAt(pe)?(r="'",pe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(V)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));o!==i;)n.push(o),U.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(V)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));n!==i?(39===t.charCodeAt(pe)?(o="'",pe++):(o=i,Ae(M)),o!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l,u=30*pe+16,c=ye[u];if(c)return pe=c.nextPos,c.result;for(e=pe,r=pe,n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));if(n!==i?(46===t.charCodeAt(pe)?(o=".",pe++):(o=i,Ae(D)),o!==i?r=n=[n,o]:(pe=r,r=i)):(pe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i?(s=n,l=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(l+s.join(""))},e=r):(pe=e,e=i)}else pe=e,e=i;return ye[u]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,t,r=30*pe+17,n=ye[r];return n?(pe=n.nextPos,n.result):((t=Se())!==i&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:pe,result:e},e)}()),o!==i?(r=I(r,n,o),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?(93===t.charCodeAt(pe)?(o="]",pe++):(o=i,Ae(E)),o!==i?e=r=n:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s,l,u,c=30*pe+21,p=ye[c];if(p)return pe=p.nextPos,p.result;if(e=pe,46===t.charCodeAt(pe)?(r=".",pe++):(r=i,Ae(D)),r!==i)if((n=Se())!==i){for(o=[],a=pe,46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(pe=a,a=i);a!==i;)o.push(a),a=pe,46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(pe=a,a=i);o!==i?(u=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[c]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o,a=30*pe+22,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":not("===t.substr(pe,5)?(r=":not(",pe+=5):(r=i,Ae(X)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"not",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+23,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":matches("===t.substr(pe,9)?(r=":matches(",pe+=9):(r=i,Ae(Z)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"matches",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+24,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":has("===t.substr(pe,5)?(r=":has(",pe+=5):(r=i,Ae(ee)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"has",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+25,o=ye[n];return o?(pe=o.nextPos,o.result):(":first-child"===t.substr(pe,12)?(r=":first-child",pe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+26,o=ye[n];return o?(pe=o.nextPos,o.result):(":last-child"===t.substr(pe,11)?(r=":last-child",pe+=11):(r=i,Ae(re)),r!==i&&(r=je(1)),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s=30*pe+27,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-child("===t.substr(pe,11)?(r=":nth-child(",pe+=11):(r=i,Ae(ne)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o,a,s=30*pe+28,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-last-child("===t.substr(pe,16)?(r=":nth-last-child(",pe+=16):(r=i,Ae(oe)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r=je(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o=30*pe+29,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,58===t.charCodeAt(pe)?(r=":",pe++):(r=i,Ae(ae)),r!==i?("statement"===t.substr(pe,9).toLowerCase()?(n=t.substr(pe,9),pe+=9):(n=i,Ae(se)),n===i&&("expression"===t.substr(pe,10).toLowerCase()?(n=t.substr(pe,10),pe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(pe,11).toLowerCase()?(n=t.substr(pe,11),pe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(pe,8).toLowerCase()?(n=t.substr(pe,8),pe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(pe,7).toLowerCase()?(n=t.substr(pe,7),pe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(pe=e,e=i)):(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}()),ye[r]={nextPos:pe,result:e},e)}function De(){var e,r,n,o=30*pe+13,a=ye[o];if(a)return pe=a.nextPos,a.result;if(r=[],(n=Se())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=Se())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:pe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&pe===t.length)return n;throw n!==i&&pe":return A>r.value.value;case">=":return A>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return l(t,r.right,n)&&u(t,r.left,n,"LEFT_SIDE")||r.left.subject&&l(t,r.left,n)&&u(t,r.right,n,"RIGHT_SIDE");case"adjacent":return l(t,r.right,n)&&c(t,r.left,n,"LEFT_SIDE")||r.right.subject&&l(t,r.left,n)&&c(t,r.right,n,"RIGHT_SIDE");case"nth-child":return l(t,r.right,n)&&p(t,n,(function(){return r.index.value-1}));case"nth-last-child":return l(t,r.right,n)&&p(t,n,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function u(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u0&&l(p[f-1],r,n))return!0;if("RIGHT_SIDE"===o&&f=0&&c===n(u.length))return!0}}return!1}function f(n,o){if(null==n||"object"!=e(n))return[];null==o&&(o=n);for(var a=n.subject?[o]:[],s=0,i=function(e){for(var t=[],r=Object.keys(e),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function i(e,t){return e(t={exports:{}},t.exports),t.exports}var s=i((function(e,t){!function e(t){var r,n,a,o,i,s;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,a,o;for(n=e.length,a=0;n;)t(e[o=a+(r=n>>>1)])?n=r:(a=o+1,n-=r+1);return a}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},a={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:o={},Skip:i={},Remove:s={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,a;function o(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(l,x[d]))a=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;a=new c(v[m],[f,m],null,null)}r.push(a)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}else if(a=n.pop(),u=this.__execute(t.leave,a),this.__state===o||u===o)return},f.prototype.replace=function(e,t){var r,n,a,l,f,y,d,m,x,v,g,b,A;function E(e){var t,n,a,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if((a=r[t]).ref&&a.ref.parent===o){if(a.ref.key=0;)if(v=a[A=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(l,x[d]))y=new c(v[m],[A,m],"Property",new u(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[A,m],null,new u(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,A,null,new u(a,A)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==o&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||E(y),this.__state===o||f===o)return b.root;return b.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var a,o,i,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,o=t.length;ie.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?n.Break:u[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;se.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=a,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),l=i((function(e){e.exports&&(e.exports=function(){function e(t,r,n,a){this.message=t,this.expected=r,this.found=n,this.location=a,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,p=me([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=de(">",!1),y=de("~",!1),d=de("+",!1),m=de(",",!1),x=de("!",!1),v=de("*",!1),g=de("#",!1),b=de("[",!1),A=de("]",!1),E=/^[>","<","!"],!1,!1),_=de("=",!1),w=function(e){return(e||"")+"="},C=/^[><]/,P=me([">","<"],!1,!1),k=de(".",!1),D=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=de('"',!1),I=/^[^\\"]/,T=me(["\\",'"'],!0,!1),F=de("\\",!1),L={type:"any"},O=function(e,t){return e+t},R=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=de("'",!1),M=/^[^\\']/,U=me(["\\","'"],!0,!1),V=/^[0-9]/,q=me([["0","9"]],!1,!1),N=de("type(",!1),W=/^[^ )]/,K=me([" ",")"],!0,!1),G=de(")",!1),z=/^[imsu]/,H=me(["i","m","s","u"],!1,!1),Y=de("/",!1),$=/^[^\/]/,J=me(["/"],!0,!1),Q=de(":not(",!1),X=de(":matches(",!1),Z=de(":has(",!1),ee=de(":first-child",!1),te=de(":last-child",!1),re=de(":nth-child(",!1),ne=de(":nth-last-child(",!1),ae=de(":",!1),oe=de("statement",!0),ie=de("expression",!0),se=de("declaration",!0),le=de("function",!0),ue=de("pattern",!0),ce=0,fe=[{line:1,column:1}],pe=0,he=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function de(e,t){return{type:"literal",text:e,ignoreCase:t}}function me(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function xe(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};rpe&&(pe=ce,he=[]),he.push(e))}function be(){var e,t,r,n,a=30*ce+0,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,(t=Ae())!==s&&(r=_e())!==s&&Ae()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ce=e,e=s),e===s&&(e=ce,(t=Ae())!==s&&(t=void 0),e=t),ye[a]={nextPos:ce,result:e},e)}function Ae(){var e,r,n=30*ce+1,a=ye[n];if(a)return ce=a.nextPos,a.result;for(e=[],32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));r!==s;)e.push(r),32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));return ye[n]={nextPos:ce,result:e},e}function Ee(){var e,r,n,a=30*ce+2,o=ye[a];if(o)return ce=o.nextPos,o.result;if(r=[],f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p));else r=s;return r!==s&&(r=r.join("")),e=r,ye[a]={nextPos:ce,result:e},e}function Se(){var e,r,n,a=30*ce+3,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,(r=Ae())!==s?(62===t.charCodeAt(ce)?(n=">",ce++):(n=s,ge(h)),n!==s&&Ae()!==s?e=r="child":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ae())!==s?(126===t.charCodeAt(ce)?(n="~",ce++):(n=s,ge(y)),n!==s&&Ae()!==s?e=r="sibling":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ae())!==s?(43===t.charCodeAt(ce)?(n="+",ce++):(n=s,ge(d)),n!==s&&Ae()!==s?e=r="adjacent":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c)),r!==s&&(n=Ae())!==s?e=r="descendant":(ce=e,e=s)))),ye[a]={nextPos:ce,result:e},e)}function _e(){var e,r,n,a,o,i,l,u,c=30*ce+4,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=we())!==s){for(n=[],a=ce,(o=Ae())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(l=Ae())!==s&&(u=we())!==s?a=o=[o,i,l,u]:(ce=a,a=s)):(ce=a,a=s);a!==s;)n.push(a),a=ce,(o=Ae())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(l=Ae())!==s&&(u=we())!==s?a=o=[o,i,l,u]:(ce=a,a=s)):(ce=a,a=s);n!==s?e=r=[r].concat(n.map((function(e){return e[3]}))):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function we(){var e,t,r,n,a,o,i,l=30*ce+5,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,(t=Ce())!==s){for(r=[],n=ce,(a=Se())!==s&&(o=Ce())!==s?n=a=[a,o]:(ce=n,n=s);n!==s;)r.push(n),n=ce,(a=Se())!==s&&(o=Ce())!==s?n=a=[a,o]:(ce=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}function Ce(){var e,r,n,a,o,i,l,u=30*ce+6,c=ye[u];if(c)return ce=c.nextPos,c.result;if(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(x)),r===s&&(r=null),r!==s){if(n=[],(a=Pe())!==s)for(;a!==s;)n.push(a),a=Pe();else n=s;n!==s?(o=r,l=1===(i=n).length?i[0]:{type:"compound",selectors:i},o&&(l.subject=!0),e=r=l):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}function Pe(){var e,r=30*ce+7,n=ye[r];return n?(ce=n.nextPos,n.result):((e=function(){var e,r,n=30*ce+8,a=ye[n];return a?(ce=a.nextPos,a.result):(42===t.charCodeAt(ce)?(r="*",ce++):(r=s,ge(v)),r!==s&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a=30*ce+9,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,35===t.charCodeAt(ce)?(r="#",ce++):(r=s,ge(g)),r===s&&(r=null),r!==s&&(n=Ee())!==s?e=r={type:"identifier",value:n}:(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*ce+10,i=ye[o];return i?(ce=i.nextPos,i.result):(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(b)),r!==s&&Ae()!==s&&(n=function(){var e,r,n,a,o=30*ce+14,i=ye[o];return i?(ce=i.nextPos,i.result):(e=ce,(r=ke())!==s&&Ae()!==s&&(n=function(){var e,r,n,a=30*ce+12,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(x)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(_)),n!==s?(r=w(r),e=r):(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?((a=function(){var e,r,n,a,o,i=30*ce+18,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,"type("===t.substr(ce,5)?(r="type(",ce+=5):(r=s,ge(N)),r!==s)if(Ae()!==s){if(n=[],W.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(K)),a!==s)for(;a!==s;)n.push(a),W.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(K));else n=s;n!==s&&(a=Ae())!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?(r={type:"type",value:n.join("")},e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(a=function(){var e,r,n,a,o,i,l=30*ce+20,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,47===t.charCodeAt(ce)?(r="/",ce++):(r=s,ge(Y)),r!==s){if(n=[],$.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(J)),a!==s)for(;a!==s;)n.push(a),$.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(J));else n=s;n!==s?(47===t.charCodeAt(ce)?(a="/",ce++):(a=s,ge(Y)),a!==s?((o=function(){var e,r,n=30*ce+19,a=ye[n];if(a)return ce=a.nextPos,a.result;if(e=[],z.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(H)),r!==s)for(;r!==s;)e.push(r),z.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(H));else e=s;return ye[n]={nextPos:ce,result:e},e}())===s&&(o=null),o!==s?(i=o,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ce=e,e=s)):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}()),a!==s?(r=D(r,n,a),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=ke())!==s&&Ae()!==s&&(n=function(){var e,r,n,a=30*ce+11,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,E.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(S)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(_)),n!==s?(r=w(r),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(C.test(t.charAt(ce))?(e=t.charAt(ce),ce++):(e=s,ge(P))),ye[a]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?((a=function(){var e,r,n,a,o,i,l=30*ce+15,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,34===t.charCodeAt(ce)?(r='"',ce++):(r=s,ge(j)),r!==s){for(n=[],I.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(T)),a===s&&(a=ce,92===t.charCodeAt(ce)?(o="\\",ce++):(o=s,ge(F)),o!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(o=O(o,i),a=o):(ce=a,a=s)):(ce=a,a=s));a!==s;)n.push(a),I.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(T)),a===s&&(a=ce,92===t.charCodeAt(ce)?(o="\\",ce++):(o=s,ge(F)),o!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(o=O(o,i),a=o):(ce=a,a=s)):(ce=a,a=s));n!==s?(34===t.charCodeAt(ce)?(a='"',ce++):(a=s,ge(j)),a!==s?(r=R(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;if(e===s)if(e=ce,39===t.charCodeAt(ce)?(r="'",ce++):(r=s,ge(B)),r!==s){for(n=[],M.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(U)),a===s&&(a=ce,92===t.charCodeAt(ce)?(o="\\",ce++):(o=s,ge(F)),o!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(o=O(o,i),a=o):(ce=a,a=s)):(ce=a,a=s));a!==s;)n.push(a),M.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(U)),a===s&&(a=ce,92===t.charCodeAt(ce)?(o="\\",ce++):(o=s,ge(F)),o!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(o=O(o,i),a=o):(ce=a,a=s)):(ce=a,a=s));n!==s?(39===t.charCodeAt(ce)?(a="'",ce++):(a=s,ge(B)),a!==s?(r=R(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}())===s&&(a=function(){var e,r,n,a,o,i,l,u=30*ce+16,c=ye[u];if(c)return ce=c.nextPos,c.result;for(e=ce,r=ce,n=[],V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q));a!==s;)n.push(a),V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q));if(n!==s?(46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(k)),a!==s?r=n=[n,a]:(ce=r,r=s)):(ce=r,r=s),r===s&&(r=null),r!==s){if(n=[],V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q)),a!==s)for(;a!==s;)n.push(a),V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q));else n=s;n!==s?(i=n,l=(o=r)?[].concat.apply([],o).join(""):"",r={type:"literal",value:parseFloat(l+i.join(""))},e=r):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}())===s&&(a=function(){var e,t,r=30*ce+17,n=ye[r];return n?(ce=n.nextPos,n.result):((t=Ee())!==s&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:ce,result:e},e)}()),a!==s?(r=D(r,n,a),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=ke())!==s&&(r={type:"attribute",name:r}),e=r)),ye[o]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?(93===t.charCodeAt(ce)?(a="]",ce++):(a=s,ge(A)),a!==s?e=r=n:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a,o,i,l,u,c=30*ce+21,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,46===t.charCodeAt(ce)?(r=".",ce++):(r=s,ge(k)),r!==s)if((n=Ee())!==s){for(a=[],o=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(k)),i!==s&&(l=Ee())!==s?o=i=[i,l]:(ce=o,o=s);o!==s;)a.push(o),o=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(k)),i!==s&&(l=Ee())!==s?o=i=[i,l]:(ce=o,o=s);a!==s?(u=n,r={type:"field",name:a.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,a,o=30*ce+22,i=ye[o];return i?(ce=i.nextPos,i.result):(e=ce,":not("===t.substr(ce,5)?(r=":not(",ce+=5):(r=s,ge(Q)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?e=r={type:"not",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*ce+23,i=ye[o];return i?(ce=i.nextPos,i.result):(e=ce,":matches("===t.substr(ce,9)?(r=":matches(",ce+=9):(r=s,ge(X)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?e=r={type:"matches",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a,o=30*ce+24,i=ye[o];return i?(ce=i.nextPos,i.result):(e=ce,":has("===t.substr(ce,5)?(r=":has(",ce+=5):(r=s,ge(Z)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?e=r={type:"has",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=30*ce+25,a=ye[n];return a?(ce=a.nextPos,a.result):(":first-child"===t.substr(ce,12)?(r=":first-child",ce+=12):(r=s,ge(ee)),r!==s&&(r=De(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=30*ce+26,a=ye[n];return a?(ce=a.nextPos,a.result):(":last-child"===t.substr(ce,11)?(r=":last-child",ce+=11):(r=s,ge(te)),r!==s&&(r=je(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,a,o,i=30*ce+27,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,":nth-child("===t.substr(ce,11)?(r=":nth-child(",ce+=11):(r=s,ge(re)),r!==s)if(Ae()!==s){if(n=[],V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q)),a!==s)for(;a!==s;)n.push(a),V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q));else n=s;n!==s&&(a=Ae())!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?(r=De(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,a,o,i=30*ce+28,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,":nth-last-child("===t.substr(ce,16)?(r=":nth-last-child(",ce+=16):(r=s,ge(ne)),r!==s)if(Ae()!==s){if(n=[],V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q)),a!==s)for(;a!==s;)n.push(a),V.test(t.charAt(ce))?(a=t.charAt(ce),ce++):(a=s,ge(q));else n=s;n!==s&&(a=Ae())!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?(r=je(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,a=30*ce+29,o=ye[a];return o?(ce=o.nextPos,o.result):(e=ce,58===t.charCodeAt(ce)?(r=":",ce++):(r=s,ge(ae)),r!==s?("statement"===t.substr(ce,9).toLowerCase()?(n=t.substr(ce,9),ce+=9):(n=s,ge(oe)),n===s&&("expression"===t.substr(ce,10).toLowerCase()?(n=t.substr(ce,10),ce+=10):(n=s,ge(ie)),n===s&&("declaration"===t.substr(ce,11).toLowerCase()?(n=t.substr(ce,11),ce+=11):(n=s,ge(se)),n===s&&("function"===t.substr(ce,8).toLowerCase()?(n=t.substr(ce,8),ce+=8):(n=s,ge(le)),n===s&&("pattern"===t.substr(ce,7).toLowerCase()?(n=t.substr(ce,7),ce+=7):(n=s,ge(ue)))))),n!==s?e=r={type:"class",name:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}()),ye[r]={nextPos:ce,result:e},e)}function ke(){var e,r,n,a,o,i,l,u,c=30*ce+13,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Ee())!==s){for(n=[],a=ce,46===t.charCodeAt(ce)?(o=".",ce++):(o=s,ge(k)),o!==s&&(i=Ee())!==s?a=o=[o,i]:(ce=a,a=s);a!==s;)n.push(a),a=ce,46===t.charCodeAt(ce)?(o=".",ce++):(o=s,ge(k)),o!==s&&(i=Ee())!==s?a=o=[o,i]:(ce=a,a=s);n!==s?(l=r,u=n,e=r=[].concat.apply([l],u).join("")):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function De(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==s&&ce===t.length)return n;throw n!==s&&ce":return w>r.value.value;case">=":return w>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return u(t,r.right,n,a)&&p(t,r.left,n,"LEFT_SIDE",a)||r.left.subject&&u(t,r.left,n,a)&&p(t,r.right,n,"RIGHT_SIDE",a);case"adjacent":return u(t,r.right,n,a)&&h(t,r.left,n,"LEFT_SIDE",a)||r.right.subject&&u(t,r.left,n,a)&&h(t,r.right,n,"RIGHT_SIDE",a);case"nth-child":return u(t,r.right,n,a)&&y(t,n,(function(){return r.index.value-1}),a);case"nth-last-child":return u(t,r.right,n,a)&&y(t,n,(function(e){return e-r.index.value}),a);case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function c(e,t){var r=e.type;return t&&t.visitorKeys&&t.visitorKeys[r]?t.visitorKeys[r]:s.VisitorKeys[r]?s.VisitorKeys[r]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return"type"!==e}))}function f(t){return null!==t&&"object"===e(t)&&"string"==typeof t.type}function p(e,r,n,a,i){var s=t(n,1)[0];if(!s)return!1;var l,p=o(c(s,i));try{for(p.s();!(l=p.n()).done;){var h=s[l.value];if(Array.isArray(h)){var y=h.indexOf(e);if(y<0)continue;var d=void 0,m=void 0;"LEFT_SIDE"===a?(d=0,m=y):(d=y+1,m=h.length);for(var x=d;x0&&f(h[y-1])&&u(h[y-1],r,n,i))return!0;if("RIGHT_SIDE"===a&&y=0&&f===n(u.length))return!0}}}catch(e){l.e(e)}finally{l.f()}return!1}function d(n,a){if(null==n||"object"!=e(n))return[];null==a&&(a=n);for(var o=n.subject?[a]:[],i=0,s=function(e){for(var t=[],r=Object.keys(e),n=0;n= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = o[Symbol.iterator](); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { @@ -188,6 +245,7 @@ BreakStatement: 'BreakStatement', CallExpression: 'CallExpression', CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', ClassBody: 'ClassBody', ClassDeclaration: 'ClassDeclaration', ClassExpression: 'ClassExpression', @@ -266,6 +324,7 @@ BreakStatement: ['label'], CallExpression: ['callee', 'arguments'], CatchClause: ['param', 'body'], + ChainExpression: ['expression'], ClassBody: ['body'], ClassDeclaration: ['id', 'superClass', 'body'], ClassExpression: ['id', 'superClass', 'body'], @@ -1132,7 +1191,10 @@ peg$c41 = peg$classExpectation([">", "<"], false, false), peg$c42 = ".", peg$c43 = peg$literalExpectation(".", false), - peg$c44 = function peg$c44(name, op, value) { + peg$c44 = function peg$c44(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c45 = function peg$c45(name, op, value) { return { type: 'attribute', name: name, @@ -1140,35 +1202,35 @@ value: value }; }, - peg$c45 = function peg$c45(name) { + peg$c46 = function peg$c46(name) { return { type: 'attribute', name: name }; }, - peg$c46 = "\"", - peg$c47 = peg$literalExpectation("\"", false), - peg$c48 = /^[^\\"]/, - peg$c49 = peg$classExpectation(["\\", "\""], true, false), - peg$c50 = "\\", - peg$c51 = peg$literalExpectation("\\", false), - peg$c52 = peg$anyExpectation(), - peg$c53 = function peg$c53(a, b) { + peg$c47 = "\"", + peg$c48 = peg$literalExpectation("\"", false), + peg$c49 = /^[^\\"]/, + peg$c50 = peg$classExpectation(["\\", "\""], true, false), + peg$c51 = "\\", + peg$c52 = peg$literalExpectation("\\", false), + peg$c53 = peg$anyExpectation(), + peg$c54 = function peg$c54(a, b) { return a + b; }, - peg$c54 = function peg$c54(d) { + peg$c55 = function peg$c55(d) { return { type: 'literal', value: strUnescape(d.join('')) }; }, - peg$c55 = "'", - peg$c56 = peg$literalExpectation("'", false), - peg$c57 = /^[^\\']/, - peg$c58 = peg$classExpectation(["\\", "'"], true, false), - peg$c59 = /^[0-9]/, - peg$c60 = peg$classExpectation([["0", "9"]], false, false), - peg$c61 = function peg$c61(a, b) { + peg$c56 = "'", + peg$c57 = peg$literalExpectation("'", false), + peg$c58 = /^[^\\']/, + peg$c59 = peg$classExpectation(["\\", "'"], true, false), + peg$c60 = /^[0-9]/, + peg$c61 = peg$classExpectation([["0", "9"]], false, false), + peg$c62 = function peg$c62(a, b) { // Can use `a.flat().join('')` once supported var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; return { @@ -1176,37 +1238,37 @@ value: parseFloat(leadingDecimals + b.join('')) }; }, - peg$c62 = function peg$c62(i) { + peg$c63 = function peg$c63(i) { return { type: 'literal', value: i }; }, - peg$c63 = "type(", - peg$c64 = peg$literalExpectation("type(", false), - peg$c65 = /^[^ )]/, - peg$c66 = peg$classExpectation([" ", ")"], true, false), - peg$c67 = ")", - peg$c68 = peg$literalExpectation(")", false), - peg$c69 = function peg$c69(t) { + peg$c64 = "type(", + peg$c65 = peg$literalExpectation("type(", false), + peg$c66 = /^[^ )]/, + peg$c67 = peg$classExpectation([" ", ")"], true, false), + peg$c68 = ")", + peg$c69 = peg$literalExpectation(")", false), + peg$c70 = function peg$c70(t) { return { type: 'type', value: t.join('') }; }, - peg$c70 = /^[imsu]/, - peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false), - peg$c72 = "/", - peg$c73 = peg$literalExpectation("/", false), - peg$c74 = /^[^\/]/, - peg$c75 = peg$classExpectation(["/"], true, false), - peg$c76 = function peg$c76(d, flgs) { + peg$c71 = /^[imsu]/, + peg$c72 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c73 = "/", + peg$c74 = peg$literalExpectation("/", false), + peg$c75 = /^[^\/]/, + peg$c76 = peg$classExpectation(["/"], true, false), + peg$c77 = function peg$c77(d, flgs) { return { type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') }; }, - peg$c77 = function peg$c77(i, is) { + peg$c78 = function peg$c78(i, is) { return { type: 'field', name: is.reduce(function (memo, p) { @@ -1214,63 +1276,63 @@ }, i) }; }, - peg$c78 = ":not(", - peg$c79 = peg$literalExpectation(":not(", false), - peg$c80 = function peg$c80(ss) { + peg$c79 = ":not(", + peg$c80 = peg$literalExpectation(":not(", false), + peg$c81 = function peg$c81(ss) { return { type: 'not', selectors: ss }; }, - peg$c81 = ":matches(", - peg$c82 = peg$literalExpectation(":matches(", false), - peg$c83 = function peg$c83(ss) { + peg$c82 = ":matches(", + peg$c83 = peg$literalExpectation(":matches(", false), + peg$c84 = function peg$c84(ss) { return { type: 'matches', selectors: ss }; }, - peg$c84 = ":has(", - peg$c85 = peg$literalExpectation(":has(", false), - peg$c86 = function peg$c86(ss) { + peg$c85 = ":has(", + peg$c86 = peg$literalExpectation(":has(", false), + peg$c87 = function peg$c87(ss) { return { type: 'has', selectors: ss }; }, - peg$c87 = ":first-child", - peg$c88 = peg$literalExpectation(":first-child", false), - peg$c89 = function peg$c89() { + peg$c88 = ":first-child", + peg$c89 = peg$literalExpectation(":first-child", false), + peg$c90 = function peg$c90() { return nth(1); }, - peg$c90 = ":last-child", - peg$c91 = peg$literalExpectation(":last-child", false), - peg$c92 = function peg$c92() { + peg$c91 = ":last-child", + peg$c92 = peg$literalExpectation(":last-child", false), + peg$c93 = function peg$c93() { return nthLast(1); }, - peg$c93 = ":nth-child(", - peg$c94 = peg$literalExpectation(":nth-child(", false), - peg$c95 = function peg$c95(n) { + peg$c94 = ":nth-child(", + peg$c95 = peg$literalExpectation(":nth-child(", false), + peg$c96 = function peg$c96(n) { return nth(parseInt(n.join(''), 10)); }, - peg$c96 = ":nth-last-child(", - peg$c97 = peg$literalExpectation(":nth-last-child(", false), - peg$c98 = function peg$c98(n) { + peg$c97 = ":nth-last-child(", + peg$c98 = peg$literalExpectation(":nth-last-child(", false), + peg$c99 = function peg$c99(n) { return nthLast(parseInt(n.join(''), 10)); }, - peg$c99 = ":", - peg$c100 = peg$literalExpectation(":", false), - peg$c101 = "statement", - peg$c102 = peg$literalExpectation("statement", true), - peg$c103 = "expression", - peg$c104 = peg$literalExpectation("expression", true), - peg$c105 = "declaration", - peg$c106 = peg$literalExpectation("declaration", true), - peg$c107 = "function", - peg$c108 = peg$literalExpectation("function", true), - peg$c109 = "pattern", - peg$c110 = peg$literalExpectation("pattern", true), - peg$c111 = function peg$c111(c) { + peg$c100 = ":", + peg$c101 = peg$literalExpectation(":", false), + peg$c102 = "statement", + peg$c103 = peg$literalExpectation("statement", true), + peg$c104 = "expression", + peg$c105 = peg$literalExpectation("expression", true), + peg$c106 = "declaration", + peg$c107 = peg$literalExpectation("declaration", true), + peg$c108 = "function", + peg$c109 = peg$literalExpectation("function", true), + peg$c110 = "pattern", + peg$c111 = peg$literalExpectation("pattern", true), + peg$c112 = function peg$c112(c) { return { type: 'class', name: c @@ -2301,7 +2363,7 @@ } function peg$parseattrName() { - var s0, s1, s2; + var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 30 + 13, cached = peg$resultsCache[key]; @@ -2311,49 +2373,81 @@ } s0 = peg$currPos; - s1 = []; - s2 = peg$parseidentifierName(); + s1 = peg$parseidentifierName(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; - if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; + s4 = peg$c42; peg$currPos++; } else { - s2 = peg$FAILED; + s4 = peg$FAILED; { peg$fail(peg$c43); } } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parseidentifierName(); + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; - peg$currPos++; - } else { - s2 = peg$FAILED; + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } - { - peg$fail(peg$c43); - } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c42; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c43); } } + + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s1 = peg$c6(s1); + if (s2 !== peg$FAILED) { + s1 = peg$c44(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; } - s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 @@ -2391,7 +2485,7 @@ } if (s5 !== peg$FAILED) { - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -2439,7 +2533,7 @@ } if (s5 !== peg$FAILED) { - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -2467,7 +2561,7 @@ s1 = peg$parseattrName(); if (s1 !== peg$FAILED) { - s1 = peg$c45(s1); + s1 = peg$c46(s1); } s0 = s1; @@ -2494,27 +2588,27 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c46; + s1 = peg$c47; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c47); + peg$fail(peg$c48); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c49); + peg$fail(peg$c50); } } @@ -2522,13 +2616,13 @@ s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2540,12 +2634,12 @@ s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2560,14 +2654,14 @@ while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c49); + peg$fail(peg$c50); } } @@ -2575,13 +2669,13 @@ s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2593,12 +2687,12 @@ s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2613,18 +2707,18 @@ if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c46; + s3 = peg$c47; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c47); + peg$fail(peg$c48); } } if (s3 !== peg$FAILED) { - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -2643,27 +2737,27 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s1 = peg$c55; + s1 = peg$c56; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c56); + peg$fail(peg$c57); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c58); + peg$fail(peg$c59); } } @@ -2671,13 +2765,13 @@ s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2689,12 +2783,12 @@ s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2709,14 +2803,14 @@ while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c58); + peg$fail(peg$c59); } } @@ -2724,13 +2818,13 @@ s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c51); + peg$fail(peg$c52); } } @@ -2742,12 +2836,12 @@ s5 = peg$FAILED; { - peg$fail(peg$c52); + peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -2762,18 +2856,18 @@ if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s3 = peg$c55; + s3 = peg$c56; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c56); + peg$fail(peg$c57); } } if (s3 !== peg$FAILED) { - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -2810,28 +2904,28 @@ s1 = peg$currPos; s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -2867,14 +2961,14 @@ if (s1 !== peg$FAILED) { s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -2882,14 +2976,14 @@ while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -2898,7 +2992,7 @@ } if (s2 !== peg$FAILED) { - s1 = peg$c61(s1, s2); + s1 = peg$c62(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -2930,7 +3024,7 @@ s1 = peg$parseidentifierName(); if (s1 !== peg$FAILED) { - s1 = peg$c62(s1); + s1 = peg$c63(s1); } s0 = s1; @@ -2953,14 +3047,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c63) { - s1 = peg$c63; + if (input.substr(peg$currPos, 5) === peg$c64) { + s1 = peg$c64; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c64); + peg$fail(peg$c65); } } @@ -2970,14 +3064,14 @@ if (s2 !== peg$FAILED) { s3 = []; - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c66); + peg$fail(peg$c67); } } @@ -2985,14 +3079,14 @@ while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c66); + peg$fail(peg$c67); } } } @@ -3005,18 +3099,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c69(s3); + s1 = peg$c70(s3); s0 = s1; } else { peg$currPos = s0; @@ -3058,14 +3152,14 @@ s0 = []; - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c71); + peg$fail(peg$c72); } } @@ -3073,14 +3167,14 @@ while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c71); + peg$fail(peg$c72); } } } @@ -3108,27 +3202,27 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c72; + s1 = peg$c73; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c73); + peg$fail(peg$c74); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c75); + peg$fail(peg$c76); } } @@ -3136,14 +3230,14 @@ while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c75); + peg$fail(peg$c76); } } } @@ -3153,13 +3247,13 @@ if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s3 = peg$c72; + s3 = peg$c73; peg$currPos++; } else { s3 = peg$FAILED; { - peg$fail(peg$c73); + peg$fail(peg$c74); } } @@ -3171,7 +3265,7 @@ } if (s4 !== peg$FAILED) { - s1 = peg$c76(s2, s4); + s1 = peg$c77(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -3285,7 +3379,7 @@ } if (s3 !== peg$FAILED) { - s1 = peg$c77(s2, s3); + s1 = peg$c78(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -3319,14 +3413,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c78) { - s1 = peg$c78; + if (input.substr(peg$currPos, 5) === peg$c79) { + s1 = peg$c79; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c79); + peg$fail(peg$c80); } } @@ -3341,18 +3435,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c80(s3); + s1 = peg$c81(s3); s0 = s1; } else { peg$currPos = s0; @@ -3394,14 +3488,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 9) === peg$c81) { - s1 = peg$c81; + if (input.substr(peg$currPos, 9) === peg$c82) { + s1 = peg$c82; peg$currPos += 9; } else { s1 = peg$FAILED; { - peg$fail(peg$c82); + peg$fail(peg$c83); } } @@ -3416,18 +3510,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c83(s3); + s1 = peg$c84(s3); s0 = s1; } else { peg$currPos = s0; @@ -3469,14 +3563,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c84) { - s1 = peg$c84; + if (input.substr(peg$currPos, 5) === peg$c85) { + s1 = peg$c85; peg$currPos += 5; } else { s1 = peg$FAILED; { - peg$fail(peg$c85); + peg$fail(peg$c86); } } @@ -3491,18 +3585,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c86(s3); + s1 = peg$c87(s3); s0 = s1; } else { peg$currPos = s0; @@ -3544,19 +3638,19 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 12) === peg$c87) { - s1 = peg$c87; + if (input.substr(peg$currPos, 12) === peg$c88) { + s1 = peg$c88; peg$currPos += 12; } else { s1 = peg$FAILED; { - peg$fail(peg$c88); + peg$fail(peg$c89); } } if (s1 !== peg$FAILED) { - s1 = peg$c89(); + s1 = peg$c90(); } s0 = s1; @@ -3579,19 +3673,19 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c90) { - s1 = peg$c90; + if (input.substr(peg$currPos, 11) === peg$c91) { + s1 = peg$c91; peg$currPos += 11; } else { s1 = peg$FAILED; { - peg$fail(peg$c91); + peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { - s1 = peg$c92(); + s1 = peg$c93(); } s0 = s1; @@ -3614,14 +3708,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c93) { - s1 = peg$c93; + if (input.substr(peg$currPos, 11) === peg$c94) { + s1 = peg$c94; peg$currPos += 11; } else { s1 = peg$FAILED; { - peg$fail(peg$c94); + peg$fail(peg$c95); } } @@ -3631,14 +3725,14 @@ if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -3646,14 +3740,14 @@ while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -3666,18 +3760,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c95(s3); + s1 = peg$c96(s3); s0 = s1; } else { peg$currPos = s0; @@ -3719,14 +3813,14 @@ s0 = peg$currPos; - if (input.substr(peg$currPos, 16) === peg$c96) { - s1 = peg$c96; + if (input.substr(peg$currPos, 16) === peg$c97) { + s1 = peg$c97; peg$currPos += 16; } else { s1 = peg$FAILED; { - peg$fail(peg$c97); + peg$fail(peg$c98); } } @@ -3736,14 +3830,14 @@ if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } @@ -3751,14 +3845,14 @@ while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; { - peg$fail(peg$c60); + peg$fail(peg$c61); } } } @@ -3771,18 +3865,18 @@ if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; { - peg$fail(peg$c68); + peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { - s1 = peg$c98(s3); + s1 = peg$c99(s3); s0 = s1; } else { peg$currPos = s0; @@ -3825,73 +3919,73 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c99; + s1 = peg$c100; peg$currPos++; } else { s1 = peg$FAILED; { - peg$fail(peg$c100); + peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c102) { s2 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s2 = peg$FAILED; { - peg$fail(peg$c102); + peg$fail(peg$c103); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c104) { s2 = input.substr(peg$currPos, 10); peg$currPos += 10; } else { s2 = peg$FAILED; { - peg$fail(peg$c104); + peg$fail(peg$c105); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c106) { s2 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s2 = peg$FAILED; { - peg$fail(peg$c106); + peg$fail(peg$c107); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c108) { s2 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s2 = peg$FAILED; { - peg$fail(peg$c108); + peg$fail(peg$c109); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c110) { s2 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s2 = peg$FAILED; { - peg$fail(peg$c110); + peg$fail(peg$c111); } } } @@ -3900,7 +3994,7 @@ } if (s2 !== peg$FAILED) { - s1 = peg$c111(s2); + s1 = peg$c112(s2); s0 = s1; } else { peg$currPos = s0; @@ -4026,12 +4120,23 @@ function getPath(obj, key) { var keys = key.split('.'); - for (var i = 0; i < keys.length; i++) { - if (obj == null) { - return obj; - } + var _iterator = _createForOfIteratorHelper(keys), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var _key = _step.value; + + if (obj == null) { + return obj; + } - obj = obj[keys[i]]; + obj = obj[_key]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } return obj; @@ -4059,10 +4164,21 @@ var remainingPath = path.slice(1); if (Array.isArray(field)) { - for (var i = 0, l = field.length; i < l; ++i) { - if (inPath(node, field[i], remainingPath)) { - return true; + var _iterator2 = _createForOfIteratorHelper(field), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var component = _step2.value; + + if (inPath(node, component, remainingPath)) { + return true; + } } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } return false; @@ -4070,19 +4186,32 @@ return inPath(node, field, remainingPath); } } + /** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + + /** + * @typedef {object} ESQueryOptions + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + */ + /** * Given a `node` and its ancestors, determine if `node` is matched * by `selector`. * @param {?external:AST} node * @param {?SelectorAST} selector * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] * @throws {Error} Unknowns (operator, class name, selector type, or * selector value type) * @returns {boolean} */ - function matches(node, selector, ancestry) { + function matches(node, selector, ancestry, options) { if (!selector) { return true; } @@ -4110,28 +4239,61 @@ } case 'matches': - for (var i = 0, l = selector.selectors.length; i < l; ++i) { - if (matches(node, selector.selectors[i], ancestry)) { - return true; + var _iterator3 = _createForOfIteratorHelper(selector.selectors), + _step3; + + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var sel = _step3.value; + + if (matches(node, sel, ancestry, options)) { + return true; + } } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); } return false; case 'compound': - for (var _i = 0, _l = selector.selectors.length; _i < _l; ++_i) { - if (!matches(node, selector.selectors[_i], ancestry)) { - return false; + var _iterator4 = _createForOfIteratorHelper(selector.selectors), + _step4; + + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var _sel = _step4.value; + + if (!matches(node, _sel, ancestry, options)) { + return false; + } } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); } return true; case 'not': - for (var _i2 = 0, _l2 = selector.selectors.length; _i2 < _l2; ++_i2) { - if (matches(node, selector.selectors[_i2], ancestry)) { - return false; + var _iterator5 = _createForOfIteratorHelper(selector.selectors), + _step5; + + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var _sel2 = _step5.value; + + if (matches(node, _sel2, ancestry, options)) { + return false; + } } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); } return true; @@ -4141,27 +4303,38 @@ var _ret = function () { var collector = []; - var _loop = function _loop(_i3, _l3) { - var a = []; - estraverse.traverse(node, { - enter: function enter(node, parent) { - if (parent != null) { - a.unshift(parent); - } - - if (matches(node, selector.selectors[_i3], a)) { - collector.push(node); - } - }, - leave: function leave() { - a.shift(); - }, - fallback: 'iteration' - }); - }; + var _iterator6 = _createForOfIteratorHelper(selector.selectors), + _step6; + + try { + var _loop = function _loop() { + var sel = _step6.value; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } - for (var _i3 = 0, _l3 = selector.selectors.length; _i3 < _l3; ++_i3) { - _loop(_i3); + if (matches(node, sel, a, options)) { + collector.push(node); + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + }; + + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + _loop(); + } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); } return { @@ -4173,16 +4346,16 @@ } case 'child': - if (matches(node, selector.right, ancestry)) { - return matches(ancestry[0], selector.left, ancestry.slice(1)); + if (matches(node, selector.right, ancestry, options)) { + return matches(ancestry[0], selector.left, ancestry.slice(1), options); } return false; case 'descendant': - if (matches(node, selector.right, ancestry)) { - for (var _i4 = 0, _l4 = ancestry.length; _i4 < _l4; ++_i4) { - if (matches(ancestry[_i4], selector.left, ancestry.slice(_i4 + 1))) { + if (matches(node, selector.right, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (matches(ancestry[i], selector.left, ancestry.slice(i + 1), options)) { return true; } } @@ -4243,20 +4416,20 @@ } case 'sibling': - return matches(node, selector.right, ancestry) && sibling(node, selector.left, ancestry, LEFT_SIDE) || selector.left.subject && matches(node, selector.left, ancestry) && sibling(node, selector.right, ancestry, RIGHT_SIDE); + return matches(node, selector.right, ancestry, options) && sibling(node, selector.left, ancestry, LEFT_SIDE, options) || selector.left.subject && matches(node, selector.left, ancestry, options) && sibling(node, selector.right, ancestry, RIGHT_SIDE, options); case 'adjacent': - return matches(node, selector.right, ancestry) && adjacent(node, selector.left, ancestry, LEFT_SIDE) || selector.right.subject && matches(node, selector.left, ancestry) && adjacent(node, selector.right, ancestry, RIGHT_SIDE); + return matches(node, selector.right, ancestry, options) && adjacent(node, selector.left, ancestry, LEFT_SIDE, options) || selector.right.subject && matches(node, selector.left, ancestry, options) && adjacent(node, selector.right, ancestry, RIGHT_SIDE, options); case 'nth-child': - return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function () { + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function () { return selector.index.value - 1; - }); + }, options); case 'nth-last-child': - return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function (length) { + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function (length) { return length - selector.index.value; - }); + }, options); case 'class': switch (selector.name.toLowerCase()) { @@ -4283,6 +4456,44 @@ throw new Error("Unknown selector type: ".concat(selector.type)); } + /** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ + + + function getVisitorKeys(node, options) { + var nodeType = node.type; + + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } // 'iteration' fallback + + + return Object.keys(node).filter(function (key) { + return key !== 'type'; + }); + } + /** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ + + + function isNode(node) { + return node !== null && _typeof(node) === 'object' && typeof node.type === 'string'; + } /** * Determines if the given node has a sibling that matches the * given selector. @@ -4290,11 +4501,12 @@ * @param {SelectorSequenceAST} selector * @param {external:AST[]} ancestry * @param {Side} side + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ - function sibling(node, selector, ancestry, side) { + function sibling(node, selector, ancestry, side, options) { var _ancestry = _slicedToArray(ancestry, 1), parent = _ancestry[0]; @@ -4302,35 +4514,45 @@ return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator7 = _createForOfIteratorHelper(keys), + _step7; - if (Array.isArray(listProp)) { - var startIndex = listProp.indexOf(node); + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var key = _step7.value; + var listProp = parent[key]; - if (startIndex < 0) { - continue; - } + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); - var lowerBound = void 0, - upperBound = void 0; + if (startIndex < 0) { + continue; + } - if (side === LEFT_SIDE) { - lowerBound = 0; - upperBound = startIndex; - } else { - lowerBound = startIndex + 1; - upperBound = listProp.length; - } + var lowerBound = void 0, + upperBound = void 0; - for (var k = lowerBound; k < upperBound; ++k) { - if (matches(listProp[k], selector, ancestry)) { - return true; + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k]) && matches(listProp[k], selector, ancestry, options)) { + return true; + } } } } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); } return false; @@ -4342,11 +4564,12 @@ * @param {SelectorSequenceAST} selector * @param {external:AST[]} ancestry * @param {Side} side + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ - function adjacent(node, selector, ancestry, side) { + function adjacent(node, selector, ancestry, side, options) { var _ancestry2 = _slicedToArray(ancestry, 1), parent = _ancestry2[0]; @@ -4354,26 +4577,36 @@ return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator8 = _createForOfIteratorHelper(keys), + _step8; - if (Array.isArray(listProp)) { - var idx = listProp.indexOf(node); + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var key = _step8.value; + var listProp = parent[key]; - if (idx < 0) { - continue; - } + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); - if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) { - return true; - } + if (idx < 0) { + continue; + } - if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) { - return true; + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1]) && matches(listProp[idx - 1], selector, ancestry, options)) { + return true; + } + + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1]) && matches(listProp[idx + 1], selector, ancestry, options)) { + return true; + } } } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); } return false; @@ -4390,11 +4623,12 @@ * @param {external:AST} node * @param {external:AST[]} ancestry * @param {IndexFunction} idxFn + * @param {ESQueryOptions|undefined} options * @returns {boolean} */ - function nthChild(node, ancestry, idxFn) { + function nthChild(node, ancestry, idxFn, options) { var _ancestry3 = _slicedToArray(ancestry, 1), parent = _ancestry3[0]; @@ -4402,18 +4636,28 @@ return false; } - var keys = estraverse.VisitorKeys[parent.type]; + var keys = getVisitorKeys(parent, options); - for (var i = 0, l = keys.length; i < l; ++i) { - var listProp = parent[keys[i]]; + var _iterator9 = _createForOfIteratorHelper(keys), + _step9; - if (Array.isArray(listProp)) { - var idx = listProp.indexOf(node); + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var key = _step9.value; + var listProp = parent[key]; - if (idx >= 0 && idx === idxFn(listProp.length)) { - return true; + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + + if (idx >= 0 && idx === idxFn(listProp.length)) { + return true; + } } } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); } return false; @@ -4438,8 +4682,8 @@ var results = selector.subject ? [ancestor] : []; - for (var _i5 = 0, _Object$entries = _objectEntries(selector); _i5 < _Object$entries.length; _i5++) { - var _Object$entries$_i = _slicedToArray(_Object$entries[_i5], 2), + for (var _i = 0, _Object$entries = _objectEntries(selector); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), p = _Object$entries$_i[0], sel = _Object$entries$_i[1]; @@ -4461,11 +4705,12 @@ * @param {external:AST} ast * @param {?SelectorAST} selector * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ - function traverse(ast, selector, visitor) { + function traverse(ast, selector, visitor, options) { if (!selector) { return; } @@ -4478,17 +4723,17 @@ ancestry.unshift(parent); } - if (matches(node, selector, ancestry)) { + if (matches(node, selector, ancestry, options)) { if (altSubjects.length) { for (var i = 0, l = altSubjects.length; i < l; ++i) { - if (matches(node, altSubjects[i], ancestry)) { + if (matches(node, altSubjects[i], ancestry, options)) { visitor(node, parent, ancestry); } for (var k = 0, m = ancestry.length; k < m; ++k) { var succeedingAncestry = ancestry.slice(k + 1); - if (matches(ancestry[k], altSubjects[i], succeedingAncestry)) { + if (matches(ancestry[k], altSubjects[i], succeedingAncestry, options)) { visitor(ancestry[k], parent, succeedingAncestry); } } @@ -4501,7 +4746,8 @@ leave: function leave() { ancestry.shift(); }, - fallback: 'iteration' + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' }); } /** @@ -4509,15 +4755,16 @@ * match the selector. * @param {external:AST} ast * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ - function match(ast, selector) { + function match(ast, selector, options) { var results = []; traverse(ast, selector, function (node) { results.push(node); - }); + }, options); return results; } /** @@ -4534,12 +4781,13 @@ * Query the code AST using the selector string. * @param {external:AST} ast * @param {string} selector + * @param {ESQueryOptions} [options] * @returns {external:AST[]} */ - function query(ast, selector) { - return match(ast, parse(selector)); + function query(ast, selector, options) { + return match(ast, parse(selector), options); } query.parse = parse; diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.js new file mode 100644 index 00000000000000..8a181abec8df8c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.js @@ -0,0 +1,3995 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('estraverse')) : + typeof define === 'function' && define.amd ? define(['estraverse'], factory) : + (global = global || self, global.esquery = factory(global.estraverse)); +}(this, (function (estraverse) { 'use strict'; + + estraverse = estraverse && Object.prototype.hasOwnProperty.call(estraverse, 'default') ? estraverse['default'] : estraverse; + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function _iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _createForOfIteratorHelper(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + + var F = function () {}; + + return { + s: F, + n: function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = o[Symbol.iterator](); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var parser = createCommonjsModule(function (module) { + /* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + (function (root, factory) { + if ( module.exports) { + module.exports = factory(); + } + })(commonjsGlobal, function () { + + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + + peg$subclass(peg$SyntaxError, Error); + + peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function literal(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + "class": function _class(expectation) { + var escapedParts = "", + i; + + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); + } + + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function any(expectation) { + return "any character"; + }, + end: function end(expectation) { + return "end of input"; + }, + other: function other(expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + + function classEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, + j; + + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + peg$startRuleFunctions = { + start: peg$parsestart + }, + peg$startRuleFunction = peg$parsestart, + peg$c0 = function peg$c0(ss) { + return ss.length === 1 ? ss[0] : { + type: 'matches', + selectors: ss + }; + }, + peg$c1 = function peg$c1() { + return void 0; + }, + peg$c2 = " ", + peg$c3 = peg$literalExpectation(" ", false), + peg$c4 = /^[^ [\],():#!=><~+.]/, + peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false), + peg$c6 = function peg$c6(i) { + return i.join(''); + }, + peg$c7 = ">", + peg$c8 = peg$literalExpectation(">", false), + peg$c9 = function peg$c9() { + return 'child'; + }, + peg$c10 = "~", + peg$c11 = peg$literalExpectation("~", false), + peg$c12 = function peg$c12() { + return 'sibling'; + }, + peg$c13 = "+", + peg$c14 = peg$literalExpectation("+", false), + peg$c15 = function peg$c15() { + return 'adjacent'; + }, + peg$c16 = function peg$c16() { + return 'descendant'; + }, + peg$c17 = ",", + peg$c18 = peg$literalExpectation(",", false), + peg$c19 = function peg$c19(s, ss) { + return [s].concat(ss.map(function (s) { + return s[3]; + })); + }, + peg$c20 = function peg$c20(a, ops) { + return ops.reduce(function (memo, rhs) { + return { + type: rhs[0], + left: memo, + right: rhs[1] + }; + }, a); + }, + peg$c21 = "!", + peg$c22 = peg$literalExpectation("!", false), + peg$c23 = function peg$c23(subject, as) { + var b = as.length === 1 ? as[0] : { + type: 'compound', + selectors: as + }; + if (subject) b.subject = true; + return b; + }, + peg$c24 = "*", + peg$c25 = peg$literalExpectation("*", false), + peg$c26 = function peg$c26(a) { + return { + type: 'wildcard', + value: a + }; + }, + peg$c27 = "#", + peg$c28 = peg$literalExpectation("#", false), + peg$c29 = function peg$c29(i) { + return { + type: 'identifier', + value: i + }; + }, + peg$c30 = "[", + peg$c31 = peg$literalExpectation("[", false), + peg$c32 = "]", + peg$c33 = peg$literalExpectation("]", false), + peg$c34 = function peg$c34(v) { + return v; + }, + peg$c35 = /^[>", "<", "!"], false, false), + peg$c37 = "=", + peg$c38 = peg$literalExpectation("=", false), + peg$c39 = function peg$c39(a) { + return (a || '') + '='; + }, + peg$c40 = /^[><]/, + peg$c41 = peg$classExpectation([">", "<"], false, false), + peg$c42 = ".", + peg$c43 = peg$literalExpectation(".", false), + peg$c44 = function peg$c44(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c45 = function peg$c45(name, op, value) { + return { + type: 'attribute', + name: name, + operator: op, + value: value + }; + }, + peg$c46 = function peg$c46(name) { + return { + type: 'attribute', + name: name + }; + }, + peg$c47 = "\"", + peg$c48 = peg$literalExpectation("\"", false), + peg$c49 = /^[^\\"]/, + peg$c50 = peg$classExpectation(["\\", "\""], true, false), + peg$c51 = "\\", + peg$c52 = peg$literalExpectation("\\", false), + peg$c53 = peg$anyExpectation(), + peg$c54 = function peg$c54(a, b) { + return a + b; + }, + peg$c55 = function peg$c55(d) { + return { + type: 'literal', + value: strUnescape(d.join('')) + }; + }, + peg$c56 = "'", + peg$c57 = peg$literalExpectation("'", false), + peg$c58 = /^[^\\']/, + peg$c59 = peg$classExpectation(["\\", "'"], true, false), + peg$c60 = /^[0-9]/, + peg$c61 = peg$classExpectation([["0", "9"]], false, false), + peg$c62 = function peg$c62(a, b) { + // Can use `a.flat().join('')` once supported + var leadingDecimals = a ? [].concat.apply([], a).join('') : ''; + return { + type: 'literal', + value: parseFloat(leadingDecimals + b.join('')) + }; + }, + peg$c63 = function peg$c63(i) { + return { + type: 'literal', + value: i + }; + }, + peg$c64 = "type(", + peg$c65 = peg$literalExpectation("type(", false), + peg$c66 = /^[^ )]/, + peg$c67 = peg$classExpectation([" ", ")"], true, false), + peg$c68 = ")", + peg$c69 = peg$literalExpectation(")", false), + peg$c70 = function peg$c70(t) { + return { + type: 'type', + value: t.join('') + }; + }, + peg$c71 = /^[imsu]/, + peg$c72 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c73 = "/", + peg$c74 = peg$literalExpectation("/", false), + peg$c75 = /^[^\/]/, + peg$c76 = peg$classExpectation(["/"], true, false), + peg$c77 = function peg$c77(d, flgs) { + return { + type: 'regexp', + value: new RegExp(d.join(''), flgs ? flgs.join('') : '') + }; + }, + peg$c78 = function peg$c78(i, is) { + return { + type: 'field', + name: is.reduce(function (memo, p) { + return memo + p[0] + p[1]; + }, i) + }; + }, + peg$c79 = ":not(", + peg$c80 = peg$literalExpectation(":not(", false), + peg$c81 = function peg$c81(ss) { + return { + type: 'not', + selectors: ss + }; + }, + peg$c82 = ":matches(", + peg$c83 = peg$literalExpectation(":matches(", false), + peg$c84 = function peg$c84(ss) { + return { + type: 'matches', + selectors: ss + }; + }, + peg$c85 = ":has(", + peg$c86 = peg$literalExpectation(":has(", false), + peg$c87 = function peg$c87(ss) { + return { + type: 'has', + selectors: ss + }; + }, + peg$c88 = ":first-child", + peg$c89 = peg$literalExpectation(":first-child", false), + peg$c90 = function peg$c90() { + return nth(1); + }, + peg$c91 = ":last-child", + peg$c92 = peg$literalExpectation(":last-child", false), + peg$c93 = function peg$c93() { + return nthLast(1); + }, + peg$c94 = ":nth-child(", + peg$c95 = peg$literalExpectation(":nth-child(", false), + peg$c96 = function peg$c96(n) { + return nth(parseInt(n.join(''), 10)); + }, + peg$c97 = ":nth-last-child(", + peg$c98 = peg$literalExpectation(":nth-last-child(", false), + peg$c99 = function peg$c99(n) { + return nthLast(parseInt(n.join(''), 10)); + }, + peg$c100 = ":", + peg$c101 = peg$literalExpectation(":", false), + peg$c102 = "statement", + peg$c103 = peg$literalExpectation("statement", true), + peg$c104 = "expression", + peg$c105 = peg$literalExpectation("expression", true), + peg$c106 = "declaration", + peg$c107 = peg$literalExpectation("declaration", true), + peg$c108 = "function", + peg$c109 = peg$literalExpectation("function", true), + peg$c110 = "pattern", + peg$c111 = peg$literalExpectation("pattern", true), + peg$c112 = function peg$c112(c) { + return { + type: 'class', + name: c + }; + }, + peg$currPos = 0, + peg$posDetailsCache = [{ + line: 1, + column: 1 + }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$resultsCache = {}, + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function peg$literalExpectation(text, ignoreCase) { + return { + type: "literal", + text: text, + ignoreCase: ignoreCase + }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase + }; + } + + function peg$anyExpectation() { + return { + type: "any" + }; + } + + function peg$endExpectation() { + return { + type: "end" + }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], + p; + + if (details) { + return details; + } else { + p = pos - 1; + + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location); + } + + function peg$parsestart() { + var s0, s1, s2, s3; + var key = peg$currPos * 30 + 0, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parse_(); + + if (s1 !== peg$FAILED) { + s2 = peg$parseselectors(); + + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + + if (s3 !== peg$FAILED) { + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + + if (s1 !== peg$FAILED) { + s1 = peg$c1(); + } + + s0 = s1; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parse_() { + var s0, s1; + var key = peg$currPos * 30 + 1, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = []; + + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c3); + } + } + + while (s1 !== peg$FAILED) { + s0.push(s1); + + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c3); + } + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseidentifierName() { + var s0, s1, s2; + var key = peg$currPos * 30 + 2, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = []; + + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c5); + } + } + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + + if (peg$c4.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c5); + } + } + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + s1 = peg$c6(s1); + } + + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsebinaryOp() { + var s0, s1, s2, s3; + var key = peg$currPos * 30 + 3, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parse_(); + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 62) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c8); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + + if (s3 !== peg$FAILED) { + s1 = peg$c9(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 126) { + s2 = peg$c10; + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c11); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + + if (s3 !== peg$FAILED) { + s1 = peg$c12(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s2 = peg$c13; + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c14); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + + if (s3 !== peg$FAILED) { + s1 = peg$c15(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c2; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c3); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s1 = peg$c16(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseselectors() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 30 + 4, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseselector(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c18); + } + } + + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c17; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c18); + } + } + + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + + if (s6 !== peg$FAILED) { + s7 = peg$parseselector(); + + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseselector() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 5, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parsesequence(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parsebinaryOp(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsesequence(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c20(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsesequence() { + var s0, s1, s2, s3; + var key = peg$currPos * 30 + 6, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c21; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c22); + } + } + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseatom(); + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseatom(); + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s1 = peg$c23(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseatom() { + var s0; + var key = peg$currPos * 30 + 7, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$parsewildcard(); + + if (s0 === peg$FAILED) { + s0 = peg$parseidentifier(); + + if (s0 === peg$FAILED) { + s0 = peg$parseattr(); + + if (s0 === peg$FAILED) { + s0 = peg$parsefield(); + + if (s0 === peg$FAILED) { + s0 = peg$parsenegation(); + + if (s0 === peg$FAILED) { + s0 = peg$parsematches(); + + if (s0 === peg$FAILED) { + s0 = peg$parsehas(); + + if (s0 === peg$FAILED) { + s0 = peg$parsefirstChild(); + + if (s0 === peg$FAILED) { + s0 = peg$parselastChild(); + + if (s0 === peg$FAILED) { + s0 = peg$parsenthChild(); + + if (s0 === peg$FAILED) { + s0 = peg$parsenthLastChild(); + + if (s0 === peg$FAILED) { + s0 = peg$parseclass(); + } + } + } + } + } + } + } + } + } + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsewildcard() { + var s0, s1; + var key = peg$currPos * 30 + 8, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c24; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c25); + } + } + + if (s1 !== peg$FAILED) { + s1 = peg$c26(s1); + } + + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseidentifier() { + var s0, s1, s2; + var key = peg$currPos * 30 + 9, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c27; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c28); + } + } + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + + if (s2 !== peg$FAILED) { + s1 = peg$c29(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseattr() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 10, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c30; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c31); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseattrValue(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c32; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c33); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c34(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseattrOps() { + var s0, s1, s2; + var key = peg$currPos * 30 + 11, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (peg$c35.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c36); + } + } + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c37; + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c38); + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c39(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + if (peg$c40.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + { + peg$fail(peg$c41); + } + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseattrEqOps() { + var s0, s1, s2; + var key = peg$currPos * 30 + 12, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c21; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c22); + } + } + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c37; + peg$currPos++; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c38); + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c39(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseattrName() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 13, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c42; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c42; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c44(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseattrValue() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 14, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseattrName(); + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseattrEqOps(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsetype(); + + if (s5 === peg$FAILED) { + s5 = peg$parseregex(); + } + + if (s5 !== peg$FAILED) { + s1 = peg$c45(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseattrOps(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsestring(); + + if (s5 === peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 === peg$FAILED) { + s5 = peg$parsepath(); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c45(s1, s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseattrName(); + + if (s1 !== peg$FAILED) { + s1 = peg$c46(s1); + } + + s0 = s1; + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 15, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c47; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c48); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$c49.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c50); + } + } + + if (s3 === peg$FAILED) { + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c51; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c52); + } + } + + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c53); + } + } + + if (s5 !== peg$FAILED) { + s4 = peg$c54(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$c49.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c50); + } + } + + if (s3 === peg$FAILED) { + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c51; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c52); + } + } + + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c53); + } + } + + if (s5 !== peg$FAILED) { + s4 = peg$c54(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c47; + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c48); + } + } + + if (s3 !== peg$FAILED) { + s1 = peg$c55(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c56; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c57); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$c58.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c59); + } + } + + if (s3 === peg$FAILED) { + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c51; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c52); + } + } + + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c53); + } + } + + if (s5 !== peg$FAILED) { + s4 = peg$c54(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$c58.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c59); + } + } + + if (s3 === peg$FAILED) { + s3 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 92) { + s4 = peg$c51; + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c52); + } + } + + if (s4 !== peg$FAILED) { + if (input.length > peg$currPos) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c53); + } + } + + if (s5 !== peg$FAILED) { + s4 = peg$c54(s4, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c56; + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c57); + } + } + + if (s3 !== peg$FAILED) { + s1 = peg$c55(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsenumber() { + var s0, s1, s2, s3; + var key = peg$currPos * 30 + 16, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s3 = peg$c42; + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s1 = peg$c62(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsepath() { + var s0, s1; + var key = peg$currPos * 30 + 17, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + s1 = peg$parseidentifierName(); + + if (s1 !== peg$FAILED) { + s1 = peg$c63(s1); + } + + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsetype() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 18, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c64) { + s1 = peg$c64; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c65); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = []; + + if (peg$c66.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c67); + } + } + + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + + if (peg$c66.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c67); + } + } + } + } else { + s3 = peg$FAILED; + } + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c70(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseflags() { + var s0, s1; + var key = peg$currPos * 30 + 19, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = []; + + if (peg$c71.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c72); + } + } + + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + + if (peg$c71.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c72); + } + } + } + } else { + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseregex() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 30 + 20, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c74); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$c75.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c76); + } + } + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$c75.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c76); + } + } + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = peg$FAILED; + + { + peg$fail(peg$c74); + } + } + + if (s3 !== peg$FAILED) { + s4 = peg$parseflags(); + + if (s4 === peg$FAILED) { + s4 = null; + } + + if (s4 !== peg$FAILED) { + s1 = peg$c77(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsefield() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 30 + 21, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parseidentifierName(); + + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c42; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 46) { + s5 = peg$c42; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c43); + } + } + + if (s5 !== peg$FAILED) { + s6 = peg$parseidentifierName(); + + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } else { + peg$currPos = s4; + s4 = peg$FAILED; + } + } + + if (s3 !== peg$FAILED) { + s1 = peg$c78(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsenegation() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 22, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c79) { + s1 = peg$c79; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c80); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c81(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsematches() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 23, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 9) === peg$c82) { + s1 = peg$c82; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c83); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c84(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsehas() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 24, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c85) { + s1 = peg$c85; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c86); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseselectors(); + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c87(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsefirstChild() { + var s0, s1; + var key = peg$currPos * 30 + 25, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 12) === peg$c88) { + s1 = peg$c88; + peg$currPos += 12; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c89); + } + } + + if (s1 !== peg$FAILED) { + s1 = peg$c90(); + } + + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parselastChild() { + var s0, s1; + var key = peg$currPos * 30 + 26, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 11) === peg$c91) { + s1 = peg$c91; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c92); + } + } + + if (s1 !== peg$FAILED) { + s1 = peg$c93(); + } + + s0 = s1; + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsenthChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 27, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 11) === peg$c94) { + s1 = peg$c94; + peg$currPos += 11; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c95); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = []; + + if (peg$c60.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + + if (peg$c60.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + } + } else { + s3 = peg$FAILED; + } + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c96(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parsenthLastChild() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 30 + 28, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.substr(peg$currPos, 16) === peg$c97) { + s1 = peg$c97; + peg$currPos += 16; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c98); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + + if (s2 !== peg$FAILED) { + s3 = []; + + if (peg$c60.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + + if (peg$c60.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + + { + peg$fail(peg$c61); + } + } + } + } else { + s3 = peg$FAILED; + } + + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c68; + peg$currPos++; + } else { + s5 = peg$FAILED; + + { + peg$fail(peg$c69); + } + } + + if (s5 !== peg$FAILED) { + s1 = peg$c99(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function peg$parseclass() { + var s0, s1, s2; + var key = peg$currPos * 30 + 29, + cached = peg$resultsCache[key]; + + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c100; + peg$currPos++; + } else { + s1 = peg$FAILED; + + { + peg$fail(peg$c101); + } + } + + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c102) { + s2 = input.substr(peg$currPos, 9); + peg$currPos += 9; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c103); + } + } + + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c104) { + s2 = input.substr(peg$currPos, 10); + peg$currPos += 10; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c105); + } + } + + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c106) { + s2 = input.substr(peg$currPos, 11); + peg$currPos += 11; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c107); + } + } + + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c108) { + s2 = input.substr(peg$currPos, 8); + peg$currPos += 8; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c109); + } + } + + if (s2 === peg$FAILED) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c110) { + s2 = input.substr(peg$currPos, 7); + peg$currPos += 7; + } else { + s2 = peg$FAILED; + + { + peg$fail(peg$c111); + } + } + } + } + } + } + + if (s2 !== peg$FAILED) { + s1 = peg$c112(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$resultsCache[key] = { + nextPos: peg$currPos, + result: s0 + }; + return s0; + } + + function nth(n) { + return { + type: 'nth-child', + index: { + type: 'literal', + value: n + } + }; + } + + function nthLast(n) { + return { + type: 'nth-last-child', + index: { + type: 'literal', + value: n + } + }; + } + + function strUnescape(s) { + return s.replace(/\\(.)/g, function (match, ch) { + switch (ch) { + case 'b': + return '\b'; + + case 'f': + return '\f'; + + case 'n': + return '\n'; + + case 'r': + return '\r'; + + case 't': + return '\t'; + + case 'v': + return '\v'; + + default: + return ch; + } + }); + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; + }); + }); + + function _objectEntries(obj) { + var entries = []; + var keys = Object.keys(obj); + + for (var k = 0; k < keys.length; k++) entries.push([keys[k], obj[keys[k]]]); + + return entries; + } + /** + * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side + */ + + var LEFT_SIDE = 'LEFT_SIDE'; + var RIGHT_SIDE = 'RIGHT_SIDE'; + /** + * @external AST + * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html + */ + + /** + * One of the rules of `grammar.pegjs` + * @typedef {PlainObject} SelectorAST + * @see grammar.pegjs + */ + + /** + * The `sequence` production of `grammar.pegjs` + * @typedef {PlainObject} SelectorSequenceAST + */ + + /** + * Get the value of a property which may be multiple levels down + * in the object. + * @param {?PlainObject} obj + * @param {string} key + * @returns {undefined|boolean|string|number|external:AST} + */ + + function getPath(obj, key) { + var keys = key.split('.'); + + var _iterator = _createForOfIteratorHelper(keys), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var _key = _step.value; + + if (obj == null) { + return obj; + } + + obj = obj[_key]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + return obj; + } + /** + * Determine whether `node` can be reached by following `path`, + * starting at `ancestor`. + * @param {?external:AST} node + * @param {?external:AST} ancestor + * @param {string[]} path + * @returns {boolean} + */ + + + function inPath(node, ancestor, path) { + if (path.length === 0) { + return node === ancestor; + } + + if (ancestor == null) { + return false; + } + + var field = ancestor[path[0]]; + var remainingPath = path.slice(1); + + if (Array.isArray(field)) { + var _iterator2 = _createForOfIteratorHelper(field), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var component = _step2.value; + + if (inPath(node, component, remainingPath)) { + return true; + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + + return false; + } else { + return inPath(node, field, remainingPath); + } + } + /** + * @callback TraverseOptionFallback + * @param {external:AST} node The given node. + * @returns {string[]} An array of visitor keys for the given node. + */ + + /** + * @typedef {object} ESQueryOptions + * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node. + * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes. + */ + + /** + * Given a `node` and its ancestors, determine if `node` is matched + * by `selector`. + * @param {?external:AST} node + * @param {?SelectorAST} selector + * @param {external:AST[]} [ancestry=[]] + * @param {ESQueryOptions} [options] + * @throws {Error} Unknowns (operator, class name, selector type, or + * selector value type) + * @returns {boolean} + */ + + + function matches(node, selector, ancestry, options) { + if (!selector) { + return true; + } + + if (!node) { + return false; + } + + if (!ancestry) { + ancestry = []; + } + + switch (selector.type) { + case 'wildcard': + return true; + + case 'identifier': + return selector.value.toLowerCase() === node.type.toLowerCase(); + + case 'field': + { + var path = selector.name.split('.'); + var ancestor = ancestry[path.length - 1]; + return inPath(node, ancestor, path); + } + + case 'matches': + var _iterator3 = _createForOfIteratorHelper(selector.selectors), + _step3; + + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var sel = _step3.value; + + if (matches(node, sel, ancestry, options)) { + return true; + } + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + + return false; + + case 'compound': + var _iterator4 = _createForOfIteratorHelper(selector.selectors), + _step4; + + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var _sel = _step4.value; + + if (!matches(node, _sel, ancestry, options)) { + return false; + } + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + + return true; + + case 'not': + var _iterator5 = _createForOfIteratorHelper(selector.selectors), + _step5; + + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var _sel2 = _step5.value; + + if (matches(node, _sel2, ancestry, options)) { + return false; + } + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); + } + + return true; + + case 'has': + { + var _ret = function () { + var collector = []; + + var _iterator6 = _createForOfIteratorHelper(selector.selectors), + _step6; + + try { + var _loop = function _loop() { + var sel = _step6.value; + var a = []; + estraverse.traverse(node, { + enter: function enter(node, parent) { + if (parent != null) { + a.unshift(parent); + } + + if (matches(node, sel, a, options)) { + collector.push(node); + } + }, + leave: function leave() { + a.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + }; + + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + _loop(); + } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); + } + + return { + v: collector.length !== 0 + }; + }(); + + if (_typeof(_ret) === "object") return _ret.v; + } + + case 'child': + if (matches(node, selector.right, ancestry, options)) { + return matches(ancestry[0], selector.left, ancestry.slice(1), options); + } + + return false; + + case 'descendant': + if (matches(node, selector.right, ancestry, options)) { + for (var i = 0, l = ancestry.length; i < l; ++i) { + if (matches(ancestry[i], selector.left, ancestry.slice(i + 1), options)) { + return true; + } + } + } + + return false; + + case 'attribute': + { + var p = getPath(node, selector.name); + + switch (selector.operator) { + case void 0: + return p != null; + + case '=': + switch (selector.value.type) { + case 'regexp': + return typeof p === 'string' && selector.value.value.test(p); + + case 'literal': + return "".concat(selector.value.value) === "".concat(p); + + case 'type': + return selector.value.value === _typeof(p); + } + + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + + case '!=': + switch (selector.value.type) { + case 'regexp': + return !selector.value.value.test(p); + + case 'literal': + return "".concat(selector.value.value) !== "".concat(p); + + case 'type': + return selector.value.value !== _typeof(p); + } + + throw new Error("Unknown selector value type: ".concat(selector.value.type)); + + case '<=': + return p <= selector.value.value; + + case '<': + return p < selector.value.value; + + case '>': + return p > selector.value.value; + + case '>=': + return p >= selector.value.value; + } + + throw new Error("Unknown operator: ".concat(selector.operator)); + } + + case 'sibling': + return matches(node, selector.right, ancestry, options) && sibling(node, selector.left, ancestry, LEFT_SIDE, options) || selector.left.subject && matches(node, selector.left, ancestry, options) && sibling(node, selector.right, ancestry, RIGHT_SIDE, options); + + case 'adjacent': + return matches(node, selector.right, ancestry, options) && adjacent(node, selector.left, ancestry, LEFT_SIDE, options) || selector.right.subject && matches(node, selector.left, ancestry, options) && adjacent(node, selector.right, ancestry, RIGHT_SIDE, options); + + case 'nth-child': + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function () { + return selector.index.value - 1; + }, options); + + case 'nth-last-child': + return matches(node, selector.right, ancestry, options) && nthChild(node, ancestry, function (length) { + return length - selector.index.value; + }, options); + + case 'class': + switch (selector.name.toLowerCase()) { + case 'statement': + if (node.type.slice(-9) === 'Statement') return true; + // fallthrough: interface Declaration <: Statement { } + + case 'declaration': + return node.type.slice(-11) === 'Declaration'; + + case 'pattern': + if (node.type.slice(-7) === 'Pattern') return true; + // fallthrough: interface Expression <: Node, Pattern { } + + case 'expression': + return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty'; + + case 'function': + return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'; + } + + throw new Error("Unknown class name: ".concat(selector.name)); + } + + throw new Error("Unknown selector type: ".concat(selector.type)); + } + /** + * Get visitor keys of a given node. + * @param {external:AST} node The AST node to get keys. + * @param {ESQueryOptions|undefined} options + * @returns {string[]} Visitor keys of the node. + */ + + + function getVisitorKeys(node, options) { + var nodeType = node.type; + + if (options && options.visitorKeys && options.visitorKeys[nodeType]) { + return options.visitorKeys[nodeType]; + } + + if (estraverse.VisitorKeys[nodeType]) { + return estraverse.VisitorKeys[nodeType]; + } + + if (options && typeof options.fallback === 'function') { + return options.fallback(node); + } // 'iteration' fallback + + + return Object.keys(node).filter(function (key) { + return key !== 'type'; + }); + } + /** + * Check whether the given value is an ASTNode or not. + * @param {any} node The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ + + + function isNode(node) { + return node !== null && _typeof(node) === 'object' && typeof node.type === 'string'; + } + /** + * Determines if the given node has a sibling that matches the + * given selector. + * @param {external:AST} node + * @param {SelectorSequenceAST} selector + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + + + function sibling(node, selector, ancestry, side, options) { + var _ancestry = _slicedToArray(ancestry, 1), + parent = _ancestry[0]; + + if (!parent) { + return false; + } + + var keys = getVisitorKeys(parent, options); + + var _iterator7 = _createForOfIteratorHelper(keys), + _step7; + + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var key = _step7.value; + var listProp = parent[key]; + + if (Array.isArray(listProp)) { + var startIndex = listProp.indexOf(node); + + if (startIndex < 0) { + continue; + } + + var lowerBound = void 0, + upperBound = void 0; + + if (side === LEFT_SIDE) { + lowerBound = 0; + upperBound = startIndex; + } else { + lowerBound = startIndex + 1; + upperBound = listProp.length; + } + + for (var k = lowerBound; k < upperBound; ++k) { + if (isNode(listProp[k]) && matches(listProp[k], selector, ancestry, options)) { + return true; + } + } + } + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + + return false; + } + /** + * Determines if the given node has an adjacent sibling that matches + * the given selector. + * @param {external:AST} node + * @param {SelectorSequenceAST} selector + * @param {external:AST[]} ancestry + * @param {Side} side + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + + + function adjacent(node, selector, ancestry, side, options) { + var _ancestry2 = _slicedToArray(ancestry, 1), + parent = _ancestry2[0]; + + if (!parent) { + return false; + } + + var keys = getVisitorKeys(parent, options); + + var _iterator8 = _createForOfIteratorHelper(keys), + _step8; + + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var key = _step8.value; + var listProp = parent[key]; + + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + + if (idx < 0) { + continue; + } + + if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1]) && matches(listProp[idx - 1], selector, ancestry, options)) { + return true; + } + + if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1]) && matches(listProp[idx + 1], selector, ancestry, options)) { + return true; + } + } + } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); + } + + return false; + } + /** + * @callback IndexFunction + * @param {Integer} len Containing list's length + * @returns {Integer} + */ + + /** + * Determines if the given node is the nth child, determined by + * `idxFn`, which is given the containing list's length. + * @param {external:AST} node + * @param {external:AST[]} ancestry + * @param {IndexFunction} idxFn + * @param {ESQueryOptions|undefined} options + * @returns {boolean} + */ + + + function nthChild(node, ancestry, idxFn, options) { + var _ancestry3 = _slicedToArray(ancestry, 1), + parent = _ancestry3[0]; + + if (!parent) { + return false; + } + + var keys = getVisitorKeys(parent, options); + + var _iterator9 = _createForOfIteratorHelper(keys), + _step9; + + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var key = _step9.value; + var listProp = parent[key]; + + if (Array.isArray(listProp)) { + var idx = listProp.indexOf(node); + + if (idx >= 0 && idx === idxFn(listProp.length)) { + return true; + } + } + } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); + } + + return false; + } + /** + * For each selector node marked as a subject, find the portion of the + * selector that the subject must match. + * @param {SelectorAST} selector + * @param {SelectorAST} [ancestor] Defaults to `selector` + * @returns {SelectorAST[]} + */ + + + function subjects(selector, ancestor) { + if (selector == null || _typeof(selector) != 'object') { + return []; + } + + if (ancestor == null) { + ancestor = selector; + } + + var results = selector.subject ? [ancestor] : []; + + for (var _i = 0, _Object$entries = _objectEntries(selector); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), + p = _Object$entries$_i[0], + sel = _Object$entries$_i[1]; + + results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor))); + } + + return results; + } + /** + * @callback TraverseVisitor + * @param {?external:AST} node + * @param {?external:AST} parent + * @param {external:AST[]} ancestry + */ + + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {TraverseVisitor} visitor + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + + + function traverse(ast, selector, visitor, options) { + if (!selector) { + return; + } + + var ancestry = []; + var altSubjects = subjects(selector); + estraverse.traverse(ast, { + enter: function enter(node, parent) { + if (parent != null) { + ancestry.unshift(parent); + } + + if (matches(node, selector, ancestry, options)) { + if (altSubjects.length) { + for (var i = 0, l = altSubjects.length; i < l; ++i) { + if (matches(node, altSubjects[i], ancestry, options)) { + visitor(node, parent, ancestry); + } + + for (var k = 0, m = ancestry.length; k < m; ++k) { + var succeedingAncestry = ancestry.slice(k + 1); + + if (matches(ancestry[k], altSubjects[i], succeedingAncestry, options)) { + visitor(ancestry[k], parent, succeedingAncestry); + } + } + } + } else { + visitor(node, parent, ancestry); + } + } + }, + leave: function leave() { + ancestry.shift(); + }, + keys: options && options.visitorKeys, + fallback: options && options.fallback || 'iteration' + }); + } + /** + * From a JS AST and a selector AST, collect all JS AST nodes that + * match the selector. + * @param {external:AST} ast + * @param {?SelectorAST} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + + + function match(ast, selector, options) { + var results = []; + traverse(ast, selector, function (node) { + results.push(node); + }, options); + return results; + } + /** + * Parse a selector string and return its AST. + * @param {string} selector + * @returns {SelectorAST} + */ + + + function parse(selector) { + return parser.parse(selector); + } + /** + * Query the code AST using the selector string. + * @param {external:AST} ast + * @param {string} selector + * @param {ESQueryOptions} [options] + * @returns {external:AST[]} + */ + + + function query(ast, selector, options) { + return match(ast, parse(selector), options); + } + + query.parse = parse; + query.match = match; + query.traverse = traverse; + query.matches = matches; + query.query = query; + + return query; + +}))); diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.min.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.min.js new file mode 100644 index 00000000000000..70d7b762a975c0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.lite.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("estraverse")):"function"==typeof define&&define.amd?define(["estraverse"],e):(t=t||self).esquery=e(t.estraverse)}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var u,s=t[Symbol.iterator]();!(n=(u=s.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(a)throw o}}return r}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,s=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,u=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw u}}}}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var s=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){t.exports&&(t.exports=function(){function t(e,r,n,a){this.message=e,this.expected=r,this.found=n,this.location=a,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+a(t.text)+'"'},class:function(t){var e,r="";for(e=0;e0){for(e=1,n=1;e<~+.]/,h=dt([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),p=vt(">",!1),y=vt("~",!1),v=vt("+",!1),d=vt(",",!1),A=vt("!",!1),x=vt("*",!1),g=vt("#",!1),b=vt("[",!1),m=vt("]",!1),P=/^[>","<","!"],!1,!1),C=vt("=",!1),j=function(t){return(t||"")+"="},S=/^[><]/,E=dt([">","<"],!1,!1),I=vt(".",!1),k=function(t,e,r){return{type:"attribute",name:t,operator:e,value:r}},F=vt('"',!1),T=/^[^\\"]/,L=dt(["\\",'"'],!0,!1),O=vt("\\",!1),D={type:"any"},R=function(t,e){return t+e},K=function(t){return{type:"literal",value:(e=t.join(""),e.replace(/\\(.)/g,(function(t,e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return e}})))};var e},U=vt("'",!1),_=/^[^\\']/,M=dt(["\\","'"],!0,!1),q=/^[0-9]/,G=dt([["0","9"]],!1,!1),H=vt("type(",!1),V=/^[^ )]/,$=dt([" ",")"],!0,!1),z=vt(")",!1),B=/^[imsu]/,J=dt(["i","m","s","u"],!1,!1),N=vt("/",!1),Q=/^[^\/]/,W=dt(["/"],!0,!1),X=vt(":not(",!1),Y=vt(":matches(",!1),Z=vt(":has(",!1),tt=vt(":first-child",!1),et=vt(":last-child",!1),rt=vt(":nth-child(",!1),nt=vt(":nth-last-child(",!1),at=vt(":",!1),ot=vt("statement",!0),ut=vt("expression",!0),st=vt("declaration",!0),ct=vt("function",!0),it=vt("pattern",!0),lt=0,ft=[{line:1,column:1}],ht=0,pt=[],yt={};if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');i=c[r.startRule]}function vt(t,e){return{type:"literal",text:t,ignoreCase:e}}function dt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){var r,n=ft[t];if(n)return n;for(r=t-1;!ft[r];)r--;for(n={line:(n=ft[r]).line,column:n.column};rht&&(ht=lt,pt=[]),pt.push(t))}function bt(){var t,e,r,n,a=30*lt+0,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,(e=mt())!==s&&(r=Ct())!==s&&mt()!==s?t=e=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(lt=t,t=s),t===s&&(t=lt,(e=mt())!==s&&(e=void 0),t=e),yt[a]={nextPos:lt,result:t},t)}function mt(){var t,r,n=30*lt+1,a=yt[n];if(a)return lt=a.nextPos,a.result;for(t=[],32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l));r!==s;)t.push(r),32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l));return yt[n]={nextPos:lt,result:t},t}function Pt(){var t,r,n,a=30*lt+2,o=yt[a];if(o)return lt=o.nextPos,o.result;if(r=[],f.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(h)),n!==s)for(;n!==s;)r.push(n),f.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(h));else r=s;return r!==s&&(r=r.join("")),t=r,yt[a]={nextPos:lt,result:t},t}function wt(){var t,r,n,a=30*lt+3,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,(r=mt())!==s?(62===e.charCodeAt(lt)?(n=">",lt++):(n=s,gt(p)),n!==s&&mt()!==s?t=r="child":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=mt())!==s?(126===e.charCodeAt(lt)?(n="~",lt++):(n=s,gt(y)),n!==s&&mt()!==s?t=r="sibling":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=mt())!==s?(43===e.charCodeAt(lt)?(n="+",lt++):(n=s,gt(v)),n!==s&&mt()!==s?t=r="adjacent":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l)),r!==s&&(n=mt())!==s?t=r="descendant":(lt=t,t=s)))),yt[a]={nextPos:lt,result:t},t)}function Ct(){var t,r,n,a,o,u,c,i,l=30*lt+4,f=yt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,(r=jt())!==s){for(n=[],a=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(u=",",lt++):(u=s,gt(d)),u!==s&&(c=mt())!==s&&(i=jt())!==s?a=o=[o,u,c,i]:(lt=a,a=s)):(lt=a,a=s);a!==s;)n.push(a),a=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(u=",",lt++):(u=s,gt(d)),u!==s&&(c=mt())!==s&&(i=jt())!==s?a=o=[o,u,c,i]:(lt=a,a=s)):(lt=a,a=s);n!==s?t=r=[r].concat(n.map((function(t){return t[3]}))):(lt=t,t=s)}else lt=t,t=s;return yt[l]={nextPos:lt,result:t},t}function jt(){var t,e,r,n,a,o,u,c=30*lt+5,i=yt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,(e=St())!==s){for(r=[],n=lt,(a=wt())!==s&&(o=St())!==s?n=a=[a,o]:(lt=n,n=s);n!==s;)r.push(n),n=lt,(a=wt())!==s&&(o=St())!==s?n=a=[a,o]:(lt=n,n=s);r!==s?(u=e,t=e=r.reduce((function(t,e){return{type:e[0],left:t,right:e[1]}}),u)):(lt=t,t=s)}else lt=t,t=s;return yt[c]={nextPos:lt,result:t},t}function St(){var t,r,n,a,o,u,c,i=30*lt+6,l=yt[i];if(l)return lt=l.nextPos,l.result;if(t=lt,33===e.charCodeAt(lt)?(r="!",lt++):(r=s,gt(A)),r===s&&(r=null),r!==s){if(n=[],(a=Et())!==s)for(;a!==s;)n.push(a),a=Et();else n=s;n!==s?(o=r,c=1===(u=n).length?u[0]:{type:"compound",selectors:u},o&&(c.subject=!0),t=r=c):(lt=t,t=s)}else lt=t,t=s;return yt[i]={nextPos:lt,result:t},t}function Et(){var t,r=30*lt+7,n=yt[r];return n?(lt=n.nextPos,n.result):((t=function(){var t,r,n=30*lt+8,a=yt[n];return a?(lt=a.nextPos,a.result):(42===e.charCodeAt(lt)?(r="*",lt++):(r=s,gt(x)),r!==s&&(r={type:"wildcard",value:r}),t=r,yt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a=30*lt+9,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,35===e.charCodeAt(lt)?(r="#",lt++):(r=s,gt(g)),r===s&&(r=null),r!==s&&(n=Pt())!==s?t=r={type:"identifier",value:n}:(lt=t,t=s),yt[a]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a,o=30*lt+10,u=yt[o];return u?(lt=u.nextPos,u.result):(t=lt,91===e.charCodeAt(lt)?(r="[",lt++):(r=s,gt(b)),r!==s&&mt()!==s&&(n=function(){var t,r,n,a,o=30*lt+14,u=yt[o];return u?(lt=u.nextPos,u.result):(t=lt,(r=It())!==s&&mt()!==s&&(n=function(){var t,r,n,a=30*lt+12,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,33===e.charCodeAt(lt)?(r="!",lt++):(r=s,gt(A)),r===s&&(r=null),r!==s?(61===e.charCodeAt(lt)?(n="=",lt++):(n=s,gt(C)),n!==s?(r=j(r),t=r):(lt=t,t=s)):(lt=t,t=s),yt[a]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?((a=function(){var t,r,n,a,o,u=30*lt+18,c=yt[u];if(c)return lt=c.nextPos,c.result;if(t=lt,"type("===e.substr(lt,5)?(r="type(",lt+=5):(r=s,gt(H)),r!==s)if(mt()!==s){if(n=[],V.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt($)),a!==s)for(;a!==s;)n.push(a),V.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt($));else n=s;n!==s&&(a=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt(z)),o!==s?(r={type:"type",value:n.join("")},t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return yt[u]={nextPos:lt,result:t},t}())===s&&(a=function(){var t,r,n,a,o,u,c=30*lt+20,i=yt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,47===e.charCodeAt(lt)?(r="/",lt++):(r=s,gt(N)),r!==s){if(n=[],Q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(W)),a!==s)for(;a!==s;)n.push(a),Q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(W));else n=s;n!==s?(47===e.charCodeAt(lt)?(a="/",lt++):(a=s,gt(N)),a!==s?((o=function(){var t,r,n=30*lt+19,a=yt[n];if(a)return lt=a.nextPos,a.result;if(t=[],B.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(J)),r!==s)for(;r!==s;)t.push(r),B.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(J));else t=s;return yt[n]={nextPos:lt,result:t},t}())===s&&(o=null),o!==s?(u=o,r={type:"regexp",value:new RegExp(n.join(""),u?u.join(""):"")},t=r):(lt=t,t=s)):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;return yt[c]={nextPos:lt,result:t},t}()),a!==s?(r=k(r,n,a),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=It())!==s&&mt()!==s&&(n=function(){var t,r,n,a=30*lt+11,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,P.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(w)),r===s&&(r=null),r!==s?(61===e.charCodeAt(lt)?(n="=",lt++):(n=s,gt(C)),n!==s?(r=j(r),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(S.test(e.charAt(lt))?(t=e.charAt(lt),lt++):(t=s,gt(E))),yt[a]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?((a=function(){var t,r,n,a,o,u,c=30*lt+15,i=yt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,34===e.charCodeAt(lt)?(r='"',lt++):(r=s,gt(F)),r!==s){for(n=[],T.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(L)),a===s&&(a=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(u=e.charAt(lt),lt++):(u=s,gt(D)),u!==s?(o=R(o,u),a=o):(lt=a,a=s)):(lt=a,a=s));a!==s;)n.push(a),T.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(L)),a===s&&(a=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(u=e.charAt(lt),lt++):(u=s,gt(D)),u!==s?(o=R(o,u),a=o):(lt=a,a=s)):(lt=a,a=s));n!==s?(34===e.charCodeAt(lt)?(a='"',lt++):(a=s,gt(F)),a!==s?(r=K(n),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;if(t===s)if(t=lt,39===e.charCodeAt(lt)?(r="'",lt++):(r=s,gt(U)),r!==s){for(n=[],_.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(M)),a===s&&(a=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(u=e.charAt(lt),lt++):(u=s,gt(D)),u!==s?(o=R(o,u),a=o):(lt=a,a=s)):(lt=a,a=s));a!==s;)n.push(a),_.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(M)),a===s&&(a=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(u=e.charAt(lt),lt++):(u=s,gt(D)),u!==s?(o=R(o,u),a=o):(lt=a,a=s)):(lt=a,a=s));n!==s?(39===e.charCodeAt(lt)?(a="'",lt++):(a=s,gt(U)),a!==s?(r=K(n),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;return yt[c]={nextPos:lt,result:t},t}())===s&&(a=function(){var t,r,n,a,o,u,c,i=30*lt+16,l=yt[i];if(l)return lt=l.nextPos,l.result;for(t=lt,r=lt,n=[],q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G));a!==s;)n.push(a),q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G));if(n!==s?(46===e.charCodeAt(lt)?(a=".",lt++):(a=s,gt(I)),a!==s?r=n=[n,a]:(lt=r,r=s)):(lt=r,r=s),r===s&&(r=null),r!==s){if(n=[],q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G)),a!==s)for(;a!==s;)n.push(a),q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G));else n=s;n!==s?(u=n,c=(o=r)?[].concat.apply([],o).join(""):"",r={type:"literal",value:parseFloat(c+u.join(""))},t=r):(lt=t,t=s)}else lt=t,t=s;return yt[i]={nextPos:lt,result:t},t}())===s&&(a=function(){var t,e,r=30*lt+17,n=yt[r];return n?(lt=n.nextPos,n.result):((e=Pt())!==s&&(e={type:"literal",value:e}),t=e,yt[r]={nextPos:lt,result:t},t)}()),a!==s?(r=k(r,n,a),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=It())!==s&&(r={type:"attribute",name:r}),t=r)),yt[o]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?(93===e.charCodeAt(lt)?(a="]",lt++):(a=s,gt(m)),a!==s?t=r=n:(lt=t,t=s)):(lt=t,t=s),yt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a,o,u,c,i,l=30*lt+21,f=yt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,46===e.charCodeAt(lt)?(r=".",lt++):(r=s,gt(I)),r!==s)if((n=Pt())!==s){for(a=[],o=lt,46===e.charCodeAt(lt)?(u=".",lt++):(u=s,gt(I)),u!==s&&(c=Pt())!==s?o=u=[u,c]:(lt=o,o=s);o!==s;)a.push(o),o=lt,46===e.charCodeAt(lt)?(u=".",lt++):(u=s,gt(I)),u!==s&&(c=Pt())!==s?o=u=[u,c]:(lt=o,o=s);a!==s?(i=n,r={type:"field",name:a.reduce((function(t,e){return t+e[0]+e[1]}),i)},t=r):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return yt[l]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,a,o=30*lt+22,u=yt[o];return u?(lt=u.nextPos,u.result):(t=lt,":not("===e.substr(lt,5)?(r=":not(",lt+=5):(r=s,gt(X)),r!==s&&mt()!==s&&(n=Ct())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(a=")",lt++):(a=s,gt(z)),a!==s?t=r={type:"not",selectors:n}:(lt=t,t=s)):(lt=t,t=s),yt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a,o=30*lt+23,u=yt[o];return u?(lt=u.nextPos,u.result):(t=lt,":matches("===e.substr(lt,9)?(r=":matches(",lt+=9):(r=s,gt(Y)),r!==s&&mt()!==s&&(n=Ct())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(a=")",lt++):(a=s,gt(z)),a!==s?t=r={type:"matches",selectors:n}:(lt=t,t=s)):(lt=t,t=s),yt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a,o=30*lt+24,u=yt[o];return u?(lt=u.nextPos,u.result):(t=lt,":has("===e.substr(lt,5)?(r=":has(",lt+=5):(r=s,gt(Z)),r!==s&&mt()!==s&&(n=Ct())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(a=")",lt++):(a=s,gt(z)),a!==s?t=r={type:"has",selectors:n}:(lt=t,t=s)):(lt=t,t=s),yt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n=30*lt+25,a=yt[n];return a?(lt=a.nextPos,a.result):(":first-child"===e.substr(lt,12)?(r=":first-child",lt+=12):(r=s,gt(tt)),r!==s&&(r=kt(1)),t=r,yt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n=30*lt+26,a=yt[n];return a?(lt=a.nextPos,a.result):(":last-child"===e.substr(lt,11)?(r=":last-child",lt+=11):(r=s,gt(et)),r!==s&&(r=Ft(1)),t=r,yt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,a,o,u=30*lt+27,c=yt[u];if(c)return lt=c.nextPos,c.result;if(t=lt,":nth-child("===e.substr(lt,11)?(r=":nth-child(",lt+=11):(r=s,gt(rt)),r!==s)if(mt()!==s){if(n=[],q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G)),a!==s)for(;a!==s;)n.push(a),q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G));else n=s;n!==s&&(a=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt(z)),o!==s?(r=kt(parseInt(n.join(""),10)),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return yt[u]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,a,o,u=30*lt+28,c=yt[u];if(c)return lt=c.nextPos,c.result;if(t=lt,":nth-last-child("===e.substr(lt,16)?(r=":nth-last-child(",lt+=16):(r=s,gt(nt)),r!==s)if(mt()!==s){if(n=[],q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G)),a!==s)for(;a!==s;)n.push(a),q.test(e.charAt(lt))?(a=e.charAt(lt),lt++):(a=s,gt(G));else n=s;n!==s&&(a=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt(z)),o!==s?(r=Ft(parseInt(n.join(""),10)),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return yt[u]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,a=30*lt+29,o=yt[a];return o?(lt=o.nextPos,o.result):(t=lt,58===e.charCodeAt(lt)?(r=":",lt++):(r=s,gt(at)),r!==s?("statement"===e.substr(lt,9).toLowerCase()?(n=e.substr(lt,9),lt+=9):(n=s,gt(ot)),n===s&&("expression"===e.substr(lt,10).toLowerCase()?(n=e.substr(lt,10),lt+=10):(n=s,gt(ut)),n===s&&("declaration"===e.substr(lt,11).toLowerCase()?(n=e.substr(lt,11),lt+=11):(n=s,gt(st)),n===s&&("function"===e.substr(lt,8).toLowerCase()?(n=e.substr(lt,8),lt+=8):(n=s,gt(ct)),n===s&&("pattern"===e.substr(lt,7).toLowerCase()?(n=e.substr(lt,7),lt+=7):(n=s,gt(it)))))),n!==s?t=r={type:"class",name:n}:(lt=t,t=s)):(lt=t,t=s),yt[a]={nextPos:lt,result:t},t)}()),yt[r]={nextPos:lt,result:t},t)}function It(){var t,r,n,a,o,u,c,i,l=30*lt+13,f=yt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,(r=Pt())!==s){for(n=[],a=lt,46===e.charCodeAt(lt)?(o=".",lt++):(o=s,gt(I)),o!==s&&(u=Pt())!==s?a=o=[o,u]:(lt=a,a=s);a!==s;)n.push(a),a=lt,46===e.charCodeAt(lt)?(o=".",lt++):(o=s,gt(I)),o!==s&&(u=Pt())!==s?a=o=[o,u]:(lt=a,a=s);n!==s?(c=r,i=n,t=r=[].concat.apply([c],i).join("")):(lt=t,t=s)}else lt=t,t=s;return yt[l]={nextPos:lt,result:t},t}function kt(t){return{type:"nth-child",index:{type:"literal",value:t}}}function Ft(t){return{type:"nth-last-child",index:{type:"literal",value:t}}}if((n=i())!==s&<===e.length)return n;throw n!==s&<":return j>n.value.value;case">=":return j>=n.value.value}throw new Error("Unknown operator: ".concat(n.operator));case"sibling":return c(r,n.right,a,o)&&f(r,n.left,a,"LEFT_SIDE",o)||n.left.subject&&c(r,n.left,a,o)&&f(r,n.right,a,"RIGHT_SIDE",o);case"adjacent":return c(r,n.right,a,o)&&h(r,n.left,a,"LEFT_SIDE",o)||n.right.subject&&c(r,n.left,a,o)&&h(r,n.right,a,"RIGHT_SIDE",o);case"nth-child":return c(r,n.right,a,o)&&p(r,a,(function(){return n.index.value-1}),o);case"nth-last-child":return c(r,n.right,a,o)&&p(r,a,(function(t){return t-n.index.value}),o);case"class":switch(n.name.toLowerCase()){case"statement":if("Statement"===r.type.slice(-9))return!0;case"declaration":return"Declaration"===r.type.slice(-11);case"pattern":if("Pattern"===r.type.slice(-7))return!0;case"expression":return"Expression"===r.type.slice(-10)||"Literal"===r.type.slice(-7)||"Identifier"===r.type&&(0===a.length||"MetaProperty"!==a[0].type)||"MetaProperty"===r.type;case"function":return"FunctionDeclaration"===r.type||"FunctionExpression"===r.type||"ArrowFunctionExpression"===r.type}throw new Error("Unknown class name: ".concat(n.name))}throw new Error("Unknown selector type: ".concat(n.type))}function i(e,r){var n=e.type;return r&&r.visitorKeys&&r.visitorKeys[n]?r.visitorKeys[n]:t.VisitorKeys[n]?t.VisitorKeys[n]:r&&"function"==typeof r.fallback?r.fallback(e):Object.keys(e).filter((function(t){return"type"!==t}))}function l(t){return null!==t&&"object"===e(t)&&"string"==typeof t.type}function f(t,e,n,a,o){var s=r(n,1)[0];if(!s)return!1;var f,h=u(i(s,o));try{for(h.s();!(f=h.n()).done;){var p=s[f.value];if(Array.isArray(p)){var y=p.indexOf(t);if(y<0)continue;var v=void 0,d=void 0;"LEFT_SIDE"===a?(v=0,d=y):(v=y+1,d=p.length);for(var A=v;A0&&l(p[y-1])&&c(p[y-1],e,n,o))return!0;if("RIGHT_SIDE"===a&&y=0&&f===n(l.length))return!0}}}catch(t){c.e(t)}finally{c.f()}return!1}function y(t,a){if(null==t||"object"!=e(t))return[];null==a&&(a=t);for(var o=t.subject?[a]:[],u=0,s=function(t){for(var e=[],r=Object.keys(t),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--r)if(e[r].node===t)return!0;return!1}function y(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:s={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(g=i[f=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]&&!d(n,g[m])){if(h(l,x[y]))o=new c(g[m],[f,m],"Property",null);else{if(!p(g[m]))continue;o=new c(g[m],[f,m],null,null)}r.push(o)}}else if(p(g)){if(d(n,g))continue;r.push(new c(g,f,null,null))}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},f.prototype.replace=function(e,t){var r,n,o,l,f,d,y,m,x,g,v,A,b;function E(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key=0;)if(g=o[b=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,x[y]))d=new c(g[m],[b,m],"Property",new u(g,m));else{if(!p(g[m]))continue;d=new c(g[m],[b,m],null,new u(g,m))}r.push(d)}}else p(g)&&r.push(new c(g,b,null,new u(o,b)))}}else if(d=n.pop(),void 0!==(f=this.__execute(t.leave,d))&&f!==a&&f!==s&&f!==i&&d.ref.replace(f),this.__state!==i&&f!==i||E(d),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=y,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,s,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(s=0,a=t.length;se.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,y(e,{leave:function(e){for(var t;ie.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),i=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,p=xe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),y=me("~",!1),m=me("+",!1),x=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),b=me("[",!1),E=me("]",!1),S=/^[>","<","!"],!1,!1),w=me("=",!1),C=function(e){return(e||"")+"="},P=/^[><]/,k=xe([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=me('"',!1),F=/^[^\\"]/,T=xe(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=xe(["\\","'"],!0,!1),q=/^[0-9]/,N=xe([["0","9"]],!1,!1),W=me("type(",!1),G=/^[^ )]/,z=xe([" ",")"],!0,!1),K=me(")",!1),H=/^[imsu]/,Y=xe(["i","m","s","u"],!1,!1),$=me("/",!1),J=/^[^\/]/,Q=xe(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),oe=me(":nth-last-child(",!1),ae=me(":",!1),se=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),fe=0,pe=[{line:1,column:1}],he=0,de=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function xe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=pe[e];if(n)return n;for(r=e-1;!pe[r];)r--;for(n={line:(n=pe[r]).line,column:n.column};rhe&&(he=fe,de=[]),de.push(e))}function be(){var e,t,r,n,o=30*fe+0,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,(t=Ee())!==i&&(r=we())!==i&&Ee()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(fe=e,e=i),e===i&&(e=fe,(t=Ee())!==i&&(t=void 0),e=t),ye[o]={nextPos:fe,result:e},e)}function Ee(){var e,r,n=30*fe+1,o=ye[n];if(o)return fe=o.nextPos,o.result;for(e=[],32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c));return ye[n]={nextPos:fe,result:e},e}function Se(){var e,r,n,o=30*fe+2,a=ye[o];if(a)return fe=a.nextPos,a.result;if(r=[],f.test(t.charAt(fe))?(n=t.charAt(fe),fe++):(n=i,Ae(p)),n!==i)for(;n!==i;)r.push(n),f.test(t.charAt(fe))?(n=t.charAt(fe),fe++):(n=i,Ae(p));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:fe,result:e},e}function _e(){var e,r,n,o=30*fe+3,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,(r=Ee())!==i?(62===t.charCodeAt(fe)?(n=">",fe++):(n=i,Ae(d)),n!==i&&Ee()!==i?e=r="child":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=Ee())!==i?(126===t.charCodeAt(fe)?(n="~",fe++):(n=i,Ae(y)),n!==i&&Ee()!==i?e=r="sibling":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=Ee())!==i?(43===t.charCodeAt(fe)?(n="+",fe++):(n=i,Ae(m)),n!==i&&Ee()!==i?e=r="adjacent":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c)),r!==i&&(n=Ee())!==i?e=r="descendant":(fe=e,e=i)))),ye[o]={nextPos:fe,result:e},e)}function we(){var e,r,n,o,a,s,l,u,c=30*fe+4,f=ye[c];if(f)return fe=f.nextPos,f.result;if(e=fe,(r=Ce())!==i){for(n=[],o=fe,(a=Ee())!==i?(44===t.charCodeAt(fe)?(s=",",fe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(fe=o,o=i)):(fe=o,o=i);o!==i;)n.push(o),o=fe,(a=Ee())!==i?(44===t.charCodeAt(fe)?(s=",",fe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(fe=o,o=i)):(fe=o,o=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(fe=e,e=i)}else fe=e,e=i;return ye[c]={nextPos:fe,result:e},e}function Ce(){var e,t,r,n,o,a,s,l=30*fe+5,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,(t=Pe())!==i){for(r=[],n=fe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(fe=n,n=i);n!==i;)r.push(n),n=fe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(fe=n,n=i);r!==i?(s=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),s)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}function Pe(){var e,r,n,o,a,s,l,u=30*fe+6,c=ye[u];if(c)return fe=c.nextPos,c.result;if(e=fe,33===t.charCodeAt(fe)?(r="!",fe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(o=ke())!==i)for(;o!==i;)n.push(o),o=ke();else n=i;n!==i?(a=r,l=1===(s=n).length?s[0]:{type:"compound",selectors:s},a&&(l.subject=!0),e=r=l):(fe=e,e=i)}else fe=e,e=i;return ye[u]={nextPos:fe,result:e},e}function ke(){var e,r=30*fe+7,n=ye[r];return n?(fe=n.nextPos,n.result):((e=function(){var e,r,n=30*fe+8,o=ye[n];return o?(fe=o.nextPos,o.result):(42===t.charCodeAt(fe)?(r="*",fe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o=30*fe+9,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,35===t.charCodeAt(fe)?(r="#",fe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=Se())!==i?e=r={type:"identifier",value:n}:(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+10,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,91===t.charCodeAt(fe)?(r="[",fe++):(r=i,Ae(b)),r!==i&&Ee()!==i&&(n=function(){var e,r,n,o,a=30*fe+14,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*fe+12,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,33===t.charCodeAt(fe)?(r="!",fe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(fe)?(n="=",fe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(fe=e,e=i)):(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s=30*fe+18,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,"type("===t.substr(fe,5)?(r="type(",fe+=5):(r=i,Ae(W)),r!==i)if(Ee()!==i){if(n=[],G.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(z)),o!==i)for(;o!==i;)n.push(o),G.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(z));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r={type:"type",value:n.join("")},e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l=30*fe+20,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,47===t.charCodeAt(fe)?(r="/",fe++):(r=i,Ae($)),r!==i){if(n=[],J.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(Q)),o!==i)for(;o!==i;)n.push(o),J.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(fe)?(o="/",fe++):(o=i,Ae($)),o!==i?((a=function(){var e,r,n=30*fe+19,o=ye[n];if(o)return fe=o.nextPos,o.result;if(e=[],H.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(Y)),r!==i)for(;r!==i;)e.push(r),H.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(Y));else e=i;return ye[n]={nextPos:fe,result:e},e}())===i&&(a=null),a!==i?(s=a,r={type:"regexp",value:new RegExp(n.join(""),s?s.join(""):"")},e=r):(fe=e,e=i)):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}()),o!==i?(r=I(r,n,o),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*fe+11,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,S.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(_)),r===i&&(r=null),r!==i?(61===t.charCodeAt(fe)?(n="=",fe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(P.test(t.charAt(fe))?(e=t.charAt(fe),fe++):(e=i,Ae(k))),ye[o]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s,l=30*fe+15,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,34===t.charCodeAt(fe)?(r='"',fe++):(r=i,Ae(j)),r!==i){for(n=[],F.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(T)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));o!==i;)n.push(o),F.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(T)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));n!==i?(34===t.charCodeAt(fe)?(o='"',fe++):(o=i,Ae(j)),o!==i?(r=B(n),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;if(e===i)if(e=fe,39===t.charCodeAt(fe)?(r="'",fe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(V)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));o!==i;)n.push(o),U.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(V)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));n!==i?(39===t.charCodeAt(fe)?(o="'",fe++):(o=i,Ae(M)),o!==i?(r=B(n),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l,u=30*fe+16,c=ye[u];if(c)return fe=c.nextPos,c.result;for(e=fe,r=fe,n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));if(n!==i?(46===t.charCodeAt(fe)?(o=".",fe++):(o=i,Ae(D)),o!==i?r=n=[n,o]:(fe=r,r=i)):(fe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i?(s=n,l=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(l+s.join(""))},e=r):(fe=e,e=i)}else fe=e,e=i;return ye[u]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,t,r=30*fe+17,n=ye[r];return n?(fe=n.nextPos,n.result):((t=Se())!==i&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:fe,result:e},e)}()),o!==i?(r=I(r,n,o),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?(93===t.charCodeAt(fe)?(o="]",fe++):(o=i,Ae(E)),o!==i?e=r=n:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s,l,u,c=30*fe+21,f=ye[c];if(f)return fe=f.nextPos,f.result;if(e=fe,46===t.charCodeAt(fe)?(r=".",fe++):(r=i,Ae(D)),r!==i)if((n=Se())!==i){for(o=[],a=fe,46===t.charCodeAt(fe)?(s=".",fe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(fe=a,a=i);a!==i;)o.push(a),a=fe,46===t.charCodeAt(fe)?(s=".",fe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(fe=a,a=i);o!==i?(u=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[c]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o,a=30*fe+22,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":not("===t.substr(fe,5)?(r=":not(",fe+=5):(r=i,Ae(X)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"not",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+23,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":matches("===t.substr(fe,9)?(r=":matches(",fe+=9):(r=i,Ae(Z)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"matches",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+24,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":has("===t.substr(fe,5)?(r=":has(",fe+=5):(r=i,Ae(ee)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"has",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n=30*fe+25,o=ye[n];return o?(fe=o.nextPos,o.result):(":first-child"===t.substr(fe,12)?(r=":first-child",fe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n=30*fe+26,o=ye[n];return o?(fe=o.nextPos,o.result):(":last-child"===t.substr(fe,11)?(r=":last-child",fe+=11):(r=i,Ae(re)),r!==i&&(r=je(1)),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s=30*fe+27,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,":nth-child("===t.substr(fe,11)?(r=":nth-child(",fe+=11):(r=i,Ae(ne)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o,a,s=30*fe+28,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,":nth-last-child("===t.substr(fe,16)?(r=":nth-last-child(",fe+=16):(r=i,Ae(oe)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r=je(parseInt(n.join(""),10)),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o=30*fe+29,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,58===t.charCodeAt(fe)?(r=":",fe++):(r=i,Ae(ae)),r!==i?("statement"===t.substr(fe,9).toLowerCase()?(n=t.substr(fe,9),fe+=9):(n=i,Ae(se)),n===i&&("expression"===t.substr(fe,10).toLowerCase()?(n=t.substr(fe,10),fe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(fe,11).toLowerCase()?(n=t.substr(fe,11),fe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(fe,8).toLowerCase()?(n=t.substr(fe,8),fe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(fe,7).toLowerCase()?(n=t.substr(fe,7),fe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(fe=e,e=i)):(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}()),ye[r]={nextPos:fe,result:e},e)}function De(){var e,r,n,o=30*fe+13,a=ye[o];if(a)return fe=a.nextPos,a.result;if(r=[],(n=Se())===i&&(46===t.charCodeAt(fe)?(n=".",fe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=Se())===i&&(46===t.charCodeAt(fe)?(n=".",fe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:fe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&fe===t.length)return n;throw n!==i&&fe":return A>r.value.value;case">=":return A>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return l(t,r.right,n)&&u(t,r.left,n,"LEFT_SIDE")||r.left.subject&&l(t,r.left,n)&&u(t,r.right,n,"RIGHT_SIDE");case"adjacent":return l(t,r.right,n)&&c(t,r.left,n,"LEFT_SIDE")||r.right.subject&&l(t,r.left,n)&&c(t,r.right,n,"RIGHT_SIDE");case"nth-child":return l(t,r.right,n)&&f(t,n,(function(){return r.index.value-1}));case"nth-last-child":return l(t,r.right,n)&&f(t,n,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function u(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u0&&l(f[p-1],r,n))return!0;if("RIGHT_SIDE"===o&&p=0&&c===n(u.length))return!0}}return!1}function p(n,o){if(null==n||"object"!=e(n))return[];null==o&&(o=n);for(var a=n.subject?[o]:[],s=0,i=function(e){for(var t=[],r=Object.keys(e),n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function i(e,t){return e(t={exports:{}},t.exports),t.exports}var s=i((function(e,t){!function e(t){var r,n,o,a,i,s;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(l,x[d]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},f.prototype.replace=function(e,t){var r,n,o,l,f,y,d,m,x,v,g,b,A;function E(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key=0;)if(v=o[A=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(l,x[d]))y=new c(v[m],[A,m],"Property",new u(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[A,m],null,new u(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,A,null,new u(o,A)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==a&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||E(y),this.__state===a||f===a)return b.root;return b.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;ie.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?n.Break:u[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;se.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),l=i((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;t<~+.]/,p=me([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=de(">",!1),y=de("~",!1),d=de("+",!1),m=de(",",!1),x=de("!",!1),v=de("*",!1),g=de("#",!1),b=de("[",!1),A=de("]",!1),E=/^[>","<","!"],!1,!1),_=de("=",!1),w=function(e){return(e||"")+"="},C=/^[><]/,P=me([">","<"],!1,!1),k=de(".",!1),D=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=de('"',!1),I=/^[^\\"]/,T=me(["\\",'"'],!0,!1),F=de("\\",!1),L={type:"any"},O=function(e,t){return e+t},R=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=de("'",!1),M=/^[^\\']/,U=me(["\\","'"],!0,!1),q=/^[0-9]/,V=me([["0","9"]],!1,!1),N=de("type(",!1),W=/^[^ )]/,K=me([" ",")"],!0,!1),G=de(")",!1),z=/^[imsu]/,H=me(["i","m","s","u"],!1,!1),Y=de("/",!1),$=/^[^\/]/,J=me(["/"],!0,!1),Q=de(":not(",!1),X=de(":matches(",!1),Z=de(":has(",!1),ee=de(":first-child",!1),te=de(":last-child",!1),re=de(":nth-child(",!1),ne=de(":nth-last-child(",!1),oe=de(":",!1),ae=de("statement",!0),ie=de("expression",!0),se=de("declaration",!0),le=de("function",!0),ue=de("pattern",!0),ce=0,fe=[{line:1,column:1}],pe=0,he=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function de(e,t){return{type:"literal",text:e,ignoreCase:t}}function me(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function xe(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};rpe&&(pe=ce,he=[]),he.push(e))}function be(){var e,t,r,n,o=30*ce+0,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,(t=Ae())!==s&&(r=_e())!==s&&Ae()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ce=e,e=s),e===s&&(e=ce,(t=Ae())!==s&&(t=void 0),e=t),ye[o]={nextPos:ce,result:e},e)}function Ae(){var e,r,n=30*ce+1,o=ye[n];if(o)return ce=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));r!==s;)e.push(r),32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));return ye[n]={nextPos:ce,result:e},e}function Ee(){var e,r,n,o=30*ce+2,a=ye[o];if(a)return ce=a.nextPos,a.result;if(r=[],f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p));else r=s;return r!==s&&(r=r.join("")),e=r,ye[o]={nextPos:ce,result:e},e}function Se(){var e,r,n,o=30*ce+3,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,(r=Ae())!==s?(62===t.charCodeAt(ce)?(n=">",ce++):(n=s,ge(h)),n!==s&&Ae()!==s?e=r="child":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ae())!==s?(126===t.charCodeAt(ce)?(n="~",ce++):(n=s,ge(y)),n!==s&&Ae()!==s?e=r="sibling":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ae())!==s?(43===t.charCodeAt(ce)?(n="+",ce++):(n=s,ge(d)),n!==s&&Ae()!==s?e=r="adjacent":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c)),r!==s&&(n=Ae())!==s?e=r="descendant":(ce=e,e=s)))),ye[o]={nextPos:ce,result:e},e)}function _e(){var e,r,n,o,a,i,l,u,c=30*ce+4,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=we())!==s){for(n=[],o=ce,(a=Ae())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(l=Ae())!==s&&(u=we())!==s?o=a=[a,i,l,u]:(ce=o,o=s)):(ce=o,o=s);o!==s;)n.push(o),o=ce,(a=Ae())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(l=Ae())!==s&&(u=we())!==s?o=a=[a,i,l,u]:(ce=o,o=s)):(ce=o,o=s);n!==s?e=r=[r].concat(n.map((function(e){return e[3]}))):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function we(){var e,t,r,n,o,a,i,l=30*ce+5,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,(t=Ce())!==s){for(r=[],n=ce,(o=Se())!==s&&(a=Ce())!==s?n=o=[o,a]:(ce=n,n=s);n!==s;)r.push(n),n=ce,(o=Se())!==s&&(a=Ce())!==s?n=o=[o,a]:(ce=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}function Ce(){var e,r,n,o,a,i,l,u=30*ce+6,c=ye[u];if(c)return ce=c.nextPos,c.result;if(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(x)),r===s&&(r=null),r!==s){if(n=[],(o=Pe())!==s)for(;o!==s;)n.push(o),o=Pe();else n=s;n!==s?(a=r,l=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(l.subject=!0),e=r=l):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}function Pe(){var e,r=30*ce+7,n=ye[r];return n?(ce=n.nextPos,n.result):((e=function(){var e,r,n=30*ce+8,o=ye[n];return o?(ce=o.nextPos,o.result):(42===t.charCodeAt(ce)?(r="*",ce++):(r=s,ge(v)),r!==s&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o=30*ce+9,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,35===t.charCodeAt(ce)?(r="#",ce++):(r=s,ge(g)),r===s&&(r=null),r!==s&&(n=Ee())!==s?e=r={type:"identifier",value:n}:(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=30*ce+10,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(b)),r!==s&&Ae()!==s&&(n=function(){var e,r,n,o,a=30*ce+14,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,(r=ke())!==s&&Ae()!==s&&(n=function(){var e,r,n,o=30*ce+12,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(x)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(_)),n!==s?(r=w(r),e=r):(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?((o=function(){var e,r,n,o,a,i=30*ce+18,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,"type("===t.substr(ce,5)?(r="type(",ce+=5):(r=s,ge(N)),r!==s)if(Ae()!==s){if(n=[],W.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K)),o!==s)for(;o!==s;)n.push(o),W.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K));else n=s;n!==s&&(o=Ae())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?(r={type:"type",value:n.join("")},e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,l=30*ce+20,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,47===t.charCodeAt(ce)?(r="/",ce++):(r=s,ge(Y)),r!==s){if(n=[],$.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(J)),o!==s)for(;o!==s;)n.push(o),$.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(J));else n=s;n!==s?(47===t.charCodeAt(ce)?(o="/",ce++):(o=s,ge(Y)),o!==s?((a=function(){var e,r,n=30*ce+19,o=ye[n];if(o)return ce=o.nextPos,o.result;if(e=[],z.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(H)),r!==s)for(;r!==s;)e.push(r),z.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(H));else e=s;return ye[n]={nextPos:ce,result:e},e}())===s&&(a=null),a!==s?(i=a,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ce=e,e=s)):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}()),o!==s?(r=D(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=ke())!==s&&Ae()!==s&&(n=function(){var e,r,n,o=30*ce+11,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,E.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(S)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(_)),n!==s?(r=w(r),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(C.test(t.charAt(ce))?(e=t.charAt(ce),ce++):(e=s,ge(P))),ye[o]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?((o=function(){var e,r,n,o,a,i,l=30*ce+15,u=ye[l];if(u)return ce=u.nextPos,u.result;if(e=ce,34===t.charCodeAt(ce)?(r='"',ce++):(r=s,ge(j)),r!==s){for(n=[],I.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(T)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(F)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(a=O(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),I.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(T)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(F)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(a=O(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(34===t.charCodeAt(ce)?(o='"',ce++):(o=s,ge(j)),o!==s?(r=R(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;if(e===s)if(e=ce,39===t.charCodeAt(ce)?(r="'",ce++):(r=s,ge(B)),r!==s){for(n=[],M.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(U)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(F)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(a=O(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),M.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(U)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(F)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(L)),i!==s?(a=O(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(39===t.charCodeAt(ce)?(o="'",ce++):(o=s,ge(B)),o!==s?(r=R(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,l,u=30*ce+16,c=ye[u];if(c)return ce=c.nextPos,c.result;for(e=ce,r=ce,n=[],q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V));o!==s;)n.push(o),q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V));if(n!==s?(46===t.charCodeAt(ce)?(o=".",ce++):(o=s,ge(k)),o!==s?r=n=[n,o]:(ce=r,r=s)):(ce=r,r=s),r===s&&(r=null),r!==s){if(n=[],q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V));else n=s;n!==s?(i=n,l=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(l+i.join(""))},e=r):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,t,r=30*ce+17,n=ye[r];return n?(ce=n.nextPos,n.result):((t=Ee())!==s&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:ce,result:e},e)}()),o!==s?(r=D(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=ke())!==s&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:ce,result:e},e)}())!==s&&Ae()!==s?(93===t.charCodeAt(ce)?(o="]",ce++):(o=s,ge(A)),o!==s?e=r=n:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i,l,u,c=30*ce+21,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,46===t.charCodeAt(ce)?(r=".",ce++):(r=s,ge(k)),r!==s)if((n=Ee())!==s){for(o=[],a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(k)),i!==s&&(l=Ee())!==s?a=i=[i,l]:(ce=a,a=s);a!==s;)o.push(a),a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(k)),i!==s&&(l=Ee())!==s?a=i=[i,l]:(ce=a,a=s);o!==s?(u=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a=30*ce+22,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":not("===t.substr(ce,5)?(r=":not(",ce+=5):(r=s,ge(Q)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?e=r={type:"not",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=30*ce+23,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":matches("===t.substr(ce,9)?(r=":matches(",ce+=9):(r=s,ge(X)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?e=r={type:"matches",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=30*ce+24,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":has("===t.substr(ce,5)?(r=":has(",ce+=5):(r=s,ge(Z)),r!==s&&Ae()!==s&&(n=_e())!==s&&Ae()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(G)),o!==s?e=r={type:"has",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=30*ce+25,o=ye[n];return o?(ce=o.nextPos,o.result):(":first-child"===t.substr(ce,12)?(r=":first-child",ce+=12):(r=s,ge(ee)),r!==s&&(r=De(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=30*ce+26,o=ye[n];return o?(ce=o.nextPos,o.result):(":last-child"===t.substr(ce,11)?(r=":last-child",ce+=11):(r=s,ge(te)),r!==s&&(r=je(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i=30*ce+27,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,":nth-child("===t.substr(ce,11)?(r=":nth-child(",ce+=11):(r=s,ge(re)),r!==s)if(Ae()!==s){if(n=[],q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V));else n=s;n!==s&&(o=Ae())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?(r=De(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a,i=30*ce+28,l=ye[i];if(l)return ce=l.nextPos,l.result;if(e=ce,":nth-last-child("===t.substr(ce,16)?(r=":nth-last-child(",ce+=16):(r=s,ge(ne)),r!==s)if(Ae()!==s){if(n=[],q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(V));else n=s;n!==s&&(o=Ae())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(G)),a!==s?(r=je(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o=30*ce+29,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,58===t.charCodeAt(ce)?(r=":",ce++):(r=s,ge(oe)),r!==s?("statement"===t.substr(ce,9).toLowerCase()?(n=t.substr(ce,9),ce+=9):(n=s,ge(ae)),n===s&&("expression"===t.substr(ce,10).toLowerCase()?(n=t.substr(ce,10),ce+=10):(n=s,ge(ie)),n===s&&("declaration"===t.substr(ce,11).toLowerCase()?(n=t.substr(ce,11),ce+=11):(n=s,ge(se)),n===s&&("function"===t.substr(ce,8).toLowerCase()?(n=t.substr(ce,8),ce+=8):(n=s,ge(le)),n===s&&("pattern"===t.substr(ce,7).toLowerCase()?(n=t.substr(ce,7),ce+=7):(n=s,ge(ue)))))),n!==s?e=r={type:"class",name:n}:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}()),ye[r]={nextPos:ce,result:e},e)}function ke(){var e,r,n,o,a,i,l,u,c=30*ce+13,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Ee())!==s){for(n=[],o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(k)),a!==s&&(i=Ee())!==s?o=a=[a,i]:(ce=o,o=s);o!==s;)n.push(o),o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(k)),a!==s&&(i=Ee())!==s?o=a=[a,i]:(ce=o,o=s);n!==s?(l=r,u=n,e=r=[].concat.apply([l],u).join("")):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function De(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==s&&ce===t.length)return n;throw n!==s&&ce":return w>r.value.value;case">=":return w>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return u(t,r.right,n,o)&&p(t,r.left,n,"LEFT_SIDE",o)||r.left.subject&&u(t,r.left,n,o)&&p(t,r.right,n,"RIGHT_SIDE",o);case"adjacent":return u(t,r.right,n,o)&&h(t,r.left,n,"LEFT_SIDE",o)||r.right.subject&&u(t,r.left,n,o)&&h(t,r.right,n,"RIGHT_SIDE",o);case"nth-child":return u(t,r.right,n,o)&&y(t,n,(function(){return r.index.value-1}),o);case"nth-last-child":return u(t,r.right,n,o)&&y(t,n,(function(e){return e-r.index.value}),o);case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function c(e,t){var r=e.type;return t&&t.visitorKeys&&t.visitorKeys[r]?t.visitorKeys[r]:s.VisitorKeys[r]?s.VisitorKeys[r]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return"type"!==e}))}function f(t){return null!==t&&"object"===e(t)&&"string"==typeof t.type}function p(e,r,n,o,i){var s=t(n,1)[0];if(!s)return!1;var l,p=a(c(s,i));try{for(p.s();!(l=p.n()).done;){var h=s[l.value];if(Array.isArray(h)){var y=h.indexOf(e);if(y<0)continue;var d=void 0,m=void 0;"LEFT_SIDE"===o?(d=0,m=y):(d=y+1,m=h.length);for(var x=d;x0&&f(h[y-1])&&u(h[y-1],r,n,i))return!0;if("RIGHT_SIDE"===o&&y=0&&f===n(u.length))return!0}}}catch(e){l.e(e)}finally{l.f()}return!1}function d(n,o){if(null==n||"object"!=e(n))return[];null==o&&(o=n);for(var a=n.subject?[o]:[],i=0,s=function(e){for(var t=[],r=Object.keys(e),n=0;n=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -18,28 +31,10 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", - "main": "estraverse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "estraverse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" - }, "scripts": { - "lint": "jshint estraverse.js", "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", "unit-test": "mocha --compilers js:babel-register" - }, - "version": "5.2.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/esquery/package.json b/tools/node_modules/eslint/node_modules/esquery/package.json index eac205c94b42df..3d818750d38a6d 100644 --- a/tools/node_modules/eslint/node_modules/esquery/package.json +++ b/tools/node_modules/eslint/node_modules/esquery/package.json @@ -1,39 +1,11 @@ { - "author": { - "name": "Joel Feenstra", - "email": "jrfeenst+esquery@gmail.com" - }, - "bugs": { - "url": "https://github.com/estools/esquery/issues" - }, - "bundleDependencies": false, + "name": "esquery", + "version": "1.4.0", + "author": "Joel Feenstra ", "contributors": [], - "dependencies": { - "estraverse": "^5.1.0" - }, - "deprecated": false, "description": "A query library for ECMAScript AST using a CSS selector like query language.", - "devDependencies": { - "@babel/core": "^7.9.0", - "@babel/preset-env": "^7.9.5", - "@babel/register": "^7.9.0", - "@rollup/plugin-commonjs": "^11.1.0", - "@rollup/plugin-json": "^4.0.2", - "@rollup/plugin-node-resolve": "^7.1.3", - "babel-plugin-transform-es2017-object-entries": "0.0.5", - "chai": "^4.2.0", - "eslint": "^6.8.0", - "esprima": "~4.0.1", - "mocha": "^7.1.1", - "nyc": "^15.0.1", - "pegjs": "~0.10.0", - "rollup": "^1.32.1", - "rollup-plugin-babel": "^4.4.0", - "rollup-plugin-terser": "^5.3.0" - }, - "engines": { - "node": ">=0.10" - }, + "main": "dist/esquery.min.js", + "module": "dist/esquery.esm.min.js", "files": [ "dist/*.js", "dist/*.map", @@ -41,17 +13,6 @@ "license.txt", "README.md" ], - "homepage": "https://github.com/estools/esquery/", - "keywords": [ - "ast", - "ecmascript", - "javascript", - "query" - ], - "license": "BSD-3-Clause", - "main": "dist/esquery.min.js", - "module": "dist/esquery.esm.min.js", - "name": "esquery", "nyc": { "branches": 100, "lines": 100, @@ -67,19 +28,51 @@ "tests" ] }, - "repository": { - "type": "git", - "url": "git+https://github.com/estools/esquery.git" - }, "scripts": { - "build": "npm run build:parser && npm run build:browser", - "build:browser": "rollup -c", + "prepublishOnly": "npm run build && npm test", "build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"", - "lint": "eslint .", + "build:browser": "rollup -c", + "build": "npm run build:parser && npm run build:browser", "mocha": "mocha --require chai/register-assert --require @babel/register tests", - "prepublishOnly": "npm run build && npm test", "test": "nyc npm run mocha && npm run lint", - "test:ci": "npm run mocha" + "test:ci": "npm run mocha", + "lint": "eslint ." }, - "version": "1.3.1" -} \ No newline at end of file + "repository": { + "type": "git", + "url": "https://github.com/estools/esquery.git" + }, + "bugs": "https://github.com/estools/esquery/issues", + "homepage": "https://github.com/estools/esquery/", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "query" + ], + "devDependencies": { + "@babel/core": "^7.9.0", + "@babel/preset-env": "^7.9.5", + "@babel/register": "^7.9.0", + "@rollup/plugin-commonjs": "^11.1.0", + "@rollup/plugin-json": "^4.0.2", + "@rollup/plugin-node-resolve": "^7.1.3", + "babel-plugin-transform-es2017-object-entries": "0.0.5", + "chai": "^4.2.0", + "eslint": "^6.8.0", + "esprima": "~4.0.1", + "mocha": "^7.1.1", + "nyc": "^15.0.1", + "pegjs": "~0.10.0", + "rollup": "^1.32.1", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-terser": "^5.3.0" + }, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10" + }, + "dependencies": { + "estraverse": "^5.1.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/esquery/parser.js b/tools/node_modules/eslint/node_modules/esquery/parser.js index ef8bf10a44e4a3..36d590c58118e5 100644 --- a/tools/node_modules/eslint/node_modules/esquery/parser.js +++ b/tools/node_modules/eslint/node_modules/esquery/parser.js @@ -203,86 +203,89 @@ peg$c41 = peg$classExpectation([">", "<"], false, false), peg$c42 = ".", peg$c43 = peg$literalExpectation(".", false), - peg$c44 = function(name, op, value) { + peg$c44 = function(a, as) { + return [].concat.apply([a], as).join(''); + }, + peg$c45 = function(name, op, value) { return { type: 'attribute', name: name, operator: op, value: value }; }, - peg$c45 = function(name) { return { type: 'attribute', name: name }; }, - peg$c46 = "\"", - peg$c47 = peg$literalExpectation("\"", false), - peg$c48 = /^[^\\"]/, - peg$c49 = peg$classExpectation(["\\", "\""], true, false), - peg$c50 = "\\", - peg$c51 = peg$literalExpectation("\\", false), - peg$c52 = peg$anyExpectation(), - peg$c53 = function(a, b) { return a + b; }, - peg$c54 = function(d) { + peg$c46 = function(name) { return { type: 'attribute', name: name }; }, + peg$c47 = "\"", + peg$c48 = peg$literalExpectation("\"", false), + peg$c49 = /^[^\\"]/, + peg$c50 = peg$classExpectation(["\\", "\""], true, false), + peg$c51 = "\\", + peg$c52 = peg$literalExpectation("\\", false), + peg$c53 = peg$anyExpectation(), + peg$c54 = function(a, b) { return a + b; }, + peg$c55 = function(d) { return { type: 'literal', value: strUnescape(d.join('')) }; }, - peg$c55 = "'", - peg$c56 = peg$literalExpectation("'", false), - peg$c57 = /^[^\\']/, - peg$c58 = peg$classExpectation(["\\", "'"], true, false), - peg$c59 = /^[0-9]/, - peg$c60 = peg$classExpectation([["0", "9"]], false, false), - peg$c61 = function(a, b) { + peg$c56 = "'", + peg$c57 = peg$literalExpectation("'", false), + peg$c58 = /^[^\\']/, + peg$c59 = peg$classExpectation(["\\", "'"], true, false), + peg$c60 = /^[0-9]/, + peg$c61 = peg$classExpectation([["0", "9"]], false, false), + peg$c62 = function(a, b) { // Can use `a.flat().join('')` once supported const leadingDecimals = a ? [].concat.apply([], a).join('') : ''; return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) }; }, - peg$c62 = function(i) { return { type: 'literal', value: i }; }, - peg$c63 = "type(", - peg$c64 = peg$literalExpectation("type(", false), - peg$c65 = /^[^ )]/, - peg$c66 = peg$classExpectation([" ", ")"], true, false), - peg$c67 = ")", - peg$c68 = peg$literalExpectation(")", false), - peg$c69 = function(t) { return { type: 'type', value: t.join('') }; }, - peg$c70 = /^[imsu]/, - peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false), - peg$c72 = "/", - peg$c73 = peg$literalExpectation("/", false), - peg$c74 = /^[^\/]/, - peg$c75 = peg$classExpectation(["/"], true, false), - peg$c76 = function(d, flgs) { return { + peg$c63 = function(i) { return { type: 'literal', value: i }; }, + peg$c64 = "type(", + peg$c65 = peg$literalExpectation("type(", false), + peg$c66 = /^[^ )]/, + peg$c67 = peg$classExpectation([" ", ")"], true, false), + peg$c68 = ")", + peg$c69 = peg$literalExpectation(")", false), + peg$c70 = function(t) { return { type: 'type', value: t.join('') }; }, + peg$c71 = /^[imsu]/, + peg$c72 = peg$classExpectation(["i", "m", "s", "u"], false, false), + peg$c73 = "/", + peg$c74 = peg$literalExpectation("/", false), + peg$c75 = /^[^\/]/, + peg$c76 = peg$classExpectation(["/"], true, false), + peg$c77 = function(d, flgs) { return { type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') }; }, - peg$c77 = function(i, is) { + peg$c78 = function(i, is) { return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)}; }, - peg$c78 = ":not(", - peg$c79 = peg$literalExpectation(":not(", false), - peg$c80 = function(ss) { return { type: 'not', selectors: ss }; }, - peg$c81 = ":matches(", - peg$c82 = peg$literalExpectation(":matches(", false), - peg$c83 = function(ss) { return { type: 'matches', selectors: ss }; }, - peg$c84 = ":has(", - peg$c85 = peg$literalExpectation(":has(", false), - peg$c86 = function(ss) { return { type: 'has', selectors: ss }; }, - peg$c87 = ":first-child", - peg$c88 = peg$literalExpectation(":first-child", false), - peg$c89 = function() { return nth(1); }, - peg$c90 = ":last-child", - peg$c91 = peg$literalExpectation(":last-child", false), - peg$c92 = function() { return nthLast(1); }, - peg$c93 = ":nth-child(", - peg$c94 = peg$literalExpectation(":nth-child(", false), - peg$c95 = function(n) { return nth(parseInt(n.join(''), 10)); }, - peg$c96 = ":nth-last-child(", - peg$c97 = peg$literalExpectation(":nth-last-child(", false), - peg$c98 = function(n) { return nthLast(parseInt(n.join(''), 10)); }, - peg$c99 = ":", - peg$c100 = peg$literalExpectation(":", false), - peg$c101 = "statement", - peg$c102 = peg$literalExpectation("statement", true), - peg$c103 = "expression", - peg$c104 = peg$literalExpectation("expression", true), - peg$c105 = "declaration", - peg$c106 = peg$literalExpectation("declaration", true), - peg$c107 = "function", - peg$c108 = peg$literalExpectation("function", true), - peg$c109 = "pattern", - peg$c110 = peg$literalExpectation("pattern", true), - peg$c111 = function(c) { + peg$c79 = ":not(", + peg$c80 = peg$literalExpectation(":not(", false), + peg$c81 = function(ss) { return { type: 'not', selectors: ss }; }, + peg$c82 = ":matches(", + peg$c83 = peg$literalExpectation(":matches(", false), + peg$c84 = function(ss) { return { type: 'matches', selectors: ss }; }, + peg$c85 = ":has(", + peg$c86 = peg$literalExpectation(":has(", false), + peg$c87 = function(ss) { return { type: 'has', selectors: ss }; }, + peg$c88 = ":first-child", + peg$c89 = peg$literalExpectation(":first-child", false), + peg$c90 = function() { return nth(1); }, + peg$c91 = ":last-child", + peg$c92 = peg$literalExpectation(":last-child", false), + peg$c93 = function() { return nthLast(1); }, + peg$c94 = ":nth-child(", + peg$c95 = peg$literalExpectation(":nth-child(", false), + peg$c96 = function(n) { return nth(parseInt(n.join(''), 10)); }, + peg$c97 = ":nth-last-child(", + peg$c98 = peg$literalExpectation(":nth-last-child(", false), + peg$c99 = function(n) { return nthLast(parseInt(n.join(''), 10)); }, + peg$c100 = ":", + peg$c101 = peg$literalExpectation(":", false), + peg$c102 = "statement", + peg$c103 = peg$literalExpectation("statement", true), + peg$c104 = "expression", + peg$c105 = peg$literalExpectation("expression", true), + peg$c106 = "declaration", + peg$c107 = peg$literalExpectation("declaration", true), + peg$c108 = "function", + peg$c109 = peg$literalExpectation("function", true), + peg$c110 = "pattern", + peg$c111 = peg$literalExpectation("pattern", true), + peg$c112 = function(c) { return { type: 'class', name: c }; }, @@ -1205,7 +1208,7 @@ } function peg$parseattrName() { - var s0, s1, s2; + var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 30 + 13, cached = peg$resultsCache[key]; @@ -1217,39 +1220,66 @@ } s0 = peg$currPos; - s1 = []; - s2 = peg$parseidentifierName(); - if (s2 === peg$FAILED) { + s1 = peg$parseidentifierName(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; + s4 = peg$c42; peg$currPos++; } else { - s2 = peg$FAILED; + s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parseidentifierName(); - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c42; - peg$currPos++; + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c42; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseidentifierName(); + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + peg$currPos = s3; + s3 = peg$FAILED; } + } else { + peg$currPos = s3; + s3 = peg$FAILED; } } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c44(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c6(s1); + peg$currPos = s0; + s0 = peg$FAILED; } - s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; @@ -1283,7 +1313,7 @@ } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1324,7 +1354,7 @@ } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c44(s1, s3, s5); + s1 = peg$c45(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -1351,7 +1381,7 @@ s1 = peg$parseattrName(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c45(s1); + s1 = peg$c46(s1); } s0 = s1; } @@ -1376,29 +1406,29 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c46; + s1 = peg$c47; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } + if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1406,11 +1436,11 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -1423,21 +1453,21 @@ } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c48.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1445,11 +1475,11 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -1463,15 +1493,15 @@ } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c46; + s3 = peg$c47; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } + if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -1488,29 +1518,29 @@ if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { - s1 = peg$c55; + s1 = peg$c56; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c56); } + if (peg$silentFails === 0) { peg$fail(peg$c57); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c58); } + if (peg$silentFails === 0) { peg$fail(peg$c59); } } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1518,11 +1548,11 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -1535,21 +1565,21 @@ } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c57.test(input.charAt(peg$currPos))) { + if (peg$c58.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c58); } + if (peg$silentFails === 0) { peg$fail(peg$c59); } } if (s3 === peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s4 = peg$c50; + s4 = peg$c51; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1557,11 +1587,11 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c53); } } if (s5 !== peg$FAILED) { peg$savedPos = s3; - s4 = peg$c53(s4, s5); + s4 = peg$c54(s4, s5); s3 = s4; } else { peg$currPos = s3; @@ -1575,15 +1605,15 @@ } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { - s3 = peg$c55; + s3 = peg$c56; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c56); } + if (peg$silentFails === 0) { peg$fail(peg$c57); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c54(s2); + s1 = peg$c55(s2); s0 = s1; } else { peg$currPos = s0; @@ -1619,21 +1649,21 @@ s0 = peg$currPos; s1 = peg$currPos; s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } } if (s2 !== peg$FAILED) { @@ -1660,22 +1690,22 @@ } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } } } else { @@ -1683,7 +1713,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c61(s1, s2); + s1 = peg$c62(s1, s2); s0 = s1; } else { peg$currPos = s0; @@ -1715,7 +1745,7 @@ s1 = peg$parseidentifierName(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c62(s1); + s1 = peg$c63(s1); } s0 = s1; @@ -1737,33 +1767,33 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c63) { - s1 = peg$c63; + if (input.substr(peg$currPos, 5) === peg$c64) { + s1 = peg$c64; peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c64); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = []; - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c65.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } } } else { @@ -1773,15 +1803,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c69(s3); + s1 = peg$c70(s3); s0 = s1; } else { peg$currPos = s0; @@ -1822,22 +1852,22 @@ } s0 = []; - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); - if (peg$c70.test(input.charAt(peg$currPos))) { + if (peg$c71.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } } } else { @@ -1863,30 +1893,30 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c72; + s1 = peg$c73; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c75); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c74.test(input.charAt(peg$currPos))) { + if (peg$c75.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c75); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } } } else { @@ -1894,11 +1924,11 @@ } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s3 = peg$c72; + s3 = peg$c73; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } if (s3 !== peg$FAILED) { s4 = peg$parseflags(); @@ -1907,7 +1937,7 @@ } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c76(s2, s4); + s1 = peg$c77(s2, s4); s0 = s1; } else { peg$currPos = s0; @@ -2002,7 +2032,7 @@ } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c77(s2, s3); + s1 = peg$c78(s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -2035,12 +2065,12 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c78) { - s1 = peg$c78; + if (input.substr(peg$currPos, 5) === peg$c79) { + s1 = peg$c79; peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c79); } + if (peg$silentFails === 0) { peg$fail(peg$c80); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2050,15 +2080,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c80(s3); + s1 = peg$c81(s3); s0 = s1; } else { peg$currPos = s0; @@ -2099,12 +2129,12 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 9) === peg$c81) { - s1 = peg$c81; + if (input.substr(peg$currPos, 9) === peg$c82) { + s1 = peg$c82; peg$currPos += 9; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2114,15 +2144,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c83(s3); + s1 = peg$c84(s3); s0 = s1; } else { peg$currPos = s0; @@ -2163,12 +2193,12 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c84) { - s1 = peg$c84; + if (input.substr(peg$currPos, 5) === peg$c85) { + s1 = peg$c85; peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c85); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); @@ -2178,15 +2208,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c86(s3); + s1 = peg$c87(s3); s0 = s1; } else { peg$currPos = s0; @@ -2227,16 +2257,16 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 12) === peg$c87) { - s1 = peg$c87; + if (input.substr(peg$currPos, 12) === peg$c88) { + s1 = peg$c88; peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c88); } + if (peg$silentFails === 0) { peg$fail(peg$c89); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c89(); + s1 = peg$c90(); } s0 = s1; @@ -2258,16 +2288,16 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c90) { - s1 = peg$c90; + if (input.substr(peg$currPos, 11) === peg$c91) { + s1 = peg$c91; peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c91); } + if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c92(); + s1 = peg$c93(); } s0 = s1; @@ -2289,33 +2319,33 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 11) === peg$c93) { - s1 = peg$c93; + if (input.substr(peg$currPos, 11) === peg$c94) { + s1 = peg$c94; peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } } } else { @@ -2325,15 +2355,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c95(s3); + s1 = peg$c96(s3); s0 = s1; } else { peg$currPos = s0; @@ -2374,33 +2404,33 @@ } s0 = peg$currPos; - if (input.substr(peg$currPos, 16) === peg$c96) { - s1 = peg$c96; + if (input.substr(peg$currPos, 16) === peg$c97) { + s1 = peg$c97; peg$currPos += 16; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } + if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c59.test(input.charAt(peg$currPos))) { + if (peg$c60.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } } } else { @@ -2410,15 +2440,15 @@ s4 = peg$parse_(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c67; + s5 = peg$c68; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c68); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c98(s3); + s1 = peg$c99(s3); s0 = s1; } else { peg$currPos = s0; @@ -2460,51 +2490,51 @@ s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c99; + s1 = peg$c100; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c100); } + if (peg$silentFails === 0) { peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) { + if (input.substr(peg$currPos, 9).toLowerCase() === peg$c102) { s2 = input.substr(peg$currPos, 9); peg$currPos += 9; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c102); } + if (peg$silentFails === 0) { peg$fail(peg$c103); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) { + if (input.substr(peg$currPos, 10).toLowerCase() === peg$c104) { s2 = input.substr(peg$currPos, 10); peg$currPos += 10; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) { + if (input.substr(peg$currPos, 11).toLowerCase() === peg$c106) { s2 = input.substr(peg$currPos, 11); peg$currPos += 11; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } + if (peg$silentFails === 0) { peg$fail(peg$c107); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) { + if (input.substr(peg$currPos, 8).toLowerCase() === peg$c108) { s2 = input.substr(peg$currPos, 8); peg$currPos += 8; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) { + if (input.substr(peg$currPos, 7).toLowerCase() === peg$c110) { s2 = input.substr(peg$currPos, 7); peg$currPos += 7; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c110); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } } } @@ -2512,7 +2542,7 @@ } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c111(s2); + s1 = peg$c112(s2); s0 = s1; } else { peg$currPos = s0; diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json index 4d336a00e8b526..bc99e7c4a64674 100644 --- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json @@ -1,10 +1,23 @@ { - "bugs": { - "url": "https://github.com/estools/estraverse/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "estraverse", "description": "ECMAScript JS AST traversal functions", + "homepage": "https://github.com/estools/estraverse", + "main": "estraverse.js", + "version": "5.2.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -18,28 +31,10 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", - "main": "estraverse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "estraverse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" - }, "scripts": { - "lint": "jshint estraverse.js", "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", "unit-test": "mocha --compilers js:babel-register" - }, - "version": "5.2.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/esrecurse/package.json b/tools/node_modules/eslint/node_modules/esrecurse/package.json index 8e2661c63262b1..dec5b1bc1fd3ac 100755 --- a/tools/node_modules/eslint/node_modules/esrecurse/package.json +++ b/tools/node_modules/eslint/node_modules/esrecurse/package.json @@ -1,18 +1,26 @@ { - "babel": { - "presets": [ - "es2015" - ] + "name": "esrecurse", + "description": "ECMAScript AST recursive visitor", + "homepage": "https://github.com/estools/esrecurse", + "main": "esrecurse.js", + "version": "4.3.0", + "engines": { + "node": ">=4.0" }, - "bugs": { - "url": "https://github.com/estools/esrecurse/issues" + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "https://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/estools/esrecurse.git" }, - "bundleDependencies": false, "dependencies": { "estraverse": "^5.2.0" }, - "deprecated": false, - "description": "ECMAScript AST recursive visitor", "devDependencies": { "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", @@ -30,28 +38,15 @@ "jsdoc": "^3.3.0-alpha10", "minimist": "^1.1.0" }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/esrecurse", "license": "BSD-2-Clause", - "main": "esrecurse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "https://github.com/Constellation" - } - ], - "name": "esrecurse", - "repository": { - "type": "git", - "url": "git+https://github.com/estools/esrecurse.git" - }, "scripts": { - "lint": "gulp lint", "test": "gulp travis", - "unit-test": "gulp test" + "unit-test": "gulp test", + "lint": "gulp lint" }, - "version": "4.3.0" -} \ No newline at end of file + "babel": { + "presets": [ + "es2015" + ] + } +} diff --git a/tools/node_modules/eslint/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/estraverse/package.json index 8a9a242d0fd34a..1138238672309b 100644 --- a/tools/node_modules/eslint/node_modules/estraverse/package.json +++ b/tools/node_modules/eslint/node_modules/estraverse/package.json @@ -1,10 +1,23 @@ { - "bugs": { - "url": "https://github.com/estools/estraverse/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "estraverse", "description": "ECMAScript JS AST traversal functions", + "homepage": "https://github.com/estools/estraverse", + "main": "estraverse.js", + "version": "4.3.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, "devDependencies": { "babel-preset-env": "^1.6.1", "babel-register": "^6.3.13", @@ -18,28 +31,10 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, - "engines": { - "node": ">=4.0" - }, - "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", - "main": "estraverse.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "estraverse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" - }, "scripts": { - "lint": "jshint estraverse.js", "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", "unit-test": "mocha --compilers js:babel-register" - }, - "version": "4.3.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/esutils/package.json b/tools/node_modules/eslint/node_modules/esutils/package.json index cffa439c8dafce..8396f4cee3f7e8 100644 --- a/tools/node_modules/eslint/node_modules/esutils/package.json +++ b/tools/node_modules/eslint/node_modules/esutils/package.json @@ -1,49 +1,44 @@ { - "bugs": { - "url": "https://github.com/estools/esutils/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "esutils", "description": "utility box for ECMAScript language tools", - "devDependencies": { - "chai": "~1.7.2", - "coffee-script": "~1.6.3", - "jshint": "2.6.3", - "mocha": "~2.2.1", - "regenerate": "~1.3.1", - "unicode-9.0.0": "~0.7.0" + "homepage": "https://github.com/estools/esutils", + "main": "lib/utils.js", + "version": "2.0.3", + "engines": { + "node": ">=0.10.0" }, "directories": { "lib": "./lib" }, - "engines": { - "node": ">=0.10.0" - }, "files": [ "LICENSE.BSD", "README.md", "lib" ], - "homepage": "https://github.com/estools/esutils", - "license": "BSD-2-Clause", - "main": "lib/utils.js", "maintainers": [ { "name": "Yusuke Suzuki", "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" + "web": "http://github.com/Constellation" } ], - "name": "esutils", "repository": { "type": "git", - "url": "git+ssh://git@github.com/estools/esutils.git" + "url": "http://github.com/estools/esutils.git" + }, + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.6.3", + "mocha": "~2.2.1", + "regenerate": "~1.3.1", + "unicode-9.0.0": "~0.7.0" }, + "license": "BSD-2-Clause", "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "lint": "jshint lib/*.js", "test": "npm run-script lint && npm run-script unit-test", - "unit-test": "mocha --compilers coffee:coffee-script -R spec" - }, - "version": "2.0.3" -} \ No newline at end of file + "lint": "jshint lib/*.js", + "unit-test": "mocha --compilers coffee:coffee-script -R spec", + "generate-regex": "node tools/generate-identifier-regex.js" + } +} diff --git a/tools/node_modules/eslint/node_modules/extend/package.json b/tools/node_modules/eslint/node_modules/extend/package.json deleted file mode 100644 index 429364c0c37d04..00000000000000 --- a/tools/node_modules/eslint/node_modules/extend/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "author": { - "name": "Stefan Thomas", - "email": "justmoon@members.fsf.org", - "url": "http://www.justmoon.net" - }, - "bugs": { - "url": "https://github.com/justmoon/node-extend/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Port of jQuery.extend for node.js and the browser", - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.19.1", - "jscs": "^3.0.7", - "tape": "^4.9.1" - }, - "homepage": "https://github.com/justmoon/node-extend#readme", - "keywords": [ - "extend", - "clone", - "merge" - ], - "license": "MIT", - "main": "index", - "name": "extend", - "repository": { - "type": "git", - "url": "git+https://github.com/justmoon/node-extend.git" - }, - "scripts": { - "coverage": "covert test/index.js", - "coverage-quiet": "covert test/index.js --quiet", - "eslint": "eslint *.js */*.js", - "jscs": "jscs *.js */*.js", - "lint": "npm run jscs && npm run eslint", - "posttest": "npm run coverage-quiet", - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "node test" - }, - "version": "3.0.2" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json b/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json index 6377dca7e45e79..3cfe66c68e832b 100644 --- a/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json +++ b/tools/node_modules/eslint/node_modules/fast-deep-equal/package.json @@ -1,13 +1,33 @@ { - "author": { - "name": "Evgeny Poberezkin" + "name": "fast-deep-equal", + "version": "3.1.3", + "description": "Fast deep equal", + "main": "index.js", + "scripts": { + "eslint": "eslint *.js benchmark/*.js spec/*.js", + "build": "node build", + "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-cov": "nyc npm run test-spec", + "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", + "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", + "prepublish": "npm run build" }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" + }, + "keywords": [ + "fast", + "equal", + "deep-equal" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/fast-deep-equal/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Fast deep equal", + "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", "devDependencies": { "coveralls": "^3.1.0", "dot": "^1.1.2", @@ -20,22 +40,6 @@ "sinon": "^9.0.2", "typescript": "^3.9.5" }, - "files": [ - "index.js", - "index.d.ts", - "react.js", - "react.d.ts", - "es6/" - ], - "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", - "keywords": [ - "fast", - "equal", - "deep-equal" - ], - "license": "MIT", - "main": "index.js", - "name": "fast-deep-equal", "nyc": { "exclude": [ "**/spec/**", @@ -46,20 +50,12 @@ "text-summary" ] }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" - }, - "scripts": { - "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./", - "build": "node build", - "eslint": "eslint *.js benchmark/*.js spec/*.js", - "prepublish": "npm run build", - "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov", - "test-cov": "nyc npm run test-spec", - "test-spec": "mocha spec/*.spec.js -R spec", - "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts" - }, - "types": "index.d.ts", - "version": "3.1.3" -} \ No newline at end of file + "files": [ + "index.js", + "index.d.ts", + "react.js", + "react.d.ts", + "es6/" + ], + "types": "index.d.ts" +} diff --git a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json b/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json index 46f5c8e221cc45..ad2c8bff7c94e2 100644 --- a/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json +++ b/tools/node_modules/eslint/node_modules/fast-json-stable-stringify/package.json @@ -1,16 +1,10 @@ { - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/epoberezkin/fast-json-stable-stringify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "fast-json-stable-stringify", + "version": "2.1.0", "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", + "main": "index.js", + "types": "index.d.ts", + "dependencies": {}, "devDependencies": { "benchmark": "^2.1.4", "coveralls": "^3.0.0", @@ -22,6 +16,15 @@ "pre-commit": "^1.2.2", "tape": "^4.11.0" }, + "scripts": { + "eslint": "eslint index.js test", + "test-spec": "tape test/*.js", + "test": "npm run eslint && nyc npm run test-spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" + }, "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", "keywords": [ "json", @@ -30,9 +33,12 @@ "hash", "stable" ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, "license": "MIT", - "main": "index.js", - "name": "fast-json-stable-stringify", "nyc": { "exclude": [ "test", @@ -42,16 +48,5 @@ "lcov", "text-summary" ] - }, - "repository": { - "type": "git", - "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" - }, - "scripts": { - "eslint": "eslint index.js test", - "test": "npm run eslint && nyc npm run test-spec", - "test-spec": "tape test/*.js" - }, - "types": "index.d.ts", - "version": "2.1.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json b/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json index 85c3001e0bff5e..5b4736d4537a5e 100644 --- a/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json +++ b/tools/node_modules/eslint/node_modules/fast-levenshtein/package.json @@ -1,15 +1,17 @@ { - "author": { - "name": "Ramesh Nair", - "email": "ram@hiddentao.com", - "url": "http://www.hiddentao.com/" - }, - "bugs": { - "url": "https://github.com/hiddentao/fast-levenshtein/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "fast-levenshtein", + "version": "2.0.6", "description": "Efficient implementation of Levenshtein algorithm with locale-specific collator support.", + "main": "levenshtein.js", + "files": [ + "levenshtein.js" + ], + "scripts": { + "build": "grunt build", + "prepublish": "npm run build", + "benchmark": "grunt benchmark", + "test": "mocha" + }, "devDependencies": { "chai": "~1.5.0", "grunt": "~0.4.1", @@ -23,27 +25,15 @@ "lodash": "^4.0.1", "mocha": "~1.9.0" }, - "files": [ - "levenshtein.js" - ], - "homepage": "https://github.com/hiddentao/fast-levenshtein#readme", + "repository": { + "type": "git", + "url": "https://github.com/hiddentao/fast-levenshtein.git" + }, "keywords": [ "levenshtein", "distance", "string" ], - "license": "MIT", - "main": "levenshtein.js", - "name": "fast-levenshtein", - "repository": { - "type": "git", - "url": "git+https://github.com/hiddentao/fast-levenshtein.git" - }, - "scripts": { - "benchmark": "grunt benchmark", - "build": "grunt build", - "prepublish": "npm run build", - "test": "mocha" - }, - "version": "2.0.6" -} \ No newline at end of file + "author": "Ramesh Nair (http://www.hiddentao.com/)", + "license": "MIT" +} diff --git a/tools/node_modules/eslint/node_modules/file-entry-cache/package.json b/tools/node_modules/eslint/node_modules/file-entry-cache/package.json index 8eb0f05ab8d2ea..3d84ce2543fa97 100644 --- a/tools/node_modules/eslint/node_modules/file-entry-cache/package.json +++ b/tools/node_modules/eslint/node_modules/file-entry-cache/package.json @@ -1,12 +1,50 @@ { + "name": "file-entry-cache", + "version": "6.0.0", + "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", + "repository": "royriojas/file-entry-cache", + "license": "MIT", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" }, - "bugs": { - "url": "https://github.com/royriojas/file-entry-cache/issues" + "main": "cache.js", + "files": [ + "cache.js" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" }, - "bundleDependencies": false, + "scripts": { + "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'", + "autofix": "npm run eslint -- --fix", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "changelog": "changelogx -f markdown -o ./changelog.md", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "pre-v": "npm run test", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "test": "npm run eslint --silent && mocha -R spec test/specs", + "perf": "node perf.js", + "cover": "istanbul cover test/runner.js html text-summary", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "prepush": [ + "npm run eslint --silent" + ], + "precommit": [ + "npm run eslint --silent" + ], + "keywords": [ + "file cache", + "task cache files", + "file cache", + "key par", + "key value", + "cache" + ], "changelogx": { "ignoreRegExp": [ "BLD: Release", @@ -19,11 +57,6 @@ "issueIDURL": "https://github.com/royriojas/file-entry-cache/issues/{0}", "projectName": "file-entry-cache" }, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "deprecated": false, - "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", "devDependencies": { "chai": "^4.2.0", "changelogx": "^5.0.6", @@ -41,49 +74,7 @@ "watch-run": "^1.2.5", "write": "^2.0.0" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "cache.js" - ], - "homepage": "https://github.com/royriojas/file-entry-cache#readme", - "keywords": [ - "file cache", - "task cache files", - "file cache", - "key par", - "key value", - "cache" - ], - "license": "MIT", - "main": "cache.js", - "name": "file-entry-cache", - "precommit": [ - "npm run eslint --silent" - ], - "prepush": [ - "npm run eslint --silent" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/royriojas/file-entry-cache.git" - }, - "scripts": { - "autofix": "npm run eslint -- --fix", - "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", - "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", - "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", - "changelog": "changelogx -f markdown -o ./changelog.md", - "cover": "istanbul cover test/runner.js html text-summary", - "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", - "eslint": "eslint --cache --cache-location=node_modules/.cache/ 'cache.js' 'test/**/*.js' 'perf.js'", - "install-hooks": "prepush install && changelogx install-hook && precommit install", - "perf": "node perf.js", - "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", - "pre-v": "npm run test", - "test": "npm run eslint --silent && mocha -R spec test/specs", - "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" - }, - "version": "6.0.0" -} \ No newline at end of file + "dependencies": { + "flat-cache": "^3.0.4" + } +} diff --git a/tools/node_modules/eslint/node_modules/flat-cache/package.json b/tools/node_modules/eslint/node_modules/flat-cache/package.json index a08d68db3dd4f1..8bc6f87c51083b 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/package.json +++ b/tools/node_modules/eslint/node_modules/flat-cache/package.json @@ -1,12 +1,55 @@ { + "name": "flat-cache", + "version": "3.0.4", + "description": "A stupidly simple key/value storage using files to persist some data", + "repository": "royriojas/flat-cache", + "license": "MIT", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" }, - "bugs": { - "url": "https://github.com/royriojas/flat-cache/issues" + "main": "src/cache.js", + "files": [ + "src/cache.js", + "src/del.js", + "src/utils.js" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" }, - "bundleDependencies": false, + "precommit": [ + "npm run verify --silent" + ], + "prepush": [ + "npm run verify --silent" + ], + "scripts": { + "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js", + "eslint-fix": "npm run eslint -- --fix", + "autofix": "npm run eslint-fix", + "check": "npm run eslint", + "verify": "npm run eslint && npm run test:cache", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "changelog": "changelogx -f markdown -o ./changelog.md", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "pre-v": "npm run verify", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "test:cache": "mocha -R spec test/specs", + "test": "npm run verify --silent", + "cover": "istanbul cover test/runner.js html text-summary", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "keywords": [ + "json cache", + "simple cache", + "file cache", + "key par", + "key value", + "cache" + ], "changelogx": { "ignoreRegExp": [ "BLD: Release", @@ -19,12 +62,6 @@ "issueIDURL": "https://github.com/royriojas/flat-cache/issues/{0}", "projectName": "flat-cache" }, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "deprecated": false, - "description": "A stupidly simple key/value storage using files to persist some data", "devDependencies": { "chai": "^4.2.0", "changelogx": "^5.0.6", @@ -40,54 +77,8 @@ "prettier": "^2.1.2", "watch-run": "^1.2.5" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "src/cache.js", - "src/del.js", - "src/utils.js" - ], - "homepage": "https://github.com/royriojas/flat-cache#readme", - "keywords": [ - "json cache", - "simple cache", - "file cache", - "key par", - "key value", - "cache" - ], - "license": "MIT", - "main": "src/cache.js", - "name": "flat-cache", - "precommit": [ - "npm run verify --silent" - ], - "prepush": [ - "npm run verify --silent" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/royriojas/flat-cache.git" - }, - "scripts": { - "autofix": "npm run eslint-fix", - "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", - "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", - "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", - "changelog": "changelogx -f markdown -o ./changelog.md", - "check": "npm run eslint", - "cover": "istanbul cover test/runner.js html text-summary", - "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", - "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js", - "eslint-fix": "npm run eslint -- --fix", - "install-hooks": "prepush install && changelogx install-hook && precommit install", - "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", - "pre-v": "npm run verify", - "test": "npm run verify --silent", - "test:cache": "mocha -R spec test/specs", - "verify": "npm run eslint && npm run test:cache", - "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" - }, - "version": "3.0.4" -} \ No newline at end of file + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } +} diff --git a/tools/node_modules/eslint/node_modules/flatted/package.json b/tools/node_modules/eslint/node_modules/flatted/package.json index 41a5b5defc6d20..7b106e797c1c8d 100644 --- a/tools/node_modules/eslint/node_modules/flatted/package.json +++ b/tools/node_modules/eslint/node_modules/flatted/package.json @@ -1,13 +1,37 @@ { - "author": { - "name": "Andrea Giammarchi" + "name": "flatted", + "version": "3.1.1", + "description": "A super light and fast circular JSON parser.", + "unpkg": "min.js", + "types": "types.d.ts", + "main": "./cjs/index.js", + "scripts": { + "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size", + "cjs": "ascjs esm cjs", + "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck", + "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js", + "min": "terser index.js -c -m -o min.js", + "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "nyc node test/index.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/WebReflection/flatted.git" }, + "keywords": [ + "circular", + "JSON", + "fast", + "parser", + "minimal" + ], + "author": "Andrea Giammarchi", + "license": "ISC", "bugs": { "url": "https://github.com/WebReflection/flatted/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "A super light and fast circular JSON parser.", + "homepage": "https://github.com/WebReflection/flatted#readme", "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.11.5", @@ -24,38 +48,10 @@ "rollup-plugin-terser": "^7.0.2", "terser": "^5.3.0" }, + "module": "./esm/index.js", + "type": "module", "exports": { "import": "./esm/index.js", "default": "./cjs/index.js" - }, - "homepage": "https://github.com/WebReflection/flatted#readme", - "keywords": [ - "circular", - "JSON", - "fast", - "parser", - "minimal" - ], - "license": "ISC", - "main": "./cjs/index.js", - "module": "./esm/index.js", - "name": "flatted", - "repository": { - "type": "git", - "url": "git+https://github.com/WebReflection/flatted.git" - }, - "scripts": { - "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size", - "cjs": "ascjs esm cjs", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "min": "terser index.js -c -m -o min.js", - "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js", - "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck", - "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c", - "test": "nyc node test/index.js" - }, - "type": "module", - "types": "types.d.ts", - "unpkg": "min.js", - "version": "3.1.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/fs.realpath/package.json b/tools/node_modules/eslint/node_modules/fs.realpath/package.json index 9007f26d64f78d..3edc57d21c7137 100644 --- a/tools/node_modules/eslint/node_modules/fs.realpath/package.json +++ b/tools/node_modules/eslint/node_modules/fs.realpath/package.json @@ -1,36 +1,26 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/fs.realpath/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "fs.realpath", + "version": "1.0.0", "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, "devDependencies": {}, - "files": [ - "old.js", - "index.js" - ], - "homepage": "https://github.com/isaacs/fs.realpath#readme", + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, "keywords": [ "realpath", "fs", "polyfill" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "index.js", - "name": "fs.realpath", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/fs.realpath.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "1.0.0" -} \ No newline at end of file + "files": [ + "old.js", + "index.js" + ] +} diff --git a/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json b/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json index 27edb36786b7e7..13d6f270cb95a6 100644 --- a/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json +++ b/tools/node_modules/eslint/node_modules/functional-red-black-tree/package.json @@ -1,22 +1,23 @@ { - "author": { - "name": "Mikola Lysenko" - }, - "bugs": { - "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" + "name": "functional-red-black-tree", + "version": "1.0.1", + "description": "A fully persistent balanced binary search tree", + "main": "rbtree.js", + "directories": { + "test": "test" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "A fully persistent balanced binary search tree", "devDependencies": { "iota-array": "^0.0.1", "tape": "^2.12.0" }, - "directories": { - "test": "test" + "scripts": { + "test": "tape test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" }, - "homepage": "https://github.com/mikolalysenko/functional-red-black-tree#readme", "keywords": [ "functional", "red", @@ -31,15 +32,9 @@ "data", "structure" ], + "author": "Mikola Lysenko", "license": "MIT", - "main": "rbtree.js", - "name": "functional-red-black-tree", - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "1.0.1" -} \ No newline at end of file + "bugs": { + "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" + } +} diff --git a/tools/node_modules/eslint/node_modules/glob-parent/package.json b/tools/node_modules/eslint/node_modules/glob-parent/package.json index 4d6f2f6dd4bf4b..1dfd6bc39000f9 100644 --- a/tools/node_modules/eslint/node_modules/glob-parent/package.json +++ b/tools/node_modules/eslint/node_modules/glob-parent/package.json @@ -1,28 +1,32 @@ { - "author": { - "name": "Gulp Team", - "email": "team@gulpjs.com", - "url": "https://gulpjs.com/" - }, - "bugs": { - "url": "https://github.com/gulpjs/glob-parent/issues" - }, - "bundleDependencies": false, + "name": "glob-parent", + "version": "5.1.1", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", "contributors": [ - { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com" - } + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only", + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, "dependencies": { "is-glob": "^4.0.1" }, - "deprecated": false, - "description": "Extract the non-magic parent path from a glob string.", "devDependencies": { "coveralls": "^3.0.11", "eslint": "^2.13.1", @@ -31,14 +35,6 @@ "mocha": "^6.0.2", "nyc": "^13.3.0" }, - "engines": { - "node": ">= 6" - }, - "files": [ - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/gulpjs/glob-parent#readme", "keywords": [ "glob", "parent", @@ -48,20 +44,5 @@ "directory", "base", "wildcard" - ], - "license": "ISC", - "main": "index.js", - "name": "glob-parent", - "repository": { - "type": "git", - "url": "git+https://github.com/gulpjs/glob-parent.git" - }, - "scripts": { - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only" - }, - "version": "5.1.1" -} \ No newline at end of file + ] +} diff --git a/tools/node_modules/eslint/node_modules/glob/package.json b/tools/node_modules/eslint/node_modules/glob/package.json index bf5a63608ca133..6477c3070cb14e 100644 --- a/tools/node_modules/eslint/node_modules/glob/package.json +++ b/tools/node_modules/eslint/node_modules/glob/package.json @@ -1,13 +1,21 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.1.6", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" }, - "bundleDependencies": false, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -16,41 +24,23 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, - "deprecated": false, - "description": "a little globber", "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^12.0.1", "tick": "0.0.6" }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "name": "glob", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", "profclean": "rm -f v8.log profile.txt", "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" }, - "version": "7.1.6" -} \ No newline at end of file + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/tools/node_modules/eslint/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/globals/package.json index 66435a6834e8f4..1569748ef90c16 100644 --- a/tools/node_modules/eslint/node_modules/globals/package.json +++ b/tools/node_modules/eslint/node_modules/globals/package.json @@ -1,61 +1,52 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/globals/issues" - }, - "bundleDependencies": false, - "dependencies": { - "type-fest": "^0.8.1" - }, - "deprecated": false, - "description": "Global identifiers from different JavaScript environments", - "devDependencies": { - "ava": "^2.2.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "globals.json" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/globals#readme", - "keywords": [ - "globals", - "global", - "identifiers", - "variables", - "vars", - "jshint", - "eslint", - "environments" - ], - "license": "MIT", - "name": "globals", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/globals.git" - }, - "scripts": { - "test": "xo && ava" - }, - "tsd": { - "compilerOptions": { - "resolveJsonModule": true - } - }, - "version": "12.4.0", - "xo": { - "ignores": [ - "get-browser-globals.js" - ] - } -} \ No newline at end of file + "name": "globals", + "version": "12.4.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "dependencies": { + "type-fest": "^0.8.1" + }, + "devDependencies": { + "ava": "^2.2.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + }, + "xo": { + "ignores": [ + "get-browser-globals.js" + ] + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + } +} diff --git a/tools/node_modules/eslint/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/has-flag/index.js index 5139728fba6a26..b6f80b1f8ffd76 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/index.js +++ b/tools/node_modules/eslint/node_modules/has-flag/index.js @@ -1,8 +1,8 @@ 'use strict'; -module.exports = (flag, argv) => { - argv = argv || process.argv; + +module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; diff --git a/tools/node_modules/eslint/node_modules/has-flag/package.json b/tools/node_modules/eslint/node_modules/has-flag/package.json index 1903ff01cf6766..a9cba4b856d046 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/package.json +++ b/tools/node_modules/eslint/node_modules/has-flag/package.json @@ -1,53 +1,46 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-flag/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if argv has a specific flag", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/has-flag#readme", - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "license": "MIT", - "name": "has-flag", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-flag.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} \ No newline at end of file + "name": "has-flag", + "version": "4.0.0", + "description": "Check if argv has a specific flag", + "license": "MIT", + "repository": "sindresorhus/has-flag", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/has-flag/readme.md b/tools/node_modules/eslint/node_modules/has-flag/readme.md index 677893c278a2e3..3f72dff29a6961 100644 --- a/tools/node_modules/eslint/node_modules/has-flag/readme.md +++ b/tools/node_modules/eslint/node_modules/has-flag/readme.md @@ -4,6 +4,20 @@ Correctly stops looking after an `--` argument terminator. +--- + +
    + + Get professional support for this package with a Tidelift subscription + +
    + + Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. +
    +
    + +--- + ## Install @@ -65,6 +79,11 @@ Default: `process.argv` CLI arguments. +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## License MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/ignore/package.json b/tools/node_modules/eslint/node_modules/ignore/package.json index 1c14f37a316960..8cb1b7873257b4 100644 --- a/tools/node_modules/eslint/node_modules/ignore/package.json +++ b/tools/node_modules/eslint/node_modules/ignore/package.json @@ -1,38 +1,28 @@ { - "author": { - "name": "kael" - }, - "bugs": { - "url": "https://github.com/kaelzhang/node-ignore/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "ignore", + "version": "4.0.6", "description": "Ignore is a manager and filter for .gitignore rules.", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.7.0", - "codecov": "^3.0.4", - "eslint": "^5.3.0", - "eslint-config-ostai": "^1.3.2", - "eslint-plugin-import": "^2.13.0", - "mkdirp": "^0.5.1", - "pre-suf": "^1.1.0", - "rimraf": "^2.6.2", - "spawn-sync": "^2.0.0", - "tap": "^12.0.1", - "tmp": "0.0.33", - "typescript": "^3.0.1" - }, - "engines": { - "node": ">= 4" - }, "files": [ "legacy.js", "index.js", "index.d.ts", "LICENSE-MIT" ], - "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "scripts": { + "prepublish": "npm run build", + "build": "babel -o legacy.js index.js", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts", + "test:git": "tap test/git-check-ignore.js", + "test:ignore": "tap test/ignore.js --coverage", + "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", + "test": "npm run test-no-cov", + "posttest": "tap --coverage-report=html && codecov" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, "keywords": [ "ignore", ".gitignore", @@ -48,22 +38,27 @@ "asterisks", "regular-expression" ], + "author": "kael", "license": "MIT", - "name": "ignore", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" }, - "scripts": { - "build": "babel -o legacy.js index.js", - "posttest": "tap --coverage-report=html && codecov", - "prepublish": "npm run build", - "test": "npm run test-no-cov", - "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", - "test:git": "tap test/git-check-ignore.js", - "test:ignore": "tap test/ignore.js --coverage", - "test:lint": "eslint .", - "test:tsc": "tsc ./test/ts/simple.ts" + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.7.0", + "codecov": "^3.0.4", + "eslint": "^5.3.0", + "eslint-config-ostai": "^1.3.2", + "eslint-plugin-import": "^2.13.0", + "mkdirp": "^0.5.1", + "pre-suf": "^1.1.0", + "rimraf": "^2.6.2", + "spawn-sync": "^2.0.0", + "tap": "^12.0.1", + "tmp": "0.0.33", + "typescript": "^3.0.1" }, - "version": "4.0.6" -} \ No newline at end of file + "engines": { + "node": ">= 4" + } +} diff --git a/tools/node_modules/eslint/node_modules/import-fresh/package.json b/tools/node_modules/eslint/node_modules/import-fresh/package.json index 5a30f8061505fc..0c093620687612 100644 --- a/tools/node_modules/eslint/node_modules/import-fresh/package.json +++ b/tools/node_modules/eslint/node_modules/import-fresh/package.json @@ -1,52 +1,43 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/import-fresh/issues" - }, - "bundleDependencies": false, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "deprecated": false, - "description": "Import a module while bypassing the cache", - "devDependencies": { - "ava": "^1.0.1", - "heapdump": "^0.3.12", - "tsd": "^0.7.3", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/import-fresh#readme", - "keywords": [ - "require", - "cache", - "uncache", - "uncached", - "module", - "fresh", - "bypass" - ], - "license": "MIT", - "name": "import-fresh", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/import-fresh.git" - }, - "scripts": { - "heapdump": "node heapdump.js", - "test": "xo && ava && tsd" - }, - "version": "3.3.0" -} \ No newline at end of file + "name": "import-fresh", + "version": "3.3.0", + "description": "Import a module while bypassing the cache", + "license": "MIT", + "repository": "sindresorhus/import-fresh", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd", + "heapdump": "node heapdump.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/imurmurhash/package.json b/tools/node_modules/eslint/node_modules/imurmurhash/package.json index b07b2935ed7a79..8a93edb55a2245 100644 --- a/tools/node_modules/eslint/node_modules/imurmurhash/package.json +++ b/tools/node_modules/eslint/node_modules/imurmurhash/package.json @@ -1,27 +1,22 @@ { - "author": { - "name": "Jens Taylor", - "email": "jensyt@gmail.com", - "url": "https://github.com/homebrewing" - }, - "bugs": { - "url": "https://github.com/jensyt/imurmurhash-js/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "imurmurhash", + "version": "0.1.4", "description": "An incremental implementation of MurmurHash3", - "devDependencies": {}, - "engines": { - "node": ">=0.8.19" - }, + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", "files": [ "imurmurhash.js", "imurmurhash.min.js", "package.json", "README.md" ], - "homepage": "https://github.com/jensyt/imurmurhash-js", + "repository": { + "type": "git", + "url": "https://github.com/jensyt/imurmurhash-js" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, "keywords": [ "murmur", "murmurhash", @@ -29,12 +24,17 @@ "hash", "incremental" ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, "license": "MIT", - "main": "imurmurhash.js", - "name": "imurmurhash", - "repository": { - "type": "git", - "url": "git+https://github.com/jensyt/imurmurhash-js.git" + "dependencies": { + }, + "devDependencies": { }, - "version": "0.1.4" -} \ No newline at end of file + "engines": { + "node": ">=0.8.19" + } +} diff --git a/tools/node_modules/eslint/node_modules/inflight/package.json b/tools/node_modules/eslint/node_modules/inflight/package.json index c5576ffbad6ee6..6084d3509a5d6d 100644 --- a/tools/node_modules/eslint/node_modules/inflight/package.json +++ b/tools/node_modules/eslint/node_modules/inflight/package.json @@ -1,35 +1,29 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "bundleDependencies": false, + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], "dependencies": { "once": "^1.3.0", "wrappy": "1" }, - "deprecated": false, - "description": "Add callbacks to requests in flight to avoid async duplication", "devDependencies": { "tap": "^7.1.2" }, - "files": [ - "inflight.js" - ], - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "main": "inflight.js", - "name": "inflight", + "scripts": { + "test": "tap test.js --100" + }, "repository": { "type": "git", - "url": "git+https://github.com/npm/inflight.git" + "url": "https://github.com/npm/inflight.git" }, - "scripts": { - "test": "tap test.js --100" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" }, - "version": "1.0.6" -} \ No newline at end of file + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" +} diff --git a/tools/node_modules/eslint/node_modules/inherits/package.json b/tools/node_modules/eslint/node_modules/inherits/package.json index 9642125b71d65f..37b4366b83e63e 100644 --- a/tools/node_modules/eslint/node_modules/inherits/package.json +++ b/tools/node_modules/eslint/node_modules/inherits/package.json @@ -1,19 +1,7 @@ { - "browser": "./inherits_browser.js", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "inherits", "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ], - "homepage": "https://github.com/isaacs/inherits#readme", + "version": "2.0.4", "keywords": [ "inheritance", "class", @@ -24,15 +12,18 @@ "browser", "browserify" ], - "license": "ISC", "main": "./inherits.js", - "name": "inherits", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits.git" - }, + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", "scripts": { "test": "tap" }, - "version": "2.0.4" -} \ No newline at end of file + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/tools/node_modules/eslint/node_modules/is-extglob/package.json b/tools/node_modules/eslint/node_modules/is-extglob/package.json index 3ae794888e29c7..7a908369d39f55 100644 --- a/tools/node_modules/eslint/node_modules/is-extglob/package.json +++ b/tools/node_modules/eslint/node_modules/is-extglob/package.json @@ -1,25 +1,28 @@ { - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", "bugs": { "url": "https://github.com/jonschlinkert/is-extglob/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if a string has an extglob.", + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-extglob", "keywords": [ "bash", "braces", @@ -39,16 +42,6 @@ "string", "test" ], - "license": "MIT", - "main": "index.js", - "name": "is-extglob", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extglob.git" - }, - "scripts": { - "test": "mocha" - }, "verb": { "toc": false, "layout": "default", @@ -72,6 +65,5 @@ "lint": { "reflinks": true } - }, - "version": "2.1.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json index c556c1c78dd459..2137e888fa503d 100644 --- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json +++ b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json @@ -1,51 +1,42 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "^1.3.1", - "tsd-check": "^0.5.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "string", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "is-fullwidth-code-point", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "version": "3.0.0" -} \ No newline at end of file + "name": "is-fullwidth-code-point", + "version": "3.0.0", + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "license": "MIT", + "repository": "sindresorhus/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/is-glob/package.json b/tools/node_modules/eslint/node_modules/is-glob/package.json index d8973094f63003..806000dbdafcc7 100644 --- a/tools/node_modules/eslint/node_modules/is-glob/package.json +++ b/tools/node_modules/eslint/node_modules/is-glob/package.json @@ -1,42 +1,36 @@ { - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.1", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", "bugs": { "url": "https://github.com/micromatch/is-glob/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Daniel Perez", - "url": "https://tuvistavie.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } + "license": "MIT", + "files": [ + "index.js" ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, "dependencies": { "is-extglob": "^2.1.1" }, - "deprecated": false, - "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", "devDependencies": { "gulp-format-md": "^0.1.10", "mocha": "^3.0.2" }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/micromatch/is-glob", "keywords": [ "bash", "braces", @@ -56,16 +50,6 @@ "string", "test" ], - "license": "MIT", - "main": "index.js", - "name": "is-glob", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/is-glob.git" - }, - "scripts": { - "test": "mocha" - }, "verb": { "layout": "default", "plugins": [ @@ -93,6 +77,5 @@ "verb", "vinyl" ] - }, - "version": "4.0.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/is-whitespace-character/index.js b/tools/node_modules/eslint/node_modules/is-whitespace-character/index.js deleted file mode 100644 index 801c19f0d8df82..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-whitespace-character/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -module.exports = whitespace - -var fromCode = String.fromCharCode -var re = /\s/ - -// Check if the given character code, or the character code at the first -// character, is a whitespace character. -function whitespace(character) { - return re.test( - typeof character === 'number' ? fromCode(character) : character.charAt(0) - ) -} diff --git a/tools/node_modules/eslint/node_modules/is-whitespace-character/package.json b/tools/node_modules/eslint/node_modules/is-whitespace-character/package.json deleted file mode 100644 index 6a7a6597798e5e..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-whitespace-character/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-whitespace-character/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Check if a character is a whitespace character", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^15.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-whitespace-character#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "whitespace", - "white", - "space" - ], - "license": "MIT", - "name": "is-whitespace-character", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-whitespace-character.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s isWhitespaceCharacter -o is-whitespace-character.js", - "build-mangle": "browserify . -s isWhitespaceCharacter -p tinyify -o is-whitespace-character.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "is-whitespace-character.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-whitespace-character/readme.md b/tools/node_modules/eslint/node_modules/is-whitespace-character/readme.md deleted file mode 100644 index 34d4f343c86adf..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-whitespace-character/readme.md +++ /dev/null @@ -1,74 +0,0 @@ -# is-whitespace-character - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Check if a character is a whitespace character: `\s`, which equals all Unicode -Space Separators (including `[ \t\v\f]`), the BOM (`\uFEFF`), and line -terminator (`[\n\r\u2028\u2029]`). - -## Install - -[npm][]: - -```sh -npm install is-whitespace-character -``` - -## Use - -```js -var whitespace = require('is-whitespace-character') - -whitespace(' ') // => true -whitespace('\n') // => true -whitespace('\uFEFF') // => true -whitespace('_') // => false -whitespace('a') // => false -whitespace('💩') // => false -``` - -## API - -### `whitespaceCharacter(character|code)` - -Check whether the given character code (`number`), or the character code at the -first position (`string`), is a whitespace character. - -## Related - -* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) -* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) -* [`is-decimal`](https://github.com/wooorm/is-decimal) -* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) -* [`is-word-character`](https://github.com/wooorm/is-word-character) - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/is-whitespace-character.svg - -[build]: https://travis-ci.org/wooorm/is-whitespace-character - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-whitespace-character.svg - -[coverage]: https://codecov.io/github/wooorm/is-whitespace-character - -[downloads-badge]: https://img.shields.io/npm/dm/is-whitespace-character.svg - -[downloads]: https://www.npmjs.com/package/is-whitespace-character - -[size-badge]: https://img.shields.io/bundlephobia/minzip/is-whitespace-character.svg - -[size]: https://bundlephobia.com/result?p=is-whitespace-character - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/is-word-character/index.js b/tools/node_modules/eslint/node_modules/is-word-character/index.js deleted file mode 100644 index 8c3537f99568c3..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-word-character/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -module.exports = wordCharacter - -var fromCode = String.fromCharCode -var re = /\w/ - -// Check if the given character code, or the character code at the first -// character, is a word character. -function wordCharacter(character) { - return re.test( - typeof character === 'number' ? fromCode(character) : character.charAt(0) - ) -} diff --git a/tools/node_modules/eslint/node_modules/is-word-character/package.json b/tools/node_modules/eslint/node_modules/is-word-character/package.json deleted file mode 100644 index b2fc0a1558ce2d..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-word-character/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/is-word-character/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Check if a character is a word character", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^15.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/is-word-character#readme", - "keywords": [ - "string", - "character", - "char", - "code", - "word" - ], - "license": "MIT", - "name": "is-word-character", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/is-word-character.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s isWordCharacter -o is-word-character.js", - "build-mangle": "browserify . -s isWordCharacter -p tinyify -o is-word-character.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "is-word-character.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-word-character/readme.md b/tools/node_modules/eslint/node_modules/is-word-character/readme.md deleted file mode 100644 index 3c88ce976e3da2..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-word-character/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# is-word-character - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Check if a character is a word character (`\w`, which equals `[a-zA-Z0-9_]`). - -## Install - -[npm][]: - -```sh -npm install is-word-character -``` - -## Use - -```js -var wordCharacter = require('is-word-character') - -wordCharacter('a') // => true -wordCharacter('Z') // => true -wordCharacter('0') // => true -wordCharacter('_') // => true -wordCharacter(' ') // => false -wordCharacter('💩') // => false -``` - -## API - -### `wordCharacter(character|code)` - -Check whether the given character code (`number`), or the character code at the -first position (`string`), is a word character. - -## Related - -* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) -* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) -* [`is-decimal`](https://github.com/wooorm/is-decimal) -* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) -* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/is-word-character.svg - -[build]: https://travis-ci.org/wooorm/is-word-character - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-word-character.svg - -[coverage]: https://codecov.io/github/wooorm/is-word-character - -[downloads-badge]: https://img.shields.io/npm/dm/is-word-character.svg - -[downloads]: https://www.npmjs.com/package/is-word-character - -[size-badge]: https://img.shields.io/bundlephobia/minzip/is-word-character.svg - -[size]: https://bundlephobia.com/result?p=is-word-character - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/isexe/package.json b/tools/node_modules/eslint/node_modules/isexe/package.json index 6403682bbe2c80..e452689442f201 100644 --- a/tools/node_modules/eslint/node_modules/isexe/package.json +++ b/tools/node_modules/eslint/node_modules/isexe/package.json @@ -1,37 +1,31 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/isexe/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "isexe", + "version": "2.0.0", "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, "devDependencies": { "mkdirp": "^0.5.1", "rimraf": "^2.5.0", "tap": "^10.3.0" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "homepage": "https://github.com/isaacs/isexe#readme", - "keywords": [], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "index.js", - "name": "isexe", "repository": { "type": "git", "url": "git+https://github.com/isaacs/isexe.git" }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" }, - "version": "2.0.0" -} \ No newline at end of file + "homepage": "https://github.com/isaacs/isexe#readme" +} diff --git a/tools/node_modules/eslint/node_modules/js-tokens/package.json b/tools/node_modules/eslint/node_modules/js-tokens/package.json index ccfb4ef3dc3100..66752fab275101 100644 --- a/tools/node_modules/eslint/node_modules/js-tokens/package.json +++ b/tools/node_modules/eslint/node_modules/js-tokens/package.json @@ -1,23 +1,9 @@ { - "author": { - "name": "Simon Lydell" - }, - "bugs": { - "url": "https://github.com/lydell/js-tokens/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "js-tokens", + "version": "4.0.0", + "author": "Simon Lydell", + "license": "MIT", "description": "A regex that tokenizes JavaScript.", - "devDependencies": { - "coffeescript": "2.1.1", - "esprima": "4.0.0", - "everything.js": "1.0.3", - "mocha": "5.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/lydell/js-tokens#readme", "keywords": [ "JavaScript", "js", @@ -25,17 +11,20 @@ "tokenize", "regex" ], - "license": "MIT", - "name": "js-tokens", - "repository": { - "type": "git", - "url": "git+https://github.com/lydell/js-tokens.git" - }, + "files": [ + "index.js" + ], + "repository": "lydell/js-tokens", "scripts": { - "build": "node generate-index.js", - "dev": "npm run build && npm test", + "test": "mocha --ui tdd", "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", - "test": "mocha --ui tdd" + "build": "node generate-index.js", + "dev": "npm run build && npm test" }, - "version": "4.0.0" -} \ No newline at end of file + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/js-yaml/package.json b/tools/node_modules/eslint/node_modules/js-yaml/package.json index 6f63d1aed92082..0d2366762c5448 100644 --- a/tools/node_modules/eslint/node_modules/js-yaml/package.json +++ b/tools/node_modules/eslint/node_modules/js-yaml/package.json @@ -1,38 +1,37 @@ { - "author": { - "name": "Vladimir Zapparov", - "email": "dervus.grim@gmail.com" - }, + "name": "js-yaml", + "version": "3.14.1", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "author": "Vladimir Zapparov ", + "contributors": [ + "Aleksey V Zapparov (http://www.ixti.net/)", + "Vitaly Puzrin (https://github.com/puzrin)", + "Martin Grenfell (http://got-ravings.blogspot.com)" + ], + "license": "MIT", + "repository": "nodeca/js-yaml", + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], "bin": { "js-yaml": "bin/js-yaml.js" }, - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Vitaly Puzrin", - "email": "vitaly@rcdesign.ru", - "url": "https://github.com/puzrin" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, - "deprecated": false, - "description": "YAML 1.2 parser and serializer", "devDependencies": { "ansi": "^0.3.1", "benchmark": "^2.1.4", @@ -44,29 +43,7 @@ "mocha": "^7.1.2", "uglify-js": "^3.0.1" }, - "files": [ - "index.js", - "lib/", - "bin/", - "dist/" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "jsdelivr": "dist/js-yaml.min.js", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "license": "MIT", - "name": "js-yaml", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/js-yaml.git" - }, "scripts": { "test": "make test" - }, - "unpkg": "dist/js-yaml.min.js", - "version": "3.14.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json b/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json index d5060aff01fbf6..156606327babdd 100644 --- a/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json +++ b/tools/node_modules/eslint/node_modules/json-schema-traverse/package.json @@ -1,13 +1,28 @@ { - "author": { - "name": "Evgeny Poberezkin" + "name": "json-schema-traverse", + "version": "0.4.1", + "description": "Traverse JSON Schema passing each schema object to callback", + "main": "index.js", + "scripts": { + "eslint": "eslint index.js spec", + "test-spec": "mocha spec -R spec", + "test": "npm run eslint && nyc npm run test-spec" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" }, + "keywords": [ + "JSON-Schema", + "traverse", + "iterate" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/json-schema-traverse/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Traverse JSON Schema passing each schema object to callback", + "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", "devDependencies": { "coveralls": "^2.13.1", "eslint": "^3.19.0", @@ -15,15 +30,6 @@ "nyc": "^11.0.2", "pre-commit": "^1.2.2" }, - "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", - "keywords": [ - "JSON-Schema", - "traverse", - "iterate" - ], - "license": "MIT", - "main": "index.js", - "name": "json-schema-traverse", "nyc": { "exclude": [ "**/spec/**", @@ -33,15 +39,5 @@ "lcov", "text-summary" ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" - }, - "scripts": { - "eslint": "eslint index.js spec", - "test": "npm run eslint && nyc npm run test-spec", - "test-spec": "mocha spec -R spec" - }, - "version": "0.4.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json b/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json index 8cc2f1397506e7..c59c87edbe0b5c 100644 --- a/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json +++ b/tools/node_modules/eslint/node_modules/json-stable-stringify-without-jsonify/package.json @@ -1,35 +1,13 @@ { - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/samn/json-stable-stringify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "json-stable-stringify-without-jsonify", + "version": "1.0.1", "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies", + "main": "index.js", + "dependencies": { + }, "devDependencies": { "tape": "~1.0.4" }, - "homepage": "https://github.com/samn/json-stable-stringify", - "keywords": [ - "json", - "stringify", - "deterministic", - "hash", - "sort", - "stable" - ], - "license": "MIT", - "main": "index.js", - "name": "json-stable-stringify-without-jsonify", - "repository": { - "type": "git", - "url": "git://github.com/samn/json-stable-stringify.git" - }, "scripts": { "test": "tape test/*.js" }, @@ -37,13 +15,29 @@ "files": "test/*.js", "browsers": [ "ie/8..latest", - "ff/5", - "ff/latest", - "chrome/15", - "chrome/latest", + "ff/5", "ff/latest", + "chrome/15", "chrome/latest", "safari/latest", "opera/latest" ] }, - "version": "1.0.1" -} \ No newline at end of file + "repository": { + "type": "git", + "url": "git://github.com/samn/json-stable-stringify.git" + }, + "homepage": "https://github.com/samn/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT" +} diff --git a/tools/node_modules/eslint/node_modules/levn/package.json b/tools/node_modules/eslint/node_modules/levn/package.json index a9868ae5880948..0c356d6978eef0 100644 --- a/tools/node_modules/eslint/node_modules/levn/package.json +++ b/tools/node_modules/eslint/node_modules/levn/package.json @@ -1,30 +1,8 @@ { - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "bugs": { - "url": "https://github.com/gkz/levn/issues" - }, - "bundleDependencies": false, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "deprecated": false, + "name": "levn", + "version": "0.4.1", + "author": "George Zahariev ", "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", - "devDependencies": { - "livescript": "^1.6.0", - "mocha": "^7.1.1" - }, - "engines": { - "node": ">= 0.8.0" - }, - "files": [ - "lib", - "README.md", - "LICENSE" - ], "homepage": "https://github.com/gkz/levn", "keywords": [ "levn", @@ -39,9 +17,17 @@ "typed", "flexible" ], - "license": "MIT", + "files": [ + "lib", + "README.md", + "LICENSE" + ], "main": "./lib/", - "name": "levn", + "bugs": "https://github.com/gkz/levn/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, "repository": { "type": "git", "url": "git://github.com/gkz/levn.git" @@ -49,5 +35,12 @@ "scripts": { "test": "make test" }, - "version": "0.4.1" -} \ No newline at end of file + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/lodash/package.json b/tools/node_modules/eslint/node_modules/lodash/package.json index 7acee17382cd2b..2539c2434cb741 100644 --- a/tools/node_modules/eslint/node_modules/lodash/package.json +++ b/tools/node_modules/eslint/node_modules/lodash/package.json @@ -1,40 +1,17 @@ { - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be" - } - ], - "deprecated": false, + "name": "lodash", + "version": "4.17.20", "description": "Lodash modular utilities.", + "keywords": "modules, stdlib, util", "homepage": "https://lodash.com/", + "repository": "lodash/lodash", "icon": "https://lodash.com/icon.svg", - "keywords": [ - "modules", - "stdlib", - "util" - ], "license": "MIT", "main": "lodash.js", - "name": "lodash", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" - }, - "version": "4.17.20" -} \ No newline at end of file + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" } +} diff --git a/tools/node_modules/eslint/node_modules/lru-cache/package.json b/tools/node_modules/eslint/node_modules/lru-cache/package.json index a7a6da707b62fe..43b7502c3e7c79 100644 --- a/tools/node_modules/eslint/node_modules/lru-cache/package.json +++ b/tools/node_modules/eslint/node_modules/lru-cache/package.json @@ -1,46 +1,34 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "bundleDependencies": false, - "dependencies": { - "yallist": "^4.0.0" - }, - "deprecated": false, + "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "benchmark": "^2.1.4", - "tap": "^14.10.7" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "version": "6.0.0", + "author": "Isaac Z. Schlueter ", "keywords": [ "mru", "lru", "cache" ], - "license": "ISC", - "main": "index.js", - "name": "lru-cache", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, "scripts": { - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "preversion": "npm test", + "test": "tap", "snap": "tap", - "test": "tap" + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "main": "index.js", + "repository": "git://github.com/isaacs/node-lru-cache.git", + "devDependencies": { + "benchmark": "^2.1.4", + "tap": "^14.10.7" }, - "version": "6.0.0" -} \ No newline at end of file + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + } +} diff --git a/tools/node_modules/eslint/node_modules/markdown-escapes/index.js b/tools/node_modules/eslint/node_modules/markdown-escapes/index.js deleted file mode 100644 index f8bea48eacca65..00000000000000 --- a/tools/node_modules/eslint/node_modules/markdown-escapes/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict' - -module.exports = escapes - -var defaults = [ - '\\', - '`', - '*', - '{', - '}', - '[', - ']', - '(', - ')', - '#', - '+', - '-', - '.', - '!', - '_', - '>' -] - -var gfm = defaults.concat(['~', '|']) - -var commonmark = gfm.concat([ - '\n', - '"', - '$', - '%', - '&', - "'", - ',', - '/', - ':', - ';', - '<', - '=', - '?', - '@', - '^' -]) - -escapes.default = defaults -escapes.gfm = gfm -escapes.commonmark = commonmark - -// Get markdown escapes. -function escapes(options) { - var settings = options || {} - - if (settings.commonmark) { - return commonmark - } - - return settings.gfm ? gfm : defaults -} diff --git a/tools/node_modules/eslint/node_modules/markdown-escapes/package.json b/tools/node_modules/eslint/node_modules/markdown-escapes/package.json deleted file mode 100644 index 0e4eed169f2b65..00000000000000 --- a/tools/node_modules/eslint/node_modules/markdown-escapes/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/markdown-escapes/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "List of escapable characters in markdown", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/markdown-escapes#readme", - "keywords": [ - "markdown", - "escape", - "pedantic", - "gfm", - "commonmark" - ], - "license": "MIT", - "name": "markdown-escapes", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/markdown-escapes.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s markdownEscapes -o markdown-escapes.js", - "build-mangle": "browserify . -s markdownEscapes -p tinyify -o markdown-escapes.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.4", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "markdown-escapes.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/markdown-escapes/readme.md b/tools/node_modules/eslint/node_modules/markdown-escapes/readme.md deleted file mode 100644 index a7404526114d3d..00000000000000 --- a/tools/node_modules/eslint/node_modules/markdown-escapes/readme.md +++ /dev/null @@ -1,80 +0,0 @@ -# markdown-escapes - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -List of escapable characters in markdown. - -## Install - -[npm][]: - -```sh -npm install markdown-escapes -``` - -## Use - -```js -var escapes = require('markdown-escapes'); - -// Access by property: -escapes.commonmark; //=> ['\\', '`', ..., '@', '^'] - -// Access by options object: -escapes({gfm: true}); //=> ['\\', '`', ..., '~', '|'] -``` - -## API - -### `escapes([options])` - -Get escapes. -Supports `options.commonmark` and `options.gfm`, which when `true` returns the -extra escape characters supported by those flavors. - -###### Returns - -`Array.`. - -### `escapes.default` - -List of default escapable characters. - -### `escapes.gfm` - -List of escapable characters in GFM (which includes all `default`s). - -### `escapes.commonmark` - -List of escapable characters in CommonMark (which includes all `gfm`s). - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/markdown-escapes.svg - -[build]: https://travis-ci.org/wooorm/markdown-escapes - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-escapes.svg - -[coverage]: https://codecov.io/github/wooorm/markdown-escapes - -[downloads-badge]: https://img.shields.io/npm/dm/markdown-escapes.svg - -[downloads]: https://www.npmjs.com/package/markdown-escapes - -[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-escapes.svg - -[size]: https://bundlephobia.com/result?p=markdown-escapes - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/minimatch/package.json b/tools/node_modules/eslint/node_modules/minimatch/package.json index 3cd0d037a03d23..c4514c807776de 100644 --- a/tools/node_modules/eslint/node_modules/minimatch/package.json +++ b/tools/node_modules/eslint/node_modules/minimatch/package.json @@ -1,40 +1,30 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js --cov", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" + "engines": { + "node": "*" }, - "bundleDependencies": false, "dependencies": { "brace-expansion": "^1.1.7" }, - "deprecated": false, - "description": "a glob matcher in javascript", "devDependencies": { "tap": "^10.3.2" }, - "engines": { - "node": "*" - }, + "license": "ISC", "files": [ "minimatch.js" - ], - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "name": "minimatch", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --cov" - }, - "version": "3.0.4" -} \ No newline at end of file + ] +} diff --git a/tools/node_modules/eslint/node_modules/ms/package.json b/tools/node_modules/eslint/node_modules/ms/package.json index 7192a30c57c910..eea666e1fb03d6 100644 --- a/tools/node_modules/eslint/node_modules/ms/package.json +++ b/tools/node_modules/eslint/node_modules/ms/package.json @@ -1,16 +1,16 @@ { - "bugs": { - "url": "https://github.com/zeit/ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "ms", + "version": "2.1.2", "description": "Tiny millisecond conversion utility", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", @@ -19,11 +19,6 @@ "es6": true } }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zeit/ms#readme", - "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", @@ -31,16 +26,12 @@ "git add" ] }, - "main": "./index", - "name": "ms", - "repository": { - "type": "git", - "url": "git+https://github.com/zeit/ms.git" - }, - "scripts": { - "lint": "eslint lib/* bin/*", - "precommit": "lint-staged", - "test": "mocha tests.js" - }, - "version": "2.1.2" -} \ No newline at end of file + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/natural-compare/package.json b/tools/node_modules/eslint/node_modules/natural-compare/package.json index af8b2be0162cc8..1a71362eea81a2 100644 --- a/tools/node_modules/eslint/node_modules/natural-compare/package.json +++ b/tools/node_modules/eslint/node_modules/natural-compare/package.json @@ -1,28 +1,10 @@ { - "author": { - "name": "Lauri Rooden", - "url": "https://github.com/litejs/natural-compare-lite" - }, - "bugs": { - "url": "https://github.com/litejs/natural-compare-lite/issues" - }, - "buildman": { - "dist/index-min.js": { - "banner": "/*! litejs.com/MIT-LICENSE.txt */", - "input": "index.js" - } - }, - "bundleDependencies": false, - "deprecated": false, + "name": "natural-compare", + "version": "1.4.0", + "stability": 3, + "author": "Lauri Rooden (https://github.com/litejs/natural-compare-lite)", + "license": "MIT", "description": "Compare strings containing a mix of letters and numbers in the way a human being would in sort order.", - "devDependencies": { - "buildman": "*", - "testman": "*" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/litejs/natural-compare-lite#readme", "keywords": [ "string", "natural", @@ -34,17 +16,27 @@ "alphanum", "litejs" ], - "license": "MIT", "main": "index.js", - "name": "natural-compare", - "repository": { - "type": "git", - "url": "git://github.com/litejs/natural-compare-lite.git" - }, + "readmeFilename": "README.md", + "files": [ + "index.js" + ], "scripts": { "build": "node node_modules/buildman/index.js --all", "test": "node tests/index.js" }, - "stability": 3, - "version": "1.4.0" -} \ No newline at end of file + "repository": "git://github.com/litejs/natural-compare-lite.git", + "bugs": { + "url": "https://github.com/litejs/natural-compare-lite/issues" + }, + "devDependencies": { + "buildman": "*", + "testman": "*" + }, + "buildman": { + "dist/index-min.js": { + "banner": "/*! litejs.com/MIT-LICENSE.txt */", + "input": "index.js" + } + } +} diff --git a/tools/node_modules/eslint/node_modules/object-assign/index.js b/tools/node_modules/eslint/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf8890b9af..00000000000000 --- a/tools/node_modules/eslint/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/tools/node_modules/eslint/node_modules/object-assign/license b/tools/node_modules/eslint/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/object-assign/package.json b/tools/node_modules/eslint/node_modules/object-assign/package.json deleted file mode 100644 index 56c2a93c0a97bf..00000000000000 --- a/tools/node_modules/eslint/node_modules/object-assign/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 `Object.assign()` ponyfill", - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "license": "MIT", - "name": "object-assign", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.1.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/object-assign/readme.md b/tools/node_modules/eslint/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c776cc..00000000000000 --- a/tools/node_modules/eslint/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/once/package.json b/tools/node_modules/eslint/node_modules/once/package.json index 8635367075655a..16815b2fa11193 100644 --- a/tools/node_modules/eslint/node_modules/once/package.json +++ b/tools/node_modules/eslint/node_modules/once/package.json @@ -1,43 +1,33 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/once/issues" + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" }, - "bundleDependencies": false, "dependencies": { "wrappy": "1" }, - "deprecated": false, - "description": "Run a function exactly one time", "devDependencies": { "tap": "^7.0.1" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js" }, "files": [ "once.js" ], - "homepage": "https://github.com/isaacs/once#readme", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, "keywords": [ "once", "function", "one", "single" ], - "license": "ISC", - "main": "once.js", - "name": "once", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.4.0" -} \ No newline at end of file + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/tools/node_modules/eslint/node_modules/optionator/package.json b/tools/node_modules/eslint/node_modules/optionator/package.json index b76e0b4f4c532d..83fb1c2c930a47 100644 --- a/tools/node_modules/eslint/node_modules/optionator/package.json +++ b/tools/node_modules/eslint/node_modules/optionator/package.json @@ -1,34 +1,8 @@ { - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "bugs": { - "url": "https://github.com/gkz/optionator/issues" - }, - "bundleDependencies": false, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "deprecated": false, + "name": "optionator", + "version": "0.9.1", + "author": "George Zahariev ", "description": "option parsing and help generation", - "devDependencies": { - "livescript": "^1.6.0", - "mocha": "^7.1.1" - }, - "engines": { - "node": ">= 0.8.0" - }, - "files": [ - "lib", - "README.md", - "LICENSE" - ], "homepage": "https://github.com/gkz/optionator", "keywords": [ "options", @@ -36,9 +10,17 @@ "option parsing", "cli" ], - "license": "MIT", + "files": [ + "lib", + "README.md", + "LICENSE" + ], "main": "./lib/", - "name": "optionator", + "bugs": "https://github.com/gkz/optionator/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, "repository": { "type": "git", "url": "git://github.com/gkz/optionator.git" @@ -46,5 +28,16 @@ "scripts": { "test": "make test" }, - "version": "0.9.1" -} \ No newline at end of file + "dependencies": { + "prelude-ls": "^1.2.1", + "deep-is": "^0.1.3", + "word-wrap": "^1.2.3", + "type-check": "^0.4.0", + "levn": "^0.4.1", + "fast-levenshtein": "^2.0.6" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/parent-module/package.json b/tools/node_modules/eslint/node_modules/parent-module/package.json index 1f5b6cb1757a63..790333d0b1a659 100644 --- a/tools/node_modules/eslint/node_modules/parent-module/package.json +++ b/tools/node_modules/eslint/node_modules/parent-module/package.json @@ -1,55 +1,46 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/parent-module/issues" - }, - "bundleDependencies": false, - "dependencies": { - "callsites": "^3.0.0" - }, - "deprecated": false, - "description": "Get the path of the parent module", - "devDependencies": { - "ava": "^1.4.1", - "execa": "^1.0.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/parent-module#readme", - "keywords": [ - "parent", - "module", - "package", - "pkg", - "caller", - "calling", - "module", - "path", - "callsites", - "callsite", - "stacktrace", - "stack", - "trace", - "function", - "file" - ], - "license": "MIT", - "name": "parent-module", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/parent-module.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.1" -} \ No newline at end of file + "name": "parent-module", + "version": "1.0.1", + "description": "Get the path of the parent module", + "license": "MIT", + "repository": "sindresorhus/parent-module", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "parent", + "module", + "package", + "pkg", + "caller", + "calling", + "module", + "path", + "callsites", + "callsite", + "stacktrace", + "stack", + "trace", + "function", + "file" + ], + "dependencies": { + "callsites": "^3.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "execa": "^1.0.0", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/path-is-absolute/package.json b/tools/node_modules/eslint/node_modules/path-is-absolute/package.json index 9280158131fa5a..91196d5e9c1336 100644 --- a/tools/node_modules/eslint/node_modules/path-is-absolute/package.json +++ b/tools/node_modules/eslint/node_modules/path-is-absolute/package.json @@ -1,25 +1,23 @@ { + "name": "path-is-absolute", + "version": "1.0.1", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": "sindresorhus/path-is-absolute", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": { - "xo": "^0.16.0" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && node test.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", "keywords": [ "path", "paths", @@ -39,14 +37,7 @@ "detect", "check" ], - "license": "MIT", - "name": "path-is-absolute", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "scripts": { - "test": "xo && node test.js" - }, - "version": "1.0.1" -} \ No newline at end of file + "devDependencies": { + "xo": "^0.16.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/path-key/package.json b/tools/node_modules/eslint/node_modules/path-key/package.json index 7c2ea096485043..c8cbd383afc955 100644 --- a/tools/node_modules/eslint/node_modules/path-key/package.json +++ b/tools/node_modules/eslint/node_modules/path-key/package.json @@ -1,48 +1,39 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-key/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get the PATH environment variable key cross-platform", - "devDependencies": { - "@types/node": "^11.13.0", - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/path-key#readme", - "keywords": [ - "path", - "key", - "environment", - "env", - "variable", - "var", - "get", - "cross-platform", - "windows" - ], - "license": "MIT", - "name": "path-key", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-key.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "3.1.1" -} \ No newline at end of file + "name": "path-key", + "version": "3.1.1", + "description": "Get the PATH environment variable key cross-platform", + "license": "MIT", + "repository": "sindresorhus/path-key", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "devDependencies": { + "@types/node": "^11.13.0", + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/package.json b/tools/node_modules/eslint/node_modules/prelude-ls/package.json index ff1fcd6e1a8b50..c313c3da34a9dc 100644 --- a/tools/node_modules/eslint/node_modules/prelude-ls/package.json +++ b/tools/node_modules/eslint/node_modules/prelude-ls/package.json @@ -1,30 +1,8 @@ { - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "bugs": { - "url": "https://github.com/gkz/prelude-ls/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "prelude-ls", + "version": "1.2.1", + "author": "George Zahariev ", "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", - "devDependencies": { - "browserify": "^16.5.1", - "livescript": "^1.6.0", - "mocha": "^7.1.1", - "sinon": "~8.0.1", - "uglify-js": "^3.8.1" - }, - "engines": { - "node": ">= 0.8.0" - }, - "files": [ - "lib/", - "README.md", - "LICENSE" - ], - "homepage": "http://preludels.com", "keywords": [ "prelude", "livescript", @@ -39,9 +17,18 @@ "object", "string" ], - "license": "MIT", "main": "lib/", - "name": "prelude-ls", + "files": [ + "lib/", + "README.md", + "LICENSE" + ], + "homepage": "http://preludels.com", + "bugs": "https://github.com/gkz/prelude-ls/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, "repository": { "type": "git", "url": "git://github.com/gkz/prelude-ls.git" @@ -49,5 +36,11 @@ "scripts": { "test": "make test" }, - "version": "1.2.1" -} \ No newline at end of file + "devDependencies": { + "livescript": "^1.6.0", + "uglify-js": "^3.8.1", + "mocha": "^7.1.1", + "browserify": "^16.5.1", + "sinon": "~8.0.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/progress/package.json b/tools/node_modules/eslint/node_modules/progress/package.json index 64511f8344114f..bb81fa0bcd2b1d 100644 --- a/tools/node_modules/eslint/node_modules/progress/package.json +++ b/tools/node_modules/eslint/node_modules/progress/package.json @@ -1,47 +1,26 @@ { - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "bugs": { - "url": "https://github.com/visionmedia/node-progress/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoffer Hallas", - "email": "christoffer.hallas@gmail.com" - }, - { - "name": "Jordan Scales", - "email": "scalesjordan@gmail.com" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - }, - { - "name": "Marco Brack", - "email": "PapstDonB@Googlemail.com" - } - ], - "dependencies": {}, - "deprecated": false, + "name": "progress", + "version": "2.0.3", "description": "Flexible ascii progress bar", - "engines": { - "node": ">=0.4.0" + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/node-progress" }, - "homepage": "https://github.com/visionmedia/node-progress#readme", "keywords": [ "cli", "progress" ], - "license": "MIT", + "author": "TJ Holowaychuk ", + "contributors": [ + "Christoffer Hallas ", + "Jordan Scales ", + "Andrew Rhyne ", + "Marco Brack " + ], + "dependencies": {}, "main": "./index.js", - "name": "progress", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress.git" + "engines": { + "node": ">=0.4.0" }, - "version": "2.0.3" -} \ No newline at end of file + "license": "MIT" +} diff --git a/tools/node_modules/eslint/node_modules/punycode/package.json b/tools/node_modules/eslint/node_modules/punycode/package.json index 36ee74b2ef460e..9202ccf8c0c8f7 100644 --- a/tools/node_modules/eslint/node_modules/punycode/package.json +++ b/tools/node_modules/eslint/node_modules/punycode/package.json @@ -1,62 +1,58 @@ { + "name": "punycode", + "version": "2.1.1", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "jsnext:main": "punycode.es6.js", + "module": "punycode.es6.js", + "engines": { + "node": ">=6" + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "bundleDependencies": false, "contributors": [ { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" } ], - "deprecated": false, - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "devDependencies": { - "codecov": "^1.0.1", - "istanbul": "^0.4.1", - "mocha": "^2.5.3" - }, - "engines": { - "node": ">=6" + "repository": { + "type": "git", + "url": "https://github.com/bestiejs/punycode.js.git" }, + "bugs": "https://github.com/bestiejs/punycode.js/issues", "files": [ "LICENSE-MIT.txt", "punycode.js", "punycode.es6.js" ], - "homepage": "https://mths.be/punycode", - "jsnext:main": "punycode.es6.js", + "scripts": { + "test": "mocha tests", + "prepublish": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^1.0.1", + "istanbul": "^0.4.1", + "mocha": "^2.5.3" + }, "jspm": { "map": { "./punycode.js": { "node": "@node/punycode" } } - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "main": "punycode.js", - "module": "punycode.es6.js", - "name": "punycode", - "repository": { - "type": "git", - "url": "git+https://github.com/bestiejs/punycode.js.git" - }, - "scripts": { - "prepublish": "node scripts/prepublish.js", - "test": "mocha tests" - }, - "version": "2.1.1" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/regexpp/package.json b/tools/node_modules/eslint/node_modules/regexpp/package.json index 1c2b0eb82ba809..029cbe74e37f60 100644 --- a/tools/node_modules/eslint/node_modules/regexpp/package.json +++ b/tools/node_modules/eslint/node_modules/regexpp/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/mysticatea/regexpp/issues" + "name": "regexpp", + "version": "3.1.0", + "description": "Regular expression parser for ECMAScript.", + "engines": { + "node": ">=8" }, - "bundleDependencies": false, + "main": "index", + "files": [ + "index.*" + ], "dependencies": {}, - "deprecated": false, - "description": "Regular expression parser for ECMAScript.", "devDependencies": { "@mysticatea/eslint-plugin": "^11.0.0", "@types/eslint": "^4.16.2", @@ -30,14 +30,31 @@ "ts-node": "^8.3.0", "typescript": "^3.5.3" }, - "engines": { - "node": ">=8" + "scripts": { + "prebuild": "npm run -s clean", + "build": "run-s build:*", + "build:tsc": "tsc --module es2015", + "build:rollup": "rollup -c", + "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", + "clean": "rimraf .temp index.*", + "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", + "lint": "eslint scripts src test --ext .ts", + "pretest": "run-s build lint", + "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", + "update:test": "ts-node scripts/update-fixtures.ts", + "update:unicode": "run-s update:unicode:*", + "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", + "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", + "preversion": "npm test", + "version": "npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/regexpp.git" }, - "files": [ - "index.*" - ], - "funding": "https://github.com/sponsors/mysticatea", - "homepage": "https://github.com/mysticatea/regexpp#readme", "keywords": [ "regexp", "regular", @@ -57,33 +74,11 @@ "es2020", "annexB" ], + "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "MIT", - "main": "index", - "name": "regexpp", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/regexpp.git" - }, - "scripts": { - "build": "run-s build:*", - "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", - "build:rollup": "rollup -c", - "build:tsc": "tsc --module es2015", - "clean": "rimraf .temp index.*", - "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", - "lint": "eslint scripts src test --ext .ts", - "postversion": "git push && git push --tags", - "prebuild": "npm run -s clean", - "pretest": "run-s build lint", - "preversion": "npm test", - "prewatch": "npm run -s clean", - "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", - "update:test": "ts-node scripts/update-fixtures.ts", - "update:unicode": "run-s update:unicode:*", - "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", - "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", - "version": "npm run -s build", - "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" + "bugs": { + "url": "https://github.com/mysticatea/regexpp/issues" }, - "version": "3.1.0" -} \ No newline at end of file + "homepage": "https://github.com/mysticatea/regexpp#readme", + "funding": "https://github.com/sponsors/mysticatea" +} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/index.js b/tools/node_modules/eslint/node_modules/remark-parse/index.js deleted file mode 100644 index 1579e35518c582..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var unherit = require('unherit'); -var xtend = require('xtend'); -var Parser = require('./lib/parser.js'); - -module.exports = parse; -parse.Parser = Parser; - -function parse(options) { - var Local = unherit(Parser); - Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options); - this.Parser = Local; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/block-elements.json b/tools/node_modules/eslint/node_modules/remark-parse/lib/block-elements.json deleted file mode 100644 index 2d13b561792d65..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/block-elements.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - "address", - "article", - "aside", - "base", - "basefont", - "blockquote", - "body", - "caption", - "center", - "col", - "colgroup", - "dd", - "details", - "dialog", - "dir", - "div", - "dl", - "dt", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "iframe", - "legend", - "li", - "link", - "main", - "menu", - "menuitem", - "meta", - "nav", - "noframes", - "ol", - "optgroup", - "option", - "p", - "param", - "pre", - "section", - "source", - "title", - "summary", - "table", - "tbody", - "td", - "tfoot", - "th", - "thead", - "title", - "tr", - "track", - "ul" -] diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/decode.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/decode.js deleted file mode 100644 index fd45b729d069e1..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/decode.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -var xtend = require('xtend'); -var entities = require('parse-entities'); - -module.exports = factory; - -/* Factory to create an entity decoder. */ -function factory(ctx) { - decoder.raw = decodeRaw; - - return decoder; - - /* Normalize `position` to add an `indent`. */ - function normalize(position) { - var offsets = ctx.offset; - var line = position.line; - var result = []; - - while (++line) { - if (!(line in offsets)) { - break; - } - - result.push((offsets[line] || 0) + 1); - } - - return { - start: position, - indent: result - }; - } - - /* Handle a warning. - * See https://github.com/wooorm/parse-entities - * for the warnings. */ - function handleWarning(reason, position, code) { - if (code === 3) { - return; - } - - ctx.file.message(reason, position); - } - - /* Decode `value` (at `position`) into text-nodes. */ - function decoder(value, position, handler) { - entities(value, { - position: normalize(position), - warning: handleWarning, - text: handler, - reference: handler, - textContext: ctx, - referenceContext: ctx - }); - } - - /* Decode `value` (at `position`) into a string. */ - function decodeRaw(value, position, options) { - return entities(value, xtend(options, { - position: normalize(position), - warning: handleWarning - })); - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/defaults.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/defaults.js deleted file mode 100644 index 37846f3930a35a..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/defaults.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = { - position: true, - gfm: true, - commonmark: false, - footnotes: false, - pedantic: false, - blocks: require('./block-elements.json') -}; diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js deleted file mode 100644 index 295bdc9855126e..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - var index = value.indexOf('\n', fromIndex); - - while (index > fromIndex) { - if (value.charAt(index - 1) !== ' ') { - break; - } - - index--; - } - - return index; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/code-inline.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/code-inline.js deleted file mode 100644 index 981c81698254fe..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/code-inline.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - return value.indexOf('`', fromIndex); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/delete.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/delete.js deleted file mode 100644 index d208aef2fff386..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/delete.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - return value.indexOf('~~', fromIndex); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/emphasis.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/emphasis.js deleted file mode 100644 index 6a1f24227d05bb..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/emphasis.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - var asterisk = value.indexOf('*', fromIndex); - var underscore = value.indexOf('_', fromIndex); - - if (underscore === -1) { - return asterisk; - } - - if (asterisk === -1) { - return underscore; - } - - return underscore < asterisk ? underscore : asterisk; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/escape.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/escape.js deleted file mode 100644 index f6c63715827ef3..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/escape.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - return value.indexOf('\\', fromIndex); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/link.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/link.js deleted file mode 100644 index 0f16fd8016bd36..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/link.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - var link = value.indexOf('[', fromIndex); - var image = value.indexOf('![', fromIndex); - - if (image === -1) { - return link; - } - - /* Link can never be `-1` if an image is found, so we don’t need - * to check for that :) */ - return link < image ? link : image; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/strong.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/strong.js deleted file mode 100644 index da1cac0a499f2e..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/strong.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - var asterisk = value.indexOf('**', fromIndex); - var underscore = value.indexOf('__', fromIndex); - - if (underscore === -1) { - return asterisk; - } - - if (asterisk === -1) { - return underscore; - } - - return underscore < asterisk ? underscore : asterisk; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/tag.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/tag.js deleted file mode 100644 index 3c5534268abe1d..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/tag.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = locate; - -function locate(value, fromIndex) { - return value.indexOf('<', fromIndex); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/url.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/url.js deleted file mode 100644 index 59b63e2563693e..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/url.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -module.exports = locate; - -var PROTOCOLS = ['https://', 'http://', 'mailto:']; - -function locate(value, fromIndex) { - var length = PROTOCOLS.length; - var index = -1; - var min = -1; - var position; - - if (!this.options.gfm) { - return -1; - } - - while (++index < length) { - position = value.indexOf(PROTOCOLS[index], fromIndex); - - if (position !== -1 && (position < min || min === -1)) { - min = position; - } - } - - return min; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/parse.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/parse.js deleted file mode 100644 index 5a8d8119556792..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/parse.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var xtend = require('xtend'); -var removePosition = require('unist-util-remove-position'); - -module.exports = parse; - -var C_NEWLINE = '\n'; -var EXPRESSION_LINE_BREAKS = /\r\n|\r/g; - -/* Parse the bound file. */ -function parse() { - var self = this; - var value = String(self.file); - var start = {line: 1, column: 1, offset: 0}; - var content = xtend(start); - var node; - - /* Clean non-unix newlines: `\r\n` and `\r` are all - * changed to `\n`. This should not affect positional - * information. */ - value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE); - - if (value.charCodeAt(0) === 0xFEFF) { - value = value.slice(1); - - content.column++; - content.offset++; - } - - node = { - type: 'root', - children: self.tokenizeBlock(value, content), - position: { - start: start, - end: self.eof || xtend(start) - } - }; - - if (!self.options.position) { - removePosition(node, true); - } - - return node; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/parser.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/parser.js deleted file mode 100644 index 9291109f16f3ec..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/parser.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict'; - -var xtend = require('xtend'); -var toggle = require('state-toggle'); -var vfileLocation = require('vfile-location'); -var unescape = require('./unescape'); -var decode = require('./decode'); -var tokenizer = require('./tokenizer'); - -module.exports = Parser; - -function Parser(doc, file) { - this.file = file; - this.offset = {}; - this.options = xtend(this.options); - this.setOptions({}); - - this.inList = false; - this.inBlock = false; - this.inLink = false; - this.atStart = true; - - this.toOffset = vfileLocation(file).toOffset; - this.unescape = unescape(this, 'escape'); - this.decode = decode(this); -} - -var proto = Parser.prototype; - -/* Expose core. */ -proto.setOptions = require('./set-options'); -proto.parse = require('./parse'); - -/* Expose `defaults`. */ -proto.options = require('./defaults'); - -/* Enter and exit helpers. */ -proto.exitStart = toggle('atStart', true); -proto.enterList = toggle('inList', false); -proto.enterLink = toggle('inLink', false); -proto.enterBlock = toggle('inBlock', false); - -/* Nodes that can interupt a paragraph: - * - * ```markdown - * A paragraph, followed by a thematic break. - * ___ - * ``` - * - * In the above example, the thematic break “interupts” - * the paragraph. */ -proto.interruptParagraph = [ - ['thematicBreak'], - ['atxHeading'], - ['fencedCode'], - ['blockquote'], - ['html'], - ['setextHeading', {commonmark: false}], - ['definition', {commonmark: false}], - ['footnote', {commonmark: false}] -]; - -/* Nodes that can interupt a list: - * - * ```markdown - * - One - * ___ - * ``` - * - * In the above example, the thematic break “interupts” - * the list. */ -proto.interruptList = [ - ['atxHeading', {pedantic: false}], - ['fencedCode', {pedantic: false}], - ['thematicBreak', {pedantic: false}], - ['definition', {commonmark: false}], - ['footnote', {commonmark: false}] -]; - -/* Nodes that can interupt a blockquote: - * - * ```markdown - * > A paragraph. - * ___ - * ``` - * - * In the above example, the thematic break “interupts” - * the blockquote. */ -proto.interruptBlockquote = [ - ['indentedCode', {commonmark: true}], - ['fencedCode', {commonmark: true}], - ['atxHeading', {commonmark: true}], - ['setextHeading', {commonmark: true}], - ['thematicBreak', {commonmark: true}], - ['html', {commonmark: true}], - ['list', {commonmark: true}], - ['definition', {commonmark: false}], - ['footnote', {commonmark: false}] -]; - -/* Handlers. */ -proto.blockTokenizers = { - newline: require('./tokenize/newline'), - indentedCode: require('./tokenize/code-indented'), - fencedCode: require('./tokenize/code-fenced'), - blockquote: require('./tokenize/blockquote'), - atxHeading: require('./tokenize/heading-atx'), - thematicBreak: require('./tokenize/thematic-break'), - list: require('./tokenize/list'), - setextHeading: require('./tokenize/heading-setext'), - html: require('./tokenize/html-block'), - footnote: require('./tokenize/footnote-definition'), - definition: require('./tokenize/definition'), - table: require('./tokenize/table'), - paragraph: require('./tokenize/paragraph') -}; - -proto.inlineTokenizers = { - escape: require('./tokenize/escape'), - autoLink: require('./tokenize/auto-link'), - url: require('./tokenize/url'), - html: require('./tokenize/html-inline'), - link: require('./tokenize/link'), - reference: require('./tokenize/reference'), - strong: require('./tokenize/strong'), - emphasis: require('./tokenize/emphasis'), - deletion: require('./tokenize/delete'), - code: require('./tokenize/code-inline'), - break: require('./tokenize/break'), - text: require('./tokenize/text') -}; - -/* Expose precedence. */ -proto.blockMethods = keys(proto.blockTokenizers); -proto.inlineMethods = keys(proto.inlineTokenizers); - -/* Tokenizers. */ -proto.tokenizeBlock = tokenizer('block'); -proto.tokenizeInline = tokenizer('inline'); -proto.tokenizeFactory = tokenizer; - -/* Get all keys in `value`. */ -function keys(value) { - var result = []; - var key; - - for (key in value) { - result.push(key); - } - - return result; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/set-options.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/set-options.js deleted file mode 100644 index c55f7f32f31def..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/set-options.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var xtend = require('xtend'); -var escapes = require('markdown-escapes'); -var defaults = require('./defaults'); - -module.exports = setOptions; - -function setOptions(options) { - var self = this; - var current = self.options; - var key; - var value; - - if (options == null) { - options = {}; - } else if (typeof options === 'object') { - options = xtend(options); - } else { - throw new Error( - 'Invalid value `' + options + '` ' + - 'for setting `options`' - ); - } - - for (key in defaults) { - value = options[key]; - - if (value == null) { - value = current[key]; - } - - if ( - (key !== 'blocks' && typeof value !== 'boolean') || - (key === 'blocks' && typeof value !== 'object') - ) { - throw new Error('Invalid value `' + value + '` for setting `options.' + key + '`'); - } - - options[key] = value; - } - - self.options = options; - self.escape = escapes(options); - - return self; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js deleted file mode 100644 index c945a2c1f88f58..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js +++ /dev/null @@ -1,145 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var decode = require('parse-entities'); -var locate = require('../locate/tag'); - -module.exports = autoLink; -autoLink.locator = locate; -autoLink.notInLink = true; - -var C_LT = '<'; -var C_GT = '>'; -var C_AT_SIGN = '@'; -var C_SLASH = '/'; -var MAILTO = 'mailto:'; -var MAILTO_LENGTH = MAILTO.length; - -/* Tokenise a link. */ -function autoLink(eat, value, silent) { - var self; - var subvalue; - var length; - var index; - var queue; - var character; - var hasAtCharacter; - var link; - var now; - var content; - var tokenizers; - var exit; - - if (value.charAt(0) !== C_LT) { - return; - } - - self = this; - subvalue = ''; - length = value.length; - index = 0; - queue = ''; - hasAtCharacter = false; - link = ''; - - index++; - subvalue = C_LT; - - while (index < length) { - character = value.charAt(index); - - if ( - whitespace(character) || - character === C_GT || - character === C_AT_SIGN || - (character === ':' && value.charAt(index + 1) === C_SLASH) - ) { - break; - } - - queue += character; - index++; - } - - if (!queue) { - return; - } - - link += queue; - queue = ''; - - character = value.charAt(index); - link += character; - index++; - - if (character === C_AT_SIGN) { - hasAtCharacter = true; - } else { - if ( - character !== ':' || - value.charAt(index + 1) !== C_SLASH - ) { - return; - } - - link += C_SLASH; - index++; - } - - while (index < length) { - character = value.charAt(index); - - if (whitespace(character) || character === C_GT) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - - if (!queue || character !== C_GT) { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - link += queue; - content = link; - subvalue += link + character; - now = eat.now(); - now.column++; - now.offset++; - - if (hasAtCharacter) { - if (link.slice(0, MAILTO_LENGTH).toLowerCase() === MAILTO) { - content = content.substr(MAILTO_LENGTH); - now.column += MAILTO_LENGTH; - now.offset += MAILTO_LENGTH; - } else { - link = MAILTO + link; - } - } - - /* Temporarily remove all tokenizers except text in autolinks. */ - tokenizers = self.inlineTokenizers; - self.inlineTokenizers = {text: tokenizers.text}; - - exit = self.enterLink(); - - content = self.tokenizeInline(content, now); - - self.inlineTokenizers = tokenizers; - exit(); - - return eat(subvalue)({ - type: 'link', - title: null, - url: decode(link, {nonTerminated: false}), - children: content - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js deleted file mode 100644 index bd700d6a6c8276..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -var trim = require('trim'); -var interrupt = require('../util/interrupt'); - -module.exports = blockquote; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_GT = '>'; - -/* Tokenise a blockquote. */ -function blockquote(eat, value, silent) { - var self = this; - var offsets = self.offset; - var tokenizers = self.blockTokenizers; - var interruptors = self.interruptBlockquote; - var now = eat.now(); - var currentLine = now.line; - var length = value.length; - var values = []; - var contents = []; - var indents = []; - var add; - var index = 0; - var character; - var rest; - var nextIndex; - var content; - var line; - var startIndex; - var prefixed; - var exit; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - index++; - } - - if (value.charAt(index) !== C_GT) { - return; - } - - if (silent) { - return true; - } - - index = 0; - - while (index < length) { - nextIndex = value.indexOf(C_NEWLINE, index); - startIndex = index; - prefixed = false; - - if (nextIndex === -1) { - nextIndex = length; - } - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - index++; - } - - if (value.charAt(index) === C_GT) { - index++; - prefixed = true; - - if (value.charAt(index) === C_SPACE) { - index++; - } - } else { - index = startIndex; - } - - content = value.slice(index, nextIndex); - - if (!prefixed && !trim(content)) { - index = startIndex; - break; - } - - if (!prefixed) { - rest = value.slice(index); - - /* Check if the following code contains a possible - * block. */ - if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) { - break; - } - } - - line = startIndex === index ? content : value.slice(startIndex, nextIndex); - - indents.push(index - startIndex); - values.push(line); - contents.push(content); - - index = nextIndex + 1; - } - - index = -1; - length = indents.length; - add = eat(values.join(C_NEWLINE)); - - while (++index < length) { - offsets[currentLine] = (offsets[currentLine] || 0) + indents[index]; - currentLine++; - } - - exit = self.enterBlock(); - contents = self.tokenizeBlock(contents.join(C_NEWLINE), now); - exit(); - - return add({ - type: 'blockquote', - children: contents - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/break.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/break.js deleted file mode 100644 index eb531342bfebcb..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/break.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var locate = require('../locate/break'); - -module.exports = hardBreak; -hardBreak.locator = locate; - -var MIN_BREAK_LENGTH = 2; - -function hardBreak(eat, value, silent) { - var length = value.length; - var index = -1; - var queue = ''; - var character; - - while (++index < length) { - character = value.charAt(index); - - if (character === '\n') { - if (index < MIN_BREAK_LENGTH) { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - queue += character; - - return eat(queue)({type: 'break'}); - } - - if (character !== ' ') { - return; - } - - queue += character; - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js deleted file mode 100644 index 65f2bc73273ab3..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js +++ /dev/null @@ -1,236 +0,0 @@ -'use strict'; - -var trim = require('trim-trailing-lines'); - -module.exports = fencedCode; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_TILDE = '~'; -var C_TICK = '`'; - -var MIN_FENCE_COUNT = 3; -var CODE_INDENT_COUNT = 4; - -function fencedCode(eat, value, silent) { - var self = this; - var settings = self.options; - var length = value.length + 1; - var index = 0; - var subvalue = ''; - var fenceCount; - var marker; - var character; - var flag; - var queue; - var content; - var exdentedContent; - var closing; - var exdentedClosing; - var indent; - var now; - - if (!settings.gfm) { - return; - } - - /* Eat initial spacing. */ - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - subvalue += character; - index++; - } - - indent = index; - - /* Eat the fence. */ - character = value.charAt(index); - - if (character !== C_TILDE && character !== C_TICK) { - return; - } - - index++; - marker = character; - fenceCount = 1; - subvalue += character; - - while (index < length) { - character = value.charAt(index); - - if (character !== marker) { - break; - } - - subvalue += character; - fenceCount++; - index++; - } - - if (fenceCount < MIN_FENCE_COUNT) { - return; - } - - /* Eat spacing before flag. */ - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - subvalue += character; - index++; - } - - /* Eat flag. */ - flag = ''; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if ( - character === C_NEWLINE || - character === C_TILDE || - character === C_TICK - ) { - break; - } - - if (character === C_SPACE || character === C_TAB) { - queue += character; - } else { - flag += queue + character; - queue = ''; - } - - index++; - } - - character = value.charAt(index); - - if (character && character !== C_NEWLINE) { - return; - } - - if (silent) { - return true; - } - - now = eat.now(); - now.column += subvalue.length; - now.offset += subvalue.length; - - subvalue += flag; - flag = self.decode.raw(self.unescape(flag), now); - - if (queue) { - subvalue += queue; - } - - queue = ''; - closing = ''; - exdentedClosing = ''; - content = ''; - exdentedContent = ''; - - /* Eat content. */ - while (index < length) { - character = value.charAt(index); - content += closing; - exdentedContent += exdentedClosing; - closing = ''; - exdentedClosing = ''; - - if (character !== C_NEWLINE) { - content += character; - exdentedClosing += character; - index++; - continue; - } - - /* Add the newline to `subvalue` if its the first - * character. Otherwise, add it to the `closing` - * queue. */ - if (content) { - closing += character; - exdentedClosing += character; - } else { - subvalue += character; - } - - queue = ''; - index++; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE) { - break; - } - - queue += character; - index++; - } - - closing += queue; - exdentedClosing += queue.slice(indent); - - if (queue.length >= CODE_INDENT_COUNT) { - continue; - } - - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character !== marker) { - break; - } - - queue += character; - index++; - } - - closing += queue; - exdentedClosing += queue; - - if (queue.length < fenceCount) { - continue; - } - - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - closing += character; - exdentedClosing += character; - index++; - } - - if (!character || character === C_NEWLINE) { - break; - } - } - - subvalue += content + closing; - - return eat(subvalue)({ - type: 'code', - lang: flag || null, - value: trim(exdentedContent) - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js deleted file mode 100644 index c73849d9ad8bf2..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var repeat = require('repeat-string'); -var trim = require('trim-trailing-lines'); - -module.exports = indentedCode; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; - -var CODE_INDENT_COUNT = 4; -var CODE_INDENT = repeat(C_SPACE, CODE_INDENT_COUNT); - -/* Tokenise indented code. */ -function indentedCode(eat, value, silent) { - var index = -1; - var length = value.length; - var subvalue = ''; - var content = ''; - var subvalueQueue = ''; - var contentQueue = ''; - var character; - var blankQueue; - var indent; - - while (++index < length) { - character = value.charAt(index); - - if (indent) { - indent = false; - - subvalue += subvalueQueue; - content += contentQueue; - subvalueQueue = ''; - contentQueue = ''; - - if (character === C_NEWLINE) { - subvalueQueue = character; - contentQueue = character; - } else { - subvalue += character; - content += character; - - while (++index < length) { - character = value.charAt(index); - - if (!character || character === C_NEWLINE) { - contentQueue = character; - subvalueQueue = character; - break; - } - - subvalue += character; - content += character; - } - } - } else if ( - character === C_SPACE && - value.charAt(index + 1) === character && - value.charAt(index + 2) === character && - value.charAt(index + 3) === character - ) { - subvalueQueue += CODE_INDENT; - index += 3; - indent = true; - } else if (character === C_TAB) { - subvalueQueue += character; - indent = true; - } else { - blankQueue = ''; - - while (character === C_TAB || character === C_SPACE) { - blankQueue += character; - character = value.charAt(++index); - } - - if (character !== C_NEWLINE) { - break; - } - - subvalueQueue += blankQueue + character; - contentQueue += character; - } - } - - if (content) { - if (silent) { - return true; - } - - return eat(subvalue)({ - type: 'code', - lang: null, - value: trim(content) - }); - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js deleted file mode 100644 index c0a496b49255ba..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/code-inline'); - -module.exports = inlineCode; -inlineCode.locator = locate; - -var C_TICK = '`'; - -/* Tokenise inline code. */ -function inlineCode(eat, value, silent) { - var length = value.length; - var index = 0; - var queue = ''; - var tickQueue = ''; - var contentQueue; - var subqueue; - var count; - var openingCount; - var subvalue; - var character; - var found; - var next; - - while (index < length) { - if (value.charAt(index) !== C_TICK) { - break; - } - - queue += C_TICK; - index++; - } - - if (!queue) { - return; - } - - subvalue = queue; - openingCount = index; - queue = ''; - next = value.charAt(index); - count = 0; - - while (index < length) { - character = next; - next = value.charAt(index + 1); - - if (character === C_TICK) { - count++; - tickQueue += character; - } else { - count = 0; - queue += character; - } - - if (count && next !== C_TICK) { - if (count === openingCount) { - subvalue += queue + tickQueue; - found = true; - break; - } - - queue += tickQueue; - tickQueue = ''; - } - - index++; - } - - if (!found) { - if (openingCount % 2 !== 0) { - return; - } - - queue = ''; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - contentQueue = ''; - subqueue = ''; - length = queue.length; - index = -1; - - while (++index < length) { - character = queue.charAt(index); - - if (whitespace(character)) { - subqueue += character; - continue; - } - - if (subqueue) { - if (contentQueue) { - contentQueue += subqueue; - } - - subqueue = ''; - } - - contentQueue += character; - } - - return eat(subvalue)({ - type: 'inlineCode', - value: contentQueue - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/definition.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/definition.js deleted file mode 100644 index 1cce274cfbdd71..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/definition.js +++ /dev/null @@ -1,278 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var normalize = require('../util/normalize'); - -module.exports = definition; -definition.notInList = true; -definition.notInBlock = true; - -var C_DOUBLE_QUOTE = '"'; -var C_SINGLE_QUOTE = '\''; -var C_BACKSLASH = '\\'; -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_BRACKET_OPEN = '['; -var C_BRACKET_CLOSE = ']'; -var C_PAREN_OPEN = '('; -var C_PAREN_CLOSE = ')'; -var C_COLON = ':'; -var C_LT = '<'; -var C_GT = '>'; - -function definition(eat, value, silent) { - var self = this; - var commonmark = self.options.commonmark; - var index = 0; - var length = value.length; - var subvalue = ''; - var beforeURL; - var beforeTitle; - var queue; - var character; - var test; - var identifier; - var url; - var title; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - break; - } - - subvalue += character; - index++; - } - - character = value.charAt(index); - - if (character !== C_BRACKET_OPEN) { - return; - } - - index++; - subvalue += character; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character === C_BRACKET_CLOSE) { - break; - } else if (character === C_BACKSLASH) { - queue += character; - index++; - character = value.charAt(index); - } - - queue += character; - index++; - } - - if ( - !queue || - value.charAt(index) !== C_BRACKET_CLOSE || - value.charAt(index + 1) !== C_COLON - ) { - return; - } - - identifier = queue; - subvalue += queue + C_BRACKET_CLOSE + C_COLON; - index = subvalue.length; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if ( - character !== C_TAB && - character !== C_SPACE && - character !== C_NEWLINE - ) { - break; - } - - subvalue += character; - index++; - } - - character = value.charAt(index); - queue = ''; - beforeURL = subvalue; - - if (character === C_LT) { - index++; - - while (index < length) { - character = value.charAt(index); - - if (!isEnclosedURLCharacter(character)) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - - if (character === isEnclosedURLCharacter.delimiter) { - subvalue += C_LT + queue + character; - index++; - } else { - if (commonmark) { - return; - } - - index -= queue.length + 1; - queue = ''; - } - } - - if (!queue) { - while (index < length) { - character = value.charAt(index); - - if (!isUnclosedURLCharacter(character)) { - break; - } - - queue += character; - index++; - } - - subvalue += queue; - } - - if (!queue) { - return; - } - - url = queue; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if ( - character !== C_TAB && - character !== C_SPACE && - character !== C_NEWLINE - ) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - test = null; - - if (character === C_DOUBLE_QUOTE) { - test = C_DOUBLE_QUOTE; - } else if (character === C_SINGLE_QUOTE) { - test = C_SINGLE_QUOTE; - } else if (character === C_PAREN_OPEN) { - test = C_PAREN_CLOSE; - } - - if (!test) { - queue = ''; - index = subvalue.length; - } else if (queue) { - subvalue += queue + character; - index = subvalue.length; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character === test) { - break; - } - - if (character === C_NEWLINE) { - index++; - character = value.charAt(index); - - if (character === C_NEWLINE || character === test) { - return; - } - - queue += C_NEWLINE; - } - - queue += character; - index++; - } - - character = value.charAt(index); - - if (character !== test) { - return; - } - - beforeTitle = subvalue; - subvalue += queue + character; - index++; - title = queue; - queue = ''; - } else { - return; - } - - while (index < length) { - character = value.charAt(index); - - if (character !== C_TAB && character !== C_SPACE) { - break; - } - - subvalue += character; - index++; - } - - character = value.charAt(index); - - if (!character || character === C_NEWLINE) { - if (silent) { - return true; - } - - beforeURL = eat(beforeURL).test().end; - url = self.decode.raw(self.unescape(url), beforeURL, {nonTerminated: false}); - - if (title) { - beforeTitle = eat(beforeTitle).test().end; - title = self.decode.raw(self.unescape(title), beforeTitle); - } - - return eat(subvalue)({ - type: 'definition', - identifier: normalize(identifier), - title: title || null, - url: url - }); - } -} - -/* Check if `character` can be inside an enclosed URI. */ -function isEnclosedURLCharacter(character) { - return character !== C_GT && - character !== C_BRACKET_OPEN && - character !== C_BRACKET_CLOSE; -} - -isEnclosedURLCharacter.delimiter = C_GT; - -/* Check if `character` can be inside an unclosed URI. */ -function isUnclosedURLCharacter(character) { - return character !== C_BRACKET_OPEN && - character !== C_BRACKET_CLOSE && - !whitespace(character); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/delete.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/delete.js deleted file mode 100644 index ca7c68a8c5c1be..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/delete.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/delete'); - -module.exports = strikethrough; -strikethrough.locator = locate; - -var C_TILDE = '~'; -var DOUBLE = '~~'; - -function strikethrough(eat, value, silent) { - var self = this; - var character = ''; - var previous = ''; - var preceding = ''; - var subvalue = ''; - var index; - var length; - var now; - - if ( - !self.options.gfm || - value.charAt(0) !== C_TILDE || - value.charAt(1) !== C_TILDE || - whitespace(value.charAt(2)) - ) { - return; - } - - index = 1; - length = value.length; - now = eat.now(); - now.column += 2; - now.offset += 2; - - while (++index < length) { - character = value.charAt(index); - - if ( - character === C_TILDE && - previous === C_TILDE && - (!preceding || !whitespace(preceding)) - ) { - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - return eat(DOUBLE + subvalue + DOUBLE)({ - type: 'delete', - children: self.tokenizeInline(subvalue, now) - }); - } - - subvalue += previous; - preceding = previous; - previous = character; - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js deleted file mode 100644 index b2c87b4497de38..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -var trim = require('trim'); -var word = require('is-word-character'); -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/emphasis'); - -module.exports = emphasis; -emphasis.locator = locate; - -var C_ASTERISK = '*'; -var C_UNDERSCORE = '_'; - -function emphasis(eat, value, silent) { - var self = this; - var index = 0; - var character = value.charAt(index); - var now; - var pedantic; - var marker; - var queue; - var subvalue; - var length; - var prev; - - if (character !== C_ASTERISK && character !== C_UNDERSCORE) { - return; - } - - pedantic = self.options.pedantic; - subvalue = character; - marker = character; - length = value.length; - index++; - queue = ''; - character = ''; - - if (pedantic && whitespace(value.charAt(index))) { - return; - } - - while (index < length) { - prev = character; - character = value.charAt(index); - - if (character === marker && (!pedantic || !whitespace(prev))) { - character = value.charAt(++index); - - if (character !== marker) { - if (!trim(queue) || prev === marker) { - return; - } - - if (!pedantic && marker === C_UNDERSCORE && word(character)) { - queue += marker; - continue; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - now = eat.now(); - now.column++; - now.offset++; - - return eat(subvalue + queue + marker)({ - type: 'emphasis', - children: self.tokenizeInline(queue, now) - }); - } - - queue += marker; - } - - if (!pedantic && character === '\\') { - queue += character; - character = value.charAt(++index); - } - - queue += character; - index++; - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/escape.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/escape.js deleted file mode 100644 index d6f99bcc10381d..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/escape.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var locate = require('../locate/escape'); - -module.exports = escape; -escape.locator = locate; - -function escape(eat, value, silent) { - var self = this; - var character; - var node; - - if (value.charAt(0) === '\\') { - character = value.charAt(1); - - if (self.escape.indexOf(character) !== -1) { - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - if (character === '\n') { - node = {type: 'break'}; - } else { - node = { - type: 'text', - value: character - }; - } - - return eat('\\' + character)(node); - } - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js deleted file mode 100644 index f48ff9bb7eb187..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var normalize = require('../util/normalize'); - -module.exports = footnoteDefinition; -footnoteDefinition.notInList = true; -footnoteDefinition.notInBlock = true; - -var C_BACKSLASH = '\\'; -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_BRACKET_OPEN = '['; -var C_BRACKET_CLOSE = ']'; -var C_CARET = '^'; -var C_COLON = ':'; - -var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm; - -function footnoteDefinition(eat, value, silent) { - var self = this; - var offsets = self.offset; - var index; - var length; - var subvalue; - var now; - var currentLine; - var content; - var queue; - var subqueue; - var character; - var identifier; - var add; - var exit; - - if (!self.options.footnotes) { - return; - } - - index = 0; - length = value.length; - subvalue = ''; - now = eat.now(); - currentLine = now.line; - - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - subvalue += character; - index++; - } - - if ( - value.charAt(index) !== C_BRACKET_OPEN || - value.charAt(index + 1) !== C_CARET - ) { - return; - } - - subvalue += C_BRACKET_OPEN + C_CARET; - index = subvalue.length; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character === C_BRACKET_CLOSE) { - break; - } else if (character === C_BACKSLASH) { - queue += character; - index++; - character = value.charAt(index); - } - - queue += character; - index++; - } - - if ( - !queue || - value.charAt(index) !== C_BRACKET_CLOSE || - value.charAt(index + 1) !== C_COLON - ) { - return; - } - - if (silent) { - return true; - } - - identifier = normalize(queue); - subvalue += queue + C_BRACKET_CLOSE + C_COLON; - index = subvalue.length; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_TAB && character !== C_SPACE) { - break; - } - - subvalue += character; - index++; - } - - now.column += subvalue.length; - now.offset += subvalue.length; - queue = ''; - content = ''; - subqueue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character === C_NEWLINE) { - subqueue = character; - index++; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_NEWLINE) { - break; - } - - subqueue += character; - index++; - } - - queue += subqueue; - subqueue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character !== C_SPACE) { - break; - } - - subqueue += character; - index++; - } - - if (subqueue.length === 0) { - break; - } - - queue += subqueue; - } - - if (queue) { - content += queue; - queue = ''; - } - - content += character; - index++; - } - - subvalue += content; - - content = content.replace(EXPRESSION_INITIAL_TAB, function (line) { - offsets[currentLine] = (offsets[currentLine] || 0) + line.length; - currentLine++; - - return ''; - }); - - add = eat(subvalue); - - exit = self.enterBlock(); - content = self.tokenizeBlock(content, now); - exit(); - - return add({ - type: 'footnoteDefinition', - identifier: identifier, - children: content - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js deleted file mode 100644 index aafeabb54910f6..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -module.exports = atxHeading; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_HASH = '#'; - -var MAX_ATX_COUNT = 6; - -function atxHeading(eat, value, silent) { - var self = this; - var settings = self.options; - var length = value.length + 1; - var index = -1; - var now = eat.now(); - var subvalue = ''; - var content = ''; - var character; - var queue; - var depth; - - /* Eat initial spacing. */ - while (++index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - index--; - break; - } - - subvalue += character; - } - - /* Eat hashes. */ - depth = 0; - - while (++index <= length) { - character = value.charAt(index); - - if (character !== C_HASH) { - index--; - break; - } - - subvalue += character; - depth++; - } - - if (depth > MAX_ATX_COUNT) { - return; - } - - if ( - !depth || - (!settings.pedantic && value.charAt(index + 1) === C_HASH) - ) { - return; - } - - length = value.length + 1; - - /* Eat intermediate white-space. */ - queue = ''; - - while (++index < length) { - character = value.charAt(index); - - if (character !== C_SPACE && character !== C_TAB) { - index--; - break; - } - - queue += character; - } - - /* Exit when not in pedantic mode without spacing. */ - if ( - !settings.pedantic && - queue.length === 0 && - character && - character !== C_NEWLINE - ) { - return; - } - - if (silent) { - return true; - } - - /* Eat content. */ - subvalue += queue; - queue = ''; - content = ''; - - while (++index < length) { - character = value.charAt(index); - - if (!character || character === C_NEWLINE) { - break; - } - - if ( - character !== C_SPACE && - character !== C_TAB && - character !== C_HASH - ) { - content += queue + character; - queue = ''; - continue; - } - - while (character === C_SPACE || character === C_TAB) { - queue += character; - character = value.charAt(++index); - } - - while (character === C_HASH) { - queue += character; - character = value.charAt(++index); - } - - while (character === C_SPACE || character === C_TAB) { - queue += character; - character = value.charAt(++index); - } - - index--; - } - - now.column += subvalue.length; - now.offset += subvalue.length; - subvalue += content + queue; - - return eat(subvalue)({ - type: 'heading', - depth: depth, - children: self.tokenizeInline(content, now) - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js deleted file mode 100644 index 96c6130da744e1..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict'; - -module.exports = setextHeading; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_EQUALS = '='; -var C_DASH = '-'; - -var MAX_HEADING_INDENT = 3; - -/* Map of characters which can be used to mark setext - * headers, mapping to their corresponding depth. */ -var SETEXT_MARKERS = {}; - -SETEXT_MARKERS[C_EQUALS] = 1; -SETEXT_MARKERS[C_DASH] = 2; - -function setextHeading(eat, value, silent) { - var self = this; - var now = eat.now(); - var length = value.length; - var index = -1; - var subvalue = ''; - var content; - var queue; - var character; - var marker; - var depth; - - /* Eat initial indentation. */ - while (++index < length) { - character = value.charAt(index); - - if (character !== C_SPACE || index >= MAX_HEADING_INDENT) { - index--; - break; - } - - subvalue += character; - } - - /* Eat content. */ - content = ''; - queue = ''; - - while (++index < length) { - character = value.charAt(index); - - if (character === C_NEWLINE) { - index--; - break; - } - - if (character === C_SPACE || character === C_TAB) { - queue += character; - } else { - content += queue + character; - queue = ''; - } - } - - now.column += subvalue.length; - now.offset += subvalue.length; - subvalue += content + queue; - - /* Ensure the content is followed by a newline and a - * valid marker. */ - character = value.charAt(++index); - marker = value.charAt(++index); - - if (character !== C_NEWLINE || !SETEXT_MARKERS[marker]) { - return; - } - - subvalue += character; - - /* Eat Setext-line. */ - queue = marker; - depth = SETEXT_MARKERS[marker]; - - while (++index < length) { - character = value.charAt(index); - - if (character !== marker) { - if (character !== C_NEWLINE) { - return; - } - - index--; - break; - } - - queue += character; - } - - if (silent) { - return true; - } - - return eat(subvalue + queue)({ - type: 'heading', - depth: depth, - children: self.tokenizeInline(content, now) - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-block.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-block.js deleted file mode 100644 index 6e81eb290a3993..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-block.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -var openCloseTag = require('../util/html').openCloseTag; - -module.exports = blockHTML; - -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_NEWLINE = '\n'; -var C_LT = '<'; - -function blockHTML(eat, value, silent) { - var self = this; - var blocks = self.options.blocks; - var length = value.length; - var index = 0; - var next; - var line; - var offset; - var character; - var count; - var sequence; - var subvalue; - - var sequences = [ - [/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true], - [/^/, true], - [/^<\?/, /\?>/, true], - [/^/, true], - [/^/, true], - [new RegExp('^|$))', 'i'), /^$/, true], - [new RegExp(openCloseTag.source + '\\s*$'), /^$/, false] - ]; - - /* Eat initial spacing. */ - while (index < length) { - character = value.charAt(index); - - if (character !== C_TAB && character !== C_SPACE) { - break; - } - - index++; - } - - if (value.charAt(index) !== C_LT) { - return; - } - - next = value.indexOf(C_NEWLINE, index + 1); - next = next === -1 ? length : next; - line = value.slice(index, next); - offset = -1; - count = sequences.length; - - while (++offset < count) { - if (sequences[offset][0].test(line)) { - sequence = sequences[offset]; - break; - } - } - - if (!sequence) { - return; - } - - if (silent) { - return sequence[2]; - } - - index = next; - - if (!sequence[1].test(line)) { - while (index < length) { - next = value.indexOf(C_NEWLINE, index + 1); - next = next === -1 ? length : next; - line = value.slice(index + 1, next); - - if (sequence[1].test(line)) { - if (line) { - index = next; - } - - break; - } - - index = next; - } - } - - subvalue = value.slice(0, index); - - return eat(subvalue)({type: 'html', value: subvalue}); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js deleted file mode 100644 index c204e962b15ae8..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var alphabetical = require('is-alphabetical'); -var locate = require('../locate/tag'); -var tag = require('../util/html').tag; - -module.exports = inlineHTML; -inlineHTML.locator = locate; - -var EXPRESSION_HTML_LINK_OPEN = /^/i; - -function inlineHTML(eat, value, silent) { - var self = this; - var length = value.length; - var character; - var subvalue; - - if (value.charAt(0) !== '<' || length < 3) { - return; - } - - character = value.charAt(1); - - if ( - !alphabetical(character) && - character !== '?' && - character !== '!' && - character !== '/' - ) { - return; - } - - subvalue = value.match(tag); - - if (!subvalue) { - return; - } - - /* istanbul ignore if - not used yet. */ - if (silent) { - return true; - } - - subvalue = subvalue[0]; - - if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test(subvalue)) { - self.inLink = true; - } else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test(subvalue)) { - self.inLink = false; - } - - return eat(subvalue)({type: 'html', value: subvalue}); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/link.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/link.js deleted file mode 100644 index 3ef5e1ba312d75..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/link.js +++ /dev/null @@ -1,392 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/link'); - -module.exports = link; -link.locator = locate; - -var own = {}.hasOwnProperty; - -var C_BACKSLASH = '\\'; -var C_BRACKET_OPEN = '['; -var C_BRACKET_CLOSE = ']'; -var C_PAREN_OPEN = '('; -var C_PAREN_CLOSE = ')'; -var C_LT = '<'; -var C_GT = '>'; -var C_TICK = '`'; -var C_DOUBLE_QUOTE = '"'; -var C_SINGLE_QUOTE = '\''; - -/* Map of characters, which can be used to mark link - * and image titles. */ -var LINK_MARKERS = {}; - -LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE; -LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE; - -/* Map of characters, which can be used to mark link - * and image titles in commonmark-mode. */ -var COMMONMARK_LINK_MARKERS = {}; - -COMMONMARK_LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE; -COMMONMARK_LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE; -COMMONMARK_LINK_MARKERS[C_PAREN_OPEN] = C_PAREN_CLOSE; - -function link(eat, value, silent) { - var self = this; - var subvalue = ''; - var index = 0; - var character = value.charAt(0); - var pedantic = self.options.pedantic; - var commonmark = self.options.commonmark; - var gfm = self.options.gfm; - var closed; - var count; - var opening; - var beforeURL; - var beforeTitle; - var subqueue; - var hasMarker; - var markers; - var isImage; - var content; - var marker; - var length; - var title; - var depth; - var queue; - var url; - var now; - var exit; - var node; - - /* Detect whether this is an image. */ - if (character === '!') { - isImage = true; - subvalue = character; - character = value.charAt(++index); - } - - /* Eat the opening. */ - if (character !== C_BRACKET_OPEN) { - return; - } - - /* Exit when this is a link and we’re already inside - * a link. */ - if (!isImage && self.inLink) { - return; - } - - subvalue += character; - queue = ''; - index++; - - /* Eat the content. */ - length = value.length; - now = eat.now(); - depth = 0; - - now.column += index; - now.offset += index; - - while (index < length) { - character = value.charAt(index); - subqueue = character; - - if (character === C_TICK) { - /* Inline-code in link content. */ - count = 1; - - while (value.charAt(index + 1) === C_TICK) { - subqueue += character; - index++; - count++; - } - - if (!opening) { - opening = count; - } else if (count >= opening) { - opening = 0; - } - } else if (character === C_BACKSLASH) { - /* Allow brackets to be escaped. */ - index++; - subqueue += value.charAt(index); - /* In GFM mode, brackets in code still count. - * In all other modes, they don’t. This empty - * block prevents the next statements are - * entered. */ - } else if ((!opening || gfm) && character === C_BRACKET_OPEN) { - depth++; - } else if ((!opening || gfm) && character === C_BRACKET_CLOSE) { - if (depth) { - depth--; - } else { - /* Allow white-space between content and - * url in GFM mode. */ - if (!pedantic) { - while (index < length) { - character = value.charAt(index + 1); - - if (!whitespace(character)) { - break; - } - - subqueue += character; - index++; - } - } - - if (value.charAt(index + 1) !== C_PAREN_OPEN) { - return; - } - - subqueue += C_PAREN_OPEN; - closed = true; - index++; - - break; - } - } - - queue += subqueue; - subqueue = ''; - index++; - } - - /* Eat the content closing. */ - if (!closed) { - return; - } - - content = queue; - subvalue += queue + subqueue; - index++; - - /* Eat white-space. */ - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - subvalue += character; - index++; - } - - /* Eat the URL. */ - character = value.charAt(index); - markers = commonmark ? COMMONMARK_LINK_MARKERS : LINK_MARKERS; - queue = ''; - beforeURL = subvalue; - - if (character === C_LT) { - index++; - beforeURL += C_LT; - - while (index < length) { - character = value.charAt(index); - - if (character === C_GT) { - break; - } - - if (commonmark && character === '\n') { - return; - } - - queue += character; - index++; - } - - if (value.charAt(index) !== C_GT) { - return; - } - - subvalue += C_LT + queue + C_GT; - url = queue; - index++; - } else { - character = null; - subqueue = ''; - - while (index < length) { - character = value.charAt(index); - - if (subqueue && own.call(markers, character)) { - break; - } - - if (whitespace(character)) { - if (!pedantic) { - break; - } - - subqueue += character; - } else { - if (character === C_PAREN_OPEN) { - depth++; - } else if (character === C_PAREN_CLOSE) { - if (depth === 0) { - break; - } - - depth--; - } - - queue += subqueue; - subqueue = ''; - - if (character === C_BACKSLASH) { - queue += C_BACKSLASH; - character = value.charAt(++index); - } - - queue += character; - } - - index++; - } - - subvalue += queue; - url = queue; - index = subvalue.length; - } - - /* Eat white-space. */ - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - subvalue += queue; - - /* Eat the title. */ - if (queue && own.call(markers, character)) { - index++; - subvalue += character; - queue = ''; - marker = markers[character]; - beforeTitle = subvalue; - - /* In commonmark-mode, things are pretty easy: the - * marker cannot occur inside the title. - * - * Non-commonmark does, however, support nested - * delimiters. */ - if (commonmark) { - while (index < length) { - character = value.charAt(index); - - if (character === marker) { - break; - } - - if (character === C_BACKSLASH) { - queue += C_BACKSLASH; - character = value.charAt(++index); - } - - index++; - queue += character; - } - - character = value.charAt(index); - - if (character !== marker) { - return; - } - - title = queue; - subvalue += queue + character; - index++; - - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - subvalue += character; - index++; - } - } else { - subqueue = ''; - - while (index < length) { - character = value.charAt(index); - - if (character === marker) { - if (hasMarker) { - queue += marker + subqueue; - subqueue = ''; - } - - hasMarker = true; - } else if (!hasMarker) { - queue += character; - } else if (character === C_PAREN_CLOSE) { - subvalue += queue + marker + subqueue; - title = queue; - break; - } else if (whitespace(character)) { - subqueue += character; - } else { - queue += marker + subqueue + character; - subqueue = ''; - hasMarker = false; - } - - index++; - } - } - } - - if (value.charAt(index) !== C_PAREN_CLOSE) { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - subvalue += C_PAREN_CLOSE; - - url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end, {nonTerminated: false}); - - if (title) { - beforeTitle = eat(beforeTitle).test().end; - title = self.decode.raw(self.unescape(title), beforeTitle); - } - - node = { - type: isImage ? 'image' : 'link', - title: title || null, - url: url - }; - - if (isImage) { - node.alt = self.decode.raw(self.unescape(content), now) || null; - } else { - exit = self.enterLink(); - node.children = self.tokenizeInline(content, now); - exit(); - } - - return eat(subvalue)(node); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/list.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/list.js deleted file mode 100644 index 9164c8167f8dc1..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/list.js +++ /dev/null @@ -1,474 +0,0 @@ -'use strict'; - -/* eslint-disable max-params */ - -var trim = require('trim'); -var repeat = require('repeat-string'); -var decimal = require('is-decimal'); -var getIndent = require('../util/get-indentation'); -var removeIndent = require('../util/remove-indentation'); -var interrupt = require('../util/interrupt'); - -module.exports = list; - -var C_ASTERISK = '*'; -var C_UNDERSCORE = '_'; -var C_PLUS = '+'; -var C_DASH = '-'; -var C_DOT = '.'; -var C_SPACE = ' '; -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_PAREN_CLOSE = ')'; -var C_X_LOWER = 'x'; - -var TAB_SIZE = 4; -var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/; -var EXPRESSION_TASK_ITEM = /^\[([ \t]|x|X)][ \t]/; -var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/; -var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/; -var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm; - -/* Map of characters which can be used to mark - * list-items. */ -var LIST_UNORDERED_MARKERS = {}; - -LIST_UNORDERED_MARKERS[C_ASTERISK] = true; -LIST_UNORDERED_MARKERS[C_PLUS] = true; -LIST_UNORDERED_MARKERS[C_DASH] = true; - -/* Map of characters which can be used to mark - * list-items after a digit. */ -var LIST_ORDERED_MARKERS = {}; - -LIST_ORDERED_MARKERS[C_DOT] = true; - -/* Map of characters which can be used to mark - * list-items after a digit. */ -var LIST_ORDERED_COMMONMARK_MARKERS = {}; - -LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true; -LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true; - -function list(eat, value, silent) { - var self = this; - var commonmark = self.options.commonmark; - var pedantic = self.options.pedantic; - var tokenizers = self.blockTokenizers; - var interuptors = self.interruptList; - var markers; - var index = 0; - var length = value.length; - var start = null; - var size = 0; - var queue; - var ordered; - var character; - var marker; - var nextIndex; - var startIndex; - var prefixed; - var currentMarker; - var content; - var line; - var prevEmpty; - var empty; - var items; - var allLines; - var emptyLines; - var item; - var enterTop; - var exitBlockquote; - var isLoose; - var node; - var now; - var end; - var indented; - - while (index < length) { - character = value.charAt(index); - - if (character === C_TAB) { - size += TAB_SIZE - (size % TAB_SIZE); - } else if (character === C_SPACE) { - size++; - } else { - break; - } - - index++; - } - - if (size >= TAB_SIZE) { - return; - } - - character = value.charAt(index); - - markers = commonmark ? - LIST_ORDERED_COMMONMARK_MARKERS : - LIST_ORDERED_MARKERS; - - if (LIST_UNORDERED_MARKERS[character] === true) { - marker = character; - ordered = false; - } else { - ordered = true; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (!decimal(character)) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - - if (!queue || markers[character] !== true) { - return; - } - - start = parseInt(queue, 10); - marker = character; - } - - character = value.charAt(++index); - - if (character !== C_SPACE && character !== C_TAB) { - return; - } - - if (silent) { - return true; - } - - index = 0; - items = []; - allLines = []; - emptyLines = []; - - while (index < length) { - nextIndex = value.indexOf(C_NEWLINE, index); - startIndex = index; - prefixed = false; - indented = false; - - if (nextIndex === -1) { - nextIndex = length; - } - - end = index + TAB_SIZE; - size = 0; - - while (index < length) { - character = value.charAt(index); - - if (character === C_TAB) { - size += TAB_SIZE - (size % TAB_SIZE); - } else if (character === C_SPACE) { - size++; - } else { - break; - } - - index++; - } - - if (size >= TAB_SIZE) { - indented = true; - } - - if (item && size >= item.indent) { - indented = true; - } - - character = value.charAt(index); - currentMarker = null; - - if (!indented) { - if (LIST_UNORDERED_MARKERS[character] === true) { - currentMarker = character; - index++; - size++; - } else { - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (!decimal(character)) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - index++; - - if (queue && markers[character] === true) { - currentMarker = character; - size += queue.length + 1; - } - } - - if (currentMarker) { - character = value.charAt(index); - - if (character === C_TAB) { - size += TAB_SIZE - (size % TAB_SIZE); - index++; - } else if (character === C_SPACE) { - end = index + TAB_SIZE; - - while (index < end) { - if (value.charAt(index) !== C_SPACE) { - break; - } - - index++; - size++; - } - - if (index === end && value.charAt(index) === C_SPACE) { - index -= TAB_SIZE - 1; - size -= TAB_SIZE - 1; - } - } else if (character !== C_NEWLINE && character !== '') { - currentMarker = null; - } - } - } - - if (currentMarker) { - if (!pedantic && marker !== currentMarker) { - break; - } - - prefixed = true; - } else { - if (!commonmark && !indented && value.charAt(startIndex) === C_SPACE) { - indented = true; - } else if (commonmark && item) { - indented = size >= item.indent || size > TAB_SIZE; - } - - prefixed = false; - index = startIndex; - } - - line = value.slice(startIndex, nextIndex); - content = startIndex === index ? line : value.slice(index, nextIndex); - - if ( - currentMarker === C_ASTERISK || - currentMarker === C_UNDERSCORE || - currentMarker === C_DASH - ) { - if (tokenizers.thematicBreak.call(self, eat, line, true)) { - break; - } - } - - prevEmpty = empty; - empty = !trim(content).length; - - if (indented && item) { - item.value = item.value.concat(emptyLines, line); - allLines = allLines.concat(emptyLines, line); - emptyLines = []; - } else if (prefixed) { - if (emptyLines.length !== 0) { - item.value.push(''); - item.trail = emptyLines.concat(); - } - - item = { - value: [line], - indent: size, - trail: [] - }; - - items.push(item); - allLines = allLines.concat(emptyLines, line); - emptyLines = []; - } else if (empty) { - if (prevEmpty) { - break; - } - - emptyLines.push(line); - } else { - if (prevEmpty) { - break; - } - - if (interrupt(interuptors, tokenizers, self, [eat, line, true])) { - break; - } - - item.value = item.value.concat(emptyLines, line); - allLines = allLines.concat(emptyLines, line); - emptyLines = []; - } - - index = nextIndex + 1; - } - - node = eat(allLines.join(C_NEWLINE)).reset({ - type: 'list', - ordered: ordered, - start: start, - loose: null, - children: [] - }); - - enterTop = self.enterList(); - exitBlockquote = self.enterBlock(); - isLoose = false; - index = -1; - length = items.length; - - while (++index < length) { - item = items[index].value.join(C_NEWLINE); - now = eat.now(); - - item = eat(item)(listItem(self, item, now), node); - - if (item.loose) { - isLoose = true; - } - - item = items[index].trail.join(C_NEWLINE); - - if (index !== length - 1) { - item += C_NEWLINE; - } - - eat(item); - } - - enterTop(); - exitBlockquote(); - - node.loose = isLoose; - - return node; -} - -function listItem(ctx, value, position) { - var offsets = ctx.offset; - var fn = ctx.options.pedantic ? pedanticListItem : normalListItem; - var checked = null; - var task; - var indent; - - value = fn.apply(null, arguments); - - if (ctx.options.gfm) { - task = value.match(EXPRESSION_TASK_ITEM); - - if (task) { - indent = task[0].length; - checked = task[1].toLowerCase() === C_X_LOWER; - offsets[position.line] += indent; - value = value.slice(indent); - } - } - - return { - type: 'listItem', - loose: EXPRESSION_LOOSE_LIST_ITEM.test(value) || - value.charAt(value.length - 1) === C_NEWLINE, - checked: checked, - children: ctx.tokenizeBlock(value, position) - }; -} - -/* Create a list-item using overly simple mechanics. */ -function pedanticListItem(ctx, value, position) { - var offsets = ctx.offset; - var line = position.line; - - /* Remove the list-item’s bullet. */ - value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer); - - /* The initial line was also matched by the below, so - * we reset the `line`. */ - line = position.line; - - return value.replace(EXPRESSION_INITIAL_INDENT, replacer); - - /* A simple replacer which removed all matches, - * and adds their length to `offset`. */ - function replacer($0) { - offsets[line] = (offsets[line] || 0) + $0.length; - line++; - - return ''; - } -} - -/* Create a list-item using sane mechanics. */ -function normalListItem(ctx, value, position) { - var offsets = ctx.offset; - var line = position.line; - var max; - var bullet; - var rest; - var lines; - var trimmedLines; - var index; - var length; - - /* Remove the list-item’s bullet. */ - value = value.replace(EXPRESSION_BULLET, replacer); - - lines = value.split(C_NEWLINE); - - trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE); - - /* We replaced the initial bullet with something - * else above, which was used to trick - * `removeIndentation` into removing some more - * characters when possible. However, that could - * result in the initial line to be stripped more - * than it should be. */ - trimmedLines[0] = rest; - - offsets[line] = (offsets[line] || 0) + bullet.length; - line++; - - index = 0; - length = lines.length; - - while (++index < length) { - offsets[line] = (offsets[line] || 0) + - lines[index].length - trimmedLines[index].length; - line++; - } - - return trimmedLines.join(C_NEWLINE); - - function replacer($0, $1, $2, $3, $4) { - bullet = $1 + $2 + $3; - rest = $4; - - /* Make sure that the first nine numbered list items - * can indent with an extra space. That is, when - * the bullet did not receive an extra final space. */ - if (Number($2) < 10 && bullet.length % 2 === 1) { - $2 = C_SPACE + $2; - } - - max = $1 + repeat(C_SPACE, $2.length) + $3; - - return max + rest; - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/newline.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/newline.js deleted file mode 100644 index 6008670cc5e742..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/newline.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); - -module.exports = newline; - -/* Tokenise newline. */ -function newline(eat, value, silent) { - var character = value.charAt(0); - var length; - var subvalue; - var queue; - var index; - - if (character !== '\n') { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - index = 1; - length = value.length; - subvalue = character; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - queue += character; - - if (character === '\n') { - subvalue += queue; - queue = ''; - } - - index++; - } - - eat(subvalue); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js deleted file mode 100644 index 1492a027e78237..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -var trim = require('trim'); -var decimal = require('is-decimal'); -var trimTrailingLines = require('trim-trailing-lines'); -var interrupt = require('../util/interrupt'); - -module.exports = paragraph; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; - -var TAB_SIZE = 4; - -/* Tokenise paragraph. */ -function paragraph(eat, value, silent) { - var self = this; - var settings = self.options; - var commonmark = settings.commonmark; - var gfm = settings.gfm; - var tokenizers = self.blockTokenizers; - var interruptors = self.interruptParagraph; - var index = value.indexOf(C_NEWLINE); - var length = value.length; - var position; - var subvalue; - var character; - var size; - var now; - - while (index < length) { - /* Eat everything if there’s no following newline. */ - if (index === -1) { - index = length; - break; - } - - /* Stop if the next character is NEWLINE. */ - if (value.charAt(index + 1) === C_NEWLINE) { - break; - } - - /* In commonmark-mode, following indented lines - * are part of the paragraph. */ - if (commonmark) { - size = 0; - position = index + 1; - - while (position < length) { - character = value.charAt(position); - - if (character === C_TAB) { - size = TAB_SIZE; - break; - } else if (character === C_SPACE) { - size++; - } else { - break; - } - - position++; - } - - if (size >= TAB_SIZE) { - index = value.indexOf(C_NEWLINE, index + 1); - continue; - } - } - - subvalue = value.slice(index + 1); - - /* Check if the following code contains a possible - * block. */ - if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) { - break; - } - - /* Break if the following line starts a list, when - * already in a list, or when in commonmark, or when - * in gfm mode and the bullet is *not* numeric. */ - if ( - tokenizers.list.call(self, eat, subvalue, true) && - ( - self.inList || - commonmark || - (gfm && !decimal(trim.left(subvalue).charAt(0))) - ) - ) { - break; - } - - position = index; - index = value.indexOf(C_NEWLINE, index + 1); - - if (index !== -1 && trim(value.slice(position, index)) === '') { - index = position; - break; - } - } - - subvalue = value.slice(0, index); - - if (trim(subvalue) === '') { - eat(subvalue); - - return null; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - now = eat.now(); - subvalue = trimTrailingLines(subvalue); - - return eat(subvalue)({ - type: 'paragraph', - children: self.tokenizeInline(subvalue, now) - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/reference.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/reference.js deleted file mode 100644 index 50713f1ccfc8fa..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/reference.js +++ /dev/null @@ -1,206 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/link'); -var normalize = require('../util/normalize'); - -module.exports = reference; -reference.locator = locate; - -var T_LINK = 'link'; -var T_IMAGE = 'image'; -var T_FOOTNOTE = 'footnote'; -var REFERENCE_TYPE_SHORTCUT = 'shortcut'; -var REFERENCE_TYPE_COLLAPSED = 'collapsed'; -var REFERENCE_TYPE_FULL = 'full'; -var C_CARET = '^'; -var C_BACKSLASH = '\\'; -var C_BRACKET_OPEN = '['; -var C_BRACKET_CLOSE = ']'; - -function reference(eat, value, silent) { - var self = this; - var character = value.charAt(0); - var index = 0; - var length = value.length; - var subvalue = ''; - var intro = ''; - var type = T_LINK; - var referenceType = REFERENCE_TYPE_SHORTCUT; - var content; - var identifier; - var now; - var node; - var exit; - var queue; - var bracketed; - var depth; - - /* Check whether we’re eating an image. */ - if (character === '!') { - type = T_IMAGE; - intro = character; - character = value.charAt(++index); - } - - if (character !== C_BRACKET_OPEN) { - return; - } - - index++; - intro += character; - queue = ''; - - /* Check whether we’re eating a footnote. */ - if (self.options.footnotes && value.charAt(index) === C_CARET) { - /* Exit if `![^` is found, so the `!` will be seen as text after this, - * and we’ll enter this function again when `[^` is found. */ - if (type === T_IMAGE) { - return; - } - - intro += C_CARET; - index++; - type = T_FOOTNOTE; - } - - /* Eat the text. */ - depth = 0; - - while (index < length) { - character = value.charAt(index); - - if (character === C_BRACKET_OPEN) { - bracketed = true; - depth++; - } else if (character === C_BRACKET_CLOSE) { - if (!depth) { - break; - } - - depth--; - } - - if (character === C_BACKSLASH) { - queue += C_BACKSLASH; - character = value.charAt(++index); - } - - queue += character; - index++; - } - - subvalue = queue; - content = queue; - character = value.charAt(index); - - if (character !== C_BRACKET_CLOSE) { - return; - } - - index++; - subvalue += character; - queue = ''; - - while (index < length) { - character = value.charAt(index); - - if (!whitespace(character)) { - break; - } - - queue += character; - index++; - } - - character = value.charAt(index); - - /* Inline footnotes cannot have an identifier. */ - if (type !== T_FOOTNOTE && character === C_BRACKET_OPEN) { - identifier = ''; - queue += character; - index++; - - while (index < length) { - character = value.charAt(index); - - if (character === C_BRACKET_OPEN || character === C_BRACKET_CLOSE) { - break; - } - - if (character === C_BACKSLASH) { - identifier += C_BACKSLASH; - character = value.charAt(++index); - } - - identifier += character; - index++; - } - - character = value.charAt(index); - - if (character === C_BRACKET_CLOSE) { - referenceType = identifier ? REFERENCE_TYPE_FULL : REFERENCE_TYPE_COLLAPSED; - queue += identifier + character; - index++; - } else { - identifier = ''; - } - - subvalue += queue; - queue = ''; - } else { - if (!content) { - return; - } - - identifier = content; - } - - /* Brackets cannot be inside the identifier. */ - if (referenceType !== REFERENCE_TYPE_FULL && bracketed) { - return; - } - - subvalue = intro + subvalue; - - if (type === T_LINK && self.inLink) { - return null; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - if (type === T_FOOTNOTE && content.indexOf(' ') !== -1) { - return eat(subvalue)({ - type: 'footnote', - children: this.tokenizeInline(content, eat.now()) - }); - } - - now = eat.now(); - now.column += intro.length; - now.offset += intro.length; - identifier = referenceType === REFERENCE_TYPE_FULL ? identifier : content; - - node = { - type: type + 'Reference', - identifier: normalize(identifier) - }; - - if (type === T_LINK || type === T_IMAGE) { - node.referenceType = referenceType; - } - - if (type === T_LINK) { - exit = self.enterLink(); - node.children = self.tokenizeInline(content, now); - exit(); - } else if (type === T_IMAGE) { - node.alt = self.decode.raw(self.unescape(content), now) || null; - } - - return eat(subvalue)(node); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/strong.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/strong.js deleted file mode 100644 index 12d5785bc64a74..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/strong.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var trim = require('trim'); -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/strong'); - -module.exports = strong; -strong.locator = locate; - -var C_ASTERISK = '*'; -var C_UNDERSCORE = '_'; - -function strong(eat, value, silent) { - var self = this; - var index = 0; - var character = value.charAt(index); - var now; - var pedantic; - var marker; - var queue; - var subvalue; - var length; - var prev; - - if ( - (character !== C_ASTERISK && character !== C_UNDERSCORE) || - value.charAt(++index) !== character - ) { - return; - } - - pedantic = self.options.pedantic; - marker = character; - subvalue = marker + marker; - length = value.length; - index++; - queue = ''; - character = ''; - - if (pedantic && whitespace(value.charAt(index))) { - return; - } - - while (index < length) { - prev = character; - character = value.charAt(index); - - if ( - character === marker && - value.charAt(index + 1) === marker && - (!pedantic || !whitespace(prev)) - ) { - character = value.charAt(index + 2); - - if (character !== marker) { - if (!trim(queue)) { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - now = eat.now(); - now.column += 2; - now.offset += 2; - - return eat(subvalue + queue + subvalue)({ - type: 'strong', - children: self.tokenizeInline(queue, now) - }); - } - } - - if (!pedantic && character === '\\') { - queue += character; - character = value.charAt(++index); - } - - queue += character; - index++; - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/table.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/table.js deleted file mode 100644 index ce93b1d22f0f31..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/table.js +++ /dev/null @@ -1,266 +0,0 @@ -'use strict'; - -var whitespace = require('is-whitespace-character'); - -module.exports = table; - -var C_BACKSLASH = '\\'; -var C_TICK = '`'; -var C_DASH = '-'; -var C_PIPE = '|'; -var C_COLON = ':'; -var C_SPACE = ' '; -var C_NEWLINE = '\n'; -var C_TAB = '\t'; - -var MIN_TABLE_COLUMNS = 1; -var MIN_TABLE_ROWS = 2; - -var TABLE_ALIGN_LEFT = 'left'; -var TABLE_ALIGN_CENTER = 'center'; -var TABLE_ALIGN_RIGHT = 'right'; -var TABLE_ALIGN_NONE = null; - -function table(eat, value, silent) { - var self = this; - var index; - var alignments; - var alignment; - var subvalue; - var row; - var length; - var lines; - var queue; - var character; - var hasDash; - var align; - var cell; - var preamble; - var count; - var opening; - var now; - var position; - var lineCount; - var line; - var rows; - var table; - var lineIndex; - var pipeIndex; - var first; - - /* Exit when not in gfm-mode. */ - if (!self.options.gfm) { - return; - } - - /* Get the rows. - * Detecting tables soon is hard, so there are some - * checks for performance here, such as the minimum - * number of rows, and allowed characters in the - * alignment row. */ - index = 0; - lineCount = 0; - length = value.length + 1; - lines = []; - - while (index < length) { - lineIndex = value.indexOf(C_NEWLINE, index); - pipeIndex = value.indexOf(C_PIPE, index + 1); - - if (lineIndex === -1) { - lineIndex = value.length; - } - - if (pipeIndex === -1 || pipeIndex > lineIndex) { - if (lineCount < MIN_TABLE_ROWS) { - return; - } - - break; - } - - lines.push(value.slice(index, lineIndex)); - lineCount++; - index = lineIndex + 1; - } - - /* Parse the alignment row. */ - subvalue = lines.join(C_NEWLINE); - alignments = lines.splice(1, 1)[0] || []; - index = 0; - length = alignments.length; - lineCount--; - alignment = false; - align = []; - - while (index < length) { - character = alignments.charAt(index); - - if (character === C_PIPE) { - hasDash = null; - - if (alignment === false) { - if (first === false) { - return; - } - } else { - align.push(alignment); - alignment = false; - } - - first = false; - } else if (character === C_DASH) { - hasDash = true; - alignment = alignment || TABLE_ALIGN_NONE; - } else if (character === C_COLON) { - if (alignment === TABLE_ALIGN_LEFT) { - alignment = TABLE_ALIGN_CENTER; - } else if (hasDash && alignment === TABLE_ALIGN_NONE) { - alignment = TABLE_ALIGN_RIGHT; - } else { - alignment = TABLE_ALIGN_LEFT; - } - } else if (!whitespace(character)) { - return; - } - - index++; - } - - if (alignment !== false) { - align.push(alignment); - } - - /* Exit when without enough columns. */ - if (align.length < MIN_TABLE_COLUMNS) { - return; - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - /* Parse the rows. */ - position = -1; - rows = []; - - table = eat(subvalue).reset({ - type: 'table', - align: align, - children: rows - }); - - while (++position < lineCount) { - line = lines[position]; - row = {type: 'tableRow', children: []}; - - /* Eat a newline character when this is not the - * first row. */ - if (position) { - eat(C_NEWLINE); - } - - /* Eat the row. */ - eat(line).reset(row, table); - - length = line.length + 1; - index = 0; - queue = ''; - cell = ''; - preamble = true; - count = null; - opening = null; - - while (index < length) { - character = line.charAt(index); - - if (character === C_TAB || character === C_SPACE) { - if (cell) { - queue += character; - } else { - eat(character); - } - - index++; - continue; - } - - if (character === '' || character === C_PIPE) { - if (preamble) { - eat(character); - } else { - if (character && opening) { - queue += character; - index++; - continue; - } - - if ((cell || character) && !preamble) { - subvalue = cell; - - if (queue.length > 1) { - if (character) { - subvalue += queue.slice(0, queue.length - 1); - queue = queue.charAt(queue.length - 1); - } else { - subvalue += queue; - queue = ''; - } - } - - now = eat.now(); - - eat(subvalue)({ - type: 'tableCell', - children: self.tokenizeInline(cell, now) - }, row); - } - - eat(queue + character); - - queue = ''; - cell = ''; - } - } else { - if (queue) { - cell += queue; - queue = ''; - } - - cell += character; - - if (character === C_BACKSLASH && index !== length - 2) { - cell += line.charAt(index + 1); - index++; - } - - if (character === C_TICK) { - count = 1; - - while (line.charAt(index + 1) === character) { - cell += character; - index++; - count++; - } - - if (!opening) { - opening = count; - } else if (count >= opening) { - opening = 0; - } - } - } - - preamble = false; - index++; - } - - /* Eat the alignment row. */ - if (!position) { - eat(C_NEWLINE + alignments); - } - } - - return table; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/text.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/text.js deleted file mode 100644 index 4aedfa90d5d9b8..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/text.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -module.exports = text; - -function text(eat, value, silent) { - var self = this; - var methods; - var tokenizers; - var index; - var length; - var subvalue; - var position; - var tokenizer; - var name; - var min; - var now; - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - methods = self.inlineMethods; - length = methods.length; - tokenizers = self.inlineTokenizers; - index = -1; - min = value.length; - - while (++index < length) { - name = methods[index]; - - if (name === 'text' || !tokenizers[name]) { - continue; - } - - tokenizer = tokenizers[name].locator; - - if (!tokenizer) { - eat.file.fail('Missing locator: `' + name + '`'); - } - - position = tokenizer.call(self, value, 1); - - if (position !== -1 && position < min) { - min = position; - } - } - - subvalue = value.slice(0, min); - now = eat.now(); - - self.decode(subvalue, now, function (content, position, source) { - eat(source || content)({ - type: 'text', - value: content - }); - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js deleted file mode 100644 index 2391e3f592cb25..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -module.exports = thematicBreak; - -var C_NEWLINE = '\n'; -var C_TAB = '\t'; -var C_SPACE = ' '; -var C_ASTERISK = '*'; -var C_UNDERSCORE = '_'; -var C_DASH = '-'; - -var THEMATIC_BREAK_MARKER_COUNT = 3; - -function thematicBreak(eat, value, silent) { - var index = -1; - var length = value.length + 1; - var subvalue = ''; - var character; - var marker; - var markerCount; - var queue; - - while (++index < length) { - character = value.charAt(index); - - if (character !== C_TAB && character !== C_SPACE) { - break; - } - - subvalue += character; - } - - if ( - character !== C_ASTERISK && - character !== C_DASH && - character !== C_UNDERSCORE - ) { - return; - } - - marker = character; - subvalue += character; - markerCount = 1; - queue = ''; - - while (++index < length) { - character = value.charAt(index); - - if (character === marker) { - markerCount++; - subvalue += queue + marker; - queue = ''; - } else if (character === C_SPACE) { - queue += character; - } else if ( - markerCount >= THEMATIC_BREAK_MARKER_COUNT && - (!character || character === C_NEWLINE) - ) { - subvalue += queue; - - if (silent) { - return true; - } - - return eat(subvalue)({type: 'thematicBreak'}); - } else { - return; - } - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/url.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/url.js deleted file mode 100644 index 297940bf4ab922..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenize/url.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; - -var decode = require('parse-entities'); -var whitespace = require('is-whitespace-character'); -var locate = require('../locate/url'); - -module.exports = url; -url.locator = locate; -url.notInLink = true; - -var C_BRACKET_OPEN = '['; -var C_BRACKET_CLOSE = ']'; -var C_PAREN_OPEN = '('; -var C_PAREN_CLOSE = ')'; -var C_LT = '<'; -var C_AT_SIGN = '@'; - -var HTTP_PROTOCOL = 'http://'; -var HTTPS_PROTOCOL = 'https://'; -var MAILTO_PROTOCOL = 'mailto:'; - -var PROTOCOLS = [ - HTTP_PROTOCOL, - HTTPS_PROTOCOL, - MAILTO_PROTOCOL -]; - -var PROTOCOLS_LENGTH = PROTOCOLS.length; - -function url(eat, value, silent) { - var self = this; - var subvalue; - var content; - var character; - var index; - var position; - var protocol; - var match; - var length; - var queue; - var parenCount; - var nextCharacter; - var exit; - - if (!self.options.gfm) { - return; - } - - subvalue = ''; - index = -1; - length = PROTOCOLS_LENGTH; - - while (++index < length) { - protocol = PROTOCOLS[index]; - match = value.slice(0, protocol.length); - - if (match.toLowerCase() === protocol) { - subvalue = match; - break; - } - } - - if (!subvalue) { - return; - } - - index = subvalue.length; - length = value.length; - queue = ''; - parenCount = 0; - - while (index < length) { - character = value.charAt(index); - - if (whitespace(character) || character === C_LT) { - break; - } - - if ( - character === '.' || - character === ',' || - character === ':' || - character === ';' || - character === '"' || - character === '\'' || - character === ')' || - character === ']' - ) { - nextCharacter = value.charAt(index + 1); - - if (!nextCharacter || whitespace(nextCharacter)) { - break; - } - } - - if (character === C_PAREN_OPEN || character === C_BRACKET_OPEN) { - parenCount++; - } - - if (character === C_PAREN_CLOSE || character === C_BRACKET_CLOSE) { - parenCount--; - - if (parenCount < 0) { - break; - } - } - - queue += character; - index++; - } - - if (!queue) { - return; - } - - subvalue += queue; - content = subvalue; - - if (protocol === MAILTO_PROTOCOL) { - position = queue.indexOf(C_AT_SIGN); - - if (position === -1 || position === length - 1) { - return; - } - - content = content.substr(MAILTO_PROTOCOL.length); - } - - /* istanbul ignore if - never used (yet) */ - if (silent) { - return true; - } - - exit = self.enterLink(); - content = self.tokenizeInline(content, eat.now()); - exit(); - - return eat(subvalue)({ - type: 'link', - title: null, - url: decode(subvalue, {nonTerminated: false}), - children: content - }); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenizer.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenizer.js deleted file mode 100644 index 498ef22ad949af..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/tokenizer.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -module.exports = factory; - -var MERGEABLE_NODES = { - text: mergeText, - blockquote: mergeBlockquote -}; - -/* Check whether a node is mergeable with adjacent nodes. */ -function mergeable(node) { - var start; - var end; - - if (node.type !== 'text' || !node.position) { - return true; - } - - start = node.position.start; - end = node.position.end; - - /* Only merge nodes which occupy the same size as their - * `value`. */ - return start.line !== end.line || - end.column - start.column === node.value.length; -} - -/* Merge two text nodes: `node` into `prev`. */ -function mergeText(prev, node) { - prev.value += node.value; - - return prev; -} - -/* Merge two blockquotes: `node` into `prev`, unless in - * CommonMark mode. */ -function mergeBlockquote(prev, node) { - if (this.options.commonmark) { - return node; - } - - prev.children = prev.children.concat(node.children); - - return prev; -} - -/* Construct a tokenizer. This creates both - * `tokenizeInline` and `tokenizeBlock`. */ -function factory(type) { - return tokenize; - - /* Tokenizer for a bound `type`. */ - function tokenize(value, location) { - var self = this; - var offset = self.offset; - var tokens = []; - var methods = self[type + 'Methods']; - var tokenizers = self[type + 'Tokenizers']; - var line = location.line; - var column = location.column; - var index; - var length; - var method; - var name; - var matched; - var valueLength; - - /* Trim white space only lines. */ - if (!value) { - return tokens; - } - - /* Expose on `eat`. */ - eat.now = now; - eat.file = self.file; - - /* Sync initial offset. */ - updatePosition(''); - - /* Iterate over `value`, and iterate over all - * tokenizers. When one eats something, re-iterate - * with the remaining value. If no tokenizer eats, - * something failed (should not happen) and an - * exception is thrown. */ - while (value) { - index = -1; - length = methods.length; - matched = false; - - while (++index < length) { - name = methods[index]; - method = tokenizers[name]; - - if ( - method && - /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && - (!method.notInList || !self.inList) && - (!method.notInBlock || !self.inBlock) && - (!method.notInLink || !self.inLink) - ) { - valueLength = value.length; - - method.apply(self, [eat, value]); - - matched = valueLength !== value.length; - - if (matched) { - break; - } - } - } - - /* istanbul ignore if */ - if (!matched) { - self.file.fail(new Error('Infinite loop'), eat.now()); - } - } - - self.eof = now(); - - return tokens; - - /* Update line, column, and offset based on - * `value`. */ - function updatePosition(subvalue) { - var lastIndex = -1; - var index = subvalue.indexOf('\n'); - - while (index !== -1) { - line++; - lastIndex = index; - index = subvalue.indexOf('\n', index + 1); - } - - if (lastIndex === -1) { - column += subvalue.length; - } else { - column = subvalue.length - lastIndex; - } - - if (line in offset) { - if (lastIndex !== -1) { - column += offset[line]; - } else if (column <= offset[line]) { - column = offset[line] + 1; - } - } - } - - /* Get offset. Called before the first character is - * eaten to retrieve the range's offsets. */ - function getOffset() { - var indentation = []; - var pos = line + 1; - - /* Done. Called when the last character is - * eaten to retrieve the range’s offsets. */ - return function () { - var last = line + 1; - - while (pos < last) { - indentation.push((offset[pos] || 0) + 1); - - pos++; - } - - return indentation; - }; - } - - /* Get the current position. */ - function now() { - var pos = {line: line, column: column}; - - pos.offset = self.toOffset(pos); - - return pos; - } - - /* Store position information for a node. */ - function Position(start) { - this.start = start; - this.end = now(); - } - - /* Throw when a value is incorrectly eaten. - * This shouldn’t happen but will throw on new, - * incorrect rules. */ - function validateEat(subvalue) { - /* istanbul ignore if */ - if (value.substring(0, subvalue.length) !== subvalue) { - /* Capture stack-trace. */ - self.file.fail( - new Error( - 'Incorrectly eaten value: please report this ' + - 'warning on http://git.io/vg5Ft' - ), - now() - ); - } - } - - /* Mark position and patch `node.position`. */ - function position() { - var before = now(); - - return update; - - /* Add the position to a node. */ - function update(node, indent) { - var prev = node.position; - var start = prev ? prev.start : before; - var combined = []; - var n = prev && prev.end.line; - var l = before.line; - - node.position = new Position(start); - - /* If there was already a `position`, this - * node was merged. Fixing `start` wasn’t - * hard, but the indent is different. - * Especially because some information, the - * indent between `n` and `l` wasn’t - * tracked. Luckily, that space is - * (should be?) empty, so we can safely - * check for it now. */ - if (prev && indent && prev.indent) { - combined = prev.indent; - - if (n < l) { - while (++n < l) { - combined.push((offset[n] || 0) + 1); - } - - combined.push(before.column); - } - - indent = combined.concat(indent); - } - - node.position.indent = indent || []; - - return node; - } - } - - /* Add `node` to `parent`s children or to `tokens`. - * Performs merges where possible. */ - function add(node, parent) { - var children = parent ? parent.children : tokens; - var prev = children[children.length - 1]; - - if ( - prev && - node.type === prev.type && - node.type in MERGEABLE_NODES && - mergeable(prev) && - mergeable(node) - ) { - node = MERGEABLE_NODES[node.type].call(self, prev, node); - } - - if (node !== prev) { - children.push(node); - } - - if (self.atStart && tokens.length !== 0) { - self.exitStart(); - } - - return node; - } - - /* Remove `subvalue` from `value`. - * `subvalue` must be at the start of `value`. */ - function eat(subvalue) { - var indent = getOffset(); - var pos = position(); - var current = now(); - - validateEat(subvalue); - - apply.reset = reset; - reset.test = test; - apply.test = test; - - value = value.substring(subvalue.length); - - updatePosition(subvalue); - - indent = indent(); - - return apply; - - /* Add the given arguments, add `position` to - * the returned node, and return the node. */ - function apply(node, parent) { - return pos(add(pos(node), parent), indent); - } - - /* Functions just like apply, but resets the - * content: the line and column are reversed, - * and the eaten value is re-added. - * This is useful for nodes with a single - * type of content, such as lists and tables. - * See `apply` above for what parameters are - * expected. */ - function reset() { - var node = apply.apply(null, arguments); - - line = current.line; - column = current.column; - value = subvalue + value; - - return node; - } - - /* Test the position, after eating, and reverse - * to a not-eaten state. */ - function test() { - var result = pos({}); - - line = current.line; - column = current.column; - value = subvalue + value; - - return result.position; - } - } - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/unescape.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/unescape.js deleted file mode 100644 index 321900e7eacd73..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/unescape.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -module.exports = factory; - -/* Factory to de-escape a value, based on a list at `key` - * in `ctx`. */ -function factory(ctx, key) { - return unescape; - - /* De-escape a string using the expression at `key` - * in `ctx`. */ - function unescape(value) { - var prev = 0; - var index = value.indexOf('\\'); - var escape = ctx[key]; - var queue = []; - var character; - - while (index !== -1) { - queue.push(value.slice(prev, index)); - prev = index + 1; - character = value.charAt(prev); - - /* If the following character is not a valid escape, - * add the slash. */ - if (!character || escape.indexOf(character) === -1) { - queue.push('\\'); - } - - index = value.indexOf('\\', prev); - } - - queue.push(value.slice(prev)); - - return queue.join(''); - } -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/get-indentation.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/get-indentation.js deleted file mode 100644 index 3e09e1411ed67c..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/get-indentation.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -module.exports = indentation; - -/* Map of characters, and their column length, - * which can be used as indentation. */ -var characters = {' ': 1, '\t': 4}; - -/* Gets indentation information for a line. */ -function indentation(value) { - var index = 0; - var indent = 0; - var character = value.charAt(index); - var stops = {}; - var size; - - while (character in characters) { - size = characters[character]; - - indent += size; - - if (size > 1) { - indent = Math.floor(indent / size) * size; - } - - stops[indent] = index; - - character = value.charAt(++index); - } - - return {indent: indent, stops: stops}; -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/html.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/html.js deleted file mode 100644 index 5f211f13f8f534..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/html.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; -var unquoted = '[^"\'=<>`\\u0000-\\u0020]+'; -var singleQuoted = '\'[^\']*\''; -var doubleQuoted = '"[^"]*"'; -var attributeValue = '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')'; -var attribute = '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)'; -var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; -var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; -var comment = '|'; -var processing = '<[?].*?[?]>'; -var declaration = ']*>'; -var cdata = ''; - -exports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')'); - -exports.tag = new RegExp('^(?:' + - openTag + '|' + - closeTag + '|' + - comment + '|' + - processing + '|' + - declaration + '|' + - cdata + -')'); diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/interrupt.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/interrupt.js deleted file mode 100644 index e3178ab45c60df..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/interrupt.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -module.exports = interrupt; - -function interrupt(interruptors, tokenizers, ctx, params) { - var bools = ['pedantic', 'commonmark']; - var count = bools.length; - var length = interruptors.length; - var index = -1; - var interruptor; - var config; - var fn; - var offset; - var bool; - var ignore; - - while (++index < length) { - interruptor = interruptors[index]; - config = interruptor[1] || {}; - fn = interruptor[0]; - offset = -1; - ignore = false; - - while (++offset < count) { - bool = bools[offset]; - - if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) { - ignore = true; - break; - } - } - - if (ignore) { - continue; - } - - if (tokenizers[fn].apply(ctx, params)) { - return true; - } - } - - return false; -} 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 deleted file mode 100644 index 846ceeecac5ade..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/normalize.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var collapseWhiteSpace = require('collapse-white-space'); - -module.exports = normalize; - -/* Normalize an identifier. Collapses multiple white space - * characters into a single space, and removes casing. */ -function normalize(value) { - return collapseWhiteSpace(value).toLowerCase(); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/remove-indentation.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/util/remove-indentation.js deleted file mode 100644 index 20f18be74087eb..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/lib/util/remove-indentation.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -var trim = require('trim'); -var repeat = require('repeat-string'); -var getIndent = require('./get-indentation'); - -module.exports = indentation; - -var C_SPACE = ' '; -var C_NEWLINE = '\n'; -var C_TAB = '\t'; - -/* Remove the minimum indent from every line in `value`. - * Supports both tab, spaced, and mixed indentation (as - * well as possible). */ -function indentation(value, maximum) { - var values = value.split(C_NEWLINE); - var position = values.length + 1; - var minIndent = Infinity; - var matrix = []; - var index; - var indentation; - var stops; - var padding; - - values.unshift(repeat(C_SPACE, maximum) + '!'); - - while (position--) { - indentation = getIndent(values[position]); - - matrix[position] = indentation.stops; - - if (trim(values[position]).length === 0) { - continue; - } - - if (indentation.indent) { - if (indentation.indent > 0 && indentation.indent < minIndent) { - minIndent = indentation.indent; - } - } else { - minIndent = Infinity; - - break; - } - } - - if (minIndent !== Infinity) { - position = values.length; - - while (position--) { - stops = matrix[position]; - index = minIndent; - - while (index && !(index in stops)) { - index--; - } - - if ( - trim(values[position]).length !== 0 && - minIndent && - index !== minIndent - ) { - padding = C_TAB; - } else { - padding = ''; - } - - values[position] = padding + values[position].slice( - index in stops ? stops[index] + 1 : 0 - ); - } - } - - values.shift(); - - return values.join(C_NEWLINE); -} diff --git a/tools/node_modules/eslint/node_modules/remark-parse/package.json b/tools/node_modules/eslint/node_modules/remark-parse/package.json deleted file mode 100644 index b47866c95b256b..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - "bugs": { - "url": "https://github.com/remarkjs/remark/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" - }, - { - "name": "Eugene Sharygin", - "email": "eush77@gmail.com" - } - ], - "dependencies": { - "collapse-white-space": "^1.0.2", - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-whitespace-character": "^1.0.0", - "is-word-character": "^1.0.0", - "markdown-escapes": "^1.0.0", - "parse-entities": "^1.1.0", - "repeat-string": "^1.5.4", - "state-toggle": "^1.0.0", - "trim": "0.0.1", - "trim-trailing-lines": "^1.0.0", - "unherit": "^1.0.4", - "unist-util-remove-position": "^1.0.0", - "vfile-location": "^2.0.0", - "xtend": "^4.0.1" - }, - "deprecated": false, - "description": "Markdown parser for remark", - "files": [ - "index.js", - "lib" - ], - "homepage": "http://remark.js.org", - "keywords": [ - "markdown", - "abstract", - "syntax", - "tree", - "ast", - "parse" - ], - "license": "MIT", - "name": "remark-parse", - "repository": { - "type": "git", - "url": "https://github.com/remarkjs/remark/tree/master/packages/remark-parse" - }, - "version": "5.0.0", - "xo": false -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/remark-parse/readme.md b/tools/node_modules/eslint/node_modules/remark-parse/readme.md deleted file mode 100644 index ecaa6c093c0ab2..00000000000000 --- a/tools/node_modules/eslint/node_modules/remark-parse/readme.md +++ /dev/null @@ -1,453 +0,0 @@ -# remark-parse [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] - -[Parser][] for [**unified**][unified]. Parses markdown to an -[**MDAST**][mdast] syntax tree. Used in the [**remark** -processor][processor]. Can be [extended][extend] to change how -markdown is parsed. - -## Installation - -[npm][]: - -```sh -npm install remark-parse -``` - -## Usage - -```js -var unified = require('unified'); -var createStream = require('unified-stream'); -var markdown = require('remark-parse'); -var html = require('remark-html'); - -var processor = unified() - .use(markdown, {commonmark: true}) - .use(html) - -process.stdin - .pipe(createStream(processor)) - .pipe(process.stdout); -``` - -## Table of Contents - -* [API](#api) - * [processor.use(parse\[, options\])](#processoruseparse-options) - * [parse.Parser](#parseparser) -* [Extending the Parser](#extending-the-parser) - * [Parser#blockTokenizers](#parserblocktokenizers) - * [Parser#blockMethods](#parserblockmethods) - * [Parser#inlineTokenizers](#parserinlinetokenizers) - * [Parser#inlineMethods](#parserinlinemethods) - * [function tokenizer(eat, value, silent)](#function-tokenizereat-value-silent) - * [tokenizer.locator(value, fromIndex)](#tokenizerlocatorvalue-fromindex) - * [eat(subvalue)](#eatsubvalue) - * [add(node\[, parent\])](#addnode-parent) - * [add.test()](#addtest) - * [add.reset(node\[, parent\])](#addresetnode-parent) - * [Turning off a tokenizer](#turning-off-a-tokenizer) -* [License](#license) - -## API - -### `processor.use(parse[, options])` - -Configure the `processor` to read markdown as input and process an -[**MDAST**][mdast] syntax tree. - -##### `options` - -Options are passed directly, or passed later through [`processor.data()`][data]. - -##### `options.gfm` - -```md -hello ~~hi~~ world -``` - -GFM mode (`boolean`, default: `true`) turns on: - -* [Fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks) -* [Autolinking of URLs](https://help.github.com/articles/github-flavored-markdown/#url-autolinking) -* [Deletions (strikethrough)](https://help.github.com/articles/github-flavored-markdown/#strikethrough) -* [Task lists](https://help.github.com/articles/writing-on-github/#task-lists) -* [Tables](https://help.github.com/articles/github-flavored-markdown/#tables) - -##### `options.commonmark` - -```md -This is a paragraph - and this is also part of the preceding paragraph. -``` - -CommonMark mode (`boolean`, default: `false`) allows: - -* Empty lines to split blockquotes -* Parentheses (`(` and `)`) around for link and image titles -* Any escaped [ASCII-punctuation][escapes] character -* Closing parenthesis (`)`) as an ordered list marker -* URL definitions (and footnotes, when enabled) in blockquotes - -CommonMark mode disallows: - -* Code directly following a paragraph -* ATX-headings (`# Hash headings`) without spacing after opening hashes - or and before closing hashes -* Setext headings (`Underline headings\n---`) when following a paragraph -* Newlines in link and image titles -* White space in link and image URLs in auto-links (links in brackets, - `<` and `>`) -* Lazy blockquote continuation, lines not preceded by a closing angle - bracket (`>`), for lists, code, and thematicBreak - -##### `options.footnotes` - -```md -Something something[^or something?]. - -And something else[^1]. - -[^1]: This reference footnote contains a paragraph... - - * ...and a list -``` - -Footnotes mode (`boolean`, default: `false`) enables reference footnotes and -inline footnotes. Both are wrapped in square brackets and preceded by a caret -(`^`), and can be referenced from inside other footnotes. - -##### `options.blocks` - -```md -foo - -``` - -Blocks (`Array.`, default: list of [block HTML elements][blocks]) -exposes let’s users define block-level HTML elements. - -##### `options.pedantic` - -```md -Check out some_file_name.txt -``` - -Pedantic mode (`boolean`, default: `false`) turns on: - -* Emphasis (`_alpha_`) and importance (`__bravo__`) with underscores - in words -* Unordered lists with different markers (`*`, `-`, `+`) -* If `commonmark` is also turned on, ordered lists with different - markers (`.`, `)`) -* And pedantic mode removes less spaces in list-items (at most four, - instead of the whole indent) - -### `parse.Parser` - -Access to the [parser][], if you need it. - -## Extending the Parser - -Most often, using transformers to manipulate a syntax tree produces -the desired output. Sometimes, mainly when introducing new syntactic -entities with a certain level of precedence, interfacing with the parser -is necessary. - -If the `remark-parse` plugin is used, it adds a [`Parser`][parser] constructor -to the `processor`. Other plugins can add tokenizers to the parser’s prototype -to change how markdown is parsed. - -The below plugin adds a [tokenizer][] for at-mentions. - -```js -module.exports = mentions; - -function mentions() { - var Parser = this.Parser; - var tokenizers = Parser.prototype.inlineTokenizers; - var methods = Parser.prototype.inlineMethods; - - /* Add an inline tokenizer (defined in the following example). */ - tokenizers.mention = tokenizeMention; - - /* Run it just before `text`. */ - methods.splice(methods.indexOf('text'), 0, 'mention'); -} -``` - -### `Parser#blockTokenizers` - -An object mapping tokenizer names to [tokenizer][]s. These -tokenizers (for example: `fencedCode`, `table`, and `paragraph`) eat -from the start of a value to a line ending. - -See `#blockMethods` below for a list of methods that are included by -default. - -### `Parser#blockMethods` - -Array of `blockTokenizers` names (`string`) specifying the order in -which they run. - - - -* `newline` -* `indentedCode` -* `fencedCode` -* `blockquote` -* `atxHeading` -* `thematicBreak` -* `list` -* `setextHeading` -* `html` -* `footnote` -* `definition` -* `table` -* `paragraph` - - - -### `Parser#inlineTokenizers` - -An object mapping tokenizer names to [tokenizer][]s. These tokenizers -(for example: `url`, `reference`, and `emphasis`) eat from the start -of a value. To increase performance, they depend on [locator][]s. - -See `#inlineMethods` below for a list of methods that are included by -default. - -### `Parser#inlineMethods` - -Array of `inlineTokenizers` names (`string`) specifying the order in -which they run. - - - -* `escape` -* `autoLink` -* `url` -* `html` -* `link` -* `reference` -* `strong` -* `emphasis` -* `deletion` -* `code` -* `break` -* `text` - - - -### `function tokenizer(eat, value, silent)` - -```js -tokenizeMention.notInLink = true; -tokenizeMention.locator = locateMention; - -function tokenizeMention(eat, value, silent) { - var match = /^@(\w+)/.exec(value); - - if (match) { - if (silent) { - return true; - } - - return eat(match[0])({ - type: 'link', - url: 'https://social-network/' + match[1], - children: [{type: 'text', value: match[0]}] - }); - } -} -``` - -The parser knows two types of tokenizers: block level and inline level. -Block level tokenizers are the same as inline level tokenizers, with -the exception that the latter must have a [locator][]. - -Tokenizers _test_ whether a document starts with a certain syntactic -entity. In _silent_ mode, they return whether that test passes. -In _normal_ mode, they consume that token, a process which is called -“eating”. Locators enable tokenizers to function faster by providing -information on where the next entity may occur. - -###### Signatures - -* `Node? = tokenizer(eat, value)` -* `boolean? = tokenizer(eat, value, silent)` - -###### Parameters - -* `eat` ([`Function`][eat]) — Eat, when applicable, an entity -* `value` (`string`) — Value which may start an entity -* `silent` (`boolean`, optional) — Whether to detect or consume - -###### Properties - -* `locator` ([`Function`][locator]) - — Required for inline tokenizers -* `onlyAtStart` (`boolean`) - — Whether nodes can only be found at the beginning of the document -* `notInBlock` (`boolean`) - — Whether nodes cannot be in blockquotes, lists, or footnote - definitions -* `notInList` (`boolean`) - — Whether nodes cannot be in lists -* `notInLink` (`boolean`) - — Whether nodes cannot be in links - -###### Returns - -* In _silent_ mode, whether a node can be found at the start of `value` -* In _normal_ mode, a node if it can be found at the start of `value` - -### `tokenizer.locator(value, fromIndex)` - -```js -function locateMention(value, fromIndex) { - return value.indexOf('@', fromIndex); -} -``` - -Locators are required for inline tokenization to keep the process -performant. Locators enable inline tokenizers to function faster by -providing information on the where the next entity occurs. Locators -may be wrong, it’s OK if there actually isn’t a node to be found at -the index they return, but they must skip any nodes. - -###### Parameters - -* `value` (`string`) — Value which may contain an entity -* `fromIndex` (`number`) — Position to start searching at - -###### Returns - -Index at which an entity may start, and `-1` otherwise. - -### `eat(subvalue)` - -```js -var add = eat('foo'); -``` - -Eat `subvalue`, which is a string at the start of the -[tokenize][tokenizer]d `value` (it’s tracked to ensure the correct -value is eaten). - -###### Parameters - -* `subvalue` (`string`) - Value to eat. - -###### Returns - -[`add`][add]. - -### `add(node[, parent])` - -```js -var add = eat('foo'); -add({type: 'text', value: 'foo'}); -``` - -Add [positional information][location] to `node` and add it to `parent`. - -###### Parameters - -* `node` ([`Node`][node]) - Node to patch position on and insert -* `parent` ([`Node`][node], optional) - Place to add `node` to in - the syntax tree. Defaults to the currently processed node - -###### Returns - -The given `node`. - -### `add.test()` - -Get the [positional information][location] which would be patched on -`node` by `add`. - -###### Returns - -[`Location`][location]. - -### `add.reset(node[, parent])` - -`add`, but resets the internal location. Useful for example in -lists, where the same content is first eaten for a list, and later -for list items - -###### Parameters - -* `node` ([`Node`][node]) - Node to patch position on and insert -* `parent` ([`Node`][node], optional) - Place to add `node` to in - the syntax tree. Defaults to the currently processed node - -###### Returns - -The given `node`. - -### Turning off a tokenizer - -In rare situations, you may want to turn off a tokenizer to avoid parsing -that syntactic feature. This can be done by deleting the tokenizer from -your Parser’s `blockTokenizers` (or `blockMethods`) or `inlineTokenizers` -(or `inlineMethods`). - -The following example turns off indented code blocks: - -```js -delete remarkParse.Parser.prototype.blockTokenizers.indentedCode; -``` - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/remarkjs/remark.svg - -[build-status]: https://travis-ci.org/remarkjs/remark - -[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark.svg - -[coverage-status]: https://codecov.io/github/remarkjs/remark - -[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg - -[chat]: https://gitter.im/remarkjs/Lobby - -[license]: https://github.com/remarkjs/remark/blob/master/LICENSE - -[author]: http://wooorm.com - -[npm]: https://docs.npmjs.com/cli/install - -[unified]: https://github.com/unifiedjs/unified - -[data]: https://github.com/unifiedjs/unified#processordatakey-value - -[processor]: https://github.com/unifiedjs/remark/blob/master/packages/remark - -[mdast]: https://github.com/syntax-tree/mdast - -[escapes]: http://spec.commonmark.org/0.25/#backslash-escapes - -[node]: https://github.com/syntax-tree/unist#node - -[location]: https://github.com/syntax-tree/unist#location - -[parser]: https://github.com/unifiedjs/unified#processorparser - -[extend]: #extending-the-parser - -[tokenizer]: #function-tokenizereat-value-silent - -[locator]: #tokenizerlocatorvalue-fromindex - -[eat]: #eatsubvalue - -[add]: #addnode-parent - -[blocks]: https://github.com/remarkjs/remark/blob/master/packages/remark-parse/lib/block-elements.json diff --git a/tools/node_modules/eslint/node_modules/repeat-string/LICENSE b/tools/node_modules/eslint/node_modules/repeat-string/LICENSE deleted file mode 100644 index 39245ac1c60613..00000000000000 --- a/tools/node_modules/eslint/node_modules/repeat-string/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/repeat-string/README.md b/tools/node_modules/eslint/node_modules/repeat-string/README.md deleted file mode 100644 index aaa5e91c7a7f91..00000000000000 --- a/tools/node_modules/eslint/node_modules/repeat-string/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# repeat-string [![NPM version](https://img.shields.io/npm/v/repeat-string.svg?style=flat)](https://www.npmjs.com/package/repeat-string) [![NPM monthly downloads](https://img.shields.io/npm/dm/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![NPM total downloads](https://img.shields.io/npm/dt/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/repeat-string.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/repeat-string) - -> Repeat the given string n times. Fastest implementation for repeating a string. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save repeat-string -``` - -## Usage - -### [repeat](index.js#L41) - -Repeat the given `string` the specified `number` of times. - -**Example:** - -**Example** - -```js -var repeat = require('repeat-string'); -repeat('A', 5); -//=> AAAAA -``` - -**Params** - -* `string` **{String}**: The string to repeat -* `number` **{Number}**: The number of times to repeat the string -* `returns` **{String}**: Repeated string - -## Benchmarks - -Repeat string is significantly faster than the native method (which is itself faster than [repeating](https://github.com/sindresorhus/repeating)): - -```sh -# 2x -repeat-string █████████████████████████ (26,953,977 ops/sec) -repeating █████████ (9,855,695 ops/sec) -native ██████████████████ (19,453,895 ops/sec) - -# 3x -repeat-string █████████████████████████ (19,445,252 ops/sec) -repeating ███████████ (8,661,565 ops/sec) -native ████████████████████ (16,020,598 ops/sec) - -# 10x -repeat-string █████████████████████████ (23,792,521 ops/sec) -repeating █████████ (8,571,332 ops/sec) -native ███████████████ (14,582,955 ops/sec) - -# 50x -repeat-string █████████████████████████ (23,640,179 ops/sec) -repeating █████ (5,505,509 ops/sec) -native ██████████ (10,085,557 ops/sec) - -# 250x -repeat-string █████████████████████████ (23,489,618 ops/sec) -repeating ████ (3,962,937 ops/sec) -native ████████ (7,724,892 ops/sec) - -# 2000x -repeat-string █████████████████████████ (20,315,172 ops/sec) -repeating ████ (3,297,079 ops/sec) -native ███████ (6,203,331 ops/sec) - -# 20000x -repeat-string █████████████████████████ (23,382,915 ops/sec) -repeating ███ (2,980,058 ops/sec) -native █████ (5,578,808 ops/sec) -``` - -**Run the benchmarks** - -Install dev dependencies: - -```sh -npm i -d && node benchmark -``` - -## About - -### Related projects - -[repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor**
    | -| --- | --- | -| 51 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [LinusU](https://github.com/LinusU) | -| 2 | [tbusser](https://github.com/tbusser) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [wooorm](https://github.com/wooorm) | - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 23, 2016._ \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/repeat-string/index.js b/tools/node_modules/eslint/node_modules/repeat-string/index.js deleted file mode 100644 index 4459afd8016e31..00000000000000 --- a/tools/node_modules/eslint/node_modules/repeat-string/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/*! - * repeat-string - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -/** - * Results cache - */ - -var res = ''; -var cache; - -/** - * Expose `repeat` - */ - -module.exports = repeat; - -/** - * Repeat the given `string` the specified `number` - * of times. - * - * **Example:** - * - * ```js - * var repeat = require('repeat-string'); - * repeat('A', 5); - * //=> AAAAA - * ``` - * - * @param {String} `string` The string to repeat - * @param {Number} `number` The number of times to repeat the string - * @return {String} Repeated string - * @api public - */ - -function repeat(str, num) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - - // cover common, quick use cases - if (num === 1) return str; - if (num === 2) return str + str; - - var max = str.length * num; - if (cache !== str || typeof cache === 'undefined') { - cache = str; - res = ''; - } else if (res.length >= max) { - return res.substr(0, max); - } - - while (max > res.length && num > 1) { - if (num & 1) { - res += str; - } - - num >>= 1; - str += str; - } - - res += str; - res = res.substr(0, max); - return res; -} diff --git a/tools/node_modules/eslint/node_modules/repeat-string/package.json b/tools/node_modules/eslint/node_modules/repeat-string/package.json deleted file mode 100644 index 90fa9a34d8afb7..00000000000000 --- a/tools/node_modules/eslint/node_modules/repeat-string/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "author": { - "name": "Jon Schlinkert", - "url": "http://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/repeat-string/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "email": "brian.woodward@gmail.com", - "url": "https://github.com/doowb" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Linus Unnebäck", - "email": "linus@folkdatorn.se", - "url": "http://linus.unnebäck.se" - }, - { - "name": "Thijs Busser", - "email": "tbusser@gmail.com", - "url": "http://tbusser.net" - }, - { - "name": "Titus", - "email": "tituswormer@gmail.com", - "url": "wooorm.com" - } - ], - "deprecated": false, - "description": "Repeat the given string n times. Fastest implementation for repeating a string.", - "devDependencies": { - "ansi-cyan": "^0.1.1", - "benchmarked": "^0.2.5", - "gulp-format-md": "^0.1.11", - "isobject": "^2.1.0", - "mocha": "^3.1.2", - "repeating": "^3.0.0", - "text-table": "^0.2.0", - "yargs-parser": "^4.0.2" - }, - "engines": { - "node": ">=0.10" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/repeat-string", - "keywords": [ - "fast", - "fastest", - "fill", - "left", - "left-pad", - "multiple", - "pad", - "padding", - "repeat", - "repeating", - "repetition", - "right", - "right-pad", - "string", - "times" - ], - "license": "MIT", - "main": "index.js", - "name": "repeat-string", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/repeat-string.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "repeat-element" - ] - }, - "helpers": [ - "./benchmark/helper.js" - ], - "reflinks": [ - "verb" - ] - }, - "version": "1.6.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/require-from-string/package.json b/tools/node_modules/eslint/node_modules/require-from-string/package.json index 4ca96a63470da5..800d46efcb00b3 100644 --- a/tools/node_modules/eslint/node_modules/require-from-string/package.json +++ b/tools/node_modules/eslint/node_modules/require-from-string/package.json @@ -1,35 +1,28 @@ { + "name": "require-from-string", + "version": "2.0.2", + "description": "Require module from string", + "license": "MIT", + "repository": "floatdrop/require-from-string", "author": { "name": "Vsevolod Strukchinsky", "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, - "bugs": { - "url": "https://github.com/floatdrop/require-from-string/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Require module from string", - "devDependencies": { - "mocha": "*" - }, "engines": { "node": ">=0.10.0" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/require-from-string#readme", - "keywords": [], - "license": "MIT", - "name": "require-from-string", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/require-from-string.git" - }, "scripts": { "test": "mocha" }, - "version": "2.0.2" -} \ No newline at end of file + "files": [ + "index.js" + ], + "keywords": [ + "" + ], + "dependencies": {}, + "devDependencies": { + "mocha": "*" + } +} diff --git a/tools/node_modules/eslint/node_modules/resolve-from/package.json b/tools/node_modules/eslint/node_modules/resolve-from/package.json index dde5eec0bc6102..96bade58824569 100644 --- a/tools/node_modules/eslint/node_modules/resolve-from/package.json +++ b/tools/node_modules/eslint/node_modules/resolve-from/package.json @@ -1,43 +1,34 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/resolve-from/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Resolve the path of a module like `require.resolve()` but from a given path", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/resolve-from#readme", - "keywords": [ - "require", - "resolve", - "path", - "module", - "from", - "like", - "import" - ], - "license": "MIT", - "name": "resolve-from", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/resolve-from.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} \ No newline at end of file + "name": "resolve-from", + "version": "4.0.0", + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "license": "MIT", + "repository": "sindresorhus/resolve-from", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/tools/node_modules/eslint/node_modules/rimraf/package.json b/tools/node_modules/eslint/node_modules/rimraf/package.json index 036517586b227f..1bf8d5e38775d7 100644 --- a/tools/node_modules/eslint/node_modules/rimraf/package.json +++ b/tools/node_modules/eslint/node_modules/rimraf/package.json @@ -1,47 +1,32 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bin": { - "rimraf": "bin.js" - }, - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" + "name": "rimraf", + "version": "3.0.2", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": "git://github.com/isaacs/rimraf.git", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "tap test/*.js" }, - "bundleDependencies": false, + "bin": "./bin.js", "dependencies": { "glob": "^7.1.3" }, - "deprecated": false, - "description": "A deep deletion module for node (like `rm -rf`)", - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, "funding": { "url": "https://github.com/sponsors/isaacs" - }, - "homepage": "https://github.com/isaacs/rimraf#readme", - "license": "ISC", - "main": "rimraf.js", - "name": "rimraf", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js" - }, - "version": "3.0.2" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/semver/package.json b/tools/node_modules/eslint/node_modules/semver/package.json index 2aa14e5a6dd7e9..d4043d38a13529 100644 --- a/tools/node_modules/eslint/node_modules/semver/package.json +++ b/tools/node_modules/eslint/node_modules/semver/package.json @@ -1,21 +1,22 @@ { - "bin": { - "semver": "bin/semver.js" - }, - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, - "bundleDependencies": false, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "deprecated": false, + "name": "semver", + "version": "7.3.4", "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, "devDependencies": { "tap": "^14.10.7" }, - "engines": { - "node": ">=10" + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "bin/semver.js" }, "files": [ "bin/**/*.js", @@ -27,24 +28,14 @@ "index.js", "preload.js" ], - "homepage": "https://github.com/npm/node-semver#readme", - "license": "ISC", - "main": "index.js", - "name": "semver", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "tap", - "test": "tap" - }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, - "version": "7.3.4" -} \ No newline at end of file + "engines": { + "node": ">=10" + }, + "dependencies": { + "lru-cache": "^6.0.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/shebang-command/package.json b/tools/node_modules/eslint/node_modules/shebang-command/package.json index 3dc3563bceda96..18e3c04638cb68 100644 --- a/tools/node_modules/eslint/node_modules/shebang-command/package.json +++ b/tools/node_modules/eslint/node_modules/shebang-command/package.json @@ -1,43 +1,34 @@ { - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "bugs": { - "url": "https://github.com/kevva/shebang-command/issues" - }, - "bundleDependencies": false, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "deprecated": false, - "description": "Get the command from a shebang", - "devDependencies": { - "ava": "^2.3.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/kevva/shebang-command#readme", - "keywords": [ - "cmd", - "command", - "parse", - "shebang" - ], - "license": "MIT", - "name": "shebang-command", - "repository": { - "type": "git", - "url": "git+https://github.com/kevva/shebang-command.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0" -} \ No newline at end of file + "name": "shebang-command", + "version": "2.0.0", + "description": "Get the command from a shebang", + "license": "MIT", + "repository": "kevva/shebang-command", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "cmd", + "command", + "parse", + "shebang" + ], + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.3.0", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/shebang-regex/package.json b/tools/node_modules/eslint/node_modules/shebang-regex/package.json index 22a96573aadd2d..00ab30feeefe89 100644 --- a/tools/node_modules/eslint/node_modules/shebang-regex/package.json +++ b/tools/node_modules/eslint/node_modules/shebang-regex/package.json @@ -1,44 +1,35 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/shebang-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching a shebang line", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/shebang-regex#readme", - "keywords": [ - "regex", - "regexp", - "shebang", - "match", - "test", - "line" - ], - "license": "MIT", - "name": "shebang-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/shebang-regex.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "3.0.0" -} \ No newline at end of file + "name": "shebang-regex", + "version": "3.0.0", + "description": "Regular expression for matching a shebang line", + "license": "MIT", + "repository": "sindresorhus/shebang-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "regex", + "regexp", + "shebang", + "match", + "test", + "line" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581a13f990..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json deleted file mode 100644 index d276e03d2549c8..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-convert": "^2.0.1" - }, - "deprecated": false, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "ansi-styles", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", - "test": "xo && ava && tsd" - }, - "version": "4.3.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE deleted file mode 100644 index 5b4c386f9269b3..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011-2016 Heather Arthur - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc369948d..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js deleted file mode 100644 index 2657f265c9e102..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/conversions.js +++ /dev/null @@ -1,839 +0,0 @@ -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; -} - -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -module.exports = convert; - -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } - - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); -} - -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } - - const l = (min + max) / 2; - - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } - - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; -}; - -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - - return [c * 100, m * 100, y * 100, k * 100]; -}; - -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} - -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - - let currentClosestDistance = Infinity; - let currentClosestKeyword; - - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - - // Compute comparative distance - const distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - - return currentClosestKeyword; -}; - -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; - -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y * 100, z * 100]; -}; - -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - - const t1 = 2 * l - t2; - - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - - if (t3 > 1) { - t3--; - } - - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - - rgb[i] = val * 255; - } - - return rgb; -}; - -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - - return [h, sv * 100, v * 100]; -}; - -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; - - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; - -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - - return [h, sl * 100, l * 100]; -}; - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - const n = wh + f * (v - wh); // Linear interpolation - - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ - - return [r * 255, g * 255, b * 255]; -}; - -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; - - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; - - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - - x *= 95.047; - y *= 100; - z *= 108.883; - - return [x, y, z]; -}; - -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - - if (h < 0) { - h += 360; - } - - const c = Math.sqrt(a * a + b * b); - - return [l, c, h]; -}; - -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - - return [l, a, b]; -}; - -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization - - value = Math.round(value / 50); - - if (value === 0) { - return 30; - } - - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); - - if (value === 2) { - ansi += 60; - } - - return ansi; -}; - -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; - -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } - - if (r > 248) { - return 231; - } - - return Math.round(((r - 8) / 247) * 24) + 232; - } - - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); - - return ansi; -}; - -convert.ansi16.rgb = function (args) { - let color = args % 10; - - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - - color = color / 10.5 * 255; - - return [color, color, color]; - } - - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; - - return [r, g, b]; -}; - -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - - args -= 16; - - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; - - return [r, g, b]; -}; - -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - - let colorString = match[0]; - - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } - - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; - - return [r, g, b]; -}; - -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; - - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - - const c = s * v; - let f = 0; - - if (c < 1.0) { - f = (v - c) / (1 - c); - } - - return [hsv[0], c * 100, f * 100]; -}; - -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } - - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ - - mg = (1.0 - c) * g; - - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; - -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const v = c + g * (1.0 - c); - let f = 0; - - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; - - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - - return [hcg[0], s * 100, l * 100]; -}; - -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; - -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - - if (c < 1) { - g = (v - c) / (1 - c); - } - - return [hwb[0], c * 100, g * 100]; -}; - -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; - -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; - -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; - -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; - -convert.gray.hsv = convert.gray.hsl; - -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; - -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; - -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; - -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js deleted file mode 100644 index b648e5737be616..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/index.js +++ /dev/null @@ -1,81 +0,0 @@ -const conversions = require('./conversions'); -const route = require('./route'); - -const convert = {}; - -const models = Object.keys(conversions); - -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - return fn(args); - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - const result = fn(args); - - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - const routes = route(fromModel); - const routeModels = Object.keys(routes); - - routeModels.forEach(toModel => { - const fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json deleted file mode 100644 index 427616bd0587d8..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-convert/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "author": { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - "bugs": { - "url": "https://github.com/Qix-/color-convert/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-name": "~1.1.4" - }, - "deprecated": false, - "description": "Plain color conversion functions", - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=7.0.0" - }, - "files": [ - "index.js", - "conversions.js", - "route.js" - ], - "homepage": "https://github.com/Qix-/color-convert#readme", - "keywords": [ - "color", - "colour", - "convert", - "converter", - "conversion", - "rgb", - "hsl", - "hsv", - "hwb", - "cmyk", - "ansi", - "ansi16" - ], - "license": "MIT", - "name": "color-convert", - "repository": { - "type": "git", - "url": "git+https://github.com/Qix-/color-convert.git" - }, - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "version": "2.0.1", - "xo": { - "rules": { - "default-case": 0, - "no-inline-comments": 0, - "operator-linebreak": 0 - } - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE deleted file mode 100644 index c6b10012540c24..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md deleted file mode 100644 index 932b979176f33b..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - -
    diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js deleted file mode 100644 index b7c198a6f3d7c5..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json deleted file mode 100644 index 07b8f6ece8170a..00000000000000 --- a/tools/node_modules/eslint/node_modules/slice-ansi/node_modules/color-name/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": { - "name": "DY", - "email": "dfcreative@gmail.com" - }, - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A list of color names and its values", - "files": [ - "index.js" - ], - "homepage": "https://github.com/colorjs/color-name", - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "license": "MIT", - "main": "index.js", - "name": "color-name", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/colorjs/color-name.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.1.4" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/package.json index 1e32ac1c4a9650..7d6ea6956dcfb1 100644 --- a/tools/node_modules/eslint/node_modules/slice-ansi/package.json +++ b/tools/node_modules/eslint/node_modules/slice-ansi/package.json @@ -1,61 +1,52 @@ { - "bugs": { - "url": "https://github.com/chalk/slice-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "deprecated": false, - "description": "Slice a string with ANSI escape codes", - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^3.0.0", - "random-item": "^3.0.0", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js" - ], - "funding": "https://github.com/chalk/slice-ansi?sponsor=1", - "homepage": "https://github.com/chalk/slice-ansi#readme", - "keywords": [ - "slice", - "string", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "slice-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/slice-ansi.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.0" -} \ No newline at end of file + "name": "slice-ansi", + "version": "4.0.0", + "description": "Slice a string with ANSI escape codes", + "license": "MIT", + "repository": "chalk/slice-ansi", + "funding": "https://github.com/chalk/slice-ansi?sponsor=1", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "slice", + "string", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "chalk": "^3.0.0", + "random-item": "^3.0.0", + "strip-ansi": "^6.0.0", + "xo": "^0.26.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/sprintf-js/package.json b/tools/node_modules/eslint/node_modules/sprintf-js/package.json index da639c61582bbe..75f7eca71ea37f 100644 --- a/tools/node_modules/eslint/node_modules/sprintf-js/package.json +++ b/tools/node_modules/eslint/node_modules/sprintf-js/package.json @@ -1,31 +1,22 @@ { - "author": { - "name": "Alexandru Marasteanu", - "email": "hello@alexei.ro", - "url": "http://alexei.ro/" - }, - "bugs": { - "url": "https://github.com/alexei/sprintf.js/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "JavaScript sprintf implementation", - "devDependencies": { - "grunt": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-watch": "*", - "mocha": "*" - }, - "homepage": "https://github.com/alexei/sprintf.js#readme", - "license": "BSD-3-Clause", - "main": "src/sprintf.js", - "name": "sprintf-js", - "repository": { - "type": "git", - "url": "git+https://github.com/alexei/sprintf.js.git" - }, - "scripts": { - "test": "mocha test/test.js" - }, - "version": "1.0.3" -} \ No newline at end of file + "name": "sprintf-js", + "version": "1.0.3", + "description": "JavaScript sprintf implementation", + "author": "Alexandru Marasteanu (http://alexei.ro/)", + "main": "src/sprintf.js", + "scripts": { + "test": "mocha test/test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/alexei/sprintf.js.git" + }, + "license": "BSD-3-Clause", + "readmeFilename": "README.md", + "devDependencies": { + "mocha": "*", + "grunt": "*", + "grunt-contrib-watch": "*", + "grunt-contrib-uglify": "*" + } +} diff --git a/tools/node_modules/eslint/node_modules/state-toggle/index.js b/tools/node_modules/eslint/node_modules/state-toggle/index.js deleted file mode 100644 index aceee00d1db789..00000000000000 --- a/tools/node_modules/eslint/node_modules/state-toggle/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict' - -module.exports = factory - -// Construct a state `toggler`: a function which inverses `property` in context -// based on its current value. -// The by `toggler` returned function restores that value. -function factory(key, state, ctx) { - return enter - - function enter() { - var context = ctx || this - var current = context[key] - - context[key] = !state - - return exit - - function exit() { - context[key] = current - } - } -} diff --git a/tools/node_modules/eslint/node_modules/state-toggle/license b/tools/node_modules/eslint/node_modules/state-toggle/license deleted file mode 100644 index 8d8660d36ef2ec..00000000000000 --- a/tools/node_modules/eslint/node_modules/state-toggle/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/state-toggle/package.json b/tools/node_modules/eslint/node_modules/state-toggle/package.json deleted file mode 100644 index 573df7117bfe98..00000000000000 --- a/tools/node_modules/eslint/node_modules/state-toggle/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/state-toggle/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Enter/exit a state", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^15.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/state-toggle#readme", - "keywords": [ - "enter", - "exit", - "state" - ], - "license": "MIT", - "name": "state-toggle", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/state-toggle.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s stateToggle -o state-toggle.js", - "build-mangle": "browserify . -s stateToggle -p tinyify -o state-toggle.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.0.3", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "state-toggle.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/state-toggle/readme.md b/tools/node_modules/eslint/node_modules/state-toggle/readme.md deleted file mode 100644 index 9fcca1e5ef6ddb..00000000000000 --- a/tools/node_modules/eslint/node_modules/state-toggle/readme.md +++ /dev/null @@ -1,95 +0,0 @@ -# state-toggle - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Enter/exit a state. - -## Install - -[npm][]: - -```sh -npm install state-toggle -``` - -## Use - -```js -var toggle = require('state-toggle') - -var ctx = {on: false} -var enter = toggle('on', ctx.on, ctx) -var exit - -// Entering: -exit = enter() -console.log(ctx.on) // => true - -// Exiting: -exit() -console.log(ctx.on) // => false -``` - -## API - -### `toggle(key, initial[, ctx])` - -Create a toggle, which when entering toggles `key` on `ctx` (or `this`, if `ctx` -is not given) to `!initial`, and when exiting, sets `key` on the context back to -the value it had before entering. - -###### Returns - -`Function` — [`enter`][enter]. - -### `enter()` - -Enter the state. - -###### Context - -If no `ctx` was given to `toggle`, the context object (`this`) of `enter()` is -used to toggle. - -###### Returns - -`Function` — [`exit`][exit]. - -### `exit()` - -Exit the state, reverting `key` to the value it had before entering. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/state-toggle.svg - -[build]: https://travis-ci.org/wooorm/state-toggle - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/state-toggle.svg - -[coverage]: https://codecov.io/github/wooorm/state-toggle - -[downloads-badge]: https://img.shields.io/npm/dm/state-toggle.svg - -[downloads]: https://www.npmjs.com/package/state-toggle - -[size-badge]: https://img.shields.io/bundlephobia/minzip/state-toggle.svg - -[size]: https://bundlephobia.com/result?p=state-toggle - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com - -[enter]: #enter - -[exit]: #exit diff --git a/tools/node_modules/eslint/node_modules/string-width/package.json b/tools/node_modules/eslint/node_modules/string-width/package.json index 38993c1e2e336d..5751de5a6464ea 100644 --- a/tools/node_modules/eslint/node_modules/string-width/package.json +++ b/tools/node_modules/eslint/node_modules/string-width/package.json @@ -1,65 +1,56 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "character", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "4.2.0" -} \ No newline at end of file + "name": "string-width", + "version": "4.2.0", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/strip-ansi/package.json index 5db6f68dc0aef7..65a6c95161f747 100644 --- a/tools/node_modules/eslint/node_modules/strip-ansi/package.json +++ b/tools/node_modules/eslint/node_modules/strip-ansi/package.json @@ -1,63 +1,54 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/strip-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes from a string", - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/chalk/strip-ansi#readme", - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "6.0.0" -} \ No newline at end of file + "name": "strip-ansi", + "version": "6.0.0", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json index d28e657025b6e9..ce7875aa0d1963 100644 --- a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json +++ b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json @@ -1,56 +1,47 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/strip-json-comments/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Strip comments from JSON. Lets you use comments in your JSON files!", - "devDependencies": { - "ava": "^1.4.1", - "matcha": "^0.7.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/strip-json-comments#readme", - "keywords": [ - "json", - "strip", - "comments", - "remove", - "delete", - "trim", - "multiline", - "parse", - "config", - "configuration", - "settings", - "util", - "env", - "environment", - "jsonc" - ], - "license": "MIT", - "name": "strip-json-comments", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-json-comments.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "test": "xo && ava && tsd" - }, - "version": "3.1.1" -} \ No newline at end of file + "name": "strip-json-comments", + "version": "3.1.1", + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "license": "MIT", + "repository": "sindresorhus/strip-json-comments", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/supports-color/index.js b/tools/node_modules/eslint/node_modules/supports-color/index.js index 1704131bdf6c8f..6fada390fb88d8 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/index.js +++ b/tools/node_modules/eslint/node_modules/supports-color/index.js @@ -1,22 +1,31 @@ 'use strict'; const os = require('os'); +const tty = require('tty'); const hasFlag = require('has-flag'); -const env = process.env; +const {env} = process; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || - hasFlag('color=false')) { - forceColor = false; + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { - forceColor = true; + forceColor = 1; } + if ('FORCE_COLOR' in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } } function translateLevel(level) { @@ -32,8 +41,8 @@ function translateLevel(level) { }; } -function supportsColor(stream) { - if (forceColor === false) { +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { return 0; } @@ -47,22 +56,21 @@ function supportsColor(stream) { return 2; } - if (stream && !stream.isTTY && forceColor !== true) { + if (haveStream && !streamIsTTY && forceColor === undefined) { return 0; } - const min = forceColor ? 1 : 0; + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } if (process.platform === 'win32') { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( - Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { @@ -73,7 +81,7 @@ function supportsColor(stream) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -112,20 +120,16 @@ function supportsColor(stream) { return 1; } - if (env.TERM === 'dumb') { - return min; - } - return min; } function getSupportLevel(stream) { - const level = supportsColor(stream); + const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; diff --git a/tools/node_modules/eslint/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/supports-color/package.json index 9e4eafa8573232..f7182edcea2baa 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/package.json +++ b/tools/node_modules/eslint/node_modules/supports-color/package.json @@ -1,62 +1,53 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "bundleDependencies": false, - "dependencies": { - "has-flag": "^3.0.0" - }, - "deprecated": false, - "description": "Detect whether a terminal supports color", - "devDependencies": { - "ava": "^0.25.0", - "import-fresh": "^2.0.0", - "xo": "^0.20.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "browser.js" - ], - "homepage": "https://github.com/chalk/supports-color#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "license": "MIT", - "name": "supports-color", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "5.5.0" -} \ No newline at end of file + "name": "supports-color", + "version": "7.2.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "browser": "browser.js" +} diff --git a/tools/node_modules/eslint/node_modules/supports-color/readme.md b/tools/node_modules/eslint/node_modules/supports-color/readme.md index f6e40195730ae8..36542285863330 100644 --- a/tools/node_modules/eslint/node_modules/supports-color/readme.md +++ b/tools/node_modules/eslint/node_modules/supports-color/readme.md @@ -44,7 +44,7 @@ The `stdout`/`stderr` objects specifies a level of support for color through a ` It obeys the `--color` and `--no-color` CLI flags. -Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. @@ -61,6 +61,16 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= - [Josh Junon](https://github.com/qix-) -## License +--- -MIT +
    + + Get professional support for this package with a Tidelift subscription + +
    + + Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. +
    +
    + +--- diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js index ef1b1670127d50..91919e8880b493 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = void 0; +exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; const code_1 = require("./code"); class ValueError extends Error { constructor(name) { @@ -8,6 +8,11 @@ class ValueError extends Error { this.value = name.value; } } +var UsedValueState; +(function (UsedValueState) { + UsedValueState[UsedValueState["Started"] = 0] = "Started"; + UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; +})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {})); exports.varKinds = { const: new code_1.Name("const"), let: new code_1.Name("let"), @@ -112,11 +117,11 @@ class ValueScope extends Scope { const vs = values[prefix]; if (!vs) continue; - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Set()); + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()); vs.forEach((name) => { if (nameSet.has(name)) return; - nameSet.add(name); + nameSet.set(name, UsedValueState.Started); let c = valueCode(name); if (c) { const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; @@ -128,6 +133,7 @@ class ValueScope extends Scope { else { throw new ValueError(name); } + nameSet.set(name, UsedValueState.Completed); }); } return code; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js index b9d9bfb09974ce..0c709323f19b5f 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js @@ -171,7 +171,7 @@ ref // reference to resolve ) { const p = URI.parse(ref); const refPath = resolve_1._getFullPath(p); - const baseId = resolve_1.getFullPath(root.baseId); + let baseId = resolve_1.getFullPath(root.baseId); // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests if (Object.keys(root.schema).length > 0 && refPath === baseId) { return getJsonPointer.call(this, p, root); @@ -188,8 +188,12 @@ ref // reference to resolve return; if (!schOrRef.validate) compileSchema.call(this, schOrRef); - if (id === resolve_1.normalizeId(ref)) - return new SchemaEnv({ schema: schOrRef.schema, root, baseId }); + if (id === resolve_1.normalizeId(ref)) { + const { schema } = schOrRef; + if (schema.$id) + baseId = resolve_1.resolveUrl(baseId, schema.$id); + return new SchemaEnv({ schema, root, baseId }); + } return getJsonPointer.call(this, p, schOrRef); } exports.resolveSchema = resolveSchema; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js index c49bde936bcb33..f58ebb6977bfba 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js @@ -40,9 +40,9 @@ function standaloneCode(ajv, refsOrFunc) { function validateCode(usedValues, s) { if (!s) throw new Error('moduleCode: function does not have "source" property'); - const { prefix } = s.validateName; - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Set()); - nameSet.add(s.validateName); + if (usedState(s.validateName) === scope_1.UsedValueState.Completed) + return code_1.nil; + setUsedState(s.validateName, scope_1.UsedValueState.Started); const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); return s.evaluated ? code_1._ `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; @@ -55,12 +55,26 @@ function standaloneCode(ajv, refsOrFunc) { } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { const { validate, validateName } = vRef; - const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); + if (!validateName) + throw new Error("ajv internal error"); const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; - return code_1._ `${def} ${n} = {validate: ${validateName}};${_n}${vCode}`; + const wrapper = code_1._ `${def} ${n} = {validate: ${validateName}};`; + if (usedState(validateName) === scope_1.UsedValueState.Started) + return wrapper; + const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); + return code_1._ `${wrapper}${_n}${vCode}`; } return undefined; } + function usedState(name) { + var _a; + return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); + } + function setUsedState(name, state) { + const { prefix } = name; + const names = (usedValues[prefix] = usedValues[prefix] || new Map()); + names.set(name, state); + } } } exports.default = standaloneCode; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json index 032498f33b03b8..5813580d7b6795 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json @@ -1,23 +1,71 @@ { - "author": { - "name": "Evgeny Poberezkin" + "name": "ajv", + "version": "7.0.4", + "description": "Another JSON Schema Validator", + "main": "dist/ajv.js", + "types": "dist/ajv.d.ts", + "files": [ + "lib/", + "docs/", + "dist/", + "scripts/", + ".tonic_example.js" + ], + "scripts": { + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"", + "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-cov": "nyc npm run test-spec", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019", + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "test-karma": "karma start", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", + "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", + "test-ci": "AJV_FULL_TEST=true npm test", + "prepublish": "npm run build" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] }, + "repository": { + "type": "git", + "url": "https://github.com/ajv-validator/ajv.git" + }, + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", "bugs": { "url": "https://github.com/ajv-validator/ajv/issues" }, - "bundleDependencies": false, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, + "homepage": "https://github.com/ajv-validator/ajv", + "tonicExampleFilename": ".tonic_example.js", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, - "deprecated": false, - "description": "Another JSON Schema Validator", "devDependencies": { "@ajv-validator/config": "^0.3.0", "@types/chai": "^4.2.12", @@ -49,73 +97,21 @@ "tsify": "^5.0.2", "typescript": "^4.0.0" }, - "files": [ - "lib/", - "docs/", - "dist/", - "scripts/", - ".tonic_example.js" - ], + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" }, - "homepage": "https://github.com/ajv-validator/ajv", + "prettier": "@ajv-validator/config/prettierrc.json", "husky": { "hooks": { "pre-commit": "lint-staged && npm test" } }, - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "license": "MIT", "lint-staged": { "*.{md,json,yaml,js,ts}": "prettier --write" - }, - "main": "dist/ajv.js", - "name": "ajv", - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "prettier": "@ajv-validator/config/prettierrc.json", - "repository": { - "type": "git", - "url": "git+https://github.com/ajv-validator/ajv.git" - }, - "scripts": { - "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts", - "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019", - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", - "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", - "prepublish": "npm run build", - "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"", - "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"", - "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", - "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", - "test-ci": "AJV_FULL_TEST=true npm test", - "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", - "test-cov": "nyc npm run test-spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-karma": "karma start", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot" - }, - "tonicExampleFilename": ".tonic_example.js", - "types": "dist/ajv.d.ts", - "version": "7.0.3" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json index 98fee959b778b7..e32dfbaeec58fb 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json +++ b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json @@ -1,28 +1,35 @@ { - "author": { - "name": "Evgeny Poberezkin" + "name": "json-schema-traverse", + "version": "1.0.0", + "description": "Traverse JSON Schema passing each schema object to callback", + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "eslint": "eslint index.js spec", + "test-spec": "mocha spec -R spec", + "test": "npm run eslint && nyc npm run test-spec" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" }, + "keywords": [ + "JSON-Schema", + "traverse", + "iterate" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", "bugs": { "url": "https://github.com/epoberezkin/json-schema-traverse/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Traverse JSON Schema passing each schema object to callback", + "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", "devDependencies": { "eslint": "^7.3.1", "mocha": "^8.0.1", "nyc": "^15.0.0", "pre-commit": "^1.2.2" }, - "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme", - "keywords": [ - "JSON-Schema", - "traverse", - "iterate" - ], - "license": "MIT", - "main": "index.js", - "name": "json-schema-traverse", "nyc": { "exclude": [ "**/spec/**", @@ -32,16 +39,5 @@ "lcov", "text-summary" ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/json-schema-traverse.git" - }, - "scripts": { - "eslint": "eslint index.js spec", - "test": "npm run eslint && nyc npm run test-spec", - "test-spec": "mocha spec -R spec" - }, - "types": "index.d.ts", - "version": "1.0.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index 892f772a2f312a..85036e7f2e5bb9 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -1,20 +1,15 @@ { "author": { - "name": "Gajus Kuizinas", "email": "gajus@gajus.com", + "name": "Gajus Kuizinas", "url": "http://gajus.com" }, - "bugs": { - "url": "https://github.com/gajus/table/issues" - }, - "bundleDependencies": false, "dependencies": { "ajv": "^7.0.2", "lodash": "^4.17.20", "slice-ansi": "^4.0.0", "string-width": "^4.2.0" }, - "deprecated": false, "description": "Formats data into a string table.", "devDependencies": { "@babel/cli": "^7.12.10", @@ -46,7 +41,6 @@ "engines": { "node": ">=10.0.0" }, - "homepage": "https://github.com/gajus/table#readme", "husky": { "hooks": { "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", @@ -78,7 +72,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/gajus/table.git" + "url": "https://github.com/gajus/table" }, "scripts": { "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", @@ -88,4 +82,4 @@ "test": "mocha --require @babel/register" }, "version": "6.0.7" -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/text-table/package.json b/tools/node_modules/eslint/node_modules/text-table/package.json index f5c43b5d934ee1..b4d17a4ff81316 100644 --- a/tools/node_modules/eslint/node_modules/text-table/package.json +++ b/tools/node_modules/eslint/node_modules/text-table/package.json @@ -1,50 +1,44 @@ { - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/text-table/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "borderless text tables with alignment", - "devDependencies": { - "cli-color": "~0.2.3", - "tap": "~0.4.0", - "tape": "~1.0.2" - }, - "homepage": "https://github.com/substack/text-table", - "keywords": [ - "text", - "table", - "align", - "ascii", - "rows", - "tabular" - ], - "license": "MIT", - "main": "index.js", - "name": "text-table", - "repository": { - "type": "git", - "url": "git://github.com/substack/text-table.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "chrome/20..latest", - "firefox/10..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", - "ipad/6" - ] - }, - "version": "0.2.0" -} \ No newline at end of file + "name": "text-table", + "version": "0.2.0", + "description": "borderless text tables with alignment", + "main": "index.js", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.2", + "cli-color": "~0.2.3" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT" +} diff --git a/tools/node_modules/eslint/node_modules/trim-trailing-lines/index.js b/tools/node_modules/eslint/node_modules/trim-trailing-lines/index.js deleted file mode 100644 index eff85c6baedffb..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim-trailing-lines/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' - -module.exports = trimTrailingLines - -// Remove final newline characters from `value`. -function trimTrailingLines(value) { - return String(value).replace(/\n+$/, '') -} diff --git a/tools/node_modules/eslint/node_modules/trim-trailing-lines/license b/tools/node_modules/eslint/node_modules/trim-trailing-lines/license deleted file mode 100644 index 611b67581bb8e2..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim-trailing-lines/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/trim-trailing-lines/package.json b/tools/node_modules/eslint/node_modules/trim-trailing-lines/package.json deleted file mode 100644 index c0242dc1299bdc..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim-trailing-lines/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/trim-trailing-lines/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Remove final line feeds from a string", - "devDependencies": { - "browserify": "^17.0.0", - "nyc": "^15.0.0", - "prettier": "^2.0.0", - "remark-cli": "^9.0.0", - "remark-preset-wooorm": "^8.0.0", - "tape": "^5.0.0", - "tinyify": "^3.0.0", - "xo": "^0.34.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/trim-trailing-lines#readme", - "keywords": [ - "trim", - "final", - "line", - "newline", - "characters" - ], - "license": "MIT", - "name": "trim-trailing-lines", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/trim-trailing-lines.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s trimTrailingLines -o trim-trailing-lines.js", - "build-mangle": "browserify . -s trimTrailingLines -p tinyify -o trim-trailing-lines.min.js", - "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.1.4", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "trim-trailing-lines.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/trim-trailing-lines/readme.md b/tools/node_modules/eslint/node_modules/trim-trailing-lines/readme.md deleted file mode 100644 index a9c1f441b84262..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim-trailing-lines/readme.md +++ /dev/null @@ -1,68 +0,0 @@ -# trim-trailing-lines - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Remove final line feeds from a string. - -## Install - -[npm][]: - -```sh -npm install trim-trailing-lines -``` - -## Use - -```js -var trimTrailingLines = require('trim-trailing-lines') - -trimTrailingLines('foo\nbar') // => 'foo\nbar' -trimTrailingLines('foo\nbar\n') // => 'foo\nbar' -trimTrailingLines('foo\nbar\n\n') // => 'foo\nbar' -``` - -## API - -### `trimTrailingLines(value)` - -Remove final line feed characters from `value`. - -###### Parameters - -* `value` (`string`) — Value with trailing line feeds, coerced to string. - -###### Returns - -`string` — Value without trailing newlines. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/trim-trailing-lines.svg - -[build]: https://travis-ci.org/wooorm/trim-trailing-lines - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/trim-trailing-lines.svg - -[coverage]: https://codecov.io/github/wooorm/trim-trailing-lines - -[downloads-badge]: https://img.shields.io/npm/dm/trim-trailing-lines.svg - -[downloads]: https://www.npmjs.com/package/trim-trailing-lines - -[size-badge]: https://img.shields.io/bundlephobia/minzip/trim-trailing-lines.svg - -[size]: https://bundlephobia.com/result?p=trim-trailing-lines - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/trim/Makefile b/tools/node_modules/eslint/node_modules/trim/Makefile deleted file mode 100644 index 4e9c8d36ebcd2f..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec - -.PHONY: test \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/trim/Readme.md b/tools/node_modules/eslint/node_modules/trim/Readme.md deleted file mode 100644 index 3460f523fbe8ac..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim/Readme.md +++ /dev/null @@ -1,69 +0,0 @@ - -# trim - - Trims string whitespace. - -## Installation - -``` -$ npm install trim -$ component install component/trim -``` - -## API - - - [trim(str)](#trimstr) - - [.left(str)](#leftstr) - - [.right(str)](#rightstr) - - - -### trim(str) -should trim leading / trailing whitespace. - -```js -trim(' foo bar ').should.equal('foo bar'); -trim('\n\n\nfoo bar\n\r\n\n').should.equal('foo bar'); -``` - - -### .left(str) -should trim leading whitespace. - -```js -trim.left(' foo bar ').should.equal('foo bar '); -``` - - -### .right(str) -should trim trailing whitespace. - -```js -trim.right(' foo bar ').should.equal(' foo bar'); -``` - - -## License - -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/trim/index.js b/tools/node_modules/eslint/node_modules/trim/index.js deleted file mode 100644 index 640c24cf302e60..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim/index.js +++ /dev/null @@ -1,14 +0,0 @@ - -exports = module.exports = trim; - -function trim(str){ - return str.replace(/^\s*|\s*$/g, ''); -} - -exports.left = function(str){ - return str.replace(/^\s*/, ''); -}; - -exports.right = function(str){ - return str.replace(/\s*$/, ''); -}; diff --git a/tools/node_modules/eslint/node_modules/trim/package.json b/tools/node_modules/eslint/node_modules/trim/package.json deleted file mode 100644 index b6c977af444974..00000000000000 --- a/tools/node_modules/eslint/node_modules/trim/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "bundleDependencies": false, - "component": { - "scripts": { - "trim/index.js": "index.js" - } - }, - "dependencies": {}, - "deprecated": false, - "description": "Trim string whitespace", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "keywords": [ - "string", - "trim" - ], - "main": "index", - "name": "trim", - "version": "0.0.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/type-check/package.json b/tools/node_modules/eslint/node_modules/type-check/package.json index a056438a760bad..2a57ea0643dc58 100644 --- a/tools/node_modules/eslint/node_modules/type-check/package.json +++ b/tools/node_modules/eslint/node_modules/type-check/package.json @@ -1,30 +1,8 @@ { - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "bugs": { - "url": "https://github.com/gkz/type-check/issues" - }, - "bundleDependencies": false, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "deprecated": false, + "name": "type-check", + "version": "0.4.0", + "author": "George Zahariev ", "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", - "devDependencies": { - "browserify": "^16.5.1", - "livescript": "^1.6.0", - "mocha": "^7.1.1" - }, - "engines": { - "node": ">= 0.8.0" - }, - "files": [ - "lib", - "README.md", - "LICENSE" - ], "homepage": "https://github.com/gkz/type-check", "keywords": [ "type", @@ -32,9 +10,17 @@ "checking", "library" ], - "license": "MIT", + "files": [ + "lib", + "README.md", + "LICENSE" + ], "main": "./lib/", - "name": "type-check", + "bugs": "https://github.com/gkz/type-check/issues", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + }, "repository": { "type": "git", "url": "git://github.com/gkz/type-check.git" @@ -42,5 +28,12 @@ "scripts": { "test": "make test" }, - "version": "0.4.0" -} \ No newline at end of file + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "devDependencies": { + "livescript": "^1.6.0", + "mocha": "^7.1.1", + "browserify": "^16.5.1" + } +} diff --git a/tools/node_modules/eslint/node_modules/type-fest/package.json b/tools/node_modules/eslint/node_modules/type-fest/package.json index 0164025631ef29..ea6621129dc660 100644 --- a/tools/node_modules/eslint/node_modules/type-fest/package.json +++ b/tools/node_modules/eslint/node_modules/type-fest/package.json @@ -1,60 +1,51 @@ { - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/type-fest/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A collection of essential TypeScript types", - "devDependencies": { - "@sindresorhus/tsconfig": "^0.4.0", - "@typescript-eslint/eslint-plugin": "^2.2.0", - "@typescript-eslint/parser": "^2.2.0", - "eslint-config-xo-typescript": "^0.18.0", - "tsd": "^0.7.3", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.d.ts", - "source" - ], - "homepage": "https://github.com/sindresorhus/type-fest#readme", - "keywords": [ - "typescript", - "ts", - "types", - "utility", - "util", - "utilities", - "omit", - "merge", - "json" - ], - "license": "(MIT OR CC0-1.0)", - "name": "type-fest", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/type-fest.git" - }, - "scripts": { - "test": "xo && tsd" - }, - "version": "0.8.1", - "xo": { - "extends": "xo-typescript", - "extensions": [ - "ts" - ], - "rules": { - "import/no-unresolved": "off", - "@typescript-eslint/indent": "off" - } - } -} \ No newline at end of file + "name": "type-fest", + "version": "0.8.1", + "description": "A collection of essential TypeScript types", + "license": "(MIT OR CC0-1.0)", + "repository": "sindresorhus/type-fest", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && tsd" + }, + "files": [ + "index.d.ts", + "source" + ], + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "^0.4.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", + "eslint-config-xo-typescript": "^0.18.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} diff --git a/tools/node_modules/eslint/node_modules/unherit/index.js b/tools/node_modules/eslint/node_modules/unherit/index.js deleted file mode 100644 index 32ead7770fa2c9..00000000000000 --- a/tools/node_modules/eslint/node_modules/unherit/index.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict' - -var xtend = require('xtend') -var inherits = require('inherits') - -module.exports = unherit - -// Create a custom constructor which can be modified without affecting the -// original class. -function unherit(Super) { - var result - var key - var value - - inherits(Of, Super) - inherits(From, Of) - - // Clone values. - result = Of.prototype - - for (key in result) { - value = result[key] - - if (value && typeof value === 'object') { - result[key] = 'concat' in value ? value.concat() : xtend(value) - } - } - - return Of - - // Constructor accepting a single argument, which itself is an `arguments` - // object. - function From(parameters) { - return Super.apply(this, parameters) - } - - // Constructor accepting variadic arguments. - function Of() { - if (!(this instanceof Of)) { - return new From(arguments) - } - - return Super.apply(this, arguments) - } -} diff --git a/tools/node_modules/eslint/node_modules/unherit/license b/tools/node_modules/eslint/node_modules/unherit/license deleted file mode 100644 index f3722d94b38121..00000000000000 --- a/tools/node_modules/eslint/node_modules/unherit/license +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/unherit/package.json b/tools/node_modules/eslint/node_modules/unherit/package.json deleted file mode 100644 index b3cb27e60d4ebe..00000000000000 --- a/tools/node_modules/eslint/node_modules/unherit/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/wooorm/unherit/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": { - "inherits": "^2.0.0", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "Clone a constructor without affecting the super-class", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^15.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - }, - "homepage": "https://github.com/wooorm/unherit#readme", - "keywords": [ - "clone", - "super", - "class", - "constructor" - ], - "license": "MIT", - "name": "unherit", - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wooorm/unherit.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s unherit -o unherit.js", - "build-mangle": "browserify . -s unherit -p tinyify -o unherit.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.1.3", - "xo": { - "prettier": true, - "esnext": false, - "rules": { - "unicorn/prefer-reflect-apply": "off", - "guard-for-in": "off" - }, - "ignores": [ - "unherit.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/unherit/readme.md b/tools/node_modules/eslint/node_modules/unherit/readme.md deleted file mode 100644 index bf679597d89d50..00000000000000 --- a/tools/node_modules/eslint/node_modules/unherit/readme.md +++ /dev/null @@ -1,79 +0,0 @@ -# unherit - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -Create a custom constructor which can be modified without affecting the original -class. - -## Install - -[npm][]: - -```sh -npm install unherit -``` - -## Use - -```js -var EventEmitter = require('events').EventEmitter -var unherit = require('unherit') - -// Create a private class which acts just like `EventEmitter`. -var Emitter = unherit(EventEmitter) - -Emitter.prototype.defaultMaxListeners = 0 -// Now, all instances of `Emitter` have no maximum listeners, without affecting -// other `EventEmitter`s. - -new Emitter().defaultMaxListeners === 0 // => true -new EventEmitter().defaultMaxListeners === undefined // => true -new Emitter() instanceof EventEmitter // => true -``` - -## API - -### `unherit(Super)` - -Create a custom constructor which can be modified without affecting the original -class. - -###### Parameters - -* `Super` (`Function`) — Super-class - -###### Returns - -`Function` — Constructor acting like `Super`, which can be modified without -affecting the original class. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/wooorm/unherit.svg - -[build]: https://travis-ci.org/wooorm/unherit - -[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/unherit.svg - -[coverage]: https://codecov.io/github/wooorm/unherit - -[downloads-badge]: https://img.shields.io/npm/dm/unherit.svg - -[downloads]: https://www.npmjs.com/package/unherit - -[size-badge]: https://img.shields.io/bundlephobia/minzip/unherit.svg - -[size]: https://bundlephobia.com/result?p=unherit - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com diff --git a/tools/node_modules/eslint/node_modules/unist-util-is/convert.js b/tools/node_modules/eslint/node_modules/unist-util-is/convert.js deleted file mode 100644 index f92f34f1051b25..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-is/convert.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' - -module.exports = convert - -function convert(test) { - if (typeof test === 'string') { - return typeFactory(test) - } - - if (test === null || test === undefined) { - return ok - } - - if (typeof test === 'object') { - return ('length' in test ? anyFactory : matchesFactory)(test) - } - - if (typeof test === 'function') { - return test - } - - throw new Error('Expected function, string, or object as test') -} - -function convertAll(tests) { - var results = [] - var length = tests.length - var index = -1 - - while (++index < length) { - results[index] = convert(tests[index]) - } - - return results -} - -// Utility assert each property in `test` is represented in `node`, and each -// values are strictly equal. -function matchesFactory(test) { - return matches - - function matches(node) { - var key - - for (key in test) { - if (node[key] !== test[key]) { - return false - } - } - - return true - } -} - -function anyFactory(tests) { - var checks = convertAll(tests) - var length = checks.length - - return matches - - function matches() { - var index = -1 - - while (++index < length) { - if (checks[index].apply(this, arguments)) { - return true - } - } - - return false - } -} - -// Utility to convert a string into a function which checks a given node’s type -// for said string. -function typeFactory(test) { - return type - - function type(node) { - return Boolean(node && node.type === test) - } -} - -// Utility to return true. -function ok() { - return true -} diff --git a/tools/node_modules/eslint/node_modules/unist-util-is/index.js b/tools/node_modules/eslint/node_modules/unist-util-is/index.js deleted file mode 100644 index f18d416e08d214..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-is/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict' - -var convert = require('./convert') - -module.exports = is - -is.convert = convert - -// Assert if `test` passes for `node`. -// When a `parent` node is known the `index` of node should also be given. -// eslint-disable-next-line max-params -function is(node, test, index, parent, context) { - var hasParent = parent !== null && parent !== undefined - var hasIndex = index !== null && index !== undefined - var check = convert(test) - - if ( - hasIndex && - (typeof index !== 'number' || index < 0 || index === Infinity) - ) { - throw new Error('Expected positive finite index or child node') - } - - if (hasParent && (!is(parent) || !parent.children)) { - throw new Error('Expected parent node') - } - - if (!node || !node.type || typeof node.type !== 'string') { - return false - } - - if (hasParent !== hasIndex) { - throw new Error('Expected both parent and index') - } - - return Boolean(check.call(context, node, index, parent)) -} diff --git a/tools/node_modules/eslint/node_modules/unist-util-is/license b/tools/node_modules/eslint/node_modules/unist-util-is/license deleted file mode 100644 index cfa79e66cfc072..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-is/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT license) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/unist-util-is/package.json b/tools/node_modules/eslint/node_modules/unist-util-is/package.json deleted file mode 100644 index 780e6d7618a9fd..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-is/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/syntax-tree/unist-util-is/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Utility to check if a node passes a test", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark-cli": "^6.0.0", - "remark-preset-wooorm": "^5.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.24.0" - }, - "files": [ - "index.js", - "convert.js" - ], - "homepage": "https://github.com/syntax-tree/unist-util-is#readme", - "keywords": [ - "unist", - "node", - "is", - "equal", - "test", - "type", - "util", - "utility" - ], - "license": "MIT", - "name": "unist-util-is", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/syntax-tree/unist-util-is.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s unistUtilIs > unist-util-is.js", - "build-mangle": "browserify . -s unistUtilIs -p tinyify > unist-util-is.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "3.0.0", - "xo": { - "prettier": true, - "esnext": false, - "rules": { - "unicorn/prefer-type-error": "off" - }, - "ignore": [ - "unist-util-is.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/unist-util-is/readme.md b/tools/node_modules/eslint/node_modules/unist-util-is/readme.md deleted file mode 100644 index 7d53629aba87db..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-is/readme.md +++ /dev/null @@ -1,202 +0,0 @@ -# unist-util-is - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] -[![Sponsors][sponsors-badge]][collective] -[![Backers][backers-badge]][collective] -[![Chat][chat-badge]][chat] - -[**unist**][unist] utility to check if a node passes a test. - -## Install - -[npm][]: - -```sh -npm install unist-util-is -``` - -## Usage - -```js -var is = require('unist-util-is') - -var node = {type: 'strong'} -var parent = {type: 'paragraph', children: [node]} - -function test(node, n) { - return n === 5 -} - -is() // => false -is({children: []}) // => false -is(node) // => true -is(node, 'strong') // => true -is(node, 'emphasis') // => false - -is(node, node) // => true -is(parent, {type: 'paragraph'}) // => true -is(parent, {type: 'strong'}) // => false - -is(node, test) // => false -is(node, test, 4, parent) // => false -is(node, test, 5, parent) // => true -``` - -## API - -### `is(node[, test[, index, parent[, context]]])` - -###### Parameters - -* `node` ([`Node`][node]) — Node to check. -* `test` ([`Function`][test], `string`, `Object`, or `Array.`, optional) - — When not given, checks if `node` is a [`Node`][node]. - When `string`, works like passing `node => node.type === test`. - When `array`, checks if any one of the subtests pass. - When `object`, checks that all keys in `test` are in `node`, - and that they have strictly equal values -* `index` (`number`, optional) — [Index][] of `node` in `parent` -* `parent` ([`Node`][node], optional) — [Parent][] of `node` -* `context` (`*`, optional) — Context object to invoke `test` with - -###### Returns - -`boolean` — Whether `test` passed *and* `node` is a [`Node`][node] (object with -`type` set to a non-empty `string`). - -#### `function test(node[, index, parent])` - -###### Parameters - -* `node` ([`Node`][node]) — Node to check -* `index` (`number?`) — [Index][] of `node` in `parent` -* `parent` ([`Node?`][node]) — [Parent][] of `node` - -###### Context - -`*` — The to `is` given `context`. - -###### Returns - -`boolean?` — Whether `node` matches. - -### `is.convert(test)` - -Create a test function from `test`, that can later be called with a `node`, -`index`, and `parent`. -Useful if you’re going to test many nodes, for example when creating a utility -where something else passes an is-compatible test. - -Can also be accessed with `require('unist-util-is/convert')`. - -For example: - -```js -var u = require('unist-builder') -var convert = require('unist-util-is/convert') - -var test = convert('leaf') - -var tree = u('tree', [ - u('node', [u('leaf', '1')]), - u('leaf', '2'), - u('node', [u('leaf', '3'), u('leaf', '4')]), - u('leaf', '5') -]) - -var leafs = tree.children.filter((child, index) => test(child, index, tree)) - -console.log(leafs) -``` - -Yields: - -```js -[({type: 'leaf', value: '2'}, {type: 'leaf', value: '5'})] -``` - -## Related - -* [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after) - — Find a node after another node -* [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before) - — Find a node before another node -* [`unist-util-find-all-after`](https://github.com/syntax-tree/unist-util-find-all-after) - — Find all nodes after another node -* [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before) - — Find all nodes before another node -* [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between) - — Find all nodes between two nodes -* [`unist-util-find`](https://github.com/blahah/unist-util-find) - — Find nodes matching a predicate -* [`unist-util-filter`](https://github.com/eush77/unist-util-filter) - — Create a new tree with nodes that pass a check -* [`unist-util-remove`](https://github.com/eush77/unist-util-remove) - — Remove nodes from tree - -## Contribute - -See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get -started. -See [`support.md`][support] for ways to get help. - -This project has a [Code of Conduct][coc]. -By interacting with this repository, organisation, or community you agree to -abide by its terms. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-is.svg - -[build]: https://travis-ci.org/syntax-tree/unist-util-is - -[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-is.svg - -[coverage]: https://codecov.io/github/syntax-tree/unist-util-is - -[downloads-badge]: https://img.shields.io/npm/dm/unist-util-is.svg - -[downloads]: https://www.npmjs.com/package/unist-util-is - -[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-is.svg - -[size]: https://bundlephobia.com/result?p=unist-util-is - -[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg - -[backers-badge]: https://opencollective.com/unified/backers/badge.svg - -[collective]: https://opencollective.com/unified - -[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg - -[chat]: https://spectrum.chat/unified/syntax-tree - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com - -[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md - -[support]: https://github.com/syntax-tree/.github/blob/master/support.md - -[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md - -[unist]: https://github.com/syntax-tree/unist - -[node]: https://github.com/syntax-tree/unist#node - -[parent]: https://github.com/syntax-tree/unist#parent-1 - -[index]: https://github.com/syntax-tree/unist#index - -[test]: #function-testnode-index-parent diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js b/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js deleted file mode 100644 index 096395981793d9..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' - -var visit = require('unist-util-visit') - -module.exports = removePosition - -function removePosition(node, force) { - visit(node, force ? hard : soft) - return node -} - -function hard(node) { - delete node.position -} - -function soft(node) { - node.position = undefined -} diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/license b/tools/node_modules/eslint/node_modules/unist-util-remove-position/license deleted file mode 100644 index 8d8660d36ef2ec..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-remove-position/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json b/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json deleted file mode 100644 index 768b0c3e6cbc56..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/syntax-tree/unist-util-remove-position/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": { - "unist-util-visit": "^1.1.0" - }, - "deprecated": false, - "description": "Remove `position`s from a unist tree", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark": "^11.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "unist-builder": "^2.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - }, - "homepage": "https://github.com/syntax-tree/unist-util-remove-position#readme", - "keywords": [ - "unist", - "utility", - "remove", - "position", - "location" - ], - "license": "MIT", - "name": "unist-util-remove-position", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/syntax-tree/unist-util-remove-position.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s unistUtilRemovePosition > unist-util-remove-position.js", - "build-mangle": "browserify . -s unistUtilRemovePosition -p tinyify > unist-util-remove-position.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.1.4", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "unist-util-remove-position.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md b/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md deleted file mode 100644 index e79ed14b35084f..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# unist-util-remove-position - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] -[![Sponsors][sponsors-badge]][collective] -[![Backers][backers-badge]][collective] -[![Chat][chat-badge]][chat] - -[**unist**][unist] utility to remove [`position`][position]s from tree. - -## Install - -[npm][]: - -```sh -npm install unist-util-remove-position -``` - -## Usage - -```js -var remark = require('remark') -var removePosition = require('unist-util-remove-position') - -var tree = remark().parse('Some _emphasis_, **importance**, and `code`.') - -removePosition(tree, true) - -console.dir(tree, {depth: null}) -``` - -Yields: - -```js -{ - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { type: 'text', value: 'Some ' }, - { - type: 'emphasis', - children: [ { type: 'text', value: 'emphasis' } ] - }, - { type: 'text', value: ', ' }, - { - type: 'strong', - children: [ { type: 'text', value: 'importance' } ] - }, - { type: 'text', value: ', and ' }, - { type: 'inlineCode', value: 'code' }, - { type: 'text', value: '.' } - ] - } - ] -} -``` - -## API - -### `removePosition(node[, force])` - -Remove [`position`][position]s from [`node`][node]. -If `force` is given, uses `delete`, otherwise, sets `position`s to `undefined`. - -###### Returns - -The given `node`. - -## Contribute - -See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get -started. -See [`support.md`][support] for ways to get help. - -This project has a [Code of Conduct][coc]. -By interacting with this repository, organisation, or community you agree to -abide by its terms. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg - -[build]: https://travis-ci.org/syntax-tree/unist-util-remove-position - -[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg - -[coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position - -[downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg - -[downloads]: https://www.npmjs.com/package/unist-util-remove-position - -[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-remove-position.svg - -[size]: https://bundlephobia.com/result?p=unist-util-remove-position - -[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg - -[backers-badge]: https://opencollective.com/unified/backers/badge.svg - -[collective]: https://opencollective.com/unified - -[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg - -[chat]: https://spectrum.chat/unified/syntax-tree - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com - -[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md - -[support]: https://github.com/syntax-tree/.github/blob/master/support.md - -[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md - -[unist]: https://github.com/syntax-tree/unist - -[position]: https://github.com/syntax-tree/unist#position - -[node]: https://github.com/syntax-tree/unist#node diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/index.js b/tools/node_modules/eslint/node_modules/unist-util-visit-parents/index.js deleted file mode 100644 index c72635924f86d1..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict' - -module.exports = visitParents - -var convert = require('unist-util-is/convert') - -var CONTINUE = true -var SKIP = 'skip' -var EXIT = false - -visitParents.CONTINUE = CONTINUE -visitParents.SKIP = SKIP -visitParents.EXIT = EXIT - -function visitParents(tree, test, visitor, reverse) { - var is - - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor - visitor = test - test = null - } - - is = convert(test) - - one(tree, null, []) - - // Visit a single node. - function one(node, index, parents) { - var result = [] - var subresult - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult(visitor(node, parents)) - - if (result[0] === EXIT) { - return result - } - } - - if (node.children && result[0] !== SKIP) { - subresult = toResult(all(node.children, parents.concat(node))) - return subresult[0] === EXIT ? subresult : result - } - - return result - } - - // Visit children in `parent`. - function all(children, parents) { - var min = -1 - var step = reverse ? -1 : 1 - var index = (reverse ? children.length : min) + step - var result - - while (index > min && index < children.length) { - result = one(children[index], index, parents) - - if (result[0] === EXIT) { - return result - } - - index = typeof result[1] === 'number' ? result[1] : index + step - } - } -} - -function toResult(value) { - if (value !== null && typeof value === 'object' && 'length' in value) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE, value] - } - - return [value] -} diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/package.json b/tools/node_modules/eslint/node_modules/unist-util-visit-parents/package.json deleted file mode 100644 index 79a66d8458bd3b..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/syntax-tree/unist-util-visit-parents/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": { - "unist-util-is": "^3.0.0" - }, - "deprecated": false, - "description": "Recursively walk over unist nodes, with ancestral information", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark": "^10.0.0", - "remark-cli": "^6.0.0", - "remark-preset-wooorm": "^5.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.24.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/syntax-tree/unist-util-visit-parents#readme", - "keywords": [ - "unist", - "walk", - "util", - "utility" - ], - "license": "MIT", - "name": "unist-util-visit-parents", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/syntax-tree/unist-util-visit-parents.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js -s unistUtilVisitParents > unist-util-visit-parents.js", - "build-mangle": "browserify index.js -s unistUtilVisitParents -p tinyify > unist-util-visit-parents.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "2.1.2", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "unist-util-visit-parents.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/readme.md b/tools/node_modules/eslint/node_modules/unist-util-visit-parents/readme.md deleted file mode 100644 index ec7efc7bd03402..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit-parents/readme.md +++ /dev/null @@ -1,218 +0,0 @@ -# unist-util-visit-parents - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] -[![Sponsors][sponsors-badge]][collective] -[![Backers][backers-badge]][collective] -[![Chat][chat-badge]][chat] - -[**unist**][unist] utility to visit nodes, with ancestral information. - -## Install - -[npm][]: - -```sh -npm install unist-util-visit-parents -``` - -## Usage - -```js -var remark = require('remark') -var visit = require('unist-util-visit-parents') - -var tree = remark.parse('Some _emphasis_, **importance**, and `code`.') - -visit(tree, 'strong', visitor) - -function visitor(node, ancestors) { - console.log(ancestors) -} -``` - -Yields: - -```js -[ { type: 'root', children: [ [Object] ] }, - { type: 'paragraph', - children: - [ [Object], - [Object], - [Object], - [Object], - [Object], - [Object], - [Object] ] } ] -``` - -## API - -### `visit(tree[, test], visitor[, reverse])` - -Visit nodes ([**inclusive descendants**][descendant] of [`tree`][tree]), with -ancestral information. Optionally filtering nodes. Optionally in reverse. - -###### Parameters - -* `tree` ([`Node`][node]) — [Tree][] to traverse -* `test` ([`Test`][is], optional) — [`is`][is]-compatible test (such as a - [type][]) -* `visitor` ([Function][visitor]) — Function invoked when a node is found - that passes `test` -* `reverse` (`boolean`, default: `false`) — The tree is walked in [preorder][] - (NLR), visiting the node itself, then its [head][], etc. - When `reverse` is passed, the tree is stilled walked in preorder, but now - in NRL (the node itself, then its [tail][], etc.) - -#### `next? = visitor(node, ancestors)` - -Invoked when a node (matching `test`, if given) is found. - -Visitors are free to transform `node`. -They can also transform the [parent][] of node (the last of `ancestors`). -Replacing `node` itself, if `visit.SKIP` is not returned, still causes its -[descendant][]s to be visited. -If adding or removing previous [sibling][]s (or next siblings, in case of -`reverse`) of `node`, `visitor` should return a new [`index`][index] (`number`) -to specify the sibling to traverse after `node` is traversed. -Adding or removing next siblings of `node` (or previous siblings, in case of -reverse) is handled as expected without needing to return a new `index`. -Removing the `children` property of parent still results in them being -traversed. - -###### Parameters - -* `node` ([`Node`][node]) — Found node -* `ancestors` (`Array.`) — [Ancestor][]s of `node` - -##### Returns - -The return value can have the following forms: - -* [`index`][index] (`number`) — Treated as a tuple of `[CONTINUE, index]` -* `action` (`*`) — Treated as a tuple of `[action]` -* `tuple` (`Array.<*>`) — List with one or two values, the first an `action`, - the second and `index`. - Note that passing a tuple only makes sense if the `action` is `SKIP`. - If the `action` is `EXIT`, that action can be returned. - If the `action` is `CONTINUE`, `index` can be returned. - -###### `action` - -An action can have the following values: - -* `visit.EXIT` (`false`) — Stop traversing immediately -* `visit.CONTINUE` (`true`) — Continue traversing as normal (same behaviour - as not returning anything) -* `visit.SKIP` (`'skip'`) — Do not traverse this node’s children; continue - with the specified index - -###### `index` - -[`index`][index] (`number`) — Move to the sibling at `index` next (after `node` -itself is completely traversed). -Useful if mutating the tree, such as removing the node the visitor is currently -on, or any of its previous siblings (or next siblings, in case of `reverse`) -Results less than `0` or greater than or equal to `children.length` stop -traversing the parent - -## Related - -* [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit) - — Like `visit-parents`, but with one parent -* [`unist-util-filter`](https://github.com/eush77/unist-util-filter) - — Create a new tree with all nodes that pass a test -* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) - — Create a new tree with all nodes mapped by a given function -* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap) - — Create a new tree by mapping (to an array) with the provided function and - then flattening -* [`unist-util-remove`](https://github.com/eush77/unist-util-remove) - — Remove nodes from a tree that pass a test -* [`unist-util-select`](https://github.com/eush77/unist-util-select) - — Select nodes with CSS-like selectors - -## Contribute - -See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get -started. -See [`support.md`][support] for ways to get help. - -This project has a [Code of Conduct][coc]. -By interacting with this repository, organisation, or community you agree to -abide by its terms. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit-parents.svg - -[build]: https://travis-ci.org/syntax-tree/unist-util-visit-parents - -[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-parents.svg - -[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit-parents - -[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit-parents.svg - -[downloads]: https://www.npmjs.com/package/unist-util-visit-parents - -[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-visit-parents.svg - -[size]: https://bundlephobia.com/result?p=unist-util-visit-parents - -[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg - -[backers-badge]: https://opencollective.com/unified/backers/badge.svg - -[collective]: https://opencollective.com/unified - -[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg - -[chat]: https://spectrum.chat/unified/syntax-tree - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com - -[unist]: https://github.com/syntax-tree/unist - -[node]: https://github.com/syntax-tree/unist#node - -[visitor]: #next--visitornode-ancestors - -[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md - -[support]: https://github.com/syntax-tree/.github/blob/master/support.md - -[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md - -[is]: https://github.com/syntax-tree/unist-util-is - -[preorder]: https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/ - -[descendant]: https://github.com/syntax-tree/unist#descendant - -[head]: https://github.com/syntax-tree/unist#head - -[tail]: https://github.com/syntax-tree/unist#tail - -[parent]: https://github.com/syntax-tree/unist#parent-1 - -[sibling]: https://github.com/syntax-tree/unist#sibling - -[index]: https://github.com/syntax-tree/unist#index - -[ancestor]: https://github.com/syntax-tree/unist#ancestor - -[tree]: https://github.com/syntax-tree/unist#tree - -[type]: https://github.com/syntax-tree/unist#type diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit/index.js b/tools/node_modules/eslint/node_modules/unist-util-visit/index.js deleted file mode 100644 index 39970e7debaa49..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -module.exports = visit - -var visitParents = require('unist-util-visit-parents') - -var CONTINUE = visitParents.CONTINUE -var SKIP = visitParents.SKIP -var EXIT = visitParents.EXIT - -visit.CONTINUE = CONTINUE -visit.SKIP = SKIP -visit.EXIT = EXIT - -function visit(tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor - visitor = test - test = null - } - - visitParents(tree, test, overload, reverse) - - function overload(node, parents) { - var parent = parents[parents.length - 1] - var index = parent ? parent.children.indexOf(node) : null - return visitor(node, index, parent) - } -} diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit/license b/tools/node_modules/eslint/node_modules/unist-util-visit/license deleted file mode 100644 index 32e7a3d93ca5a2..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2015 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit/package.json b/tools/node_modules/eslint/node_modules/unist-util-visit/package.json deleted file mode 100644 index a0ef4a3cc172d3..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/syntax-tree/unist-util-visit/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - { - "name": "Eugene Sharygin", - "email": "eush77@gmail.com" - }, - { - "name": "Richard Gibson", - "email": "richard.gibson@gmail.com" - } - ], - "dependencies": { - "unist-util-visit-parents": "^2.0.0" - }, - "deprecated": false, - "description": "Recursively walk over unist nodes", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark": "^10.0.0", - "remark-cli": "^6.0.0", - "remark-preset-wooorm": "^5.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "xo": "^0.24.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/syntax-tree/unist-util-visit#readme", - "keywords": [ - "unist", - "remark", - "markdown", - "retext", - "natural", - "language", - "node", - "visit", - "walk", - "util", - "utility" - ], - "license": "MIT", - "name": "unist-util-visit", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/syntax-tree/unist-util-visit.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s unistUtilVisit > unist-util-visit.js", - "build-mangle": "browserify . -s unistUtilVisit -p tinyify > unist-util-visit.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "1.4.1", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "unist-util-visit.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/unist-util-visit/readme.md b/tools/node_modules/eslint/node_modules/unist-util-visit/readme.md deleted file mode 100644 index 25808a27a543e5..00000000000000 --- a/tools/node_modules/eslint/node_modules/unist-util-visit/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# unist-util-visit - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] - -[**unist**][unist] utility to visit nodes. - -## Install - -[npm][]: - -```bash -npm install unist-util-visit -``` - -## Usage - -```javascript -var u = require('unist-builder') -var visit = require('unist-util-visit') - -var tree = u('tree', [ - u('leaf', '1'), - u('node', [u('leaf', '2')]), - u('void'), - u('leaf', '3') -]) - -visit(tree, 'leaf', function(node) { - console.log(node) -}) -``` - -Yields: - -```js -{ type: 'leaf', value: '1' } -{ type: 'leaf', value: '2' } -{ type: 'leaf', value: '3' } -``` - -## API - -### `visit(tree[, test], visitor[, reverse])` - -This function works exactly the same as [`unist-util-visit-parents`][vp], -but `visitor` has a different signature. - -#### `next? = visitor(node, index, parent)` - -Instead of being passed an array of ancestors, `visitor` is invoked with the -node’s [`index`][index] and its [`parent`][parent]. - -Otherwise the same as [`unist-util-visit-parents`][vp]. - -## Related - -* [`unist-util-visit-parents`][vp] - — Like `visit`, but with a stack of parents -* [`unist-util-filter`](https://github.com/eush77/unist-util-filter) - — Create a new tree with all nodes that pass a test -* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) - — Create a new tree with all nodes mapped by a given function -* [`unist-util-remove`](https://github.com/eush77/unist-util-remove) - — Remove nodes from a tree that pass a test -* [`unist-util-select`](https://github.com/eush77/unist-util-select) - — Select nodes with CSS-like selectors - -## Contribute - -See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get -started. -See [`support.md`][support] for ways to get help. - -This project has a [Code of Conduct][coc]. -By interacting with this repository, organisation, or community you agree to -abide by its terms. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit.svg - -[build]: https://travis-ci.org/syntax-tree/unist-util-visit - -[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit.svg - -[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit - -[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit.svg - -[downloads]: https://www.npmjs.com/package/unist-util-visit - -[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-visit.svg - -[size]: https://bundlephobia.com/result?p=unist-util-visit - -[npm]: https://docs.npmjs.com/cli/install - -[license]: license - -[author]: https://wooorm.com - -[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md - -[support]: https://github.com/syntax-tree/.github/blob/master/support.md - -[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md - -[unist]: https://github.com/syntax-tree/unist - -[vp]: https://github.com/syntax-tree/unist-util-visit-parents - -[index]: https://github.com/syntax-tree/unist#index - -[parent]: https://github.com/syntax-tree/unist#parent-1 diff --git a/tools/node_modules/eslint/node_modules/uri-js/package.json b/tools/node_modules/eslint/node_modules/uri-js/package.json index b97f667a234ea6..de95d91aa1a410 100755 --- a/tools/node_modules/eslint/node_modules/uri-js/package.json +++ b/tools/node_modules/eslint/node_modules/uri-js/package.json @@ -1,30 +1,9 @@ { - "author": { - "name": "Gary Court", - "email": "gary.court@gmail.com" - }, - "bugs": { - "url": "https://github.com/garycourt/uri-js/issues" - }, - "bundleDependencies": false, - "dependencies": { - "punycode": "^2.1.0" - }, - "deprecated": false, + "name": "uri-js", + "version": "4.4.1", "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-external-helpers": "^6.22.0", - "babel-preset-latest": "^6.24.1", - "mocha": "^8.2.1", - "mocha-qunit-ui": "^0.1.3", - "rollup": "^0.41.6", - "rollup-plugin-babel": "^2.7.1", - "rollup-plugin-node-resolve": "^2.0.0", - "sorcery": "^0.10.0", - "typescript": "^2.8.1", - "uglify-js": "^2.8.14" - }, + "main": "dist/es5/uri.all.js", + "types": "dist/es5/uri.all.d.ts", "directories": { "test": "tests" }, @@ -36,7 +15,19 @@ "CHANGELOG", "LICENSE" ], - "homepage": "https://github.com/garycourt/uri-js", + "scripts": { + "build:esnext": "tsc", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/garycourt/uri-js" + }, "keywords": [ "URI", "IRI", @@ -61,22 +52,26 @@ "RFC6455", "RFC6874" ], + "author": "Gary Court ", "license": "BSD-2-Clause", - "main": "dist/es5/uri.all.js", - "name": "uri-js", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/garycourt/uri-js.git" + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" }, - "scripts": { - "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", - "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", - "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", - "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", - "build:esnext": "tsc", - "clean": "rm -rf dist", - "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + "homepage": "https://github.com/garycourt/uri-js", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-latest": "^6.24.1", + "mocha": "^8.2.1", + "mocha-qunit-ui": "^0.1.3", + "rollup": "^0.41.6", + "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-node-resolve": "^2.0.0", + "sorcery": "^0.10.0", + "typescript": "^2.8.1", + "uglify-js": "^2.8.14" }, - "types": "dist/es5/uri.all.d.ts", - "version": "4.4.1" -} \ No newline at end of file + "dependencies": { + "punycode": "^2.1.0" + } +} diff --git a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json index 25540b730159b7..cfc665f109976b 100644 --- a/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json +++ b/tools/node_modules/eslint/node_modules/v8-compile-cache/package.json @@ -1,15 +1,25 @@ { - "author": { - "name": "Andres Suarez", - "email": "zertosh@gmail.com" + "name": "v8-compile-cache", + "version": "2.2.0", + "description": "Require hook for automatic V8 compile cache persistence", + "main": "v8-compile-cache.js", + "scripts": { + "bench": "bench/run.sh", + "eslint": "eslint --max-warnings=0 .", + "tap": "tap test/*-test.js", + "test": "npm run tap", + "posttest": "npm run eslint" }, - "bugs": { - "url": "https://github.com/zertosh/v8-compile-cache/issues" + "author": "Andres Suarez ", + "repository": { + "type": "git", + "url": "https://github.com/zertosh/v8-compile-cache.git" }, - "bundleDependencies": false, + "files": [ + "v8-compile-cache.js" + ], + "license": "MIT", "dependencies": {}, - "deprecated": false, - "description": "Require hook for automatic V8 compile cache persistence", "devDependencies": { "babel-core": "6.26.3", "eslint": "^7.12.1", @@ -20,24 +30,5 @@ "tap": "^10.1.1", "temp": "^0.8.3", "yarn": "1.22.10" - }, - "files": [ - "v8-compile-cache.js" - ], - "homepage": "https://github.com/zertosh/v8-compile-cache#readme", - "license": "MIT", - "main": "v8-compile-cache.js", - "name": "v8-compile-cache", - "repository": { - "type": "git", - "url": "git+https://github.com/zertosh/v8-compile-cache.git" - }, - "scripts": { - "bench": "bench/run.sh", - "eslint": "eslint --max-warnings=0 .", - "posttest": "npm run eslint", - "tap": "tap test/*-test.js", - "test": "npm run tap" - }, - "version": "2.2.0" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/vfile-location/index.js b/tools/node_modules/eslint/node_modules/vfile-location/index.js deleted file mode 100644 index 2d7c21c1808b7f..00000000000000 --- a/tools/node_modules/eslint/node_modules/vfile-location/index.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' - -module.exports = factory - -function factory(file) { - var contents = indices(String(file)) - - return { - toPosition: offsetToPositionFactory(contents), - toOffset: positionToOffsetFactory(contents) - } -} - -// Factory to get the line and column-based `position` for `offset` in the bound -// indices. -function offsetToPositionFactory(indices) { - return offsetToPosition - - // Get the line and column-based `position` for `offset` in the bound indices. - function offsetToPosition(offset) { - var index = -1 - var length = indices.length - - if (offset < 0) { - return {} - } - - while (++index < length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset: offset - } - } - } - - return {} - } -} - -// Factory to get the `offset` for a line and column-based `position` in the -// bound indices. -function positionToOffsetFactory(indices) { - return positionToOffset - - // Get the `offset` for a line and column-based `position` in the bound - // indices. - function positionToOffset(position) { - var line = position && position.line - var column = position && position.column - - if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { - return (indices[line - 2] || 0) + column - 1 || 0 - } - - return -1 - } -} - -// Get indices of line-breaks in `value`. -function indices(value) { - var result = [] - var index = value.indexOf('\n') - - while (index !== -1) { - result.push(index + 1) - index = value.indexOf('\n', index + 1) - } - - result.push(value.length + 1) - - return result -} diff --git a/tools/node_modules/eslint/node_modules/vfile-location/license b/tools/node_modules/eslint/node_modules/vfile-location/license deleted file mode 100644 index 8d8660d36ef2ec..00000000000000 --- a/tools/node_modules/eslint/node_modules/vfile-location/license +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Titus Wormer - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/vfile-location/package.json b/tools/node_modules/eslint/node_modules/vfile-location/package.json deleted file mode 100644 index 9db9207b5cb3c6..00000000000000 --- a/tools/node_modules/eslint/node_modules/vfile-location/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "author": { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - }, - "bugs": { - "url": "https://github.com/vfile/vfile-location/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Titus Wormer", - "email": "tituswormer@gmail.com", - "url": "https://wooorm.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", - "devDependencies": { - "browserify": "^16.0.0", - "nyc": "^14.0.0", - "prettier": "^1.0.0", - "remark-cli": "^7.0.0", - "remark-preset-wooorm": "^6.0.0", - "tape": "^4.0.0", - "tinyify": "^2.0.0", - "vfile": "^4.0.0", - "xo": "^0.25.0" - }, - "files": [ - "index.js" - ], - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - }, - "homepage": "https://github.com/vfile/vfile-location#readme", - "keywords": [ - "remark", - "comment", - "message", - "marker", - "control" - ], - "license": "MIT", - "name": "vfile-location", - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, - "prettier": { - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "bracketSpacing": false, - "semi": false, - "trailingComma": "none" - }, - "remarkConfig": { - "plugins": [ - "preset-wooorm" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vfile/vfile-location.git" - }, - "scripts": { - "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify . -s vfileLocation > vfile-location.js", - "build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", - "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", - "test": "npm run format && npm run build && npm run test-coverage", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test.js" - }, - "version": "2.0.6", - "xo": { - "prettier": true, - "esnext": false, - "ignores": [ - "vfile-location.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/vfile-location/readme.md b/tools/node_modules/eslint/node_modules/vfile-location/readme.md deleted file mode 100644 index aa126a3fe3978d..00000000000000 --- a/tools/node_modules/eslint/node_modules/vfile-location/readme.md +++ /dev/null @@ -1,115 +0,0 @@ -# vfile-location - -[![Build][build-badge]][build] -[![Coverage][coverage-badge]][coverage] -[![Downloads][downloads-badge]][downloads] -[![Size][size-badge]][size] -[![Sponsors][sponsors-badge]][collective] -[![Backers][backers-badge]][collective] -[![Chat][chat-badge]][chat] - -Convert between positions (line and column-based) and offsets (range-based) -locations in a [virtual file][vfile]. - -## Install - -[npm][]: - -```sh -npm install vfile-location -``` - -## Usage - -```js -var vfile = require('vfile') -var vfileLocation = require('vfile-location') - -var location = vfileLocation(vfile('foo\nbar\nbaz')) - -var offset = location.toOffset({line: 3, column: 3}) // => 10 -location.toPosition(offset) // => {line: 3, column: 3, offset: 10} -``` - -## API - -### `location = vfileLocation(doc)` - -Get transform functions for the given `doc` (`string`) or [`file`][vfile]. - -Returns an object with [`toOffset`][to-offset] and [`toPosition`][to-position]. - -### `location.toOffset(position)` - -Get the `offset` (`number`) for a line and column-based [`position`][position] -in the bound file. -Returns `-1` when given invalid or out of bounds input. - -### `location.toPosition(offset)` - -Get the line and column-based [`position`][position] for `offset` in the bound -file. - -## Contribute - -See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to -get started. -See [`support.md`][support] for ways to get help. - -This project has a [Code of Conduct][coc]. -By interacting with this repository, organisation, or community you agree to -abide by its terms. - -## License - -[MIT][license] © [Titus Wormer][author] - - - -[build-badge]: https://img.shields.io/travis/vfile/vfile-location.svg - -[build]: https://travis-ci.org/vfile/vfile-location - -[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg - -[coverage]: https://codecov.io/github/vfile/vfile-location - -[downloads-badge]: https://img.shields.io/npm/dm/vfile-location.svg - -[downloads]: https://www.npmjs.com/package/vfile-location - -[size-badge]: https://img.shields.io/bundlephobia/minzip/vfile-location.svg - -[size]: https://bundlephobia.com/result?p=vfile-location - -[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg - -[backers-badge]: https://opencollective.com/unified/backers/badge.svg - -[collective]: https://opencollective.com/unified - -[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg - -[chat]: https://spectrum.chat/unified/vfile - -[npm]: https://docs.npmjs.com/cli/install - -[contributing]: https://github.com/vfile/.github/blob/master/contributing.md - -[support]: https://github.com/vfile/.github/blob/master/support.md - -[health]: https://github.com/vfile/.github - -[coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md - -[license]: license - -[author]: https://wooorm.com - -[vfile]: https://github.com/vfile/vfile - -[to-offset]: #locationtooffsetposition - -[to-position]: #locationtopositionoffset - -[position]: https://github.com/syntax-tree/unist#position diff --git a/tools/node_modules/eslint/node_modules/which/package.json b/tools/node_modules/eslint/node_modules/which/package.json index 9620a99a29e14c..97ad7fbabc52b5 100644 --- a/tools/node_modules/eslint/node_modules/which/package.json +++ b/tools/node_modules/eslint/node_modules/which/package.json @@ -1,53 +1,43 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "2.0.2", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" }, + "main": "which.js", "bin": { "node-which": "./bin/node-which" }, - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" - }, - "bundleDependencies": false, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, - "deprecated": false, - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.6.2", "tap": "^14.6.9" }, - "engines": { - "node": ">= 8" + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublish": "npm run changelog", + "prechangelog": "bash gen-changelog.sh", + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags" }, "files": [ "which.js", "bin/node-which" ], - "homepage": "https://github.com/isaacs/node-which#readme", - "license": "ISC", - "main": "which.js", - "name": "which", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" - }, - "scripts": { - "changelog": "git add CHANGELOG.md", - "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "prechangelog": "bash gen-changelog.sh", - "prepublish": "npm run changelog", - "preversion": "npm test", - "test": "tap" - }, "tap": { "check-coverage": true }, - "version": "2.0.2" -} \ No newline at end of file + "engines": { + "node": ">= 8" + } +} diff --git a/tools/node_modules/eslint/node_modules/word-wrap/package.json b/tools/node_modules/eslint/node_modules/word-wrap/package.json index b53b03260e2797..6f8f633c475f82 100644 --- a/tools/node_modules/eslint/node_modules/word-wrap/package.json +++ b/tools/node_modules/eslint/node_modules/word-wrap/package.json @@ -1,65 +1,39 @@ { - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, + "name": "word-wrap", + "description": "Wrap words to a specified length.", + "version": "1.2.3", + "homepage": "https://github.com/jonschlinkert/word-wrap", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Danilo Sampaio (localhost:8080)", + "Fede Ramirez (https://2fd.github.io)", + "Joe Hildebrand (https://twitter.com/hildjj)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Todd Kennedy (https://tck.io)", + "Waldemar Reusch (https://github.com/lordvlad)", + "Wolfgang Faust (http://www.linestarve.com)", + "Zach Hale (http://zachhale.com)" + ], + "repository": "jonschlinkert/word-wrap", "bugs": { "url": "https://github.com/jonschlinkert/word-wrap/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Danilo Sampaio", - "email": "danilo.sampaio@gmail.com", - "url": "localhost:8080" - }, - { - "name": "Fede Ramirez", - "email": "i@2fd.me", - "url": "https://2fd.github.io" - }, - { - "name": "Joe Hildebrand", - "email": "joe-github@cursive.net", - "url": "https://twitter.com/hildjj" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Todd Kennedy", - "url": "https://tck.io" - }, - { - "name": "Waldemar Reusch", - "url": "https://github.com/lordvlad" - }, - { - "name": "Wolfgang Faust", - "url": "http://www.linestarve.com" - }, - { - "name": "Zach Hale", - "email": "zachhale@gmail.com", - "url": "http://zachhale.com" - } + "license": "MIT", + "files": [ + "index.js", + "index.d.ts" ], - "deprecated": false, - "description": "Wrap words to a specified length.", + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, "devDependencies": { "gulp-format-md": "^0.1.11", "mocha": "^3.2.0" }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/jonschlinkert/word-wrap", "keywords": [ "break", "carriage", @@ -74,16 +48,6 @@ "words", "wrap" ], - "license": "MIT", - "main": "index.js", - "name": "word-wrap", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/word-wrap.git" - }, - "scripts": { - "test": "mocha" - }, "typings": "index.d.ts", "verb": { "toc": false, @@ -109,6 +73,5 @@ "verb", "verb-generate-readme" ] - }, - "version": "1.2.3" -} \ No newline at end of file + } +} diff --git a/tools/node_modules/eslint/node_modules/wrappy/package.json b/tools/node_modules/eslint/node_modules/wrappy/package.json index e80b47520f24ec..130752046714d6 100644 --- a/tools/node_modules/eslint/node_modules/wrappy/package.json +++ b/tools/node_modules/eslint/node_modules/wrappy/package.json @@ -1,35 +1,29 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/wrappy/issues" + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Callback wrapping utility", "devDependencies": { "tap": "^2.3.1" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap --coverage test/*.js" }, - "files": [ - "wrappy.js" - ], - "homepage": "https://github.com/npm/wrappy", - "license": "ISC", - "main": "wrappy.js", - "name": "wrappy", "repository": { "type": "git", - "url": "git+https://github.com/npm/wrappy.git" + "url": "https://github.com/npm/wrappy" }, - "scripts": { - "test": "tap --coverage test/*.js" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" }, - "version": "1.0.2" -} \ No newline at end of file + "homepage": "https://github.com/npm/wrappy" +} diff --git a/tools/node_modules/eslint/node_modules/xtend/README.md b/tools/node_modules/eslint/node_modules/xtend/README.md deleted file mode 100644 index 4a2703cff276b1..00000000000000 --- a/tools/node_modules/eslint/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: "c" -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licensed - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/tools/node_modules/eslint/node_modules/xtend/immutable.js b/tools/node_modules/eslint/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9de11a18..00000000000000 --- a/tools/node_modules/eslint/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/tools/node_modules/eslint/node_modules/xtend/mutable.js b/tools/node_modules/eslint/node_modules/xtend/mutable.js deleted file mode 100644 index 72debede6ca585..00000000000000 --- a/tools/node_modules/eslint/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/tools/node_modules/eslint/node_modules/xtend/package.json b/tools/node_modules/eslint/node_modules/xtend/package.json deleted file mode 100644 index 970fcf29de706d..00000000000000 --- a/tools/node_modules/eslint/node_modules/xtend/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "extend like a boss", - "devDependencies": { - "tape": "~1.1.0" - }, - "engines": { - "node": ">=0.4" - }, - "homepage": "https://github.com/Raynos/xtend", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "name": "xtend", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.2" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/yallist/package.json b/tools/node_modules/eslint/node_modules/yallist/package.json index 2d0ad3cb6e2f0c..8a083867d72e00 100644 --- a/tools/node_modules/eslint/node_modules/yallist/package.json +++ b/tools/node_modules/eslint/node_modules/yallist/package.json @@ -1,19 +1,8 @@ { - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "yallist", + "version": "4.0.0", "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^12.1.0" - }, + "main": "yallist.js", "directories": { "test": "test" }, @@ -21,19 +10,20 @@ "yallist.js", "iterator.js" ], - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "name": "yallist", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" + "dependencies": {}, + "devDependencies": { + "tap": "^12.1.0" }, "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", + "test": "tap test/*.js --100", "preversion": "npm test", - "test": "tap test/*.js --100" + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" }, - "version": "4.0.0" -} \ No newline at end of file + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 24c8bc57f61b9f..3a98f413bcee73 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -1,15 +1,50 @@ { - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" - }, + "name": "eslint", + "version": "7.19.0", + "author": "Nicholas C. Zakas ", + "description": "An AST-based pattern checker for JavaScript.", "bin": { - "eslint": "bin/eslint.js" + "eslint": "./bin/eslint.js" + }, + "main": "./lib/api.js", + "scripts": { + "test": "node Makefile.js test", + "test:cli": "mocha", + "lint": "node Makefile.js lint", + "fix": "node Makefile.js lint -- fix", + "fuzz": "node Makefile.js fuzz", + "generate-release": "node Makefile.js generateRelease", + "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", + "generate-betarelease": "node Makefile.js generatePrerelease -- beta", + "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", + "publish-release": "node Makefile.js publishRelease", + "docs": "node Makefile.js docs", + "gensite": "node Makefile.js gensite", + "webpack": "node Makefile.js webpack", + "perf": "node Makefile.js perf" + }, + "gitHooks": { + "pre-commit": "lint-staged" }, - "bugs": { - "url": "https://github.com/eslint/eslint/issues/" + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.md": "markdownlint" }, - "bundleDependencies": false, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "repository": "eslint/eslint", + "funding": "https://opencollective.com/eslint", + "homepage": "https://eslint.org", + "bugs": "https://github.com/eslint/eslint/issues/", "dependencies": { "@babel/code-frame": "^7.0.0", "@eslint/eslintrc": "^0.3.0", @@ -19,7 +54,6 @@ "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-plugin-markdown": "^1.0.2", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", @@ -50,8 +84,6 @@ "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, - "deprecated": false, - "description": "An AST-based pattern checker for JavaScript.", "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", @@ -101,22 +133,6 @@ "webpack-cli": "^3.3.5", "yorkie": "^2.0.0" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "files": [ - "LICENSE", - "README.md", - "bin", - "conf", - "lib", - "messages" - ], - "funding": "https://opencollective.com/eslint", - "gitHooks": { - "pre-commit": "lint-staged" - }, - "homepage": "https://eslint.org", "keywords": [ "ast", "lint", @@ -125,34 +141,7 @@ "espree" ], "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ], - "*.md": "markdownlint" - }, - "main": "./lib/api.js", - "name": "eslint", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint.git" - }, - "scripts": { - "docs": "node Makefile.js docs", - "fix": "node Makefile.js lint -- fix", - "fuzz": "node Makefile.js fuzz", - "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", - "generate-betarelease": "node Makefile.js generatePrerelease -- beta", - "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", - "generate-release": "node Makefile.js generateRelease", - "gensite": "node Makefile.js gensite", - "lint": "node Makefile.js lint", - "perf": "node Makefile.js perf", - "publish-release": "node Makefile.js publishRelease", - "test": "node Makefile.js test", - "test:cli": "mocha", - "webpack": "node Makefile.js webpack" - }, - "version": "7.19.0" -} \ No newline at end of file + "engines": { + "node": "^10.12.0 || >=12.0.0" + } +} diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh index d0320ab8f841d4..169fe5bd2a7006 100755 --- a/tools/update-eslint.sh +++ b/tools/update-eslint.sh @@ -19,7 +19,7 @@ rm -rf node_modules/eslint ( cd node_modules/eslint || exit - npm install --no-bin-links --production --no-package-lock eslint-plugin-markdown@latest + npm install --no-bin-links --production --no-package-lock git+https://github.com/eslint/eslint-plugin-markdown.git#pull/172 )