From f4c1ee468ff4e2c6f1d552cb75905d01e3f478de Mon Sep 17 00:00:00 2001 From: AJ Jordan Date: Tue, 11 Jul 2017 00:14:59 -0700 Subject: [PATCH 1/2] doc: build manpages for each module Fixes #8903 --- Makefile | 15 ++++- tools/doc/generate.js | 7 +++ tools/doc/man.js | 133 +++++++++++++++++++++++++++++++++++++++++ tools/doc/package.json | 4 +- 4 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 tools/doc/man.js diff --git a/Makefile b/Makefile index e9c5a2e6bbcf17..0568ff84016bf0 100644 --- a/Makefile +++ b/Makefile @@ -476,12 +476,13 @@ DOCS_ANALYTICS ?= apidoc_sources = $(wildcard doc/api/*.md) apidocs_html = $(apidoc_dirs) $(apiassets) $(addprefix out/,$(apidoc_sources:.md=.html)) apidocs_json = $(apidoc_dirs) $(apiassets) $(addprefix out/,$(apidoc_sources:.md=.json)) +apidocs_man = $(apidoc_dirs) $(apiassets) $(addprefix out/,$(apidoc_sources:.md=.3)) apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*))) -doc-only: $(apidocs_html) $(apidocs_json) +doc-only: $(apidocs_html) $(apidocs_json) $(apidocs_man) doc: $(NODE_EXE) doc-only $(apidoc_dirs): @@ -515,6 +516,18 @@ out/doc/api/%.json: doc/api/%.md out/doc/api/%.html: doc/api/%.md $(call gen-doc, $(gen-html)) +# check if ./node is actually set, else use user pre-installed binary +gen-man = tools/doc/generate.js --format=man $< > $@ +out/doc/api/%.3: doc/api/%.md + @[ -e tools/doc/node_modules/js-yaml/package.json ] || \ + [ -e tools/eslint/node_modules/js-yaml/package.json ] || \ + if [ -x $(NODE) ]; then \ + cd tools/doc && ../../$(NODE) ../../$(NPM) install; \ + else \ + cd tools/doc && node ../../$(NPM) install; \ + fi + [ -x $(NODE) ] && $(NODE) $(gen-man) || node $(gen-man) + docopen: $(apidocs_html) @$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html diff --git a/tools/doc/generate.js b/tools/doc/generate.js index 0ae413ea7f6a82..2351e03f53ed6f 100644 --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -88,6 +88,13 @@ function next(er, input) { ); break; + case 'man': + require('./man.js')(input, inputFile, function(er, manSrc) { + console.log(manSrc); + if (er) throw er; + }); + break; + default: throw new Error('Invalid format: ' + format); } diff --git a/tools/doc/man.js b/tools/doc/man.js new file mode 100644 index 00000000000000..cbf346cbc53cca --- /dev/null +++ b/tools/doc/man.js @@ -0,0 +1,133 @@ +// Copyright AJ Jordan and other Node contributors. +// +// 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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const remark = require('remark'); +const man = require('remark-man'); +const parser = remark().use(fixupHeader).use(synopsis).use(stability).use(description).use(man); +const dontBuild = ['_toc', 'all', 'addons', 'async_hooks', 'cli', 'deprecations', 'documentation', 'domain', 'errors', 'globals', 'http2', 'index', 'inspector', 'intl', 'n-api', 'process', 'punycode', 'synopsis', 'tracing', 'v8']; + +module.exports = toMan; + +function fixupHeader(opts) { + return function _fixupHeader(ast, file, next) { + const header = ast.children[0]; + + assert.strictEqual(header.type, 'heading', 'First node is not a header'); + assert.strictEqual(header.depth, 1, 'Header is not of depth 1'); + + const moduleName = header.children[0].value; + header.children[0].value = `node-${moduleName.toLowerCase()}(3)`; + header.children[0].value += ` -- Node.js ${moduleName} module`; + + // Attach the module name for other plugins in this file to use + file.moduleName = moduleName; + + next(); + }; +} + +function synopsis(opts) { + return function _synopsis(ast, file, next) { + const moduleName = file.moduleName.toLowerCase(); + + const heading = { + type: 'heading', + depth: 2, + children: [ + { + type: 'text', + value: 'SYNOPSIS' + } + ] + }; + + const text = { + type: 'paragraph', + children: [ + { + type: 'inlineCode', + value: `const ${moduleName} = require('${moduleName}');` + } + ] + }; + + ast.children.splice(1, 0, heading); + ast.children.splice(2, 0, text); + + next(); + }; +} + +function stability(opts) { + return function _stability(ast, file, next) { + const node = ast.children[4]; + + assert.equal(node.type, 'blockquote', 'Stability information in unexpected location'); + + const heading = { + type: 'heading', + depth: 2, + children: [ + { + type: 'text', + value: 'STABILITY' + } + ] + }; + + ast.children.splice(3, 0, heading); + // Unwrap the paragraph inside the blockquote + ast.children[4] = node.children[0]; + + next(); + }; +} + +function description(opts) { + return function _description(ast, file, next) { + const heading = { + type: 'heading', + depth: 2, + children: [ + { + type: 'text', + value: 'DESCRIPTION' + } + ] + }; + + ast.children.splice(5, 0, heading); + + next(); + }; +} +function toMan(input, inputFile, cb) { + // Silently skip things we can't/shouldn't build + if (dontBuild.includes(path.parse(inputFile).name)) return; + + parser.process(input, function(er, file) { + cb(er, String(file)); + }); +} diff --git a/tools/doc/package.json b/tools/doc/package.json index 15b8531e1f8052..959ad7fca64c38 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -7,8 +7,10 @@ "node": ">=6" }, "dependencies": { + "js-yaml": "^3.5.2", "marked": "^0.3.5", - "js-yaml": "^3.5.2" + "remark": "^7.0.1", + "remark-man": "^5.0.1" }, "devDependencies": {}, "optionalDependencies": {}, From 613b62ccc03601b2d869c11ecb9ff4df4aed3ec7 Mon Sep 17 00:00:00 2001 From: AJ Jordan Date: Fri, 22 Sep 2017 11:05:34 -0400 Subject: [PATCH 2/2] deps: add node_modules for tools/doc/man.js --- tools/doc/node_modules/array-iterate/LICENSE | 21 + tools/doc/node_modules/array-iterate/index.js | 43 + .../node_modules/array-iterate/package.json | 102 + .../doc/node_modules/array-iterate/readme.md | 97 + tools/doc/node_modules/bail/LICENSE | 22 + tools/doc/node_modules/bail/index.js | 9 + tools/doc/node_modules/bail/package.json | 99 + tools/doc/node_modules/bail/readme.md | 71 + tools/doc/node_modules/ccount/LICENSE | 22 + tools/doc/node_modules/ccount/history.md | 11 + tools/doc/node_modules/ccount/index.js | 46 + tools/doc/node_modules/ccount/package.json | 101 + tools/doc/node_modules/ccount/readme.md | 57 + .../character-entities-html4/LICENSE | 22 + .../character-entities-html4/index.json | 254 ++ .../character-entities-html4/package.json | 98 + .../character-entities-html4/readme.md | 52 + .../character-entities-legacy/LICENSE | 22 + .../character-entities-legacy/index.json | 108 + .../character-entities-legacy/package.json | 98 + .../character-entities-legacy/readme.md | 54 + .../node_modules/character-entities/LICENSE | 22 + .../character-entities/index.json | 2224 +++++++++++++++++ .../character-entities/package.json | 97 + .../node_modules/character-entities/readme.md | 53 + .../character-reference-invalid/LICENSE | 22 + .../character-reference-invalid/index.json | 30 + .../character-reference-invalid/package.json | 101 + .../character-reference-invalid/readme.md | 51 + .../node_modules/collapse-white-space/LICENSE | 22 + .../collapse-white-space/index.js | 8 + .../collapse-white-space/package.json | 94 + .../collapse-white-space/readme.md | 45 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + tools/doc/node_modules/emoji-regex/README.md | 59 + .../node_modules/emoji-regex/dist/index.js | 7 + tools/doc/node_modules/emoji-regex/index.js | 3 + .../doc/node_modules/emoji-regex/package.json | 73 + tools/doc/node_modules/extend/.eslintrc | 17 + tools/doc/node_modules/extend/.jscs.json | 175 ++ tools/doc/node_modules/extend/.npmignore | 1 + tools/doc/node_modules/extend/.travis.yml | 179 ++ tools/doc/node_modules/extend/CHANGELOG.md | 77 + tools/doc/node_modules/extend/LICENSE | 23 + tools/doc/node_modules/extend/README.md | 81 + tools/doc/node_modules/extend/component.json | 32 + tools/doc/node_modules/extend/index.js | 86 + tools/doc/node_modules/extend/package.json | 75 + .../doc/node_modules/function-bind/.eslintrc | 13 + .../doc/node_modules/function-bind/.jscs.json | 159 ++ .../doc/node_modules/function-bind/.npmignore | 16 + .../node_modules/function-bind/.travis.yml | 77 + tools/doc/node_modules/function-bind/LICENSE | 20 + .../doc/node_modules/function-bind/README.md | 48 + .../function-bind/implementation.js | 48 + tools/doc/node_modules/function-bind/index.js | 3 + .../node_modules/function-bind/package.json | 98 + .../node_modules/function-bind/test/index.js | 250 ++ .../node_modules/github-slugger/.npmignore | 27 + .../node_modules/github-slugger/.travis.yml | 10 + .../node_modules/github-slugger/CHANGELOG.md | 26 + .../github-slugger/CONTRIBUTING.md | 61 + tools/doc/node_modules/github-slugger/LICENSE | 5 + .../doc/node_modules/github-slugger/README.md | 51 + .../doc/node_modules/github-slugger/index.js | 62 + .../node_modules/github-slugger/package.json | 76 + .../node_modules/github-slugger/test/index.js | 184 ++ tools/doc/node_modules/groff-escape/LICENSE | 22 + .../doc/node_modules/groff-escape/index.json | 291 +++ .../node_modules/groff-escape/package.json | 89 + tools/doc/node_modules/groff-escape/readme.md | 52 + tools/doc/node_modules/has/.jshintrc | 14 + tools/doc/node_modules/has/.npmignore | 3 + tools/doc/node_modules/has/LICENSE-MIT | 22 + tools/doc/node_modules/has/README.mkd | 18 + tools/doc/node_modules/has/package.json | 62 + tools/doc/node_modules/has/src/index.js | 3 + tools/doc/node_modules/has/test/.jshintrc | 7 + tools/doc/node_modules/has/test/index.js | 10 + tools/doc/node_modules/inherits/LICENSE | 16 + tools/doc/node_modules/inherits/README.md | 42 + tools/doc/node_modules/inherits/inherits.js | 7 + .../node_modules/inherits/inherits_browser.js | 23 + tools/doc/node_modules/inherits/package.json | 61 + .../doc/node_modules/is-alphabetical/LICENSE | 22 + .../node_modules/is-alphabetical/history.md | 6 + .../doc/node_modules/is-alphabetical/index.js | 29 + .../node_modules/is-alphabetical/package.json | 110 + .../node_modules/is-alphabetical/readme.md | 58 + .../doc/node_modules/is-alphanumeric/index.js | 8 + .../doc/node_modules/is-alphanumeric/license | 21 + .../node_modules/is-alphanumeric/package.json | 73 + .../node_modules/is-alphanumeric/readme.md | 40 + .../node_modules/is-alphanumerical/LICENSE | 22 + .../node_modules/is-alphanumerical/history.md | 6 + .../node_modules/is-alphanumerical/index.js | 29 + .../is-alphanumerical/package.json | 115 + .../node_modules/is-alphanumerical/readme.md | 60 + tools/doc/node_modules/is-buffer/.npmignore | 2 + tools/doc/node_modules/is-buffer/LICENSE | 21 + tools/doc/node_modules/is-buffer/README.md | 49 + tools/doc/node_modules/is-buffer/index.js | 21 + tools/doc/node_modules/is-buffer/package.json | 77 + .../doc/node_modules/is-buffer/test/basic.js | 25 + tools/doc/node_modules/is-decimal/LICENSE | 22 + tools/doc/node_modules/is-decimal/history.md | 6 + tools/doc/node_modules/is-decimal/index.js | 28 + .../doc/node_modules/is-decimal/package.json | 112 + tools/doc/node_modules/is-decimal/readme.md | 58 + tools/doc/node_modules/is-hexadecimal/LICENSE | 22 + .../node_modules/is-hexadecimal/history.md | 6 + .../doc/node_modules/is-hexadecimal/index.js | 30 + .../node_modules/is-hexadecimal/package.json | 110 + .../doc/node_modules/is-hexadecimal/readme.md | 58 + tools/doc/node_modules/is-plain-obj/index.js | 7 + tools/doc/node_modules/is-plain-obj/license | 21 + .../node_modules/is-plain-obj/package.json | 68 + tools/doc/node_modules/is-plain-obj/readme.md | 35 + .../is-whitespace-character/LICENSE | 22 + .../is-whitespace-character/history.md | 6 + .../is-whitespace-character/index.js | 33 + .../is-whitespace-character/package.json | 112 + .../is-whitespace-character/readme.md | 63 + .../node_modules/is-word-character/LICENSE | 22 + .../node_modules/is-word-character/history.md | 6 + .../node_modules/is-word-character/index.js | 33 + .../is-word-character/package.json | 109 + .../node_modules/is-word-character/readme.md | 62 + tools/doc/node_modules/longest-streak/LICENSE | 22 + .../doc/node_modules/longest-streak/index.js | 37 + .../node_modules/longest-streak/package.json | 97 + .../doc/node_modules/longest-streak/readme.md | 59 + tools/doc/node_modules/mapz/LICENSE | 22 + tools/doc/node_modules/mapz/history.md | 6 + tools/doc/node_modules/mapz/index.js | 74 + tools/doc/node_modules/mapz/package.json | 114 + tools/doc/node_modules/mapz/readme.md | 116 + .../doc/node_modules/markdown-escapes/LICENSE | 22 + .../node_modules/markdown-escapes/history.md | 6 + .../node_modules/markdown-escapes/index.js | 75 + .../markdown-escapes/package.json | 110 + .../node_modules/markdown-escapes/readme.md | 71 + tools/doc/node_modules/markdown-table/LICENSE | 22 + .../doc/node_modules/markdown-table/index.js | 250 ++ .../node_modules/markdown-table/package.json | 107 + .../doc/node_modules/markdown-table/readme.md | 167 ++ .../node_modules/mdast-util-compact/LICENSE | 22 + .../node_modules/mdast-util-compact/index.js | 72 + .../mdast-util-compact/package.json | 102 + .../node_modules/mdast-util-compact/readme.md | 72 + .../node_modules/mdast-util-to-string/LICENSE | 22 + .../mdast-util-to-string/index.js | 22 + .../mdast-util-to-string/package.json | 101 + .../mdast-util-to-string/readme.md | 75 + tools/doc/node_modules/months/LICENSE | 21 + tools/doc/node_modules/months/README.md | 101 + tools/doc/node_modules/months/index.js | 18 + tools/doc/node_modules/months/package.json | 106 + tools/doc/node_modules/parse-entities/LICENSE | 22 + .../doc/node_modules/parse-entities/index.js | 473 ++++ .../node_modules/parse-entities/package.json | 114 + .../doc/node_modules/parse-entities/readme.md | 157 ++ tools/doc/node_modules/remark-man/LICENSE | 21 + tools/doc/node_modules/remark-man/index.js | 9 + .../node_modules/remark-man/lib/compiler.js | 145 ++ .../doc/node_modules/remark-man/lib/escape.js | 41 + .../node_modules/remark-man/lib/handlers.js | 262 ++ .../doc/node_modules/remark-man/lib/macro.js | 14 + .../doc/node_modules/remark-man/lib/quote.js | 9 + .../doc/node_modules/remark-man/package.json | 117 + tools/doc/node_modules/remark-man/readme.md | 124 + tools/doc/node_modules/remark-parse/index.js | 14 + .../remark-parse/lib/block-elements.json | 68 + .../node_modules/remark-parse/lib/decode.js | 71 + .../node_modules/remark-parse/lib/defaults.js | 21 + .../remark-parse/lib/locate/break.js | 25 + .../remark-parse/lib/locate/code-inline.js | 15 + .../remark-parse/lib/locate/delete.js | 15 + .../remark-parse/lib/locate/emphasis.js | 26 + .../remark-parse/lib/locate/escape.js | 15 + .../remark-parse/lib/locate/link.js | 24 + .../remark-parse/lib/locate/strong.js | 26 + .../remark-parse/lib/locate/tag.js | 15 + .../remark-parse/lib/locate/url.js | 34 + .../node_modules/remark-parse/lib/parse.js | 53 + .../node_modules/remark-parse/lib/parser.js | 162 ++ .../remark-parse/lib/set-options.js | 59 + .../remark-parse/lib/tokenize/auto-link.js | 151 ++ .../remark-parse/lib/tokenize/blockquote.js | 137 + .../remark-parse/lib/tokenize/break.js | 51 + .../remark-parse/lib/tokenize/code-fenced.js | 245 ++ .../lib/tokenize/code-indented.js | 106 + .../remark-parse/lib/tokenize/code-inline.js | 120 + .../remark-parse/lib/tokenize/definition.js | 287 +++ .../remark-parse/lib/tokenize/delete.js | 69 + .../remark-parse/lib/tokenize/emphasis.js | 94 + .../remark-parse/lib/tokenize/escape.js | 43 + .../lib/tokenize/footnote-definition.js | 194 ++ .../remark-parse/lib/tokenize/heading-atx.js | 150 ++ .../lib/tokenize/heading-setext.js | 116 + .../remark-parse/lib/tokenize/html-block.js | 103 + .../remark-parse/lib/tokenize/html-inline.js | 63 + .../remark-parse/lib/tokenize/link.js | 399 +++ .../remark-parse/lib/tokenize/list.js | 494 ++++ .../remark-parse/lib/tokenize/newline.js | 55 + .../remark-parse/lib/tokenize/paragraph.js | 130 + .../remark-parse/lib/tokenize/reference.js | 219 ++ .../remark-parse/lib/tokenize/strong.js | 93 + .../remark-parse/lib/tokenize/table.js | 276 ++ .../remark-parse/lib/tokenize/text.js | 67 + .../lib/tokenize/thematic-break.js | 79 + .../remark-parse/lib/tokenize/url.js | 153 ++ .../remark-parse/lib/tokenize/yaml.js | 74 + .../remark-parse/lib/tokenizer.js | 451 ++++ .../node_modules/remark-parse/lib/unescape.js | 46 + .../remark-parse/lib/util/get-indentation.js | 46 + .../remark-parse/lib/util/html.js | 33 + .../remark-parse/lib/util/interrupt.js | 51 + .../remark-parse/lib/util/normalize.js | 29 + .../lib/util/remove-indentation.js | 102 + .../node_modules/remark-parse/package.json | 86 + tools/doc/node_modules/remark-parse/readme.md | 448 ++++ .../node_modules/remark-stringify/index.js | 14 + .../remark-stringify/lib/compiler.js | 81 + .../remark-stringify/lib/defaults.js | 31 + .../remark-stringify/lib/escape.js | 283 +++ .../remark-stringify/lib/macro/all.js | 32 + .../remark-stringify/lib/macro/block.js | 60 + .../remark-stringify/lib/macro/compile.js | 25 + .../remark-stringify/lib/macro/one.js | 37 + .../lib/macro/ordered-items.js | 54 + .../lib/macro/unordered-items.js | 37 + .../remark-stringify/lib/set-options.js | 210 ++ .../lib/util/copy-identifier-encoding.js | 82 + .../lib/util/enclose-title.js | 36 + .../remark-stringify/lib/util/enclose-uri.js | 48 + .../lib/util/enter-link-reference.js | 51 + .../lib/util/entity-prefix-length.js | 42 + .../remark-stringify/lib/util/label.js | 32 + .../remark-stringify/lib/util/pad.js | 47 + .../remark-stringify/lib/util/returner.js | 20 + .../lib/visitors/blockquote.js | 33 + .../remark-stringify/lib/visitors/break.js | 28 + .../remark-stringify/lib/visitors/code.js | 100 + .../lib/visitors/definition.js | 37 + .../remark-stringify/lib/visitors/delete.js | 22 + .../remark-stringify/lib/visitors/emphasis.js | 29 + .../lib/visitors/footnote-definition.js | 28 + .../lib/visitors/footnote-reference.js | 22 + .../remark-stringify/lib/visitors/footnote.js | 22 + .../remark-stringify/lib/visitors/heading.js | 53 + .../remark-stringify/lib/visitors/html.js | 22 + .../lib/visitors/image-reference.js | 25 + .../remark-stringify/lib/visitors/image.js | 45 + .../lib/visitors/inline-code.js | 49 + .../lib/visitors/link-reference.js | 37 + .../remark-stringify/lib/visitors/link.js | 68 + .../lib/visitors/list-item.js | 79 + .../remark-stringify/lib/visitors/list.js | 29 + .../lib/visitors/paragraph.js | 22 + .../remark-stringify/lib/visitors/root.js | 24 + .../remark-stringify/lib/visitors/strong.js | 32 + .../lib/visitors/table-cell.js | 22 + .../remark-stringify/lib/visitors/table.js | 77 + .../remark-stringify/lib/visitors/text.js | 32 + .../lib/visitors/thematic-break.js | 40 + .../remark-stringify/lib/visitors/yaml.js | 26 + .../remark-stringify/package.json | 84 + .../node_modules/remark-stringify/readme.md | 215 ++ tools/doc/node_modules/remark/index.js | 7 + tools/doc/node_modules/remark/package.json | 72 + tools/doc/node_modules/remark/readme.md | 84 + tools/doc/node_modules/repeat-string/LICENSE | 21 + .../doc/node_modules/repeat-string/README.md | 136 + tools/doc/node_modules/repeat-string/index.js | 70 + .../node_modules/repeat-string/package.json | 129 + tools/doc/node_modules/replace-ext/LICENSE | 21 + tools/doc/node_modules/replace-ext/README.md | 50 + tools/doc/node_modules/replace-ext/index.js | 18 + .../doc/node_modules/replace-ext/package.json | 86 + tools/doc/node_modules/state-toggle/LICENSE | 22 + .../doc/node_modules/state-toggle/history.md | 6 + tools/doc/node_modules/state-toggle/index.js | 45 + .../node_modules/state-toggle/package.json | 108 + tools/doc/node_modules/state-toggle/readme.md | 83 + .../node_modules/stringify-entities/LICENSE | 22 + .../stringify-entities/dangerous.json | 10 + .../node_modules/stringify-entities/index.js | 132 + .../stringify-entities/package.json | 113 + .../node_modules/stringify-entities/readme.md | 118 + .../node_modules/trim-trailing-lines/LICENSE | 22 + .../node_modules/trim-trailing-lines/index.js | 15 + .../trim-trailing-lines/package.json | 96 + .../trim-trailing-lines/readme.md | 55 + tools/doc/node_modules/trim/.npmignore | 4 + tools/doc/node_modules/trim/History.md | 5 + tools/doc/node_modules/trim/Makefile | 7 + tools/doc/node_modules/trim/Readme.md | 69 + tools/doc/node_modules/trim/component.json | 7 + tools/doc/node_modules/trim/index.js | 14 + tools/doc/node_modules/trim/package.json | 49 + tools/doc/node_modules/trough/LICENSE | 21 + tools/doc/node_modules/trough/index.js | 133 + tools/doc/node_modules/trough/package.json | 100 + tools/doc/node_modules/trough/readme.md | 305 +++ tools/doc/node_modules/unherit/LICENSE | 21 + tools/doc/node_modules/unherit/index.js | 67 + tools/doc/node_modules/unherit/package.json | 110 + tools/doc/node_modules/unherit/readme.md | 66 + tools/doc/node_modules/unified/LICENSE | 21 + tools/doc/node_modules/unified/index.js | 460 ++++ tools/doc/node_modules/unified/package.json | 117 + tools/doc/node_modules/unified/readme.md | 919 +++++++ .../unist-util-modify-children/LICENSE | 22 + .../unist-util-modify-children/index.js | 35 + .../unist-util-modify-children/package.json | 104 + .../unist-util-modify-children/readme.md | 89 + .../unist-util-remove-position/LICENSE | 22 + .../unist-util-remove-position/index.js | 19 + .../unist-util-remove-position/package.json | 103 + .../unist-util-remove-position/readme.md | 77 + .../unist-util-stringify-position/LICENSE | 22 + .../unist-util-stringify-position/index.js | 50 + .../package.json | 102 + .../unist-util-stringify-position/readme.md | 85 + .../doc/node_modules/unist-util-visit/LICENSE | 22 + .../node_modules/unist-util-visit/index.js | 53 + .../unist-util-visit/package.json | 107 + .../node_modules/unist-util-visit/readme.md | 117 + tools/doc/node_modules/vfile-location/LICENSE | 22 + .../doc/node_modules/vfile-location/index.js | 123 + .../node_modules/vfile-location/package.json | 109 + .../doc/node_modules/vfile-location/readme.md | 83 + tools/doc/node_modules/vfile/LICENSE | 21 + tools/doc/node_modules/vfile/index.js | 261 ++ tools/doc/node_modules/vfile/package.json | 126 + tools/doc/node_modules/vfile/readme.md | 290 +++ tools/doc/node_modules/x-is-array/.npmignore | 16 + tools/doc/node_modules/x-is-array/.travis.yml | 8 + tools/doc/node_modules/x-is-array/LICENCE | 19 + tools/doc/node_modules/x-is-array/README.md | 46 + tools/doc/node_modules/x-is-array/index.js | 8 + .../doc/node_modules/x-is-array/package.json | 87 + .../doc/node_modules/x-is-array/test/index.js | 51 + tools/doc/node_modules/x-is-function/LICENSE | 21 + .../doc/node_modules/x-is-function/README.md | 41 + tools/doc/node_modules/x-is-function/index.js | 3 + .../node_modules/x-is-function/package.json | 46 + tools/doc/node_modules/x-is-object/.npmignore | 16 + .../doc/node_modules/x-is-object/.travis.yml | 8 + tools/doc/node_modules/x-is-object/LICENCE | 19 + tools/doc/node_modules/x-is-object/README.md | 81 + tools/doc/node_modules/x-is-object/index.js | 5 + .../doc/node_modules/x-is-object/package.json | 86 + .../node_modules/x-is-object/test/index.js | 75 + tools/doc/node_modules/x-is-string/.npmignore | 16 + .../doc/node_modules/x-is-string/.travis.yml | 8 + tools/doc/node_modules/x-is-string/LICENCE | 19 + tools/doc/node_modules/x-is-string/README.md | 46 + tools/doc/node_modules/x-is-string/index.js | 7 + .../doc/node_modules/x-is-string/package.json | 87 + .../node_modules/x-is-string/test/index.js | 51 + tools/doc/node_modules/xtend/.jshintrc | 30 + tools/doc/node_modules/xtend/.npmignore | 1 + tools/doc/node_modules/xtend/LICENCE | 19 + tools/doc/node_modules/xtend/Makefile | 4 + tools/doc/node_modules/xtend/README.md | 32 + tools/doc/node_modules/xtend/immutable.js | 19 + tools/doc/node_modules/xtend/mutable.js | 17 + tools/doc/node_modules/xtend/package.json | 88 + tools/doc/node_modules/xtend/test.js | 83 + tools/doc/node_modules/zwitch/LICENSE | 22 + tools/doc/node_modules/zwitch/index.js | 33 + tools/doc/node_modules/zwitch/package.json | 99 + tools/doc/node_modules/zwitch/readme.md | 122 + 375 files changed, 28492 insertions(+) create mode 100644 tools/doc/node_modules/array-iterate/LICENSE create mode 100644 tools/doc/node_modules/array-iterate/index.js create mode 100644 tools/doc/node_modules/array-iterate/package.json create mode 100644 tools/doc/node_modules/array-iterate/readme.md create mode 100644 tools/doc/node_modules/bail/LICENSE create mode 100644 tools/doc/node_modules/bail/index.js create mode 100644 tools/doc/node_modules/bail/package.json create mode 100644 tools/doc/node_modules/bail/readme.md create mode 100644 tools/doc/node_modules/ccount/LICENSE create mode 100644 tools/doc/node_modules/ccount/history.md create mode 100644 tools/doc/node_modules/ccount/index.js create mode 100644 tools/doc/node_modules/ccount/package.json create mode 100644 tools/doc/node_modules/ccount/readme.md create mode 100644 tools/doc/node_modules/character-entities-html4/LICENSE create mode 100644 tools/doc/node_modules/character-entities-html4/index.json create mode 100644 tools/doc/node_modules/character-entities-html4/package.json create mode 100644 tools/doc/node_modules/character-entities-html4/readme.md create mode 100644 tools/doc/node_modules/character-entities-legacy/LICENSE create mode 100644 tools/doc/node_modules/character-entities-legacy/index.json create mode 100644 tools/doc/node_modules/character-entities-legacy/package.json create mode 100644 tools/doc/node_modules/character-entities-legacy/readme.md create mode 100644 tools/doc/node_modules/character-entities/LICENSE create mode 100644 tools/doc/node_modules/character-entities/index.json create mode 100644 tools/doc/node_modules/character-entities/package.json create mode 100644 tools/doc/node_modules/character-entities/readme.md create mode 100644 tools/doc/node_modules/character-reference-invalid/LICENSE create mode 100644 tools/doc/node_modules/character-reference-invalid/index.json create mode 100644 tools/doc/node_modules/character-reference-invalid/package.json create mode 100644 tools/doc/node_modules/character-reference-invalid/readme.md create mode 100644 tools/doc/node_modules/collapse-white-space/LICENSE create mode 100644 tools/doc/node_modules/collapse-white-space/index.js create mode 100644 tools/doc/node_modules/collapse-white-space/package.json create mode 100644 tools/doc/node_modules/collapse-white-space/readme.md create mode 100644 tools/doc/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 tools/doc/node_modules/emoji-regex/README.md create mode 100644 tools/doc/node_modules/emoji-regex/dist/index.js create mode 100644 tools/doc/node_modules/emoji-regex/index.js create mode 100644 tools/doc/node_modules/emoji-regex/package.json create mode 100644 tools/doc/node_modules/extend/.eslintrc create mode 100644 tools/doc/node_modules/extend/.jscs.json create mode 100644 tools/doc/node_modules/extend/.npmignore create mode 100644 tools/doc/node_modules/extend/.travis.yml create mode 100644 tools/doc/node_modules/extend/CHANGELOG.md create mode 100644 tools/doc/node_modules/extend/LICENSE create mode 100644 tools/doc/node_modules/extend/README.md create mode 100644 tools/doc/node_modules/extend/component.json create mode 100644 tools/doc/node_modules/extend/index.js create mode 100644 tools/doc/node_modules/extend/package.json create mode 100644 tools/doc/node_modules/function-bind/.eslintrc create mode 100644 tools/doc/node_modules/function-bind/.jscs.json create mode 100644 tools/doc/node_modules/function-bind/.npmignore create mode 100644 tools/doc/node_modules/function-bind/.travis.yml create mode 100644 tools/doc/node_modules/function-bind/LICENSE create mode 100644 tools/doc/node_modules/function-bind/README.md create mode 100644 tools/doc/node_modules/function-bind/implementation.js create mode 100644 tools/doc/node_modules/function-bind/index.js create mode 100644 tools/doc/node_modules/function-bind/package.json create mode 100644 tools/doc/node_modules/function-bind/test/index.js create mode 100644 tools/doc/node_modules/github-slugger/.npmignore create mode 100644 tools/doc/node_modules/github-slugger/.travis.yml create mode 100644 tools/doc/node_modules/github-slugger/CHANGELOG.md create mode 100644 tools/doc/node_modules/github-slugger/CONTRIBUTING.md create mode 100644 tools/doc/node_modules/github-slugger/LICENSE create mode 100644 tools/doc/node_modules/github-slugger/README.md create mode 100644 tools/doc/node_modules/github-slugger/index.js create mode 100644 tools/doc/node_modules/github-slugger/package.json create mode 100644 tools/doc/node_modules/github-slugger/test/index.js create mode 100644 tools/doc/node_modules/groff-escape/LICENSE create mode 100644 tools/doc/node_modules/groff-escape/index.json create mode 100644 tools/doc/node_modules/groff-escape/package.json create mode 100644 tools/doc/node_modules/groff-escape/readme.md create mode 100644 tools/doc/node_modules/has/.jshintrc create mode 100644 tools/doc/node_modules/has/.npmignore create mode 100644 tools/doc/node_modules/has/LICENSE-MIT create mode 100644 tools/doc/node_modules/has/README.mkd create mode 100644 tools/doc/node_modules/has/package.json create mode 100644 tools/doc/node_modules/has/src/index.js create mode 100644 tools/doc/node_modules/has/test/.jshintrc create mode 100644 tools/doc/node_modules/has/test/index.js create mode 100644 tools/doc/node_modules/inherits/LICENSE create mode 100644 tools/doc/node_modules/inherits/README.md create mode 100644 tools/doc/node_modules/inherits/inherits.js create mode 100644 tools/doc/node_modules/inherits/inherits_browser.js create mode 100644 tools/doc/node_modules/inherits/package.json create mode 100644 tools/doc/node_modules/is-alphabetical/LICENSE create mode 100644 tools/doc/node_modules/is-alphabetical/history.md create mode 100644 tools/doc/node_modules/is-alphabetical/index.js create mode 100644 tools/doc/node_modules/is-alphabetical/package.json create mode 100644 tools/doc/node_modules/is-alphabetical/readme.md create mode 100644 tools/doc/node_modules/is-alphanumeric/index.js create mode 100644 tools/doc/node_modules/is-alphanumeric/license create mode 100644 tools/doc/node_modules/is-alphanumeric/package.json create mode 100644 tools/doc/node_modules/is-alphanumeric/readme.md create mode 100644 tools/doc/node_modules/is-alphanumerical/LICENSE create mode 100644 tools/doc/node_modules/is-alphanumerical/history.md create mode 100644 tools/doc/node_modules/is-alphanumerical/index.js create mode 100644 tools/doc/node_modules/is-alphanumerical/package.json create mode 100644 tools/doc/node_modules/is-alphanumerical/readme.md create mode 100644 tools/doc/node_modules/is-buffer/.npmignore create mode 100644 tools/doc/node_modules/is-buffer/LICENSE create mode 100644 tools/doc/node_modules/is-buffer/README.md create mode 100644 tools/doc/node_modules/is-buffer/index.js create mode 100644 tools/doc/node_modules/is-buffer/package.json create mode 100644 tools/doc/node_modules/is-buffer/test/basic.js create mode 100644 tools/doc/node_modules/is-decimal/LICENSE create mode 100644 tools/doc/node_modules/is-decimal/history.md create mode 100644 tools/doc/node_modules/is-decimal/index.js create mode 100644 tools/doc/node_modules/is-decimal/package.json create mode 100644 tools/doc/node_modules/is-decimal/readme.md create mode 100644 tools/doc/node_modules/is-hexadecimal/LICENSE create mode 100644 tools/doc/node_modules/is-hexadecimal/history.md create mode 100644 tools/doc/node_modules/is-hexadecimal/index.js create mode 100644 tools/doc/node_modules/is-hexadecimal/package.json create mode 100644 tools/doc/node_modules/is-hexadecimal/readme.md create mode 100644 tools/doc/node_modules/is-plain-obj/index.js create mode 100644 tools/doc/node_modules/is-plain-obj/license create mode 100644 tools/doc/node_modules/is-plain-obj/package.json create mode 100644 tools/doc/node_modules/is-plain-obj/readme.md create mode 100644 tools/doc/node_modules/is-whitespace-character/LICENSE create mode 100644 tools/doc/node_modules/is-whitespace-character/history.md create mode 100644 tools/doc/node_modules/is-whitespace-character/index.js create mode 100644 tools/doc/node_modules/is-whitespace-character/package.json create mode 100644 tools/doc/node_modules/is-whitespace-character/readme.md create mode 100644 tools/doc/node_modules/is-word-character/LICENSE create mode 100644 tools/doc/node_modules/is-word-character/history.md create mode 100644 tools/doc/node_modules/is-word-character/index.js create mode 100644 tools/doc/node_modules/is-word-character/package.json create mode 100644 tools/doc/node_modules/is-word-character/readme.md create mode 100644 tools/doc/node_modules/longest-streak/LICENSE create mode 100644 tools/doc/node_modules/longest-streak/index.js create mode 100644 tools/doc/node_modules/longest-streak/package.json create mode 100644 tools/doc/node_modules/longest-streak/readme.md create mode 100644 tools/doc/node_modules/mapz/LICENSE create mode 100644 tools/doc/node_modules/mapz/history.md create mode 100644 tools/doc/node_modules/mapz/index.js create mode 100644 tools/doc/node_modules/mapz/package.json create mode 100644 tools/doc/node_modules/mapz/readme.md create mode 100644 tools/doc/node_modules/markdown-escapes/LICENSE create mode 100644 tools/doc/node_modules/markdown-escapes/history.md create mode 100644 tools/doc/node_modules/markdown-escapes/index.js create mode 100644 tools/doc/node_modules/markdown-escapes/package.json create mode 100644 tools/doc/node_modules/markdown-escapes/readme.md create mode 100644 tools/doc/node_modules/markdown-table/LICENSE create mode 100644 tools/doc/node_modules/markdown-table/index.js create mode 100644 tools/doc/node_modules/markdown-table/package.json create mode 100644 tools/doc/node_modules/markdown-table/readme.md create mode 100644 tools/doc/node_modules/mdast-util-compact/LICENSE create mode 100644 tools/doc/node_modules/mdast-util-compact/index.js create mode 100644 tools/doc/node_modules/mdast-util-compact/package.json create mode 100644 tools/doc/node_modules/mdast-util-compact/readme.md create mode 100644 tools/doc/node_modules/mdast-util-to-string/LICENSE create mode 100644 tools/doc/node_modules/mdast-util-to-string/index.js create mode 100644 tools/doc/node_modules/mdast-util-to-string/package.json create mode 100644 tools/doc/node_modules/mdast-util-to-string/readme.md create mode 100644 tools/doc/node_modules/months/LICENSE create mode 100644 tools/doc/node_modules/months/README.md create mode 100644 tools/doc/node_modules/months/index.js create mode 100644 tools/doc/node_modules/months/package.json create mode 100644 tools/doc/node_modules/parse-entities/LICENSE create mode 100644 tools/doc/node_modules/parse-entities/index.js create mode 100644 tools/doc/node_modules/parse-entities/package.json create mode 100644 tools/doc/node_modules/parse-entities/readme.md create mode 100644 tools/doc/node_modules/remark-man/LICENSE create mode 100644 tools/doc/node_modules/remark-man/index.js create mode 100644 tools/doc/node_modules/remark-man/lib/compiler.js create mode 100644 tools/doc/node_modules/remark-man/lib/escape.js create mode 100644 tools/doc/node_modules/remark-man/lib/handlers.js create mode 100644 tools/doc/node_modules/remark-man/lib/macro.js create mode 100644 tools/doc/node_modules/remark-man/lib/quote.js create mode 100644 tools/doc/node_modules/remark-man/package.json create mode 100644 tools/doc/node_modules/remark-man/readme.md create mode 100644 tools/doc/node_modules/remark-parse/index.js create mode 100644 tools/doc/node_modules/remark-parse/lib/block-elements.json create mode 100644 tools/doc/node_modules/remark-parse/lib/decode.js create mode 100644 tools/doc/node_modules/remark-parse/lib/defaults.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/break.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/code-inline.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/delete.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/emphasis.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/escape.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/link.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/strong.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/tag.js create mode 100644 tools/doc/node_modules/remark-parse/lib/locate/url.js create mode 100644 tools/doc/node_modules/remark-parse/lib/parse.js create mode 100644 tools/doc/node_modules/remark-parse/lib/parser.js create mode 100644 tools/doc/node_modules/remark-parse/lib/set-options.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/auto-link.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/blockquote.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/break.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/code-fenced.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/code-indented.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/code-inline.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/definition.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/delete.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/emphasis.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/escape.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/footnote-definition.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/heading-atx.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/heading-setext.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/html-block.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/html-inline.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/link.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/list.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/newline.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/paragraph.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/reference.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/strong.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/table.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/text.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/thematic-break.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/url.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenize/yaml.js create mode 100644 tools/doc/node_modules/remark-parse/lib/tokenizer.js create mode 100644 tools/doc/node_modules/remark-parse/lib/unescape.js create mode 100644 tools/doc/node_modules/remark-parse/lib/util/get-indentation.js create mode 100644 tools/doc/node_modules/remark-parse/lib/util/html.js create mode 100644 tools/doc/node_modules/remark-parse/lib/util/interrupt.js create mode 100644 tools/doc/node_modules/remark-parse/lib/util/normalize.js create mode 100644 tools/doc/node_modules/remark-parse/lib/util/remove-indentation.js create mode 100644 tools/doc/node_modules/remark-parse/package.json create mode 100644 tools/doc/node_modules/remark-parse/readme.md create mode 100644 tools/doc/node_modules/remark-stringify/index.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/compiler.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/defaults.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/escape.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/all.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/block.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/compile.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/one.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/ordered-items.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/macro/unordered-items.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/set-options.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/enclose-title.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/enclose-uri.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/enter-link-reference.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/entity-prefix-length.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/label.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/pad.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/util/returner.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/blockquote.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/break.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/code.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/definition.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/delete.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/emphasis.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/footnote-definition.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/footnote-reference.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/footnote.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/heading.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/html.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/image-reference.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/image.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/inline-code.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/link-reference.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/link.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/list-item.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/list.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/paragraph.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/root.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/strong.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/table-cell.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/table.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/text.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/thematic-break.js create mode 100644 tools/doc/node_modules/remark-stringify/lib/visitors/yaml.js create mode 100644 tools/doc/node_modules/remark-stringify/package.json create mode 100644 tools/doc/node_modules/remark-stringify/readme.md create mode 100644 tools/doc/node_modules/remark/index.js create mode 100644 tools/doc/node_modules/remark/package.json create mode 100644 tools/doc/node_modules/remark/readme.md create mode 100644 tools/doc/node_modules/repeat-string/LICENSE create mode 100644 tools/doc/node_modules/repeat-string/README.md create mode 100644 tools/doc/node_modules/repeat-string/index.js create mode 100644 tools/doc/node_modules/repeat-string/package.json create mode 100755 tools/doc/node_modules/replace-ext/LICENSE create mode 100644 tools/doc/node_modules/replace-ext/README.md create mode 100644 tools/doc/node_modules/replace-ext/index.js create mode 100644 tools/doc/node_modules/replace-ext/package.json create mode 100644 tools/doc/node_modules/state-toggle/LICENSE create mode 100644 tools/doc/node_modules/state-toggle/history.md create mode 100644 tools/doc/node_modules/state-toggle/index.js create mode 100644 tools/doc/node_modules/state-toggle/package.json create mode 100644 tools/doc/node_modules/state-toggle/readme.md create mode 100644 tools/doc/node_modules/stringify-entities/LICENSE create mode 100644 tools/doc/node_modules/stringify-entities/dangerous.json create mode 100644 tools/doc/node_modules/stringify-entities/index.js create mode 100644 tools/doc/node_modules/stringify-entities/package.json create mode 100644 tools/doc/node_modules/stringify-entities/readme.md create mode 100644 tools/doc/node_modules/trim-trailing-lines/LICENSE create mode 100644 tools/doc/node_modules/trim-trailing-lines/index.js create mode 100644 tools/doc/node_modules/trim-trailing-lines/package.json create mode 100644 tools/doc/node_modules/trim-trailing-lines/readme.md create mode 100644 tools/doc/node_modules/trim/.npmignore create mode 100644 tools/doc/node_modules/trim/History.md create mode 100644 tools/doc/node_modules/trim/Makefile create mode 100644 tools/doc/node_modules/trim/Readme.md create mode 100644 tools/doc/node_modules/trim/component.json create mode 100644 tools/doc/node_modules/trim/index.js create mode 100644 tools/doc/node_modules/trim/package.json create mode 100644 tools/doc/node_modules/trough/LICENSE create mode 100644 tools/doc/node_modules/trough/index.js create mode 100644 tools/doc/node_modules/trough/package.json create mode 100644 tools/doc/node_modules/trough/readme.md create mode 100644 tools/doc/node_modules/unherit/LICENSE create mode 100644 tools/doc/node_modules/unherit/index.js create mode 100644 tools/doc/node_modules/unherit/package.json create mode 100644 tools/doc/node_modules/unherit/readme.md create mode 100644 tools/doc/node_modules/unified/LICENSE create mode 100644 tools/doc/node_modules/unified/index.js create mode 100644 tools/doc/node_modules/unified/package.json create mode 100644 tools/doc/node_modules/unified/readme.md create mode 100644 tools/doc/node_modules/unist-util-modify-children/LICENSE create mode 100644 tools/doc/node_modules/unist-util-modify-children/index.js create mode 100644 tools/doc/node_modules/unist-util-modify-children/package.json create mode 100644 tools/doc/node_modules/unist-util-modify-children/readme.md create mode 100644 tools/doc/node_modules/unist-util-remove-position/LICENSE create mode 100644 tools/doc/node_modules/unist-util-remove-position/index.js create mode 100644 tools/doc/node_modules/unist-util-remove-position/package.json create mode 100644 tools/doc/node_modules/unist-util-remove-position/readme.md create mode 100644 tools/doc/node_modules/unist-util-stringify-position/LICENSE create mode 100644 tools/doc/node_modules/unist-util-stringify-position/index.js create mode 100644 tools/doc/node_modules/unist-util-stringify-position/package.json create mode 100644 tools/doc/node_modules/unist-util-stringify-position/readme.md create mode 100644 tools/doc/node_modules/unist-util-visit/LICENSE create mode 100644 tools/doc/node_modules/unist-util-visit/index.js create mode 100644 tools/doc/node_modules/unist-util-visit/package.json create mode 100644 tools/doc/node_modules/unist-util-visit/readme.md create mode 100644 tools/doc/node_modules/vfile-location/LICENSE create mode 100644 tools/doc/node_modules/vfile-location/index.js create mode 100644 tools/doc/node_modules/vfile-location/package.json create mode 100644 tools/doc/node_modules/vfile-location/readme.md create mode 100644 tools/doc/node_modules/vfile/LICENSE create mode 100644 tools/doc/node_modules/vfile/index.js create mode 100644 tools/doc/node_modules/vfile/package.json create mode 100644 tools/doc/node_modules/vfile/readme.md create mode 100644 tools/doc/node_modules/x-is-array/.npmignore create mode 100644 tools/doc/node_modules/x-is-array/.travis.yml create mode 100644 tools/doc/node_modules/x-is-array/LICENCE create mode 100644 tools/doc/node_modules/x-is-array/README.md create mode 100644 tools/doc/node_modules/x-is-array/index.js create mode 100644 tools/doc/node_modules/x-is-array/package.json create mode 100644 tools/doc/node_modules/x-is-array/test/index.js create mode 100644 tools/doc/node_modules/x-is-function/LICENSE create mode 100644 tools/doc/node_modules/x-is-function/README.md create mode 100644 tools/doc/node_modules/x-is-function/index.js create mode 100644 tools/doc/node_modules/x-is-function/package.json create mode 100644 tools/doc/node_modules/x-is-object/.npmignore create mode 100644 tools/doc/node_modules/x-is-object/.travis.yml create mode 100644 tools/doc/node_modules/x-is-object/LICENCE create mode 100644 tools/doc/node_modules/x-is-object/README.md create mode 100644 tools/doc/node_modules/x-is-object/index.js create mode 100644 tools/doc/node_modules/x-is-object/package.json create mode 100644 tools/doc/node_modules/x-is-object/test/index.js create mode 100644 tools/doc/node_modules/x-is-string/.npmignore create mode 100644 tools/doc/node_modules/x-is-string/.travis.yml create mode 100644 tools/doc/node_modules/x-is-string/LICENCE create mode 100644 tools/doc/node_modules/x-is-string/README.md create mode 100644 tools/doc/node_modules/x-is-string/index.js create mode 100644 tools/doc/node_modules/x-is-string/package.json create mode 100644 tools/doc/node_modules/x-is-string/test/index.js create mode 100644 tools/doc/node_modules/xtend/.jshintrc create mode 100644 tools/doc/node_modules/xtend/.npmignore create mode 100644 tools/doc/node_modules/xtend/LICENCE create mode 100644 tools/doc/node_modules/xtend/Makefile create mode 100644 tools/doc/node_modules/xtend/README.md create mode 100644 tools/doc/node_modules/xtend/immutable.js create mode 100644 tools/doc/node_modules/xtend/mutable.js create mode 100644 tools/doc/node_modules/xtend/package.json create mode 100644 tools/doc/node_modules/xtend/test.js create mode 100644 tools/doc/node_modules/zwitch/LICENSE create mode 100644 tools/doc/node_modules/zwitch/index.js create mode 100644 tools/doc/node_modules/zwitch/package.json create mode 100644 tools/doc/node_modules/zwitch/readme.md diff --git a/tools/doc/node_modules/array-iterate/LICENSE b/tools/doc/node_modules/array-iterate/LICENSE new file mode 100644 index 00000000000000..f3722d94b38121 --- /dev/null +++ b/tools/doc/node_modules/array-iterate/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/array-iterate/index.js b/tools/doc/node_modules/array-iterate/index.js new file mode 100644 index 00000000000000..85fced981acf07 --- /dev/null +++ b/tools/doc/node_modules/array-iterate/index.js @@ -0,0 +1,43 @@ +'use strict'; + +module.exports = iterate; + +var own = {}.hasOwnProperty; + +function iterate(values, callback, context) { + var index = -1; + var result; + + if (!values) { + throw new Error('Iterate requires that |this| not be ' + values); + } + + if (!own.call(values, 'length')) { + throw new Error('Iterate requires that |this| has a `length`'); + } + + if (typeof callback !== 'function') { + throw new Error('`callback` must be a function'); + } + + /* The length might change, so we do not cache it. */ + while (++index < values.length) { + /* Skip missing values. */ + if (!(index in values)) { + continue; + } + + result = callback.call(context, values[index], index, values); + + /* If `callback` returns a `number`, move `index` over to + * `number`. */ + if (typeof result === 'number') { + /* Make sure that negative numbers do not break the loop. */ + if (result < 0) { + index = 0; + } + + index = result - 1; + } + } +} diff --git a/tools/doc/node_modules/array-iterate/package.json b/tools/doc/node_modules/array-iterate/package.json new file mode 100644 index 00000000000000..df8318a5c55c55 --- /dev/null +++ b/tools/doc/node_modules/array-iterate/package.json @@ -0,0 +1,102 @@ +{ + "_from": "array-iterate@^1.0.0", + "_id": "array-iterate@1.1.1", + "_inBundle": false, + "_integrity": "sha1-hlv3+K851rCYLGCQKRSsdrwBCPY=", + "_location": "/array-iterate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-iterate@^1.0.0", + "name": "array-iterate", + "escapedName": "array-iterate", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/unist-util-modify-children" + ], + "_resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-1.1.1.tgz", + "_shasum": "865bf7f8af39d6b0982c60902914ac76bc0108f6", + "_spec": "array-iterate@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unist-util-modify-children", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/array-iterate/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "forEach with the possibility to change the next position", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/array-iterate#readme", + "keywords": [ + "array", + "list", + "iterate", + "walk" + ], + "license": "MIT", + "name": "array-iterate", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/array-iterate.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s arrayIterate > array-iterate.js", + "build-mangle": "esmangle array-iterate.js > array-iterate.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "rules": { + "guard-for-in": "off", + "unicorn/prefer-type-error": "off" + }, + "ignores": [ + "array-iterate.js" + ] + } +} diff --git a/tools/doc/node_modules/array-iterate/readme.md b/tools/doc/node_modules/array-iterate/readme.md new file mode 100644 index 00000000000000..538f038e4e2d34 --- /dev/null +++ b/tools/doc/node_modules/array-iterate/readme.md @@ -0,0 +1,97 @@ +# array-iterate [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +[`Array#forEach()`][foreach] with the possibility to change the next +position. + +## Installation + +[npm][]: + +```bash +npm install array-iterate +``` + +## Usage + +```js +var iterate = require('array-iterate'); +var isFirst = true; +var context = 'iterate'; + +iterate([1, 2, 3, 4], function (value, index, values) { + console.log(this, value, index, values) + + if (isFirst && index + 1 === values.length) { + isFirst = false; + return 0; + } +}, context); +``` + +Yields: + +```js +[String: 'iterate'], 1, 0, [ 1, 2, 3, 4 ] +[String: 'iterate'], 2, 1, [ 1, 2, 3, 4 ] +[String: 'iterate'], 3, 2, [ 1, 2, 3, 4 ] +[String: 'iterate'], 4, 3, [ 1, 2, 3, 4 ] +[String: 'iterate'], 1, 0, [ 1, 2, 3, 4 ] +[String: 'iterate'], 2, 1, [ 1, 2, 3, 4 ] +[String: 'iterate'], 3, 2, [ 1, 2, 3, 4 ] +[String: 'iterate'], 4, 3, [ 1, 2, 3, 4 ] +``` + +## API + +### `iterate(values, callback[, context])` + +Functions just like [`Array#forEach()`][foreach], but when `callback` +returns a `number`, iterates over the item at `number` next. + +###### Parameters + +* `values` (`Array`-like thing) — Values to iterate over +* `callback` ([`Function`][callback]) — Callback given to `iterate` +* `context` (`*`, optional) — Context object to use when invoking `callback` + +#### `function callback(value, index, values)` + +Callback given to `iterate`. + +###### Parameters + +* `value` (`*`) — Current iteration +* `index` (`number`) — Position of `value` in `values` +* `values` (`Array`-like thing) — Currently iterated over + +###### Context + +`context`, when given to `iterate`. + +###### Returns + +`number` (optional) — Position to go to next. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/array-iterate.svg + +[travis]: https://travis-ci.org/wooorm/array-iterate + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/array-iterate.svg + +[codecov]: https://codecov.io/github/wooorm/array-iterate + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[foreach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + +[callback]: #function-callbackvalue-index-values diff --git a/tools/doc/node_modules/bail/LICENSE b/tools/doc/node_modules/bail/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/bail/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/bail/index.js b/tools/doc/node_modules/bail/index.js new file mode 100644 index 00000000000000..f5842e2590e48b --- /dev/null +++ b/tools/doc/node_modules/bail/index.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = bail; + +function bail(err) { + if (err) { + throw err; + } +} diff --git a/tools/doc/node_modules/bail/package.json b/tools/doc/node_modules/bail/package.json new file mode 100644 index 00000000000000..4a080123c9fb9c --- /dev/null +++ b/tools/doc/node_modules/bail/package.json @@ -0,0 +1,99 @@ +{ + "_from": "bail@^1.0.0", + "_id": "bail@1.0.2", + "_inBundle": false, + "_integrity": "sha1-99bBcxYwqfnw1NNe0fli4gdKF2Q=", + "_location": "/bail", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bail@^1.0.0", + "name": "bail", + "escapedName": "bail", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/bail/-/bail-1.0.2.tgz", + "_shasum": "f7d6c1731630a9f9f0d4d35ed1f962e2074a1764", + "_spec": "bail@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/bail/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Throw a given error", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.1", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/bail.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s bail > bail.js", + "build-mangle": "esmangle bail.js > bail.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.0.2", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "bail.js" + ] + } +} diff --git a/tools/doc/node_modules/bail/readme.md b/tools/doc/node_modules/bail/readme.md new file mode 100644 index 00000000000000..a5ca45d0f09130 --- /dev/null +++ b/tools/doc/node_modules/bail/readme.md @@ -0,0 +1,71 @@ +# bail [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +:warning: Throw a given error. + +## Installation + +[npm][npm-install]: + +```bash +npm install bail +``` + +## Usage + +```js +var bail = require('bail'); + +bail(); + +bail(new Error('failure')); +// Error: failure +// at repl:1:6 +// at REPLServer.defaultEval (repl.js:154:27) +// ... +``` + +## API + +### `bail([err])` + +Throw a given error. + +###### Parameters + +* `err` (`Error?`) — Optional error. + +###### Throws + +* `Error` — Given error, if any. + +## Related + +* [`noop`][noop] +* [`noop2`][noop2] +* [`noop3`][noop3] + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/bail.svg + +[travis]: https://travis-ci.org/wooorm/bail + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/bail.svg + +[codecov]: https://codecov.io/github/wooorm/bail + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[noop]: https://www.npmjs.com/package/noop + +[noop2]: https://www.npmjs.com/package/noop2 + +[noop3]: https://www.npmjs.com/package/noop3 diff --git a/tools/doc/node_modules/ccount/LICENSE b/tools/doc/node_modules/ccount/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/ccount/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/ccount/history.md b/tools/doc/node_modules/ccount/history.md new file mode 100644 index 00000000000000..908b6f7578944e --- /dev/null +++ b/tools/doc/node_modules/ccount/history.md @@ -0,0 +1,11 @@ + + + + +1.0.1 / 2016-07-23 +================== + +* Rewrite module ([`c3cd494`](https://github.com/wooorm/ccount/commit/c3cd494)) + +1.0.0 / 2015-07-12 +================== diff --git a/tools/doc/node_modules/ccount/index.js b/tools/doc/node_modules/ccount/index.js new file mode 100644 index 00000000000000..0d72d6e52763cc --- /dev/null +++ b/tools/doc/node_modules/ccount/index.js @@ -0,0 +1,46 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module ccount + * @fileoverview Count characters. + */ + +'use strict'; + +/* Expose. */ +module.exports = ccount; + +/** + * Count how many characters `character` occur in `value`. + * + * @example + * ccount('foo(bar(baz)', '(') // 2 + * ccount('foo(bar(baz)', ')') // 1 + * + * @param {string} value - Content, coerced to string. + * @param {string} character - Single character to look + * for. + * @return {number} - Count. + * @throws {Error} - when `character` is not a single + * character. + */ +function ccount(value, character) { + var count = 0; + var index; + + value = String(value); + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character'); + } + + index = value.indexOf(character); + + while (index !== -1) { + count++; + index = value.indexOf(character, index + 1); + } + + return count; +} diff --git a/tools/doc/node_modules/ccount/package.json b/tools/doc/node_modules/ccount/package.json new file mode 100644 index 00000000000000..bca58aadb946f7 --- /dev/null +++ b/tools/doc/node_modules/ccount/package.json @@ -0,0 +1,101 @@ +{ + "_from": "ccount@^1.0.0", + "_id": "ccount@1.0.1", + "_inBundle": false, + "_integrity": "sha1-ZlaHlFFowhjsd/9hpBVa4AInqWw=", + "_location": "/ccount", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ccount@^1.0.0", + "name": "ccount", + "escapedName": "ccount", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.1.tgz", + "_shasum": "665687945168c218ec77ff61a4155ae00227a96c", + "_spec": "ccount@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/ccount/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Count characters", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/ccount#readme", + "keywords": [ + "character", + "count", + "char" + ], + "license": "MIT", + "name": "ccount", + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/ccount.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s ccount > ccount.js", + "build-mangle": "esmangle ccount.js > ccount.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.1", + "xo": { + "space": true, + "ignores": [ + "ccount.js", + "ccount.min.js" + ] + } +} diff --git a/tools/doc/node_modules/ccount/readme.md b/tools/doc/node_modules/ccount/readme.md new file mode 100644 index 00000000000000..d773d12c8c59e5 --- /dev/null +++ b/tools/doc/node_modules/ccount/readme.md @@ -0,0 +1,57 @@ +# ccount [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Count characters. + +## Installation + +[npm][npm-install]: + +```bash +npm install ccount +``` + +## Usage + +```javascript +var ccount = require('ccount'); + +ccount('foo(bar(baz)', '(') // 2 +ccount('foo(bar(baz)', ')') // 1 +``` + +## API + +### `ccount(value, character)` + +Get the total count of `character` in `value`. + +###### Parameters + +* `value` (`string`) — Content, coerced to string. +* `character` (`string`) — Single character to look for. + +###### Returns + +`number` — Number of times `character` occurred in `value`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/ccount.svg + +[travis]: https://travis-ci.org/wooorm/ccount + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/ccount.svg + +[codecov]: https://codecov.io/github/wooorm/ccount + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/character-entities-html4/LICENSE b/tools/doc/node_modules/character-entities-html4/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/character-entities-html4/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/character-entities-html4/index.json b/tools/doc/node_modules/character-entities-html4/index.json new file mode 100644 index 00000000000000..fa0d7bc7c770c8 --- /dev/null +++ b/tools/doc/node_modules/character-entities-html4/index.json @@ -0,0 +1,254 @@ +{ + "nbsp": " ", + "iexcl": "¡", + "cent": "¢", + "pound": "£", + "curren": "¤", + "yen": "¥", + "brvbar": "¦", + "sect": "§", + "uml": "¨", + "copy": "©", + "ordf": "ª", + "laquo": "«", + "not": "¬", + "shy": "­", + "reg": "®", + "macr": "¯", + "deg": "°", + "plusmn": "±", + "sup2": "²", + "sup3": "³", + "acute": "´", + "micro": "µ", + "para": "¶", + "middot": "·", + "cedil": "¸", + "sup1": "¹", + "ordm": "º", + "raquo": "»", + "frac14": "¼", + "frac12": "½", + "frac34": "¾", + "iquest": "¿", + "Agrave": "À", + "Aacute": "Á", + "Acirc": "Â", + "Atilde": "Ã", + "Auml": "Ä", + "Aring": "Å", + "AElig": "Æ", + "Ccedil": "Ç", + "Egrave": "È", + "Eacute": "É", + "Ecirc": "Ê", + "Euml": "Ë", + "Igrave": "Ì", + "Iacute": "Í", + "Icirc": "Î", + "Iuml": "Ï", + "ETH": "Ð", + "Ntilde": "Ñ", + "Ograve": "Ò", + "Oacute": "Ó", + "Ocirc": "Ô", + "Otilde": "Õ", + "Ouml": "Ö", + "times": "×", + "Oslash": "Ø", + "Ugrave": "Ù", + "Uacute": "Ú", + "Ucirc": "Û", + "Uuml": "Ü", + "Yacute": "Ý", + "THORN": "Þ", + "szlig": "ß", + "agrave": "à", + "aacute": "á", + "acirc": "â", + "atilde": "ã", + "auml": "ä", + "aring": "å", + "aelig": "æ", + "ccedil": "ç", + "egrave": "è", + "eacute": "é", + "ecirc": "ê", + "euml": "ë", + "igrave": "ì", + "iacute": "í", + "icirc": "î", + "iuml": "ï", + "eth": "ð", + "ntilde": "ñ", + "ograve": "ò", + "oacute": "ó", + "ocirc": "ô", + "otilde": "õ", + "ouml": "ö", + "divide": "÷", + "oslash": "ø", + "ugrave": "ù", + "uacute": "ú", + "ucirc": "û", + "uuml": "ü", + "yacute": "ý", + "thorn": "þ", + "yuml": "ÿ", + "fnof": "ƒ", + "Alpha": "Α", + "Beta": "Β", + "Gamma": "Γ", + "Delta": "Δ", + "Epsilon": "Ε", + "Zeta": "Ζ", + "Eta": "Η", + "Theta": "Θ", + "Iota": "Ι", + "Kappa": "Κ", + "Lambda": "Λ", + "Mu": "Μ", + "Nu": "Ν", + "Xi": "Ξ", + "Omicron": "Ο", + "Pi": "Π", + "Rho": "Ρ", + "Sigma": "Σ", + "Tau": "Τ", + "Upsilon": "Υ", + "Phi": "Φ", + "Chi": "Χ", + "Psi": "Ψ", + "Omega": "Ω", + "alpha": "α", + "beta": "β", + "gamma": "γ", + "delta": "δ", + "epsilon": "ε", + "zeta": "ζ", + "eta": "η", + "theta": "θ", + "iota": "ι", + "kappa": "κ", + "lambda": "λ", + "mu": "μ", + "nu": "ν", + "xi": "ξ", + "omicron": "ο", + "pi": "π", + "rho": "ρ", + "sigmaf": "ς", + "sigma": "σ", + "tau": "τ", + "upsilon": "υ", + "phi": "φ", + "chi": "χ", + "psi": "ψ", + "omega": "ω", + "thetasym": "ϑ", + "upsih": "ϒ", + "piv": "ϖ", + "bull": "•", + "hellip": "…", + "prime": "′", + "Prime": "″", + "oline": "‾", + "frasl": "⁄", + "weierp": "℘", + "image": "ℑ", + "real": "ℜ", + "trade": "™", + "alefsym": "ℵ", + "larr": "←", + "uarr": "↑", + "rarr": "→", + "darr": "↓", + "harr": "↔", + "crarr": "↵", + "lArr": "⇐", + "uArr": "⇑", + "rArr": "⇒", + "dArr": "⇓", + "hArr": "⇔", + "forall": "∀", + "part": "∂", + "exist": "∃", + "empty": "∅", + "nabla": "∇", + "isin": "∈", + "notin": "∉", + "ni": "∋", + "prod": "∏", + "sum": "∑", + "minus": "−", + "lowast": "∗", + "radic": "√", + "prop": "∝", + "infin": "∞", + "ang": "∠", + "and": "∧", + "or": "∨", + "cap": "∩", + "cup": "∪", + "int": "∫", + "there4": "∴", + "sim": "∼", + "cong": "≅", + "asymp": "≈", + "ne": "≠", + "equiv": "≡", + "le": "≤", + "ge": "≥", + "sub": "⊂", + "sup": "⊃", + "nsub": "⊄", + "sube": "⊆", + "supe": "⊇", + "oplus": "⊕", + "otimes": "⊗", + "perp": "⊥", + "sdot": "⋅", + "lceil": "⌈", + "rceil": "⌉", + "lfloor": "⌊", + "rfloor": "⌋", + "lang": "〈", + "rang": "〉", + "loz": "◊", + "spades": "♠", + "clubs": "♣", + "hearts": "♥", + "diams": "♦", + "quot": "\"", + "amp": "&", + "lt": "<", + "gt": ">", + "OElig": "Œ", + "oelig": "œ", + "Scaron": "Š", + "scaron": "š", + "Yuml": "Ÿ", + "circ": "ˆ", + "tilde": "˜", + "ensp": " ", + "emsp": " ", + "thinsp": " ", + "zwnj": "‌", + "zwj": "‍", + "lrm": "‎", + "rlm": "‏", + "ndash": "–", + "mdash": "—", + "lsquo": "‘", + "rsquo": "’", + "sbquo": "‚", + "ldquo": "“", + "rdquo": "”", + "bdquo": "„", + "dagger": "†", + "Dagger": "‡", + "permil": "‰", + "lsaquo": "‹", + "rsaquo": "›", + "euro": "€" +} diff --git a/tools/doc/node_modules/character-entities-html4/package.json b/tools/doc/node_modules/character-entities-html4/package.json new file mode 100644 index 00000000000000..c5a1dac4fa0e92 --- /dev/null +++ b/tools/doc/node_modules/character-entities-html4/package.json @@ -0,0 +1,98 @@ +{ + "_from": "character-entities-html4@^1.0.0", + "_id": "character-entities-html4@1.1.0", + "_inBundle": false, + "_integrity": "sha1-GrCFUdPOH6HfCNAPucod77FHoGw=", + "_location": "/character-entities-html4", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities-html4@^1.0.0", + "name": "character-entities-html4", + "escapedName": "character-entities-html4", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.0.tgz", + "_shasum": "1ab08551d3ce1fa1df08d00fb9ca1defb147a06c", + "_spec": "character-entities-html4@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/stringify-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities-html4/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML4 character entity information", + "devDependencies": { + "bail": "^1.0.1", + "browserify": "^13.0.1", + "concat-stream": "^1.5.2", + "esmangle": "^1.0.1", + "nyc": "^8.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.0.0", + "xo": "^0.17.0" + }, + "files": [ + "index.json" + ], + "homepage": "https://github.com/wooorm/character-entities-html4#readme", + "keywords": [ + "html", + "html4", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities-html4", + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities-html4.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-generate && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json --bare -s characterEntitiesHTML4 > character-entities-html4.js", + "build-generate": "node build", + "build-mangle": "esmangle character-entities-html4.js > character-entities-html4.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "ignores": [ + "character-entities-html4.js" + ] + } +} diff --git a/tools/doc/node_modules/character-entities-html4/readme.md b/tools/doc/node_modules/character-entities-html4/readme.md new file mode 100644 index 00000000000000..d607a6483e2d8f --- /dev/null +++ b/tools/doc/node_modules/character-entities-html4/readme.md @@ -0,0 +1,52 @@ +# character-entities-html4 [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +HTML4 character entity information. + +## Installation + +[npm][npm-install]: + +```bash +npm install character-entities-html4 +``` + +## Usage + +```js +console.log(characterEntities.AElig); // Æ +console.log(characterEntities.aelig); // æ +console.log(characterEntities.amp); // & +console.log(characterEntities.apos); // undefined +``` + +## API + +### `characterEntitiesHTML4` + +Mapping between (case-sensitive) character entity names to replacements. + +## Support + +See [w3.org][html]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/character-entities-html4.svg + +[travis]: https://travis-ci.org/wooorm/character-entities-html4 + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities-html4.svg + +[codecov]: https://codecov.io/github/wooorm/character-entities-html4 + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[html]: http://www.w3.org/TR/html4/sgml/entities.html diff --git a/tools/doc/node_modules/character-entities-legacy/LICENSE b/tools/doc/node_modules/character-entities-legacy/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/character-entities-legacy/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/character-entities-legacy/index.json b/tools/doc/node_modules/character-entities-legacy/index.json new file mode 100644 index 00000000000000..d83b75251b7928 --- /dev/null +++ b/tools/doc/node_modules/character-entities-legacy/index.json @@ -0,0 +1,108 @@ +{ + "AElig": "Æ", + "AMP": "&", + "Aacute": "Á", + "Acirc": "Â", + "Agrave": "À", + "Aring": "Å", + "Atilde": "Ã", + "Auml": "Ä", + "COPY": "©", + "Ccedil": "Ç", + "ETH": "Ð", + "Eacute": "É", + "Ecirc": "Ê", + "Egrave": "È", + "Euml": "Ë", + "GT": ">", + "Iacute": "Í", + "Icirc": "Î", + "Igrave": "Ì", + "Iuml": "Ï", + "LT": "<", + "Ntilde": "Ñ", + "Oacute": "Ó", + "Ocirc": "Ô", + "Ograve": "Ò", + "Oslash": "Ø", + "Otilde": "Õ", + "Ouml": "Ö", + "QUOT": "\"", + "REG": "®", + "THORN": "Þ", + "Uacute": "Ú", + "Ucirc": "Û", + "Ugrave": "Ù", + "Uuml": "Ü", + "Yacute": "Ý", + "aacute": "á", + "acirc": "â", + "acute": "´", + "aelig": "æ", + "agrave": "à", + "amp": "&", + "aring": "å", + "atilde": "ã", + "auml": "ä", + "brvbar": "¦", + "ccedil": "ç", + "cedil": "¸", + "cent": "¢", + "copy": "©", + "curren": "¤", + "deg": "°", + "divide": "÷", + "eacute": "é", + "ecirc": "ê", + "egrave": "è", + "eth": "ð", + "euml": "ë", + "frac12": "½", + "frac14": "¼", + "frac34": "¾", + "gt": ">", + "iacute": "í", + "icirc": "î", + "iexcl": "¡", + "igrave": "ì", + "iquest": "¿", + "iuml": "ï", + "laquo": "«", + "lt": "<", + "macr": "¯", + "micro": "µ", + "middot": "·", + "nbsp": " ", + "not": "¬", + "ntilde": "ñ", + "oacute": "ó", + "ocirc": "ô", + "ograve": "ò", + "ordf": "ª", + "ordm": "º", + "oslash": "ø", + "otilde": "õ", + "ouml": "ö", + "para": "¶", + "plusmn": "±", + "pound": "£", + "quot": "\"", + "raquo": "»", + "reg": "®", + "sect": "§", + "shy": "­", + "sup1": "¹", + "sup2": "²", + "sup3": "³", + "szlig": "ß", + "thorn": "þ", + "times": "×", + "uacute": "ú", + "ucirc": "û", + "ugrave": "ù", + "uml": "¨", + "uuml": "ü", + "yacute": "ý", + "yen": "¥", + "yuml": "ÿ" +} diff --git a/tools/doc/node_modules/character-entities-legacy/package.json b/tools/doc/node_modules/character-entities-legacy/package.json new file mode 100644 index 00000000000000..904ef65d654394 --- /dev/null +++ b/tools/doc/node_modules/character-entities-legacy/package.json @@ -0,0 +1,98 @@ +{ + "_from": "character-entities-legacy@^1.0.0", + "_id": "character-entities-legacy@1.1.0", + "_inBundle": false, + "_integrity": "sha1-sYqtmPa3vMZGweTIH58ZVjdqVho=", + "_location": "/character-entities-legacy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities-legacy@^1.0.0", + "name": "character-entities-legacy", + "escapedName": "character-entities-legacy", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz", + "_shasum": "b18aad98f6b7bcc646c1e4c81f9f1956376a561a", + "_spec": "character-entities-legacy@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities-legacy/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML legacy character entity information", + "devDependencies": { + "bail": "^1.0.1", + "browserify": "^13.0.1", + "concat-stream": "^1.5.2", + "esmangle": "^1.0.1", + "nyc": "^8.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.0.0", + "xo": "^0.17.0" + }, + "files": [ + "index.json" + ], + "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", + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities-legacy.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-generate && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json --bare -s characterEntitiesLegacy > character-entities-legacy.js", + "build-generate": "node build", + "build-mangle": "esmangle character-entities-legacy.js > character-entities-legacy.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "ignores": [ + "character-entities-legacy.js" + ] + } +} diff --git a/tools/doc/node_modules/character-entities-legacy/readme.md b/tools/doc/node_modules/character-entities-legacy/readme.md new file mode 100644 index 00000000000000..7f6a876820f98a --- /dev/null +++ b/tools/doc/node_modules/character-entities-legacy/readme.md @@ -0,0 +1,54 @@ +# character-entities-legacy [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +HTML legacy character entity information: for legacy reasons some +character entities are not required to have a trailing semicolon: +`©` is perfectly okay for `©`. + +## Installation + +[npm][npm-install]: + +```bash +npm install character-entities-legacy +``` + +## Usage + +```js +console.log(characterEntitiesLegacy.copy); // © +console.log(characterEntitiesLegacy.frac34); // ¾ +console.log(characterEntitiesLegacy.sup1); // ¹ +``` + +## API + +### `characterEntitiesLegacy` + +Mapping between (case-sensitive) legacy character entity names to +replacements. + +## Support + +See [whatwg/html][html]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/character-entities-legacy.svg + +[travis]: https://travis-ci.org/wooorm/character-entities-legacy + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities-legacy.svg + +[codecov]: https://codecov.io/github/wooorm/character-entities-legacy + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[html]: https://raw.githubusercontent.com/whatwg/html/master/json-entities-legacy.inc diff --git a/tools/doc/node_modules/character-entities/LICENSE b/tools/doc/node_modules/character-entities/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/character-entities/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/character-entities/index.json b/tools/doc/node_modules/character-entities/index.json new file mode 100644 index 00000000000000..a63babe093521d --- /dev/null +++ b/tools/doc/node_modules/character-entities/index.json @@ -0,0 +1,2224 @@ +{ + "AEli": "Æ", + "AElig": "Æ", + "AM": "&", + "AMP": "&", + "Aacut": "Á", + "Aacute": "Á", + "Abreve": "Ă", + "Acir": "Â", + "Acirc": "Â", + "Acy": "А", + "Afr": "𝔄", + "Agrav": "À", + "Agrave": "À", + "Alpha": "Α", + "Amacr": "Ā", + "And": "⩓", + "Aogon": "Ą", + "Aopf": "𝔸", + "ApplyFunction": "⁡", + "Arin": "Å", + "Aring": "Å", + "Ascr": "𝒜", + "Assign": "≔", + "Atild": "Ã", + "Atilde": "Ã", + "Aum": "Ä", + "Auml": "Ä", + "Backslash": "∖", + "Barv": "⫧", + "Barwed": "⌆", + "Bcy": "Б", + "Because": "∵", + "Bernoullis": "ℬ", + "Beta": "Β", + "Bfr": "𝔅", + "Bopf": "𝔹", + "Breve": "˘", + "Bscr": "ℬ", + "Bumpeq": "≎", + "CHcy": "Ч", + "COP": "©", + "COPY": "©", + "Cacute": "Ć", + "Cap": "⋒", + "CapitalDifferentialD": "ⅅ", + "Cayleys": "ℭ", + "Ccaron": "Č", + "Ccedi": "Ç", + "Ccedil": "Ç", + "Ccirc": "Ĉ", + "Cconint": "∰", + "Cdot": "Ċ", + "Cedilla": "¸", + "CenterDot": "·", + "Cfr": "ℭ", + "Chi": "Χ", + "CircleDot": "⊙", + "CircleMinus": "⊖", + "CirclePlus": "⊕", + "CircleTimes": "⊗", + "ClockwiseContourIntegral": "∲", + "CloseCurlyDoubleQuote": "”", + "CloseCurlyQuote": "’", + "Colon": "∷", + "Colone": "⩴", + "Congruent": "≡", + "Conint": "∯", + "ContourIntegral": "∮", + "Copf": "ℂ", + "Coproduct": "∐", + "CounterClockwiseContourIntegral": "∳", + "Cross": "⨯", + "Cscr": "𝒞", + "Cup": "⋓", + "CupCap": "≍", + "DD": "ⅅ", + "DDotrahd": "⤑", + "DJcy": "Ђ", + "DScy": "Ѕ", + "DZcy": "Џ", + "Dagger": "‡", + "Darr": "↡", + "Dashv": "⫤", + "Dcaron": "Ď", + "Dcy": "Д", + "Del": "∇", + "Delta": "Δ", + "Dfr": "𝔇", + "DiacriticalAcute": "´", + "DiacriticalDot": "˙", + "DiacriticalDoubleAcute": "˝", + "DiacriticalGrave": "`", + "DiacriticalTilde": "˜", + "Diamond": "⋄", + "DifferentialD": "ⅆ", + "Dopf": "𝔻", + "Dot": "¨", + "DotDot": "⃜", + "DotEqual": "≐", + "DoubleContourIntegral": "∯", + "DoubleDot": "¨", + "DoubleDownArrow": "⇓", + "DoubleLeftArrow": "⇐", + "DoubleLeftRightArrow": "⇔", + "DoubleLeftTee": "⫤", + "DoubleLongLeftArrow": "⟸", + "DoubleLongLeftRightArrow": "⟺", + "DoubleLongRightArrow": "⟹", + "DoubleRightArrow": "⇒", + "DoubleRightTee": "⊨", + "DoubleUpArrow": "⇑", + "DoubleUpDownArrow": "⇕", + "DoubleVerticalBar": "∥", + "DownArrow": "↓", + "DownArrowBar": "⤓", + "DownArrowUpArrow": "⇵", + "DownBreve": "̑", + "DownLeftRightVector": "⥐", + "DownLeftTeeVector": "⥞", + "DownLeftVector": "↽", + "DownLeftVectorBar": "⥖", + "DownRightTeeVector": "⥟", + "DownRightVector": "⇁", + "DownRightVectorBar": "⥗", + "DownTee": "⊤", + "DownTeeArrow": "↧", + "Downarrow": "⇓", + "Dscr": "𝒟", + "Dstrok": "Đ", + "ENG": "Ŋ", + "ET": "Ð", + "ETH": "Ð", + "Eacut": "É", + "Eacute": "É", + "Ecaron": "Ě", + "Ecir": "Ê", + "Ecirc": "Ê", + "Ecy": "Э", + "Edot": "Ė", + "Efr": "𝔈", + "Egrav": "È", + "Egrave": "È", + "Element": "∈", + "Emacr": "Ē", + "EmptySmallSquare": "◻", + "EmptyVerySmallSquare": "▫", + "Eogon": "Ę", + "Eopf": "𝔼", + "Epsilon": "Ε", + "Equal": "⩵", + "EqualTilde": "≂", + "Equilibrium": "⇌", + "Escr": "ℰ", + "Esim": "⩳", + "Eta": "Η", + "Eum": "Ë", + "Euml": "Ë", + "Exists": "∃", + "ExponentialE": "ⅇ", + "Fcy": "Ф", + "Ffr": "𝔉", + "FilledSmallSquare": "◼", + "FilledVerySmallSquare": "▪", + "Fopf": "𝔽", + "ForAll": "∀", + "Fouriertrf": "ℱ", + "Fscr": "ℱ", + "GJcy": "Ѓ", + "G": ">", + "GT": ">", + "Gamma": "Γ", + "Gammad": "Ϝ", + "Gbreve": "Ğ", + "Gcedil": "Ģ", + "Gcirc": "Ĝ", + "Gcy": "Г", + "Gdot": "Ġ", + "Gfr": "𝔊", + "Gg": "⋙", + "Gopf": "𝔾", + "GreaterEqual": "≥", + "GreaterEqualLess": "⋛", + "GreaterFullEqual": "≧", + "GreaterGreater": "⪢", + "GreaterLess": "≷", + "GreaterSlantEqual": "⩾", + "GreaterTilde": "≳", + "Gscr": "𝒢", + "Gt": "≫", + "HARDcy": "Ъ", + "Hacek": "ˇ", + "Hat": "^", + "Hcirc": "Ĥ", + "Hfr": "ℌ", + "HilbertSpace": "ℋ", + "Hopf": "ℍ", + "HorizontalLine": "─", + "Hscr": "ℋ", + "Hstrok": "Ħ", + "HumpDownHump": "≎", + "HumpEqual": "≏", + "IEcy": "Е", + "IJlig": "IJ", + "IOcy": "Ё", + "Iacut": "Í", + "Iacute": "Í", + "Icir": "Î", + "Icirc": "Î", + "Icy": "И", + "Idot": "İ", + "Ifr": "ℑ", + "Igrav": "Ì", + "Igrave": "Ì", + "Im": "ℑ", + "Imacr": "Ī", + "ImaginaryI": "ⅈ", + "Implies": "⇒", + "Int": "∬", + "Integral": "∫", + "Intersection": "⋂", + "InvisibleComma": "⁣", + "InvisibleTimes": "⁢", + "Iogon": "Į", + "Iopf": "𝕀", + "Iota": "Ι", + "Iscr": "ℐ", + "Itilde": "Ĩ", + "Iukcy": "І", + "Ium": "Ï", + "Iuml": "Ï", + "Jcirc": "Ĵ", + "Jcy": "Й", + "Jfr": "𝔍", + "Jopf": "𝕁", + "Jscr": "𝒥", + "Jsercy": "Ј", + "Jukcy": "Є", + "KHcy": "Х", + "KJcy": "Ќ", + "Kappa": "Κ", + "Kcedil": "Ķ", + "Kcy": "К", + "Kfr": "𝔎", + "Kopf": "𝕂", + "Kscr": "𝒦", + "LJcy": "Љ", + "L": "<", + "LT": "<", + "Lacute": "Ĺ", + "Lambda": "Λ", + "Lang": "⟪", + "Laplacetrf": "ℒ", + "Larr": "↞", + "Lcaron": "Ľ", + "Lcedil": "Ļ", + "Lcy": "Л", + "LeftAngleBracket": "⟨", + "LeftArrow": "←", + "LeftArrowBar": "⇤", + "LeftArrowRightArrow": "⇆", + "LeftCeiling": "⌈", + "LeftDoubleBracket": "⟦", + "LeftDownTeeVector": "⥡", + "LeftDownVector": "⇃", + "LeftDownVectorBar": "⥙", + "LeftFloor": "⌊", + "LeftRightArrow": "↔", + "LeftRightVector": "⥎", + "LeftTee": "⊣", + "LeftTeeArrow": "↤", + "LeftTeeVector": "⥚", + "LeftTriangle": "⊲", + "LeftTriangleBar": "⧏", + "LeftTriangleEqual": "⊴", + "LeftUpDownVector": "⥑", + "LeftUpTeeVector": "⥠", + "LeftUpVector": "↿", + "LeftUpVectorBar": "⥘", + "LeftVector": "↼", + "LeftVectorBar": "⥒", + "Leftarrow": "⇐", + "Leftrightarrow": "⇔", + "LessEqualGreater": "⋚", + "LessFullEqual": "≦", + "LessGreater": "≶", + "LessLess": "⪡", + "LessSlantEqual": "⩽", + "LessTilde": "≲", + "Lfr": "𝔏", + "Ll": "⋘", + "Lleftarrow": "⇚", + "Lmidot": "Ŀ", + "LongLeftArrow": "⟵", + "LongLeftRightArrow": "⟷", + "LongRightArrow": "⟶", + "Longleftarrow": "⟸", + "Longleftrightarrow": "⟺", + "Longrightarrow": "⟹", + "Lopf": "𝕃", + "LowerLeftArrow": "↙", + "LowerRightArrow": "↘", + "Lscr": "ℒ", + "Lsh": "↰", + "Lstrok": "Ł", + "Lt": "≪", + "Map": "⤅", + "Mcy": "М", + "MediumSpace": " ", + "Mellintrf": "ℳ", + "Mfr": "𝔐", + "MinusPlus": "∓", + "Mopf": "𝕄", + "Mscr": "ℳ", + "Mu": "Μ", + "NJcy": "Њ", + "Nacute": "Ń", + "Ncaron": "Ň", + "Ncedil": "Ņ", + "Ncy": "Н", + "NegativeMediumSpace": "​", + "NegativeThickSpace": "​", + "NegativeThinSpace": "​", + "NegativeVeryThinSpace": "​", + "NestedGreaterGreater": "≫", + "NestedLessLess": "≪", + "NewLine": "\n", + "Nfr": "𝔑", + "NoBreak": "⁠", + "NonBreakingSpace": " ", + "Nopf": "ℕ", + "Not": "⫬", + "NotCongruent": "≢", + "NotCupCap": "≭", + "NotDoubleVerticalBar": "∦", + "NotElement": "∉", + "NotEqual": "≠", + "NotEqualTilde": "≂̸", + "NotExists": "∄", + "NotGreater": "≯", + "NotGreaterEqual": "≱", + "NotGreaterFullEqual": "≧̸", + "NotGreaterGreater": "≫̸", + "NotGreaterLess": "≹", + "NotGreaterSlantEqual": "⩾̸", + "NotGreaterTilde": "≵", + "NotHumpDownHump": "≎̸", + "NotHumpEqual": "≏̸", + "NotLeftTriangle": "⋪", + "NotLeftTriangleBar": "⧏̸", + "NotLeftTriangleEqual": "⋬", + "NotLess": "≮", + "NotLessEqual": "≰", + "NotLessGreater": "≸", + "NotLessLess": "≪̸", + "NotLessSlantEqual": "⩽̸", + "NotLessTilde": "≴", + "NotNestedGreaterGreater": "⪢̸", + "NotNestedLessLess": "⪡̸", + "NotPrecedes": "⊀", + "NotPrecedesEqual": "⪯̸", + "NotPrecedesSlantEqual": "⋠", + "NotReverseElement": "∌", + "NotRightTriangle": "⋫", + "NotRightTriangleBar": "⧐̸", + "NotRightTriangleEqual": "⋭", + "NotSquareSubset": "⊏̸", + "NotSquareSubsetEqual": "⋢", + "NotSquareSuperset": "⊐̸", + "NotSquareSupersetEqual": "⋣", + "NotSubset": "⊂⃒", + "NotSubsetEqual": "⊈", + "NotSucceeds": "⊁", + "NotSucceedsEqual": "⪰̸", + "NotSucceedsSlantEqual": "⋡", + "NotSucceedsTilde": "≿̸", + "NotSuperset": "⊃⃒", + "NotSupersetEqual": "⊉", + "NotTilde": "≁", + "NotTildeEqual": "≄", + "NotTildeFullEqual": "≇", + "NotTildeTilde": "≉", + "NotVerticalBar": "∤", + "Nscr": "𝒩", + "Ntild": "Ñ", + "Ntilde": "Ñ", + "Nu": "Ν", + "OElig": "Œ", + "Oacut": "Ó", + "Oacute": "Ó", + "Ocir": "Ô", + "Ocirc": "Ô", + "Ocy": "О", + "Odblac": "Ő", + "Ofr": "𝔒", + "Ograv": "Ò", + "Ograve": "Ò", + "Omacr": "Ō", + "Omega": "Ω", + "Omicron": "Ο", + "Oopf": "𝕆", + "OpenCurlyDoubleQuote": "“", + "OpenCurlyQuote": "‘", + "Or": "⩔", + "Oscr": "𝒪", + "Oslas": "Ø", + "Oslash": "Ø", + "Otild": "Õ", + "Otilde": "Õ", + "Otimes": "⨷", + "Oum": "Ö", + "Ouml": "Ö", + "OverBar": "‾", + "OverBrace": "⏞", + "OverBracket": "⎴", + "OverParenthesis": "⏜", + "PartialD": "∂", + "Pcy": "П", + "Pfr": "𝔓", + "Phi": "Φ", + "Pi": "Π", + "PlusMinus": "±", + "Poincareplane": "ℌ", + "Popf": "ℙ", + "Pr": "⪻", + "Precedes": "≺", + "PrecedesEqual": "⪯", + "PrecedesSlantEqual": "≼", + "PrecedesTilde": "≾", + "Prime": "″", + "Product": "∏", + "Proportion": "∷", + "Proportional": "∝", + "Pscr": "𝒫", + "Psi": "Ψ", + "QUO": "\"", + "QUOT": "\"", + "Qfr": "𝔔", + "Qopf": "ℚ", + "Qscr": "𝒬", + "RBarr": "⤐", + "RE": "®", + "REG": "®", + "Racute": "Ŕ", + "Rang": "⟫", + "Rarr": "↠", + "Rarrtl": "⤖", + "Rcaron": "Ř", + "Rcedil": "Ŗ", + "Rcy": "Р", + "Re": "ℜ", + "ReverseElement": "∋", + "ReverseEquilibrium": "⇋", + "ReverseUpEquilibrium": "⥯", + "Rfr": "ℜ", + "Rho": "Ρ", + "RightAngleBracket": "⟩", + "RightArrow": "→", + "RightArrowBar": "⇥", + "RightArrowLeftArrow": "⇄", + "RightCeiling": "⌉", + "RightDoubleBracket": "⟧", + "RightDownTeeVector": "⥝", + "RightDownVector": "⇂", + "RightDownVectorBar": "⥕", + "RightFloor": "⌋", + "RightTee": "⊢", + "RightTeeArrow": "↦", + "RightTeeVector": "⥛", + "RightTriangle": "⊳", + "RightTriangleBar": "⧐", + "RightTriangleEqual": "⊵", + "RightUpDownVector": "⥏", + "RightUpTeeVector": "⥜", + "RightUpVector": "↾", + "RightUpVectorBar": "⥔", + "RightVector": "⇀", + "RightVectorBar": "⥓", + "Rightarrow": "⇒", + "Ropf": "ℝ", + "RoundImplies": "⥰", + "Rrightarrow": "⇛", + "Rscr": "ℛ", + "Rsh": "↱", + "RuleDelayed": "⧴", + "SHCHcy": "Щ", + "SHcy": "Ш", + "SOFTcy": "Ь", + "Sacute": "Ś", + "Sc": "⪼", + "Scaron": "Š", + "Scedil": "Ş", + "Scirc": "Ŝ", + "Scy": "С", + "Sfr": "𝔖", + "ShortDownArrow": "↓", + "ShortLeftArrow": "←", + "ShortRightArrow": "→", + "ShortUpArrow": "↑", + "Sigma": "Σ", + "SmallCircle": "∘", + "Sopf": "𝕊", + "Sqrt": "√", + "Square": "□", + "SquareIntersection": "⊓", + "SquareSubset": "⊏", + "SquareSubsetEqual": "⊑", + "SquareSuperset": "⊐", + "SquareSupersetEqual": "⊒", + "SquareUnion": "⊔", + "Sscr": "𝒮", + "Star": "⋆", + "Sub": "⋐", + "Subset": "⋐", + "SubsetEqual": "⊆", + "Succeeds": "≻", + "SucceedsEqual": "⪰", + "SucceedsSlantEqual": "≽", + "SucceedsTilde": "≿", + "SuchThat": "∋", + "Sum": "∑", + "Sup": "⋑", + "Superset": "⊃", + "SupersetEqual": "⊇", + "Supset": "⋑", + "THOR": "Þ", + "THORN": "Þ", + "TRADE": "™", + "TSHcy": "Ћ", + "TScy": "Ц", + "Tab": "\t", + "Tau": "Τ", + "Tcaron": "Ť", + "Tcedil": "Ţ", + "Tcy": "Т", + "Tfr": "𝔗", + "Therefore": "∴", + "Theta": "Θ", + "ThickSpace": "  ", + "ThinSpace": " ", + "Tilde": "∼", + "TildeEqual": "≃", + "TildeFullEqual": "≅", + "TildeTilde": "≈", + "Topf": "𝕋", + "TripleDot": "⃛", + "Tscr": "𝒯", + "Tstrok": "Ŧ", + "Uacut": "Ú", + "Uacute": "Ú", + "Uarr": "↟", + "Uarrocir": "⥉", + "Ubrcy": "Ў", + "Ubreve": "Ŭ", + "Ucir": "Û", + "Ucirc": "Û", + "Ucy": "У", + "Udblac": "Ű", + "Ufr": "𝔘", + "Ugrav": "Ù", + "Ugrave": "Ù", + "Umacr": "Ū", + "UnderBar": "_", + "UnderBrace": "⏟", + "UnderBracket": "⎵", + "UnderParenthesis": "⏝", + "Union": "⋃", + "UnionPlus": "⊎", + "Uogon": "Ų", + "Uopf": "𝕌", + "UpArrow": "↑", + "UpArrowBar": "⤒", + "UpArrowDownArrow": "⇅", + "UpDownArrow": "↕", + "UpEquilibrium": "⥮", + "UpTee": "⊥", + "UpTeeArrow": "↥", + "Uparrow": "⇑", + "Updownarrow": "⇕", + "UpperLeftArrow": "↖", + "UpperRightArrow": "↗", + "Upsi": "ϒ", + "Upsilon": "Υ", + "Uring": "Ů", + "Uscr": "𝒰", + "Utilde": "Ũ", + "Uum": "Ü", + "Uuml": "Ü", + "VDash": "⊫", + "Vbar": "⫫", + "Vcy": "В", + "Vdash": "⊩", + "Vdashl": "⫦", + "Vee": "⋁", + "Verbar": "‖", + "Vert": "‖", + "VerticalBar": "∣", + "VerticalLine": "|", + "VerticalSeparator": "❘", + "VerticalTilde": "≀", + "VeryThinSpace": " ", + "Vfr": "𝔙", + "Vopf": "𝕍", + "Vscr": "𝒱", + "Vvdash": "⊪", + "Wcirc": "Ŵ", + "Wedge": "⋀", + "Wfr": "𝔚", + "Wopf": "𝕎", + "Wscr": "𝒲", + "Xfr": "𝔛", + "Xi": "Ξ", + "Xopf": "𝕏", + "Xscr": "𝒳", + "YAcy": "Я", + "YIcy": "Ї", + "YUcy": "Ю", + "Yacut": "Ý", + "Yacute": "Ý", + "Ycirc": "Ŷ", + "Ycy": "Ы", + "Yfr": "𝔜", + "Yopf": "𝕐", + "Yscr": "𝒴", + "Yuml": "Ÿ", + "ZHcy": "Ж", + "Zacute": "Ź", + "Zcaron": "Ž", + "Zcy": "З", + "Zdot": "Ż", + "ZeroWidthSpace": "​", + "Zeta": "Ζ", + "Zfr": "ℨ", + "Zopf": "ℤ", + "Zscr": "𝒵", + "aacut": "á", + "aacute": "á", + "abreve": "ă", + "ac": "∾", + "acE": "∾̳", + "acd": "∿", + "acir": "â", + "acirc": "â", + "acut": "´", + "acute": "´", + "acy": "а", + "aeli": "æ", + "aelig": "æ", + "af": "⁡", + "afr": "𝔞", + "agrav": "à", + "agrave": "à", + "alefsym": "ℵ", + "aleph": "ℵ", + "alpha": "α", + "amacr": "ā", + "amalg": "⨿", + "am": "&", + "amp": "&", + "and": "∧", + "andand": "⩕", + "andd": "⩜", + "andslope": "⩘", + "andv": "⩚", + "ang": "∠", + "ange": "⦤", + "angle": "∠", + "angmsd": "∡", + "angmsdaa": "⦨", + "angmsdab": "⦩", + "angmsdac": "⦪", + "angmsdad": "⦫", + "angmsdae": "⦬", + "angmsdaf": "⦭", + "angmsdag": "⦮", + "angmsdah": "⦯", + "angrt": "∟", + "angrtvb": "⊾", + "angrtvbd": "⦝", + "angsph": "∢", + "angst": "Å", + "angzarr": "⍼", + "aogon": "ą", + "aopf": "𝕒", + "ap": "≈", + "apE": "⩰", + "apacir": "⩯", + "ape": "≊", + "apid": "≋", + "apos": "'", + "approx": "≈", + "approxeq": "≊", + "arin": "å", + "aring": "å", + "ascr": "𝒶", + "ast": "*", + "asymp": "≈", + "asympeq": "≍", + "atild": "ã", + "atilde": "ã", + "aum": "ä", + "auml": "ä", + "awconint": "∳", + "awint": "⨑", + "bNot": "⫭", + "backcong": "≌", + "backepsilon": "϶", + "backprime": "‵", + "backsim": "∽", + "backsimeq": "⋍", + "barvee": "⊽", + "barwed": "⌅", + "barwedge": "⌅", + "bbrk": "⎵", + "bbrktbrk": "⎶", + "bcong": "≌", + "bcy": "б", + "bdquo": "„", + "becaus": "∵", + "because": "∵", + "bemptyv": "⦰", + "bepsi": "϶", + "bernou": "ℬ", + "beta": "β", + "beth": "ℶ", + "between": "≬", + "bfr": "𝔟", + "bigcap": "⋂", + "bigcirc": "◯", + "bigcup": "⋃", + "bigodot": "⨀", + "bigoplus": "⨁", + "bigotimes": "⨂", + "bigsqcup": "⨆", + "bigstar": "★", + "bigtriangledown": "▽", + "bigtriangleup": "△", + "biguplus": "⨄", + "bigvee": "⋁", + "bigwedge": "⋀", + "bkarow": "⤍", + "blacklozenge": "⧫", + "blacksquare": "▪", + "blacktriangle": "▴", + "blacktriangledown": "▾", + "blacktriangleleft": "◂", + "blacktriangleright": "▸", + "blank": "␣", + "blk12": "▒", + "blk14": "░", + "blk34": "▓", + "block": "█", + "bne": "=⃥", + "bnequiv": "≡⃥", + "bnot": "⌐", + "bopf": "𝕓", + "bot": "⊥", + "bottom": "⊥", + "bowtie": "⋈", + "boxDL": "╗", + "boxDR": "╔", + "boxDl": "╖", + "boxDr": "╓", + "boxH": "═", + "boxHD": "╦", + "boxHU": "╩", + "boxHd": "╤", + "boxHu": "╧", + "boxUL": "╝", + "boxUR": "╚", + "boxUl": "╜", + "boxUr": "╙", + "boxV": "║", + "boxVH": "╬", + "boxVL": "╣", + "boxVR": "╠", + "boxVh": "╫", + "boxVl": "╢", + "boxVr": "╟", + "boxbox": "⧉", + "boxdL": "╕", + "boxdR": "╒", + "boxdl": "┐", + "boxdr": "┌", + "boxh": "─", + "boxhD": "╥", + "boxhU": "╨", + "boxhd": "┬", + "boxhu": "┴", + "boxminus": "⊟", + "boxplus": "⊞", + "boxtimes": "⊠", + "boxuL": "╛", + "boxuR": "╘", + "boxul": "┘", + "boxur": "└", + "boxv": "│", + "boxvH": "╪", + "boxvL": "╡", + "boxvR": "╞", + "boxvh": "┼", + "boxvl": "┤", + "boxvr": "├", + "bprime": "‵", + "breve": "˘", + "brvba": "¦", + "brvbar": "¦", + "bscr": "𝒷", + "bsemi": "⁏", + "bsim": "∽", + "bsime": "⋍", + "bsol": "\\", + "bsolb": "⧅", + "bsolhsub": "⟈", + "bull": "•", + "bullet": "•", + "bump": "≎", + "bumpE": "⪮", + "bumpe": "≏", + "bumpeq": "≏", + "cacute": "ć", + "cap": "∩", + "capand": "⩄", + "capbrcup": "⩉", + "capcap": "⩋", + "capcup": "⩇", + "capdot": "⩀", + "caps": "∩︀", + "caret": "⁁", + "caron": "ˇ", + "ccaps": "⩍", + "ccaron": "č", + "ccedi": "ç", + "ccedil": "ç", + "ccirc": "ĉ", + "ccups": "⩌", + "ccupssm": "⩐", + "cdot": "ċ", + "cedi": "¸", + "cedil": "¸", + "cemptyv": "⦲", + "cen": "¢", + "cent": "¢", + "centerdot": "·", + "cfr": "𝔠", + "chcy": "ч", + "check": "✓", + "checkmark": "✓", + "chi": "χ", + "cir": "○", + "cirE": "⧃", + "circ": "ˆ", + "circeq": "≗", + "circlearrowleft": "↺", + "circlearrowright": "↻", + "circledR": "®", + "circledS": "Ⓢ", + "circledast": "⊛", + "circledcirc": "⊚", + "circleddash": "⊝", + "cire": "≗", + "cirfnint": "⨐", + "cirmid": "⫯", + "cirscir": "⧂", + "clubs": "♣", + "clubsuit": "♣", + "colon": ":", + "colone": "≔", + "coloneq": "≔", + "comma": ",", + "commat": "@", + "comp": "∁", + "compfn": "∘", + "complement": "∁", + "complexes": "ℂ", + "cong": "≅", + "congdot": "⩭", + "conint": "∮", + "copf": "𝕔", + "coprod": "∐", + "cop": "©", + "copy": "©", + "copysr": "℗", + "crarr": "↵", + "cross": "✗", + "cscr": "𝒸", + "csub": "⫏", + "csube": "⫑", + "csup": "⫐", + "csupe": "⫒", + "ctdot": "⋯", + "cudarrl": "⤸", + "cudarrr": "⤵", + "cuepr": "⋞", + "cuesc": "⋟", + "cularr": "↶", + "cularrp": "⤽", + "cup": "∪", + "cupbrcap": "⩈", + "cupcap": "⩆", + "cupcup": "⩊", + "cupdot": "⊍", + "cupor": "⩅", + "cups": "∪︀", + "curarr": "↷", + "curarrm": "⤼", + "curlyeqprec": "⋞", + "curlyeqsucc": "⋟", + "curlyvee": "⋎", + "curlywedge": "⋏", + "curre": "¤", + "curren": "¤", + "curvearrowleft": "↶", + "curvearrowright": "↷", + "cuvee": "⋎", + "cuwed": "⋏", + "cwconint": "∲", + "cwint": "∱", + "cylcty": "⌭", + "dArr": "⇓", + "dHar": "⥥", + "dagger": "†", + "daleth": "ℸ", + "darr": "↓", + "dash": "‐", + "dashv": "⊣", + "dbkarow": "⤏", + "dblac": "˝", + "dcaron": "ď", + "dcy": "д", + "dd": "ⅆ", + "ddagger": "‡", + "ddarr": "⇊", + "ddotseq": "⩷", + "de": "°", + "deg": "°", + "delta": "δ", + "demptyv": "⦱", + "dfisht": "⥿", + "dfr": "𝔡", + "dharl": "⇃", + "dharr": "⇂", + "diam": "⋄", + "diamond": "⋄", + "diamondsuit": "♦", + "diams": "♦", + "die": "¨", + "digamma": "ϝ", + "disin": "⋲", + "div": "÷", + "divid": "÷", + "divide": "÷", + "divideontimes": "⋇", + "divonx": "⋇", + "djcy": "ђ", + "dlcorn": "⌞", + "dlcrop": "⌍", + "dollar": "$", + "dopf": "𝕕", + "dot": "˙", + "doteq": "≐", + "doteqdot": "≑", + "dotminus": "∸", + "dotplus": "∔", + "dotsquare": "⊡", + "doublebarwedge": "⌆", + "downarrow": "↓", + "downdownarrows": "⇊", + "downharpoonleft": "⇃", + "downharpoonright": "⇂", + "drbkarow": "⤐", + "drcorn": "⌟", + "drcrop": "⌌", + "dscr": "𝒹", + "dscy": "ѕ", + "dsol": "⧶", + "dstrok": "đ", + "dtdot": "⋱", + "dtri": "▿", + "dtrif": "▾", + "duarr": "⇵", + "duhar": "⥯", + "dwangle": "⦦", + "dzcy": "џ", + "dzigrarr": "⟿", + "eDDot": "⩷", + "eDot": "≑", + "eacut": "é", + "eacute": "é", + "easter": "⩮", + "ecaron": "ě", + "ecir": "ê", + "ecirc": "ê", + "ecolon": "≕", + "ecy": "э", + "edot": "ė", + "ee": "ⅇ", + "efDot": "≒", + "efr": "𝔢", + "eg": "⪚", + "egrav": "è", + "egrave": "è", + "egs": "⪖", + "egsdot": "⪘", + "el": "⪙", + "elinters": "⏧", + "ell": "ℓ", + "els": "⪕", + "elsdot": "⪗", + "emacr": "ē", + "empty": "∅", + "emptyset": "∅", + "emptyv": "∅", + "emsp13": " ", + "emsp14": " ", + "emsp": " ", + "eng": "ŋ", + "ensp": " ", + "eogon": "ę", + "eopf": "𝕖", + "epar": "⋕", + "eparsl": "⧣", + "eplus": "⩱", + "epsi": "ε", + "epsilon": "ε", + "epsiv": "ϵ", + "eqcirc": "≖", + "eqcolon": "≕", + "eqsim": "≂", + "eqslantgtr": "⪖", + "eqslantless": "⪕", + "equals": "=", + "equest": "≟", + "equiv": "≡", + "equivDD": "⩸", + "eqvparsl": "⧥", + "erDot": "≓", + "erarr": "⥱", + "escr": "ℯ", + "esdot": "≐", + "esim": "≂", + "eta": "η", + "et": "ð", + "eth": "ð", + "eum": "ë", + "euml": "ë", + "euro": "€", + "excl": "!", + "exist": "∃", + "expectation": "ℰ", + "exponentiale": "ⅇ", + "fallingdotseq": "≒", + "fcy": "ф", + "female": "♀", + "ffilig": "ffi", + "fflig": "ff", + "ffllig": "ffl", + "ffr": "𝔣", + "filig": "fi", + "fjlig": "fj", + "flat": "♭", + "fllig": "fl", + "fltns": "▱", + "fnof": "ƒ", + "fopf": "𝕗", + "forall": "∀", + "fork": "⋔", + "forkv": "⫙", + "fpartint": "⨍", + "frac1": "¼", + "frac12": "½", + "frac13": "⅓", + "frac14": "¼", + "frac15": "⅕", + "frac16": "⅙", + "frac18": "⅛", + "frac23": "⅔", + "frac25": "⅖", + "frac3": "¾", + "frac34": "¾", + "frac35": "⅗", + "frac38": "⅜", + "frac45": "⅘", + "frac56": "⅚", + "frac58": "⅝", + "frac78": "⅞", + "frasl": "⁄", + "frown": "⌢", + "fscr": "𝒻", + "gE": "≧", + "gEl": "⪌", + "gacute": "ǵ", + "gamma": "γ", + "gammad": "ϝ", + "gap": "⪆", + "gbreve": "ğ", + "gcirc": "ĝ", + "gcy": "г", + "gdot": "ġ", + "ge": "≥", + "gel": "⋛", + "geq": "≥", + "geqq": "≧", + "geqslant": "⩾", + "ges": "⩾", + "gescc": "⪩", + "gesdot": "⪀", + "gesdoto": "⪂", + "gesdotol": "⪄", + "gesl": "⋛︀", + "gesles": "⪔", + "gfr": "𝔤", + "gg": "≫", + "ggg": "⋙", + "gimel": "ℷ", + "gjcy": "ѓ", + "gl": "≷", + "glE": "⪒", + "gla": "⪥", + "glj": "⪤", + "gnE": "≩", + "gnap": "⪊", + "gnapprox": "⪊", + "gne": "⪈", + "gneq": "⪈", + "gneqq": "≩", + "gnsim": "⋧", + "gopf": "𝕘", + "grave": "`", + "gscr": "ℊ", + "gsim": "≳", + "gsime": "⪎", + "gsiml": "⪐", + "g": ">", + "gt": ">", + "gtcc": "⪧", + "gtcir": "⩺", + "gtdot": "⋗", + "gtlPar": "⦕", + "gtquest": "⩼", + "gtrapprox": "⪆", + "gtrarr": "⥸", + "gtrdot": "⋗", + "gtreqless": "⋛", + "gtreqqless": "⪌", + "gtrless": "≷", + "gtrsim": "≳", + "gvertneqq": "≩︀", + "gvnE": "≩︀", + "hArr": "⇔", + "hairsp": " ", + "half": "½", + "hamilt": "ℋ", + "hardcy": "ъ", + "harr": "↔", + "harrcir": "⥈", + "harrw": "↭", + "hbar": "ℏ", + "hcirc": "ĥ", + "hearts": "♥", + "heartsuit": "♥", + "hellip": "…", + "hercon": "⊹", + "hfr": "𝔥", + "hksearow": "⤥", + "hkswarow": "⤦", + "hoarr": "⇿", + "homtht": "∻", + "hookleftarrow": "↩", + "hookrightarrow": "↪", + "hopf": "𝕙", + "horbar": "―", + "hscr": "𝒽", + "hslash": "ℏ", + "hstrok": "ħ", + "hybull": "⁃", + "hyphen": "‐", + "iacut": "í", + "iacute": "í", + "ic": "⁣", + "icir": "î", + "icirc": "î", + "icy": "и", + "iecy": "е", + "iexc": "¡", + "iexcl": "¡", + "iff": "⇔", + "ifr": "𝔦", + "igrav": "ì", + "igrave": "ì", + "ii": "ⅈ", + "iiiint": "⨌", + "iiint": "∭", + "iinfin": "⧜", + "iiota": "℩", + "ijlig": "ij", + "imacr": "ī", + "image": "ℑ", + "imagline": "ℐ", + "imagpart": "ℑ", + "imath": "ı", + "imof": "⊷", + "imped": "Ƶ", + "in": "∈", + "incare": "℅", + "infin": "∞", + "infintie": "⧝", + "inodot": "ı", + "int": "∫", + "intcal": "⊺", + "integers": "ℤ", + "intercal": "⊺", + "intlarhk": "⨗", + "intprod": "⨼", + "iocy": "ё", + "iogon": "į", + "iopf": "𝕚", + "iota": "ι", + "iprod": "⨼", + "iques": "¿", + "iquest": "¿", + "iscr": "𝒾", + "isin": "∈", + "isinE": "⋹", + "isindot": "⋵", + "isins": "⋴", + "isinsv": "⋳", + "isinv": "∈", + "it": "⁢", + "itilde": "ĩ", + "iukcy": "і", + "ium": "ï", + "iuml": "ï", + "jcirc": "ĵ", + "jcy": "й", + "jfr": "𝔧", + "jmath": "ȷ", + "jopf": "𝕛", + "jscr": "𝒿", + "jsercy": "ј", + "jukcy": "є", + "kappa": "κ", + "kappav": "ϰ", + "kcedil": "ķ", + "kcy": "к", + "kfr": "𝔨", + "kgreen": "ĸ", + "khcy": "х", + "kjcy": "ќ", + "kopf": "𝕜", + "kscr": "𝓀", + "lAarr": "⇚", + "lArr": "⇐", + "lAtail": "⤛", + "lBarr": "⤎", + "lE": "≦", + "lEg": "⪋", + "lHar": "⥢", + "lacute": "ĺ", + "laemptyv": "⦴", + "lagran": "ℒ", + "lambda": "λ", + "lang": "⟨", + "langd": "⦑", + "langle": "⟨", + "lap": "⪅", + "laqu": "«", + "laquo": "«", + "larr": "←", + "larrb": "⇤", + "larrbfs": "⤟", + "larrfs": "⤝", + "larrhk": "↩", + "larrlp": "↫", + "larrpl": "⤹", + "larrsim": "⥳", + "larrtl": "↢", + "lat": "⪫", + "latail": "⤙", + "late": "⪭", + "lates": "⪭︀", + "lbarr": "⤌", + "lbbrk": "❲", + "lbrace": "{", + "lbrack": "[", + "lbrke": "⦋", + "lbrksld": "⦏", + "lbrkslu": "⦍", + "lcaron": "ľ", + "lcedil": "ļ", + "lceil": "⌈", + "lcub": "{", + "lcy": "л", + "ldca": "⤶", + "ldquo": "“", + "ldquor": "„", + "ldrdhar": "⥧", + "ldrushar": "⥋", + "ldsh": "↲", + "le": "≤", + "leftarrow": "←", + "leftarrowtail": "↢", + "leftharpoondown": "↽", + "leftharpoonup": "↼", + "leftleftarrows": "⇇", + "leftrightarrow": "↔", + "leftrightarrows": "⇆", + "leftrightharpoons": "⇋", + "leftrightsquigarrow": "↭", + "leftthreetimes": "⋋", + "leg": "⋚", + "leq": "≤", + "leqq": "≦", + "leqslant": "⩽", + "les": "⩽", + "lescc": "⪨", + "lesdot": "⩿", + "lesdoto": "⪁", + "lesdotor": "⪃", + "lesg": "⋚︀", + "lesges": "⪓", + "lessapprox": "⪅", + "lessdot": "⋖", + "lesseqgtr": "⋚", + "lesseqqgtr": "⪋", + "lessgtr": "≶", + "lesssim": "≲", + "lfisht": "⥼", + "lfloor": "⌊", + "lfr": "𝔩", + "lg": "≶", + "lgE": "⪑", + "lhard": "↽", + "lharu": "↼", + "lharul": "⥪", + "lhblk": "▄", + "ljcy": "љ", + "ll": "≪", + "llarr": "⇇", + "llcorner": "⌞", + "llhard": "⥫", + "lltri": "◺", + "lmidot": "ŀ", + "lmoust": "⎰", + "lmoustache": "⎰", + "lnE": "≨", + "lnap": "⪉", + "lnapprox": "⪉", + "lne": "⪇", + "lneq": "⪇", + "lneqq": "≨", + "lnsim": "⋦", + "loang": "⟬", + "loarr": "⇽", + "lobrk": "⟦", + "longleftarrow": "⟵", + "longleftrightarrow": "⟷", + "longmapsto": "⟼", + "longrightarrow": "⟶", + "looparrowleft": "↫", + "looparrowright": "↬", + "lopar": "⦅", + "lopf": "𝕝", + "loplus": "⨭", + "lotimes": "⨴", + "lowast": "∗", + "lowbar": "_", + "loz": "◊", + "lozenge": "◊", + "lozf": "⧫", + "lpar": "(", + "lparlt": "⦓", + "lrarr": "⇆", + "lrcorner": "⌟", + "lrhar": "⇋", + "lrhard": "⥭", + "lrm": "‎", + "lrtri": "⊿", + "lsaquo": "‹", + "lscr": "𝓁", + "lsh": "↰", + "lsim": "≲", + "lsime": "⪍", + "lsimg": "⪏", + "lsqb": "[", + "lsquo": "‘", + "lsquor": "‚", + "lstrok": "ł", + "l": "<", + "lt": "<", + "ltcc": "⪦", + "ltcir": "⩹", + "ltdot": "⋖", + "lthree": "⋋", + "ltimes": "⋉", + "ltlarr": "⥶", + "ltquest": "⩻", + "ltrPar": "⦖", + "ltri": "◃", + "ltrie": "⊴", + "ltrif": "◂", + "lurdshar": "⥊", + "luruhar": "⥦", + "lvertneqq": "≨︀", + "lvnE": "≨︀", + "mDDot": "∺", + "mac": "¯", + "macr": "¯", + "male": "♂", + "malt": "✠", + "maltese": "✠", + "map": "↦", + "mapsto": "↦", + "mapstodown": "↧", + "mapstoleft": "↤", + "mapstoup": "↥", + "marker": "▮", + "mcomma": "⨩", + "mcy": "м", + "mdash": "—", + "measuredangle": "∡", + "mfr": "𝔪", + "mho": "℧", + "micr": "µ", + "micro": "µ", + "mid": "∣", + "midast": "*", + "midcir": "⫰", + "middo": "·", + "middot": "·", + "minus": "−", + "minusb": "⊟", + "minusd": "∸", + "minusdu": "⨪", + "mlcp": "⫛", + "mldr": "…", + "mnplus": "∓", + "models": "⊧", + "mopf": "𝕞", + "mp": "∓", + "mscr": "𝓂", + "mstpos": "∾", + "mu": "μ", + "multimap": "⊸", + "mumap": "⊸", + "nGg": "⋙̸", + "nGt": "≫⃒", + "nGtv": "≫̸", + "nLeftarrow": "⇍", + "nLeftrightarrow": "⇎", + "nLl": "⋘̸", + "nLt": "≪⃒", + "nLtv": "≪̸", + "nRightarrow": "⇏", + "nVDash": "⊯", + "nVdash": "⊮", + "nabla": "∇", + "nacute": "ń", + "nang": "∠⃒", + "nap": "≉", + "napE": "⩰̸", + "napid": "≋̸", + "napos": "ʼn", + "napprox": "≉", + "natur": "♮", + "natural": "♮", + "naturals": "ℕ", + "nbs": " ", + "nbsp": " ", + "nbump": "≎̸", + "nbumpe": "≏̸", + "ncap": "⩃", + "ncaron": "ň", + "ncedil": "ņ", + "ncong": "≇", + "ncongdot": "⩭̸", + "ncup": "⩂", + "ncy": "н", + "ndash": "–", + "ne": "≠", + "neArr": "⇗", + "nearhk": "⤤", + "nearr": "↗", + "nearrow": "↗", + "nedot": "≐̸", + "nequiv": "≢", + "nesear": "⤨", + "nesim": "≂̸", + "nexist": "∄", + "nexists": "∄", + "nfr": "𝔫", + "ngE": "≧̸", + "nge": "≱", + "ngeq": "≱", + "ngeqq": "≧̸", + "ngeqslant": "⩾̸", + "nges": "⩾̸", + "ngsim": "≵", + "ngt": "≯", + "ngtr": "≯", + "nhArr": "⇎", + "nharr": "↮", + "nhpar": "⫲", + "ni": "∋", + "nis": "⋼", + "nisd": "⋺", + "niv": "∋", + "njcy": "њ", + "nlArr": "⇍", + "nlE": "≦̸", + "nlarr": "↚", + "nldr": "‥", + "nle": "≰", + "nleftarrow": "↚", + "nleftrightarrow": "↮", + "nleq": "≰", + "nleqq": "≦̸", + "nleqslant": "⩽̸", + "nles": "⩽̸", + "nless": "≮", + "nlsim": "≴", + "nlt": "≮", + "nltri": "⋪", + "nltrie": "⋬", + "nmid": "∤", + "nopf": "𝕟", + "no": "¬", + "not": "¬", + "notin": "∉", + "notinE": "⋹̸", + "notindot": "⋵̸", + "notinva": "∉", + "notinvb": "⋷", + "notinvc": "⋶", + "notni": "∌", + "notniva": "∌", + "notnivb": "⋾", + "notnivc": "⋽", + "npar": "∦", + "nparallel": "∦", + "nparsl": "⫽⃥", + "npart": "∂̸", + "npolint": "⨔", + "npr": "⊀", + "nprcue": "⋠", + "npre": "⪯̸", + "nprec": "⊀", + "npreceq": "⪯̸", + "nrArr": "⇏", + "nrarr": "↛", + "nrarrc": "⤳̸", + "nrarrw": "↝̸", + "nrightarrow": "↛", + "nrtri": "⋫", + "nrtrie": "⋭", + "nsc": "⊁", + "nsccue": "⋡", + "nsce": "⪰̸", + "nscr": "𝓃", + "nshortmid": "∤", + "nshortparallel": "∦", + "nsim": "≁", + "nsime": "≄", + "nsimeq": "≄", + "nsmid": "∤", + "nspar": "∦", + "nsqsube": "⋢", + "nsqsupe": "⋣", + "nsub": "⊄", + "nsubE": "⫅̸", + "nsube": "⊈", + "nsubset": "⊂⃒", + "nsubseteq": "⊈", + "nsubseteqq": "⫅̸", + "nsucc": "⊁", + "nsucceq": "⪰̸", + "nsup": "⊅", + "nsupE": "⫆̸", + "nsupe": "⊉", + "nsupset": "⊃⃒", + "nsupseteq": "⊉", + "nsupseteqq": "⫆̸", + "ntgl": "≹", + "ntild": "ñ", + "ntilde": "ñ", + "ntlg": "≸", + "ntriangleleft": "⋪", + "ntrianglelefteq": "⋬", + "ntriangleright": "⋫", + "ntrianglerighteq": "⋭", + "nu": "ν", + "num": "#", + "numero": "№", + "numsp": " ", + "nvDash": "⊭", + "nvHarr": "⤄", + "nvap": "≍⃒", + "nvdash": "⊬", + "nvge": "≥⃒", + "nvgt": ">⃒", + "nvinfin": "⧞", + "nvlArr": "⤂", + "nvle": "≤⃒", + "nvlt": "<⃒", + "nvltrie": "⊴⃒", + "nvrArr": "⤃", + "nvrtrie": "⊵⃒", + "nvsim": "∼⃒", + "nwArr": "⇖", + "nwarhk": "⤣", + "nwarr": "↖", + "nwarrow": "↖", + "nwnear": "⤧", + "oS": "Ⓢ", + "oacut": "ó", + "oacute": "ó", + "oast": "⊛", + "ocir": "ô", + "ocirc": "ô", + "ocy": "о", + "odash": "⊝", + "odblac": "ő", + "odiv": "⨸", + "odot": "⊙", + "odsold": "⦼", + "oelig": "œ", + "ofcir": "⦿", + "ofr": "𝔬", + "ogon": "˛", + "ograv": "ò", + "ograve": "ò", + "ogt": "⧁", + "ohbar": "⦵", + "ohm": "Ω", + "oint": "∮", + "olarr": "↺", + "olcir": "⦾", + "olcross": "⦻", + "oline": "‾", + "olt": "⧀", + "omacr": "ō", + "omega": "ω", + "omicron": "ο", + "omid": "⦶", + "ominus": "⊖", + "oopf": "𝕠", + "opar": "⦷", + "operp": "⦹", + "oplus": "⊕", + "or": "∨", + "orarr": "↻", + "ord": "º", + "order": "ℴ", + "orderof": "ℴ", + "ordf": "ª", + "ordm": "º", + "origof": "⊶", + "oror": "⩖", + "orslope": "⩗", + "orv": "⩛", + "oscr": "ℴ", + "oslas": "ø", + "oslash": "ø", + "osol": "⊘", + "otild": "õ", + "otilde": "õ", + "otimes": "⊗", + "otimesas": "⨶", + "oum": "ö", + "ouml": "ö", + "ovbar": "⌽", + "par": "¶", + "para": "¶", + "parallel": "∥", + "parsim": "⫳", + "parsl": "⫽", + "part": "∂", + "pcy": "п", + "percnt": "%", + "period": ".", + "permil": "‰", + "perp": "⊥", + "pertenk": "‱", + "pfr": "𝔭", + "phi": "φ", + "phiv": "ϕ", + "phmmat": "ℳ", + "phone": "☎", + "pi": "π", + "pitchfork": "⋔", + "piv": "ϖ", + "planck": "ℏ", + "planckh": "ℎ", + "plankv": "ℏ", + "plus": "+", + "plusacir": "⨣", + "plusb": "⊞", + "pluscir": "⨢", + "plusdo": "∔", + "plusdu": "⨥", + "pluse": "⩲", + "plusm": "±", + "plusmn": "±", + "plussim": "⨦", + "plustwo": "⨧", + "pm": "±", + "pointint": "⨕", + "popf": "𝕡", + "poun": "£", + "pound": "£", + "pr": "≺", + "prE": "⪳", + "prap": "⪷", + "prcue": "≼", + "pre": "⪯", + "prec": "≺", + "precapprox": "⪷", + "preccurlyeq": "≼", + "preceq": "⪯", + "precnapprox": "⪹", + "precneqq": "⪵", + "precnsim": "⋨", + "precsim": "≾", + "prime": "′", + "primes": "ℙ", + "prnE": "⪵", + "prnap": "⪹", + "prnsim": "⋨", + "prod": "∏", + "profalar": "⌮", + "profline": "⌒", + "profsurf": "⌓", + "prop": "∝", + "propto": "∝", + "prsim": "≾", + "prurel": "⊰", + "pscr": "𝓅", + "psi": "ψ", + "puncsp": " ", + "qfr": "𝔮", + "qint": "⨌", + "qopf": "𝕢", + "qprime": "⁗", + "qscr": "𝓆", + "quaternions": "ℍ", + "quatint": "⨖", + "quest": "?", + "questeq": "≟", + "quo": "\"", + "quot": "\"", + "rAarr": "⇛", + "rArr": "⇒", + "rAtail": "⤜", + "rBarr": "⤏", + "rHar": "⥤", + "race": "∽̱", + "racute": "ŕ", + "radic": "√", + "raemptyv": "⦳", + "rang": "⟩", + "rangd": "⦒", + "range": "⦥", + "rangle": "⟩", + "raqu": "»", + "raquo": "»", + "rarr": "→", + "rarrap": "⥵", + "rarrb": "⇥", + "rarrbfs": "⤠", + "rarrc": "⤳", + "rarrfs": "⤞", + "rarrhk": "↪", + "rarrlp": "↬", + "rarrpl": "⥅", + "rarrsim": "⥴", + "rarrtl": "↣", + "rarrw": "↝", + "ratail": "⤚", + "ratio": "∶", + "rationals": "ℚ", + "rbarr": "⤍", + "rbbrk": "❳", + "rbrace": "}", + "rbrack": "]", + "rbrke": "⦌", + "rbrksld": "⦎", + "rbrkslu": "⦐", + "rcaron": "ř", + "rcedil": "ŗ", + "rceil": "⌉", + "rcub": "}", + "rcy": "р", + "rdca": "⤷", + "rdldhar": "⥩", + "rdquo": "”", + "rdquor": "”", + "rdsh": "↳", + "real": "ℜ", + "realine": "ℛ", + "realpart": "ℜ", + "reals": "ℝ", + "rect": "▭", + "re": "®", + "reg": "®", + "rfisht": "⥽", + "rfloor": "⌋", + "rfr": "𝔯", + "rhard": "⇁", + "rharu": "⇀", + "rharul": "⥬", + "rho": "ρ", + "rhov": "ϱ", + "rightarrow": "→", + "rightarrowtail": "↣", + "rightharpoondown": "⇁", + "rightharpoonup": "⇀", + "rightleftarrows": "⇄", + "rightleftharpoons": "⇌", + "rightrightarrows": "⇉", + "rightsquigarrow": "↝", + "rightthreetimes": "⋌", + "ring": "˚", + "risingdotseq": "≓", + "rlarr": "⇄", + "rlhar": "⇌", + "rlm": "‏", + "rmoust": "⎱", + "rmoustache": "⎱", + "rnmid": "⫮", + "roang": "⟭", + "roarr": "⇾", + "robrk": "⟧", + "ropar": "⦆", + "ropf": "𝕣", + "roplus": "⨮", + "rotimes": "⨵", + "rpar": ")", + "rpargt": "⦔", + "rppolint": "⨒", + "rrarr": "⇉", + "rsaquo": "›", + "rscr": "𝓇", + "rsh": "↱", + "rsqb": "]", + "rsquo": "’", + "rsquor": "’", + "rthree": "⋌", + "rtimes": "⋊", + "rtri": "▹", + "rtrie": "⊵", + "rtrif": "▸", + "rtriltri": "⧎", + "ruluhar": "⥨", + "rx": "℞", + "sacute": "ś", + "sbquo": "‚", + "sc": "≻", + "scE": "⪴", + "scap": "⪸", + "scaron": "š", + "sccue": "≽", + "sce": "⪰", + "scedil": "ş", + "scirc": "ŝ", + "scnE": "⪶", + "scnap": "⪺", + "scnsim": "⋩", + "scpolint": "⨓", + "scsim": "≿", + "scy": "с", + "sdot": "⋅", + "sdotb": "⊡", + "sdote": "⩦", + "seArr": "⇘", + "searhk": "⤥", + "searr": "↘", + "searrow": "↘", + "sec": "§", + "sect": "§", + "semi": ";", + "seswar": "⤩", + "setminus": "∖", + "setmn": "∖", + "sext": "✶", + "sfr": "𝔰", + "sfrown": "⌢", + "sharp": "♯", + "shchcy": "щ", + "shcy": "ш", + "shortmid": "∣", + "shortparallel": "∥", + "sh": "­", + "shy": "­", + "sigma": "σ", + "sigmaf": "ς", + "sigmav": "ς", + "sim": "∼", + "simdot": "⩪", + "sime": "≃", + "simeq": "≃", + "simg": "⪞", + "simgE": "⪠", + "siml": "⪝", + "simlE": "⪟", + "simne": "≆", + "simplus": "⨤", + "simrarr": "⥲", + "slarr": "←", + "smallsetminus": "∖", + "smashp": "⨳", + "smeparsl": "⧤", + "smid": "∣", + "smile": "⌣", + "smt": "⪪", + "smte": "⪬", + "smtes": "⪬︀", + "softcy": "ь", + "sol": "/", + "solb": "⧄", + "solbar": "⌿", + "sopf": "𝕤", + "spades": "♠", + "spadesuit": "♠", + "spar": "∥", + "sqcap": "⊓", + "sqcaps": "⊓︀", + "sqcup": "⊔", + "sqcups": "⊔︀", + "sqsub": "⊏", + "sqsube": "⊑", + "sqsubset": "⊏", + "sqsubseteq": "⊑", + "sqsup": "⊐", + "sqsupe": "⊒", + "sqsupset": "⊐", + "sqsupseteq": "⊒", + "squ": "□", + "square": "□", + "squarf": "▪", + "squf": "▪", + "srarr": "→", + "sscr": "𝓈", + "ssetmn": "∖", + "ssmile": "⌣", + "sstarf": "⋆", + "star": "☆", + "starf": "★", + "straightepsilon": "ϵ", + "straightphi": "ϕ", + "strns": "¯", + "sub": "⊂", + "subE": "⫅", + "subdot": "⪽", + "sube": "⊆", + "subedot": "⫃", + "submult": "⫁", + "subnE": "⫋", + "subne": "⊊", + "subplus": "⪿", + "subrarr": "⥹", + "subset": "⊂", + "subseteq": "⊆", + "subseteqq": "⫅", + "subsetneq": "⊊", + "subsetneqq": "⫋", + "subsim": "⫇", + "subsub": "⫕", + "subsup": "⫓", + "succ": "≻", + "succapprox": "⪸", + "succcurlyeq": "≽", + "succeq": "⪰", + "succnapprox": "⪺", + "succneqq": "⪶", + "succnsim": "⋩", + "succsim": "≿", + "sum": "∑", + "sung": "♪", + "sup": "⊃", + "sup1": "¹", + "sup2": "²", + "sup3": "³", + "supE": "⫆", + "supdot": "⪾", + "supdsub": "⫘", + "supe": "⊇", + "supedot": "⫄", + "suphsol": "⟉", + "suphsub": "⫗", + "suplarr": "⥻", + "supmult": "⫂", + "supnE": "⫌", + "supne": "⊋", + "supplus": "⫀", + "supset": "⊃", + "supseteq": "⊇", + "supseteqq": "⫆", + "supsetneq": "⊋", + "supsetneqq": "⫌", + "supsim": "⫈", + "supsub": "⫔", + "supsup": "⫖", + "swArr": "⇙", + "swarhk": "⤦", + "swarr": "↙", + "swarrow": "↙", + "swnwar": "⤪", + "szli": "ß", + "szlig": "ß", + "target": "⌖", + "tau": "τ", + "tbrk": "⎴", + "tcaron": "ť", + "tcedil": "ţ", + "tcy": "т", + "tdot": "⃛", + "telrec": "⌕", + "tfr": "𝔱", + "there4": "∴", + "therefore": "∴", + "theta": "θ", + "thetasym": "ϑ", + "thetav": "ϑ", + "thickapprox": "≈", + "thicksim": "∼", + "thinsp": " ", + "thkap": "≈", + "thksim": "∼", + "thor": "þ", + "thorn": "þ", + "tilde": "˜", + "time": "×", + "times": "×", + "timesb": "⊠", + "timesbar": "⨱", + "timesd": "⨰", + "tint": "∭", + "toea": "⤨", + "top": "⊤", + "topbot": "⌶", + "topcir": "⫱", + "topf": "𝕥", + "topfork": "⫚", + "tosa": "⤩", + "tprime": "‴", + "trade": "™", + "triangle": "▵", + "triangledown": "▿", + "triangleleft": "◃", + "trianglelefteq": "⊴", + "triangleq": "≜", + "triangleright": "▹", + "trianglerighteq": "⊵", + "tridot": "◬", + "trie": "≜", + "triminus": "⨺", + "triplus": "⨹", + "trisb": "⧍", + "tritime": "⨻", + "trpezium": "⏢", + "tscr": "𝓉", + "tscy": "ц", + "tshcy": "ћ", + "tstrok": "ŧ", + "twixt": "≬", + "twoheadleftarrow": "↞", + "twoheadrightarrow": "↠", + "uArr": "⇑", + "uHar": "⥣", + "uacut": "ú", + "uacute": "ú", + "uarr": "↑", + "ubrcy": "ў", + "ubreve": "ŭ", + "ucir": "û", + "ucirc": "û", + "ucy": "у", + "udarr": "⇅", + "udblac": "ű", + "udhar": "⥮", + "ufisht": "⥾", + "ufr": "𝔲", + "ugrav": "ù", + "ugrave": "ù", + "uharl": "↿", + "uharr": "↾", + "uhblk": "▀", + "ulcorn": "⌜", + "ulcorner": "⌜", + "ulcrop": "⌏", + "ultri": "◸", + "umacr": "ū", + "um": "¨", + "uml": "¨", + "uogon": "ų", + "uopf": "𝕦", + "uparrow": "↑", + "updownarrow": "↕", + "upharpoonleft": "↿", + "upharpoonright": "↾", + "uplus": "⊎", + "upsi": "υ", + "upsih": "ϒ", + "upsilon": "υ", + "upuparrows": "⇈", + "urcorn": "⌝", + "urcorner": "⌝", + "urcrop": "⌎", + "uring": "ů", + "urtri": "◹", + "uscr": "𝓊", + "utdot": "⋰", + "utilde": "ũ", + "utri": "▵", + "utrif": "▴", + "uuarr": "⇈", + "uum": "ü", + "uuml": "ü", + "uwangle": "⦧", + "vArr": "⇕", + "vBar": "⫨", + "vBarv": "⫩", + "vDash": "⊨", + "vangrt": "⦜", + "varepsilon": "ϵ", + "varkappa": "ϰ", + "varnothing": "∅", + "varphi": "ϕ", + "varpi": "ϖ", + "varpropto": "∝", + "varr": "↕", + "varrho": "ϱ", + "varsigma": "ς", + "varsubsetneq": "⊊︀", + "varsubsetneqq": "⫋︀", + "varsupsetneq": "⊋︀", + "varsupsetneqq": "⫌︀", + "vartheta": "ϑ", + "vartriangleleft": "⊲", + "vartriangleright": "⊳", + "vcy": "в", + "vdash": "⊢", + "vee": "∨", + "veebar": "⊻", + "veeeq": "≚", + "vellip": "⋮", + "verbar": "|", + "vert": "|", + "vfr": "𝔳", + "vltri": "⊲", + "vnsub": "⊂⃒", + "vnsup": "⊃⃒", + "vopf": "𝕧", + "vprop": "∝", + "vrtri": "⊳", + "vscr": "𝓋", + "vsubnE": "⫋︀", + "vsubne": "⊊︀", + "vsupnE": "⫌︀", + "vsupne": "⊋︀", + "vzigzag": "⦚", + "wcirc": "ŵ", + "wedbar": "⩟", + "wedge": "∧", + "wedgeq": "≙", + "weierp": "℘", + "wfr": "𝔴", + "wopf": "𝕨", + "wp": "℘", + "wr": "≀", + "wreath": "≀", + "wscr": "𝓌", + "xcap": "⋂", + "xcirc": "◯", + "xcup": "⋃", + "xdtri": "▽", + "xfr": "𝔵", + "xhArr": "⟺", + "xharr": "⟷", + "xi": "ξ", + "xlArr": "⟸", + "xlarr": "⟵", + "xmap": "⟼", + "xnis": "⋻", + "xodot": "⨀", + "xopf": "𝕩", + "xoplus": "⨁", + "xotime": "⨂", + "xrArr": "⟹", + "xrarr": "⟶", + "xscr": "𝓍", + "xsqcup": "⨆", + "xuplus": "⨄", + "xutri": "△", + "xvee": "⋁", + "xwedge": "⋀", + "yacut": "ý", + "yacute": "ý", + "yacy": "я", + "ycirc": "ŷ", + "ycy": "ы", + "ye": "¥", + "yen": "¥", + "yfr": "𝔶", + "yicy": "ї", + "yopf": "𝕪", + "yscr": "𝓎", + "yucy": "ю", + "yum": "ÿ", + "yuml": "ÿ", + "zacute": "ź", + "zcaron": "ž", + "zcy": "з", + "zdot": "ż", + "zeetrf": "ℨ", + "zeta": "ζ", + "zfr": "𝔷", + "zhcy": "ж", + "zigrarr": "⇝", + "zopf": "𝕫", + "zscr": "𝓏", + "zwj": "‍", + "zwnj": "‌" +} diff --git a/tools/doc/node_modules/character-entities/package.json b/tools/doc/node_modules/character-entities/package.json new file mode 100644 index 00000000000000..7f5a0766e3fd01 --- /dev/null +++ b/tools/doc/node_modules/character-entities/package.json @@ -0,0 +1,97 @@ +{ + "_from": "character-entities@^1.0.0", + "_id": "character-entities@1.2.0", + "_inBundle": false, + "_integrity": "sha1-poPiz3Xb6LFxljUxNk5Y4YobFV8=", + "_location": "/character-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities@^1.0.0", + "name": "character-entities", + "escapedName": "character-entities", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.0.tgz", + "_shasum": "a683e2cf75dbe8b171963531364e58e18a1b155f", + "_spec": "character-entities@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML character entity information", + "devDependencies": { + "bail": "^1.0.1", + "browserify": "^13.0.1", + "concat-stream": "^1.5.2", + "esmangle": "^1.0.1", + "nyc": "^8.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.0.0", + "xo": "^0.17.0" + }, + "files": [ + "index.json" + ], + "homepage": "https://github.com/wooorm/character-entities#readme", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities", + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-generate && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json --bare -s characterEntities > character-entities.js", + "build-generate": "node build", + "build-mangle": "esmangle character-entities.js > character-entities.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.2.0", + "xo": { + "space": true, + "ignores": [ + "character-entities.js" + ] + } +} diff --git a/tools/doc/node_modules/character-entities/readme.md b/tools/doc/node_modules/character-entities/readme.md new file mode 100644 index 00000000000000..8f79f76b2ffeed --- /dev/null +++ b/tools/doc/node_modules/character-entities/readme.md @@ -0,0 +1,53 @@ +# character-entities [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +HTML character entity information. + +## Installation + +[npm][npm-install]: + +```bash +npm install character-entities +``` + +## Usage + +```js +console.log(characterEntities.AElig); // Æ +console.log(characterEntities.aelig); // æ +console.log(characterEntities.amp); // & +``` + +## API + +### characterEntities + +Mapping between (case-sensitive) character entity names to replacements. + +## Support + +See [html.spec.whatwg.org][html]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/character-entities.svg + +[travis]: https://travis-ci.org/wooorm/character-entities + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities.svg + +[codecov]: https://codecov.io/github/wooorm/character-entities + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[html]: https://html.spec.whatwg.org/multipage/syntax.html#named-character-references diff --git a/tools/doc/node_modules/character-reference-invalid/LICENSE b/tools/doc/node_modules/character-reference-invalid/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/character-reference-invalid/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/character-reference-invalid/index.json b/tools/doc/node_modules/character-reference-invalid/index.json new file mode 100644 index 00000000000000..9337a854e40194 --- /dev/null +++ b/tools/doc/node_modules/character-reference-invalid/index.json @@ -0,0 +1,30 @@ +{ + "0": "�", + "128": "€", + "130": "‚", + "131": "ƒ", + "132": "„", + "133": "…", + "134": "†", + "135": "‡", + "136": "ˆ", + "137": "‰", + "138": "Š", + "139": "‹", + "140": "Œ", + "142": "Ž", + "145": "‘", + "146": "’", + "147": "“", + "148": "”", + "149": "•", + "150": "–", + "151": "—", + "152": "˜", + "153": "™", + "154": "š", + "155": "›", + "156": "œ", + "158": "ž", + "159": "Ÿ" +} diff --git a/tools/doc/node_modules/character-reference-invalid/package.json b/tools/doc/node_modules/character-reference-invalid/package.json new file mode 100644 index 00000000000000..11047798eef1af --- /dev/null +++ b/tools/doc/node_modules/character-reference-invalid/package.json @@ -0,0 +1,101 @@ +{ + "_from": "character-reference-invalid@^1.0.0", + "_id": "character-reference-invalid@1.1.0", + "_inBundle": false, + "_integrity": "sha1-3smtHfufjQa0/NqircPE/ZevHmg=", + "_location": "/character-reference-invalid", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-reference-invalid@^1.0.0", + "name": "character-reference-invalid", + "escapedName": "character-reference-invalid", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities" + ], + "_resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.0.tgz", + "_shasum": "dec9ad1dfb9f8d06b4fcdaa2adc3c4fd97af1e68", + "_spec": "character-reference-invalid@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-reference-invalid/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML invalid numeric character reference information", + "devDependencies": { + "bail": "^1.0.1", + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "jsdom": "^9.4.1", + "nyc": "^8.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.0.0", + "xo": "^0.17.0" + }, + "files": [ + "index.json" + ], + "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", + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-reference-invalid.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json --bare -s characterReferenceInvalid > character-reference-invalid.js", + "build-generate": "node build", + "build-mangle": "esmangle character-reference-invalid.js > character-reference-invalid.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "rules": { + "guard-for-in": "off" + }, + "ignores": [ + "character-reference-invalid.js" + ] + } +} diff --git a/tools/doc/node_modules/character-reference-invalid/readme.md b/tools/doc/node_modules/character-reference-invalid/readme.md new file mode 100644 index 00000000000000..ac6e3e1f384991 --- /dev/null +++ b/tools/doc/node_modules/character-reference-invalid/readme.md @@ -0,0 +1,51 @@ +# character-reference-invalid [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +HTML invalid numeric character reference information. + +## Installation + +[npm][npm-install]: + +```bash +npm install character-reference-invalid +``` + +## Usage + +```js +console.log(characterReferenceInvalid[0x80]); // € +console.log(characterReferenceInvalid[0x89]); // ‰ +console.log(characterReferenceInvalid[0x99]); // ™ +``` + +## API + +### `characterReferenceInvalid` + +Mapping between invalid numeric character reference to replacements. + +## Support + +See [html.spec.whatwg.org][html]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/character-reference-invalid.svg + +[travis]: https://travis-ci.org/wooorm/character-reference-invalid + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/character-reference-invalid.svg + +[codecov]: https://codecov.io/github/wooorm/character-reference-invalid + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[html]: https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides diff --git a/tools/doc/node_modules/collapse-white-space/LICENSE b/tools/doc/node_modules/collapse-white-space/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/collapse-white-space/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/collapse-white-space/index.js b/tools/doc/node_modules/collapse-white-space/index.js new file mode 100644 index 00000000000000..dcd14c65de4a8a --- /dev/null +++ b/tools/doc/node_modules/collapse-white-space/index.js @@ -0,0 +1,8 @@ +'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/doc/node_modules/collapse-white-space/package.json b/tools/doc/node_modules/collapse-white-space/package.json new file mode 100644 index 00000000000000..722826af109ea8 --- /dev/null +++ b/tools/doc/node_modules/collapse-white-space/package.json @@ -0,0 +1,94 @@ +{ + "_from": "collapse-white-space@^1.0.2", + "_id": "collapse-white-space@1.0.3", + "_inBundle": false, + "_integrity": "sha1-S5BvZw5aljqHt2sOFolkM0G2Ajw=", + "_location": "/collapse-white-space", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "collapse-white-space@^1.0.2", + "name": "collapse-white-space", + "escapedName": "collapse-white-space", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.3.tgz", + "_shasum": "4b906f670e5a963a87b76b0e1689643341b6023c", + "_spec": "collapse-white-space@^1.0.2", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/collapse-white-space/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Replace multiple white-space characters with a single space", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.1", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/collapse-white-space#readme", + "keywords": [ + "collapse", + "white", + "space" + ], + "license": "MIT", + "name": "collapse-white-space", + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/collapse-white-space.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s collapseWhiteSpace > collapse-white-space.js", + "build-mangle": "esmangle collapse-white-space.js > collapse-white-space.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.0.3", + "xo": { + "space": true, + "esnext": false, + "rules": { + "capitalized-comments": "off" + }, + "ignores": [ + "collapse-white-space.js" + ] + } +} diff --git a/tools/doc/node_modules/collapse-white-space/readme.md b/tools/doc/node_modules/collapse-white-space/readme.md new file mode 100644 index 00000000000000..5cf867a7002957 --- /dev/null +++ b/tools/doc/node_modules/collapse-white-space/readme.md @@ -0,0 +1,45 @@ +# collapse-white-space [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Replace multiple white-space characters with a single space. + +## Installation + +[npm][npm-install]: + +```bash +npm install collapse-white-space +``` + +## Usage + +```javascript +var collapse = require('collapse-white-space'); + +collapse('\tfoo \n\tbar \t\r\nbaz'); //=> ' foo bar baz' +``` + +## API + +### `collapse(value)` + +Replace multiple white-space characters in value with a single space. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/collapse-white-space.svg + +[travis]: https://travis-ci.org/wooorm/collapse-white-space + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/collapse-white-space.svg + +[codecov]: https://codecov.io/github/wooorm/collapse-white-space + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/emoji-regex/LICENSE-MIT.txt b/tools/doc/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 00000000000000..a41e0a7ef970ec --- /dev/null +++ b/tools/doc/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +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/doc/node_modules/emoji-regex/README.md b/tools/doc/node_modules/emoji-regex/README.md new file mode 100644 index 00000000000000..6caa7e30bf2fa8 --- /dev/null +++ b/tools/doc/node_modules/emoji-regex/README.md @@ -0,0 +1,59 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +let match; +while (match = emojiRegex().exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/tools/doc/node_modules/emoji-regex/dist/index.js b/tools/doc/node_modules/emoji-regex/dist/index.js new file mode 100644 index 00000000000000..8857b0487ce132 --- /dev/null +++ b/tools/doc/node_modules/emoji-regex/dist/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + // https://mathiasbynens.be/notes/es-unicode-property-escapes#emoji + return (/(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F/g + ); +}; \ No newline at end of file diff --git a/tools/doc/node_modules/emoji-regex/index.js b/tools/doc/node_modules/emoji-regex/index.js new file mode 100644 index 00000000000000..3c42831e1ad72d --- /dev/null +++ b/tools/doc/node_modules/emoji-regex/index.js @@ -0,0 +1,3 @@ +module.exports = function() { + return /[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD79\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED0\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3]|\uD83E[\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD83C\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uD83C\uDDFE\uD83C[\uDDEA\uDDF9]|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDFC\uD83C[\uDDEB\uDDF8]|\uD83C\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uD83C\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF8\uDDFE\uDDFF]|\uD83C\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uD83C\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uD83C\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uD83C\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uD83C\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uD83C\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uD83C\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uD83C\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uD83C\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uD83C\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uD83C\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uD83C\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uD83C\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uD83C\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uD83C\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uD83C\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|[#\*0-9]\u20E3/g; +}; diff --git a/tools/doc/node_modules/emoji-regex/package.json b/tools/doc/node_modules/emoji-regex/package.json new file mode 100644 index 00000000000000..0b43eb6a25e8ff --- /dev/null +++ b/tools/doc/node_modules/emoji-regex/package.json @@ -0,0 +1,73 @@ +{ + "_from": "emoji-regex@>=6.0.0 <=6.1.1", + "_id": "emoji-regex@6.1.1", + "_inBundle": false, + "_integrity": "sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4=", + "_location": "/emoji-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "emoji-regex@>=6.0.0 <=6.1.1", + "name": "emoji-regex", + "escapedName": "emoji-regex", + "rawSpec": ">=6.0.0 <=6.1.1", + "saveSpec": null, + "fetchSpec": ">=6.0.0 <=6.1.1" + }, + "_requiredBy": [ + "/github-slugger" + ], + "_resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.1.1.tgz", + "_shasum": "c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e", + "_spec": "emoji-regex@>=6.0.0 <=6.1.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/github-slugger", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/emoji-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "devDependencies": { + "babel-cli": "^6.23.0", + "babel-core": "^6.18.2", + "babel-plugin-transform-unicode-property-regex": "^2.0.1", + "babel-preset-es2015": "^6.18.0", + "mocha": "^3.2.0", + "unicode-tr51": "^8.0.1" + }, + "files": [ + "LICENSE-MIT.txt", + "dist/index.js" + ], + "homepage": "https://mths.be/emoji-regex", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "main": "index.js", + "name": "emoji-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/mathiasbynens/emoji-regex.git" + }, + "scripts": { + "build": "babel src -d dist", + "clean": "rm -rf dist", + "prepublish": "npm run clean && npm run build", + "test": "mocha --compilers js:babel-register", + "test:watch": "npm run test -- --watch" + }, + "version": "6.1.1" +} diff --git a/tools/doc/node_modules/extend/.eslintrc b/tools/doc/node_modules/extend/.eslintrc new file mode 100644 index 00000000000000..90b31938e84ab3 --- /dev/null +++ b/tools/doc/node_modules/extend/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 15], + "eqeqeq": [2, "allow-null"], + "func-name-matching": [1], + "max-depth": [1, 4], + "max-statements": [2, 26], + "no-extra-parens": [1], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + "sort-keys": [0], + } +} diff --git a/tools/doc/node_modules/extend/.jscs.json b/tools/doc/node_modules/extend/.jscs.json new file mode 100644 index 00000000000000..0284c86daafec3 --- /dev/null +++ b/tools/doc/node_modules/extend/.jscs.json @@ -0,0 +1,175 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": false, + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/tools/doc/node_modules/extend/.npmignore b/tools/doc/node_modules/extend/.npmignore new file mode 100644 index 00000000000000..30d74d258442c7 --- /dev/null +++ b/tools/doc/node_modules/extend/.npmignore @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/tools/doc/node_modules/extend/.travis.yml b/tools/doc/node_modules/extend/.travis.yml new file mode 100644 index 00000000000000..6bf696c87b872a --- /dev/null +++ b/tools/doc/node_modules/extend/.travis.yml @@ -0,0 +1,179 @@ +language: node_js +os: + - linux +node_js: + - "7.9" + - "6.10" + - "5.12" + - "4.8" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "node" + env: PRETEST=true + - node_js: "node" + env: COVERAGE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + ##- node_js: "7" + #env: TEST=true + #os: osx + #- node_js: "6" + #env: TEST=true + #os: osx + #- node_js: "5" + #env: TEST=true + #os: osx + #- node_js: "4" + #env: TEST=true + #os: osx + #- node_js: "iojs" + #env: TEST=true + #os: osx + #- node_js: "0.12" + #env: TEST=true + #os: osx + #- node_js: "0.10" + #env: TEST=true + #os: osx + #- node_js: "0.8" + #env: TEST=true + #os: osx + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/tools/doc/node_modules/extend/CHANGELOG.md b/tools/doc/node_modules/extend/CHANGELOG.md new file mode 100644 index 00000000000000..0fe528764663d0 --- /dev/null +++ b/tools/doc/node_modules/extend/CHANGELOG.md @@ -0,0 +1,77 @@ +3.0.1 / 2017-04-27 +================== + * [Fix] deep extending should work with a non-object (#46) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. + * [Docs] Add example to readme (#34) + +3.0.0 / 2015-07-01 +================== + * [Possible breaking change] Use global "strict" directive (#32) + * [Tests] `int` is an ES3 reserved word + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Add `npm run eslint` + * [Dev Deps] Update `covert`, `jscs` + +2.0.1 / 2015-04-25 +================== + * Use an inline `isArray` check, for ES3 browsers. (#27) + * Some old browsers fail when an identifier is `toString` + * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds + * Add license info to package.json (#25) + * Update `tape`, `jscs` + * Adding a CHANGELOG + +2.0.0 / 2014-10-01 +================== + * Increase code coverage to 100%; run code coverage as part of tests + * Add `npm run lint`; Run linter as part of tests + * Remove nodeType and setInterval checks in isPlainObject + * Updating `tape`, `jscs`, `covert` + * General style and README cleanup + +1.3.0 / 2014-06-20 +================== + * Add component.json for browser support (#18) + * Use SVG for badges in README (#16) + * Updating `tape`, `covert` + * Updating travis-ci to work with multiple node versions + * Fix `deep === false` bug (returning target as {}) (#14) + * Fixing constructor checks in isPlainObject + * Adding additional test coverage + * Adding `npm run coverage` + * Add LICENSE (#13) + * Adding a warning about `false`, per #11 + * General style and whitespace cleanup + +1.2.1 / 2013-09-14 +================== + * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8 + * Updating `tape` + +1.2.0 / 2013-09-02 +================== + * Updating the README: add badges + * Adding a missing variable reference. + * Using `tape` instead of `buster` for tests; add more tests (#7) + * Adding node 0.10 to Travis CI (#6) + * Enabling "npm test" and cleaning up package.json (#5) + * Add Travis CI. + +1.1.3 / 2012-12-06 +================== + * Added unit tests. + * Ensure extend function is named. (Looks nicer in a stack trace.) + * README cleanup. + +1.1.1 / 2012-11-07 +================== + * README cleanup. + * Added installation instructions. + * Added a missing semicolon + +1.0.0 / 2012-04-08 +================== + * Initial commit + diff --git a/tools/doc/node_modules/extend/LICENSE b/tools/doc/node_modules/extend/LICENSE new file mode 100644 index 00000000000000..e16d6a56ca64e2 --- /dev/null +++ b/tools/doc/node_modules/extend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +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/doc/node_modules/extend/README.md b/tools/doc/node_modules/extend/README.md new file mode 100644 index 00000000000000..5b8249aa95e5d3 --- /dev/null +++ b/tools/doc/node_modules/extend/README.md @@ -0,0 +1,81 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +Notes: + +* Since Node.js >= 4, + [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + now offers the same functionality natively (but without the "deep copy" option). + See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). +* Some native implementations of `Object.assign` in both Node.js and many + browsers (since NPM modules are for the browser too) may not be fully + spec-compliant. + Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for + a compliant candidate. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +**Example:** + +``` js +var extend = require('extend'); +extend(targetObject, object1, object2); +``` + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/tools/doc/node_modules/extend/component.json b/tools/doc/node_modules/extend/component.json new file mode 100644 index 00000000000000..1500a2f3718182 --- /dev/null +++ b/tools/doc/node_modules/extend/component.json @@ -0,0 +1,32 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.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": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} + diff --git a/tools/doc/node_modules/extend/index.js b/tools/doc/node_modules/extend/index.js new file mode 100644 index 00000000000000..bbe53f66083ce6 --- /dev/null +++ b/tools/doc/node_modules/extend/index.js @@ -0,0 +1,86 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; diff --git a/tools/doc/node_modules/extend/package.json b/tools/doc/node_modules/extend/package.json new file mode 100644 index 00000000000000..4ef0698fd755a4 --- /dev/null +++ b/tools/doc/node_modules/extend/package.json @@ -0,0 +1,75 @@ +{ + "_from": "extend@^3.0.0", + "_id": "extend@3.0.1", + "_inBundle": false, + "_integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "_location": "/extend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend@^3.0.0", + "name": "extend", + "escapedName": "extend", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "_shasum": "a755ea7bc1adfcc5a31ce7e762dbaadc5e636444", + "_spec": "extend@^3.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "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": "^11.0.0", + "covert": "^1.1.0", + "eslint": "^3.19.0", + "jscs": "^3.0.7", + "tape": "^4.6.3" + }, + "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.1" +} diff --git a/tools/doc/node_modules/function-bind/.eslintrc b/tools/doc/node_modules/function-bind/.eslintrc new file mode 100644 index 00000000000000..420b25351af38f --- /dev/null +++ b/tools/doc/node_modules/function-bind/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-nested-callbacks": [2, 3], + "max-params": [2, 3], + "max-statements": [2, 20], + "no-new-func": [1], + "strict": [0] + } +} diff --git a/tools/doc/node_modules/function-bind/.jscs.json b/tools/doc/node_modules/function-bind/.jscs.json new file mode 100644 index 00000000000000..d7047f6e952ece --- /dev/null +++ b/tools/doc/node_modules/function-bind/.jscs.json @@ -0,0 +1,159 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": "allButReserved", + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 8 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + } +} + diff --git a/tools/doc/node_modules/function-bind/.npmignore b/tools/doc/node_modules/function-bind/.npmignore new file mode 100644 index 00000000000000..8363b8e3d62c28 --- /dev/null +++ b/tools/doc/node_modules/function-bind/.npmignore @@ -0,0 +1,16 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules diff --git a/tools/doc/node_modules/function-bind/.travis.yml b/tools/doc/node_modules/function-bind/.travis.yml new file mode 100644 index 00000000000000..caabb460943e53 --- /dev/null +++ b/tools/doc/node_modules/function-bind/.travis.yml @@ -0,0 +1,77 @@ +language: node_js +node_js: + - "5.6" + - "5.5" + - "5.4" + - "5.3" + - "5.2" + - "5.1" + - "5.0" + - "4.3" + - "4.2" + - "4.1" + - "4.0" + - "iojs-v3.3" + - "iojs-v3.2" + - "iojs-v3.1" + - "iojs-v3.0" + - "iojs-v2.5" + - "iojs-v2.4" + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' +script: + - 'if [ "${TRAVIS_NODE_VERSION}" != "4.3" ]; then npm run tests-only ; else npm test ; fi' +sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "5.5" + - node_js: "5.4" + - node_js: "5.3" + - node_js: "5.2" + - node_js: "5.1" + - node_js: "5.0" + - node_js: "4.2" + - node_js: "4.1" + - node_js: "4.0" + - node_js: "iojs-v3.2" + - node_js: "iojs-v3.1" + - node_js: "iojs-v3.0" + - node_js: "iojs-v2.4" + - node_js: "iojs-v2.3" + - node_js: "iojs-v2.2" + - node_js: "iojs-v2.1" + - node_js: "iojs-v2.0" + - node_js: "iojs-v1.7" + - node_js: "iojs-v1.6" + - node_js: "iojs-v1.5" + - node_js: "iojs-v1.4" + - node_js: "iojs-v1.3" + - node_js: "iojs-v1.2" + - node_js: "iojs-v1.1" + - node_js: "iojs-v1.0" + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.6" + - node_js: "0.4" diff --git a/tools/doc/node_modules/function-bind/LICENSE b/tools/doc/node_modules/function-bind/LICENSE new file mode 100644 index 00000000000000..62d6d237ff179b --- /dev/null +++ b/tools/doc/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +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/doc/node_modules/function-bind/README.md b/tools/doc/node_modules/function-bind/README.md new file mode 100644 index 00000000000000..81862a02cb940c --- /dev/null +++ b/tools/doc/node_modules/function-bind/README.md @@ -0,0 +1,48 @@ +# function-bind + + + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/tools/doc/node_modules/function-bind/implementation.js b/tools/doc/node_modules/function-bind/implementation.js new file mode 100644 index 00000000000000..5e91272802571e --- /dev/null +++ b/tools/doc/node_modules/function-bind/implementation.js @@ -0,0 +1,48 @@ +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/tools/doc/node_modules/function-bind/index.js b/tools/doc/node_modules/function-bind/index.js new file mode 100644 index 00000000000000..60ba57846097b2 --- /dev/null +++ b/tools/doc/node_modules/function-bind/index.js @@ -0,0 +1,3 @@ +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/tools/doc/node_modules/function-bind/package.json b/tools/doc/node_modules/function-bind/package.json new file mode 100644 index 00000000000000..bd75a3b51459a5 --- /dev/null +++ b/tools/doc/node_modules/function-bind/package.json @@ -0,0 +1,98 @@ +{ + "_from": "function-bind@^1.0.2", + "_id": "function-bind@1.1.0", + "_inBundle": false, + "_integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", + "_location": "/function-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "function-bind@^1.0.2", + "name": "function-bind", + "escapedName": "function-bind", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/has" + ], + "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "_shasum": "16176714c801798e4e8f2cf7f7529467bb4a5771", + "_spec": "function-bind@^1.0.2", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/has", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Implementation of Function.prototype.bind", + "devDependencies": { + "@ljharb/eslint-config": "^2.1.0", + "covert": "^1.1.0", + "eslint": "^2.0.0", + "jscs": "^2.9.0", + "tape": "^4.4.0" + }, + "homepage": "https://github.com/Raynos/function-bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Raynos/function-bind/raw/master/LICENSE" + } + ], + "main": "index", + "name": "function-bind", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/function-bind.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "coverage-quiet": "covert test/*.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "test": "npm run lint && npm run tests-only && npm run coverage-quiet", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..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", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.0" +} diff --git a/tools/doc/node_modules/function-bind/test/index.js b/tools/doc/node_modules/function-bind/test/index.js new file mode 100644 index 00000000000000..ba1bfad257575e --- /dev/null +++ b/tools/doc/node_modules/function-bind/test/index.js @@ -0,0 +1,250 @@ +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/tools/doc/node_modules/github-slugger/.npmignore b/tools/doc/node_modules/github-slugger/.npmignore new file mode 100644 index 00000000000000..123ae94d052f3f --- /dev/null +++ b/tools/doc/node_modules/github-slugger/.npmignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules diff --git a/tools/doc/node_modules/github-slugger/.travis.yml b/tools/doc/node_modules/github-slugger/.travis.yml new file mode 100644 index 00000000000000..d84d8888666688 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - '0.12' + - 'iojs' +sudo: false +cache: + directories: + - node_modules +script: + - npm test diff --git a/tools/doc/node_modules/github-slugger/CHANGELOG.md b/tools/doc/node_modules/github-slugger/CHANGELOG.md new file mode 100644 index 00000000000000..dc3d58762edfea --- /dev/null +++ b/tools/doc/node_modules/github-slugger/CHANGELOG.md @@ -0,0 +1,26 @@ +# github-slugger change log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.1.3 2017-05-29 +* Fix`emoji-regex` semver version to ensure npm5 compatibility. + +## 1.1.2 2017-05-26 +* Lock down `emoji-regex` dependency to avoid [strange unicode bug](https://github.com/Flet/github-slugger/issues/9) + +## 1.1.1 +* Add more conformant unicode handling to ensure: + - emoji are correctly stripped + - non-Latin characters are not incorrectly lowercased +* Also adds more verified test cases + +Check the [PR](https://github.com/Flet/github-slugger/pull/8) for more details! + +Thanks [@wooorm](https://github.com/wooorm)! + +## 1.1.0 +* Feature: Support for non-latin characters in slugs https://github.com/Flet/github-slugger/pull/3) Thanks [@tadatuta](https://github.com/tadatuta)! + +## 1.0.1 +* Fix: bug for multiple empty slugds (https://github.com/Flet/github-slugger/pull/1) Thanks [@wooorm](https://github.com/wooorm)! diff --git a/tools/doc/node_modules/github-slugger/CONTRIBUTING.md b/tools/doc/node_modules/github-slugger/CONTRIBUTING.md new file mode 100644 index 00000000000000..9a7d3616af2913 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing Guidelines + +Contributions welcome! + +**Before spending lots of time on something, ask for feedback on your idea first!** + +Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations. + +In addition to improving the project by refactoring code and implementing relevant features, this project welcomes the following types of contributions: + +- **Ideas**: participate in an issue thread or start your own to have your voice heard. +- **Writing**: contribute your expertise in an area by helping expand the included content. +- **Copy editing**: fix typos, clarify language, and generally improve the quality of the content. +- **Formatting**: help keep content easy to read with consistent formatting. + +## Installing + +Fork and clone the repo, then `npm install` to install all dependencies. + +## Testing + +Tests are run with `npm test`. Unless you're creating a failing test to increase test coverage or show a problem, please make sure all tests are passing before submitting a pull request. + +## Code Style + +[![standard][standard-image]][standard-url] + +This repository uses [`standard`][standard-url] to maintain code style and consistency and avoid style arguments. `npm test` runs `standard` so you don't have to! + +[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg +[standard-url]: https://github.com/feross/standard +[semistandard-image]: https://cdn.rawgit.com/flet/semistandard/master/badge.svg +[semistandard-url]: https://github.com/Flet/semistandard + +--- + +# Collaborating Guidelines + +**This is an OPEN Open Source Project.** + +## What? + +Individuals making significant and valuable contributions are given commit access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + +## Rules + +There are a few basic ground rules for collaborators: + +1. **No `--force` pushes** or modifying the Git history in any way. +1. **Non-master branches** ought to be used for ongoing work. +1. **External API changes and significant modifications** ought to be subject to an **internal pull request** to solicit feedback from other collaborators. +1. Internal pull requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor. +1. Contributors should attempt to adhere to the prevailing code style. + +## Releases + +Declaring formal releases remains the prerogative of the project maintainer. + +## Changes to this arrangement + +This is an experiment and feedback is welcome! This document may also be subject to pull requests or changes by collaborators where you believe you have something valuable to add or change. diff --git a/tools/doc/node_modules/github-slugger/LICENSE b/tools/doc/node_modules/github-slugger/LICENSE new file mode 100644 index 00000000000000..7349890cd201f5 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Dan Flettre + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/doc/node_modules/github-slugger/README.md b/tools/doc/node_modules/github-slugger/README.md new file mode 100644 index 00000000000000..37086d76abe375 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/README.md @@ -0,0 +1,51 @@ +# github-slugger + +[![npm][npm-image]][npm-url] +[![travis][travis-image]][travis-url] + +[npm-image]: https://img.shields.io/npm/v/github-slugger.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/github-slugger +[travis-image]: https://img.shields.io/travis/Flet/github-slugger.svg?style=flat-square +[travis-url]: https://travis-ci.org/Flet/github-slugger + +Generate a slug just like GitHub does for markdown headings. It also ensures slugs are unique in the same way GitHub does it. The overall goal of this package is to emulate the way GitHub handles generating markdown heading anchors as close as possible. + +## Install + +``` +npm install github-slugger +``` + +## Usage + +```js +var GithubSlugger = require('github-slugger') +var slugger = new GithubSlugger() + +slugger.slug('foo') +// returns 'foo' + +slugger.slug('foo') +// returns 'foo-1' + +slugger.slug('bar') +// returns 'bar' + +slugger.slug('foo') +// returns 'foo-2' + +slugger.reset() + +slugger.slug('foo') +// returns 'foo' + +``` +Check `test/index.js` for more examples. + +## Contributing + +Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first. + +## License + +[ISC](LICENSE) diff --git a/tools/doc/node_modules/github-slugger/index.js b/tools/doc/node_modules/github-slugger/index.js new file mode 100644 index 00000000000000..a8f6364ffaae88 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/index.js @@ -0,0 +1,62 @@ +var emoji = require('emoji-regex') + +module.exports = BananaSlug + +function BananaSlug () { + var self = this + if (!(self instanceof BananaSlug)) return new BananaSlug() + + self.reset() +} + +/** + * Generate a unique slug. + * @param {string} value String of text to slugify + * @return {string} A unique slug string + */ +BananaSlug.prototype.slug = function (value) { + var self = this + var slug = slugger(value) + var occurrences = self.occurrences[slug] + + if (self.occurrences.hasOwnProperty(slug)) { + occurrences++ + } else { + occurrences = 0 + } + + self.occurrences[slug] = occurrences + + if (occurrences) { + slug = slug + '-' + occurrences + } + + return slug +} + +/** + * Reset - Forget all previous slugs + * @return void + */ +BananaSlug.prototype.reset = function () { + this.occurrences = {} +} + +var whitespace = /\s/g + +function lower (string) { + return string.toLowerCase() +} + +function slugger (string) { + var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g + var maintainCase = false + var replacement = '-' + + if (typeof string !== 'string') return '' + if (!maintainCase) string = string.replace(/[A-Z]+/g, lower) + return string.trim() + .replace(re, '') + .replace(emoji(), '') + .replace(whitespace, replacement) +} diff --git a/tools/doc/node_modules/github-slugger/package.json b/tools/doc/node_modules/github-slugger/package.json new file mode 100644 index 00000000000000..4d44d83afec54a --- /dev/null +++ b/tools/doc/node_modules/github-slugger/package.json @@ -0,0 +1,76 @@ +{ + "_from": "github-slugger@^1.1.1", + "_id": "github-slugger@1.1.3", + "_inBundle": false, + "_integrity": "sha1-MUpudZoYwrDMV2DVEsy6tUnFSac=", + "_location": "/github-slugger", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "github-slugger@^1.1.1", + "name": "github-slugger", + "escapedName": "github-slugger", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.1.3.tgz", + "_shasum": "314a6e759a18c2b0cc5760d512ccbab549c549a7", + "_spec": "github-slugger@^1.1.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Dan Flettre", + "email": "fletd01@yahoo.com" + }, + "bugs": { + "url": "https://github.com/Flet/github-slugger/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Dan Flettre", + "email": "fletd01@yahoo.com" + }, + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "emoji-regex": ">=6.0.0 <=6.1.1" + }, + "deprecated": false, + "description": "Generate a slug just like GitHub does for markdown headings.", + "devDependencies": { + "standard": "*", + "tap-spec": "^4.0.2", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/Flet/github-slugger", + "keywords": [ + "anchor", + "github", + "hash", + "heading", + "markdown", + "slug", + "slugger", + "url" + ], + "license": "ISC", + "main": "index.js", + "name": "github-slugger", + "repository": { + "type": "git", + "url": "git+https://github.com/Flet/github-slugger.git" + }, + "scripts": { + "test": "standard && tape test/*.js | tap-spec" + }, + "version": "1.1.3" +} diff --git a/tools/doc/node_modules/github-slugger/test/index.js b/tools/doc/node_modules/github-slugger/test/index.js new file mode 100644 index 00000000000000..65e2777d372149 --- /dev/null +++ b/tools/doc/node_modules/github-slugger/test/index.js @@ -0,0 +1,184 @@ +var test = require('tape') +var GithubSlugger = require('../') + +test('simple stuff', function (t) { + var slugger = new GithubSlugger() + + t.equals('foo', slugger.slug('foo')) + t.equals('foo-bar', slugger.slug('foo bar')) + t.equals('foo-1', slugger.slug('foo')) + + slugger.reset() + t.equals('foo', slugger.slug('foo')) + + t.end() +}) + +test('github test cases', function (t) { + var slugger = new GithubSlugger() + + testCases.forEach(function (test) { + t.equals(slugger.slug(test.text), test.slug, test.mesg) + }) + t.end() +}) + +var testCases = [ + { + mesg: 'allows a dash', + text: 'heading with a - dash', + slug: 'heading-with-a---dash' + }, + { + mesg: 'allows underscores', + text: 'heading with an _ underscore', + slug: 'heading-with-an-_-underscore' + }, + { + mesg: 'filters periods', + text: 'heading with a period.txt', + slug: 'heading-with-a-periodtxt' + }, + { + mesg: 'allows two spaces even after filtering', + text: 'exchange.bind_headers(exchange, routing [, bindCallback])', + slug: 'exchangebind_headersexchange-routing--bindcallback' + }, + { + mesg: 'empty', + text: '', + slug: '' + }, + { + mesg: 'a space', + text: ' ', + slug: '-1' + }, + { + mesg: 'initial space', + text: ' initial space', + slug: 'initial-space' + }, + { + mesg: 'final space', + text: 'final space ', + slug: 'final-space' + }, + { + mesg: 'deals with prototype properties', + text: 'length', + slug: 'length' + }, + { + mesg: 'deals with duplicates correctly', + text: 'duplicates', + slug: 'duplicates' + }, + { + mesg: 'deals with duplicates correctly-1', + text: 'duplicates', + slug: 'duplicates-1' + }, + { + mesg: 'deals with duplicates correctly-2', + text: 'duplicates', + slug: 'duplicates-2' + }, + { + mesg: 'deals with non-latin chars', + text: 'Привет', + slug: 'Привет' + }, + // https://github.com/wooorm/gh-and-npm-slug-generation + { + mesg: 'gh-and-npm-slug-generation-1', + text: 'I ♥ unicode', + slug: 'i--unicode' + }, + { + mesg: 'gh-and-npm-slug-generation-2', + text: 'Dash-dash', + slug: 'dash-dash' + }, + { + mesg: 'gh-and-npm-slug-generation-3', + text: 'en–dash!', + slug: 'endash' + }, + { + mesg: 'gh-and-npm-slug-generation-4', + text: 'em–dash', + slug: 'emdash' + }, + { + mesg: 'gh-and-npm-slug-generation-5', + text: '😄 unicode emoji', + slug: '-unicode-emoji' + }, + { + mesg: 'gh-and-npm-slug-generation-6', + text: '😄-😄 unicode emoji', + slug: '--unicode-emoji' + }, + { + mesg: 'gh-and-npm-slug-generation-7', + text: '😄_😄 unicode emoji', + slug: '_-unicode-emoji' + }, + { + mesg: 'gh-and-npm-slug-generation-8', + text: '😄 - an emoji', + slug: '---an-emoji' + }, + { + mesg: 'gh-and-npm-slug-generation-9', + text: ':smile: - a gemoji', + slug: 'smile---a-gemoji' + }, + { + mesg: 'gh-and-npm-slug-generation-10', + text: ' Initial spaces', + slug: 'initial-spaces' + }, + { + mesg: 'gh-and-npm-slug-generation-11', + text: 'Final spaces ', + slug: 'final-spaces' + }, + { + mesg: 'gh-and-npm-slug-generation-12', + text: 'duplicate', + slug: 'duplicate' + }, + { + mesg: 'gh-and-npm-slug-generation-13', + text: 'duplicate', + slug: 'duplicate-1' + }, + { + mesg: 'gh-and-npm-slug-generation-14', + text: 'Привет non-latin 你好', + slug: 'Привет-non-latin-你好' + }, + // https://github.com/chrisdickinson/emoji-slug-example + { + mesg: 'emoji-slug-example-1', + text: ':ok: No underscore', + slug: 'ok-no-underscore' + }, + { + mesg: 'emoji-slug-example-2', + text: ':ok_hand: Single', + slug: 'ok_hand-single' + }, + { + mesg: 'emoji-slug-example-3', + text: ':ok_hand::hatched_chick: Two in a row with no spaces', + slug: 'ok_handhatched_chick-two-in-a-row-with-no-spaces' + }, + { + mesg: 'emoji-slug-example-4', + text: ':ok_hand: :hatched_chick: Two in a row', + slug: 'ok_hand-hatched_chick-two-in-a-row' + } +] diff --git a/tools/doc/node_modules/groff-escape/LICENSE b/tools/doc/node_modules/groff-escape/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/groff-escape/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/groff-escape/index.json b/tools/doc/node_modules/groff-escape/index.json new file mode 100644 index 00000000000000..f952cb32c13b6d --- /dev/null +++ b/tools/doc/node_modules/groff-escape/index.json @@ -0,0 +1,291 @@ +{ + "≠": "!=", + "À": "`A", + "Á": "'A", + "Â": "^A", + "Ã": "~A", + "Ä": ":A", + "Å": "oA", + "Ć": "'C", + "Ç": ",C", + "È": "`E", + "É": "'E", + "Ê": "^E", + "Ë": ":E", + "Ì": "`I", + "Í": "'I", + "Î": "^I", + "Ï": ":I", + "Ñ": "~N", + "Ò": "`O", + "Ó": "'O", + "Ô": "^O", + "Õ": "~O", + "Ö": ":O", + "Š": "vS", + "Ù": "`U", + "Ú": "'U", + "Û": "^U", + "Ü": ":U", + "Ý": "'Y", + "Ÿ": ":Y", + "Ž": "vZ", + "à": "`a", + "á": "'a", + "â": "^a", + "ã": "~a", + "ä": ":a", + "å": "oa", + "ć": "'c", + "ç": ",c", + "è": "`e", + "é": "'e", + "ê": "^e", + "ë": ":e", + "ì": "`i", + "í": "'i", + "î": "^i", + "ï": ":i", + "ñ": "~n", + "ò": "`o", + "ó": "'o", + "ô": "^o", + "õ": "~o", + "ö": ":o", + "š": "vs", + "ù": "`u", + "ú": "'u", + "û": "^u", + "ü": ":u", + "ý": "'y", + "ÿ": ":y", + "ž": "vz", + "¡": "r!", + "¢": "ct", + "£": "Po", + "¤": "Cs", + "¥": "Ye", + "¦": "bb", + "§": "sc", + "¨": "ad", + "©": "co", + "ª": "Of", + "«": "Fo", + "¬": "no", + "®": "rg", + "¯": "a-", + "°": "de", + "±": "+-", + "²": "S2", + "³": "S3", + "´": "aa", + "µ": "mc", + "¶": "ps", + "·": "pc", + "¸": "ac", + "¹": "S1", + "º": "Om", + "»": "Fc", + "¼": "14", + "½": "12", + "¾": "34", + "¿": "r?", + "Æ": "AE", + "Ð": "-D", + "×": "mu", + "Ø": "/O", + "Þ": "TP", + "ß": "ss", + "æ": "ae", + "ð": "Sd", + "÷": "di", + "ø": "/o", + "þ": "Tp", + "ı": ".i", + "IJ": "IJ", + "ij": "ij", + "Ł": "/L", + "ł": "/l", + "Œ": "OE", + "œ": "oe", + "ƒ": "Fn", + "ȷ": ".j", + "ˇ": "ah", + "˘": "ab", + "˙": "a.", + "˚": "ao", + "˛": "ho", + "Α": "*A", + "Β": "*B", + "Γ": "*G", + "Δ": "*D", + "Ε": "*E", + "Ζ": "*Z", + "Η": "*Y", + "Θ": "*H", + "Ι": "*I", + "Κ": "*K", + "Λ": "*L", + "Μ": "*M", + "Ν": "*N", + "Ξ": "*C", + "Ο": "*O", + "Π": "*P", + "Ρ": "*R", + "Σ": "*S", + "Τ": "*T", + "Υ": "*U", + "Φ": "*F", + "Χ": "*X", + "Ψ": "*Q", + "Ω": "*W", + "α": "*a", + "β": "*b", + "γ": "*g", + "δ": "*d", + "ε": "*e", + "ζ": "*z", + "η": "*y", + "θ": "*h", + "ι": "*i", + "κ": "*k", + "λ": "*l", + "μ": "*m", + "ν": "*n", + "ξ": "*c", + "ο": "*o", + "π": "*p", + "ρ": "*r", + "ς": "ts", + "σ": "*s", + "τ": "*t", + "υ": "*u", + "φ": "+f", + "χ": "*x", + "ψ": "*q", + "ω": "*w", + "ϑ": "+h", + "ϕ": "*f", + "ϖ": "+p", + "ϵ": "+e", + "‐": "hy", + "–": "en", + "—": "em", + "‘": "oq", + "’": "cq", + "‚": "bq", + "“": "lq", + "”": "rq", + "„": "Bq", + "†": "dg", + "‡": "dd", + "•": "bu", + "‰": "%0", + "′": "fm", + "″": "sd", + "‹": "fo", + "›": "fc", + "‾": "rn", + "⁄": "f/", + "€": "Eu", + "ℏ": "-h", + "ℑ": "Im", + "℘": "wp", + "ℜ": "Re", + "™": "tm", + "ℵ": "Ah", + "⅛": "18", + "⅜": "38", + "⅝": "58", + "⅞": "78", + "←": "<-", + "↑": "ua", + "→": "->", + "↓": "da", + "↔": "<>", + "↕": "va", + "↵": "CR", + "⇐": "lA", + "⇑": "uA", + "⇒": "rA", + "⇓": "dA", + "⇔": "hA", + "⇕": "vA", + "∀": "fa", + "∂": "pd", + "∃": "te", + "∅": "es", + "∇": "gr", + "∈": "mo", + "∉": "nm", + "∋": "st", + "∏": "product", + "∐": "coproduct", + "∑": "sum", + "−": "mi", + "∓": "-+", + "∗": "**", + "√": "sr", + "∝": "pt", + "∞": "if", + "∠": "/_", + "∧": "AN", + "∨": "OR", + "∩": "ca", + "∪": "cu", + "∫": "is", + "∴": "tf", + "∼": "ap", + "≃": "|=", + "≅": "=~", + "≈": "~~", + "≡": "==", + "≢": "ne", + "≤": "<=", + "≥": ">=", + "≪": ">>", + "≫": "<<", + "⊂": "sb", + "⊄": "nb", + "⊃": "sp", + "⊅": "nc", + "⊆": "ib", + "⊇": "ip", + "⊕": "c+", + "⊗": "c*", + "⊥": "pp", + "⋅": "md", + "⌈": "lc", + "⌉": "rc", + "⌊": "lf", + "⌋": "rf", + "⎛": "parenlefttp", + "⎜": "parenleftex", + "⎝": "parenleftbt", + "⎞": "parenrighttp", + "⎟": "parenrightex", + "⎠": "parenrightbt", + "⎢": "bracketleftex", + "⎥": "bracketrightex", + "⎧": "lt", + "⎨": "lk", + "⎩": "lb", + "⎪": "bv", + "⎫": "rt", + "⎬": "rk", + "⎭": "rb", + "⎯": "an", + "│": "br", + "□": "sq", + "◊": "lz", + "○": "ci", + "☜": "lh", + "☞": "rh", + "♠": "SP", + "♣": "CL", + "♥": "HE", + "♦": "DI", + "✓": "OK", + "⟨": "la", + "⟩": "ra" +} diff --git a/tools/doc/node_modules/groff-escape/package.json b/tools/doc/node_modules/groff-escape/package.json new file mode 100644 index 00000000000000..6d88c0441f1b0f --- /dev/null +++ b/tools/doc/node_modules/groff-escape/package.json @@ -0,0 +1,89 @@ +{ + "_from": "groff-escape@^1.0.0", + "_id": "groff-escape@1.0.0", + "_inBundle": false, + "_integrity": "sha1-e5+2b1QoAhn2vRYySfhfYxGXzV8=", + "_location": "/groff-escape", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "groff-escape@^1.0.0", + "name": "groff-escape", + "escapedName": "groff-escape", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/groff-escape/-/groff-escape-1.0.0.tgz", + "_shasum": "7b9fb66f54280219f6bd163249f85f631197cd5f", + "_spec": "groff-escape@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/groff-escape/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Unicode characters to Groff commands", + "devDependencies": { + "d3-dsv": "^1.0.1", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.4.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.11.0" + }, + "files": [ + "index.json" + ], + "homepage": "https://github.com/wooorm/groff-escape#readme", + "keywords": [ + "unicode", + "groff", + "command" + ], + "license": "MIT", + "main": "index.json", + "name": "groff-escape", + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/groff-escape.git" + }, + "scripts": { + "build": "npm run build-generate && npm run build-md", + "build-generate": "bash build.sh", + "build-md": "remark . --quiet --frail", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-api", + "test-api": "node test" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "groff-escape.js" + ] + } +} diff --git a/tools/doc/node_modules/groff-escape/readme.md b/tools/doc/node_modules/groff-escape/readme.md new file mode 100644 index 00000000000000..60f96763b68026 --- /dev/null +++ b/tools/doc/node_modules/groff-escape/readme.md @@ -0,0 +1,52 @@ +# groff-escape [![Build Status][build-badge]][build-status] + +Map of non-ASCII characters to Groff commands: `'≠'` > `'!='` +(which you’ll need to wrap in like so `\[!=]` to use in Groff). + +## Installation + +[npm][]: + +```bash +npm install groff-escape +``` + +## Usage + +Dependencies: + +```javascript +var escape = require('groff-escape'); +``` + +Yields: + +```js +{ '≠': '!=', + 'À': '`A', + 'Á': '\'A', + 'Â': '^A', + 'Ã': '~A', + // ... + '♥': 'HE', + '♦': 'DI', + '✓': 'OK', + '⟨': 'la', + '⟩': 'ra' } +``` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/groff-escape.svg + +[build-status]: https://travis-ci.org/wooorm/groff-escape + +[license]: LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install diff --git a/tools/doc/node_modules/has/.jshintrc b/tools/doc/node_modules/has/.jshintrc new file mode 100644 index 00000000000000..6a61a73d1147ac --- /dev/null +++ b/tools/doc/node_modules/has/.jshintrc @@ -0,0 +1,14 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "boss": true, + "eqnull": true, + "node": true, + "browser": true +} \ No newline at end of file diff --git a/tools/doc/node_modules/has/.npmignore b/tools/doc/node_modules/has/.npmignore new file mode 100644 index 00000000000000..8419859fd3b7a0 --- /dev/null +++ b/tools/doc/node_modules/has/.npmignore @@ -0,0 +1,3 @@ +/node_modules/ +*.log +*~ diff --git a/tools/doc/node_modules/has/LICENSE-MIT b/tools/doc/node_modules/has/LICENSE-MIT new file mode 100644 index 00000000000000..ae7014d385df3d --- /dev/null +++ b/tools/doc/node_modules/has/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Thiago de Arruda + +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/doc/node_modules/has/README.mkd b/tools/doc/node_modules/has/README.mkd new file mode 100644 index 00000000000000..635e3a4baab00b --- /dev/null +++ b/tools/doc/node_modules/has/README.mkd @@ -0,0 +1,18 @@ +# has + +> Object.prototype.hasOwnProperty.call shortcut + +## Installation + +```sh +npm install --save has +``` + +## Usage + +```js +var has = require('has'); + +has({}, 'hasOwnProperty'); // false +has(Object.prototype, 'hasOwnProperty'); // true +``` diff --git a/tools/doc/node_modules/has/package.json b/tools/doc/node_modules/has/package.json new file mode 100644 index 00000000000000..08d61075661373 --- /dev/null +++ b/tools/doc/node_modules/has/package.json @@ -0,0 +1,62 @@ +{ + "_from": "has@^1.0.1", + "_id": "has@1.0.1", + "_inBundle": false, + "_integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "_location": "/has", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has@^1.0.1", + "name": "has", + "escapedName": "has", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "_shasum": "8461733f538b0837c9361e39a9ab9e9704dc2f28", + "_spec": "has@^1.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "bundleDependencies": false, + "dependencies": { + "function-bind": "^1.0.2" + }, + "deprecated": false, + "description": "Object.prototype.hasOwnProperty.call shortcut", + "devDependencies": { + "chai": "~1.7.2", + "mocha": "^1.21.4" + }, + "engines": { + "node": ">= 0.8.0" + }, + "homepage": "https://github.com/tarruda/has", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src/index", + "name": "has", + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "scripts": { + "test": "node_modules/mocha/bin/mocha" + }, + "version": "1.0.1" +} diff --git a/tools/doc/node_modules/has/src/index.js b/tools/doc/node_modules/has/src/index.js new file mode 100644 index 00000000000000..cdf328576e70c2 --- /dev/null +++ b/tools/doc/node_modules/has/src/index.js @@ -0,0 +1,3 @@ +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/tools/doc/node_modules/has/test/.jshintrc b/tools/doc/node_modules/has/test/.jshintrc new file mode 100644 index 00000000000000..e1da2e42aba02b --- /dev/null +++ b/tools/doc/node_modules/has/test/.jshintrc @@ -0,0 +1,7 @@ +{ + "globals": { + "expect": false, + "run": false + }, + "expr": true +} \ No newline at end of file diff --git a/tools/doc/node_modules/has/test/index.js b/tools/doc/node_modules/has/test/index.js new file mode 100644 index 00000000000000..38909b0a3ff2eb --- /dev/null +++ b/tools/doc/node_modules/has/test/index.js @@ -0,0 +1,10 @@ +global.expect = require('chai').expect; +var has = require('../src'); + + +describe('has', function() { + it('works!', function() { + expect(has({}, 'hasOwnProperty')).to.be.false; + expect(has(Object.prototype, 'hasOwnProperty')).to.be.true; + }); +}); diff --git a/tools/doc/node_modules/inherits/LICENSE b/tools/doc/node_modules/inherits/LICENSE new file mode 100644 index 00000000000000..dea3013d6710ee --- /dev/null +++ b/tools/doc/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/tools/doc/node_modules/inherits/README.md b/tools/doc/node_modules/inherits/README.md new file mode 100644 index 00000000000000..b1c56658557b81 --- /dev/null +++ b/tools/doc/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/tools/doc/node_modules/inherits/inherits.js b/tools/doc/node_modules/inherits/inherits.js new file mode 100644 index 00000000000000..3b94763a76eef0 --- /dev/null +++ b/tools/doc/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/tools/doc/node_modules/inherits/inherits_browser.js b/tools/doc/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000000000..c1e78a75e6b52b --- /dev/null +++ b/tools/doc/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/tools/doc/node_modules/inherits/package.json b/tools/doc/node_modules/inherits/package.json new file mode 100644 index 00000000000000..b968c4e052ce08 --- /dev/null +++ b/tools/doc/node_modules/inherits/package.json @@ -0,0 +1,61 @@ +{ + "_from": "inherits@^2.0.1", + "_id": "inherits@2.0.3", + "_inBundle": false, + "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "_location": "/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@^2.0.1", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/unherit" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_spec": "inherits@^2.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unherit", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^7.1.0" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.3" +} diff --git a/tools/doc/node_modules/is-alphabetical/LICENSE b/tools/doc/node_modules/is-alphabetical/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-alphabetical/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-alphabetical/history.md b/tools/doc/node_modules/is-alphabetical/history.md new file mode 100644 index 00000000000000..ef81df4296778c --- /dev/null +++ b/tools/doc/node_modules/is-alphabetical/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-11 +================== diff --git a/tools/doc/node_modules/is-alphabetical/index.js b/tools/doc/node_modules/is-alphabetical/index.js new file mode 100644 index 00000000000000..090d47010ff3c0 --- /dev/null +++ b/tools/doc/node_modules/is-alphabetical/index.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-alphabetical + * @fileoverview Check if a character is alphabetical. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = alphabetical; + +/** + * Check whether the given character code, or the character + * code at the first character, is alphabetical. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is alphabetical. + */ +function alphabetical(character) { + var code = typeof character === 'string' ? + character.charCodeAt(0) : character; + + return (code >= 97 && code <= 122) || /* a-z */ + (code >= 65 && code <= 90); /* A-Z */ +} diff --git a/tools/doc/node_modules/is-alphabetical/package.json b/tools/doc/node_modules/is-alphabetical/package.json new file mode 100644 index 00000000000000..174d96f2e3fbc9 --- /dev/null +++ b/tools/doc/node_modules/is-alphabetical/package.json @@ -0,0 +1,110 @@ +{ + "_from": "is-alphabetical@^1.0.0", + "_id": "is-alphabetical@1.0.0", + "_inBundle": false, + "_integrity": "sha1-4lRMEwWCVfIUTLdXBmzTNCocjEY=", + "_location": "/is-alphabetical", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphabetical@^1.0.0", + "name": "is-alphabetical", + "escapedName": "is-alphabetical", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-alphanumerical", + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.0.tgz", + "_shasum": "e2544c13058255f2144cb757066cd3342a1c8c46", + "_spec": "is-alphabetical@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-alphabetical/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is alphabetical", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphabetical.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isAlphabetical > is-alphabetical.js", + "build-mangle": "esmangle < is-alphabetical.js > is-alphabetical.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-alphabetical.js", + "is-alphabetical.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-alphabetical/readme.md b/tools/doc/node_modules/is-alphabetical/readme.md new file mode 100644 index 00000000000000..ea08662dad3bc2 --- /dev/null +++ b/tools/doc/node_modules/is-alphabetical/readme.md @@ -0,0 +1,58 @@ +# is-alphabetical [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Check if a character is alphabetical. + +## Installation + +[npm][npm-install]: + +```bash +npm install is-alphabetical +``` + +## Usage + +Dependencies: + +```javascript +var alphabetical = require('is-alphabetical'); + +alphabetical('a'); // true +alphabetical('B'); // true +alphabetical('0'); // false +alphabetical('💩'); // false +``` + +## API + +### `alphabetical(character)` + +Check whether the given character code (`number`), or the character +code at the first position (`string`), is alphabetical. + +## Related + +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-alphabetical.svg + +[travis]: https://travis-ci.org/wooorm/is-alphabetical + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphabetical.svg + +[codecov]: https://codecov.io/github/wooorm/is-alphabetical + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/is-alphanumeric/index.js b/tools/doc/node_modules/is-alphanumeric/index.js new file mode 100644 index 00000000000000..3deeea7a83efc6 --- /dev/null +++ b/tools/doc/node_modules/is-alphanumeric/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return !/[^0-9a-z\xDF-\xFF]/.test(str.toLowerCase()); +}; diff --git a/tools/doc/node_modules/is-alphanumeric/license b/tools/doc/node_modules/is-alphanumeric/license new file mode 100644 index 00000000000000..e25c14ae9e7da6 --- /dev/null +++ b/tools/doc/node_modules/is-alphanumeric/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Arthur Verschaeve (arthurverschaeve.be) + +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/doc/node_modules/is-alphanumeric/package.json b/tools/doc/node_modules/is-alphanumeric/package.json new file mode 100644 index 00000000000000..7c0bff0f8490db --- /dev/null +++ b/tools/doc/node_modules/is-alphanumeric/package.json @@ -0,0 +1,73 @@ +{ + "_from": "is-alphanumeric@^1.0.0", + "_id": "is-alphanumeric@1.0.0", + "_inBundle": false, + "_integrity": "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=", + "_location": "/is-alphanumeric", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphanumeric@^1.0.0", + "name": "is-alphanumeric", + "escapedName": "is-alphanumeric", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "_shasum": "4a9cef71daf4c001c1d81d63d140cf53fd6889f4", + "_spec": "is-alphanumeric@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Arthur Verschaeve", + "email": "contact@arthurverschaeve.be", + "url": "arthurverschaeve.be" + }, + "bugs": { + "url": "https://github.com/arthurvr/is-alphanumeric/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a string only contains alphanumeric characters", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/arthurvr/is-alphanumeric#readme", + "keywords": [ + "numbers", + "numeric", + "alphabet", + "alphabetic", + "check", + "is", + "detect", + "latin", + "alphanumeric", + "string", + "text", + "letters", + "digit", + "arabic", + "alphameric" + ], + "license": "MIT", + "name": "is-alphanumeric", + "repository": { + "type": "git", + "url": "git+https://github.com/arthurvr/is-alphanumeric.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/tools/doc/node_modules/is-alphanumeric/readme.md b/tools/doc/node_modules/is-alphanumeric/readme.md new file mode 100644 index 00000000000000..1ada8d33429e7a --- /dev/null +++ b/tools/doc/node_modules/is-alphanumeric/readme.md @@ -0,0 +1,40 @@ +# is-alphanumeric [![Build Status](https://travis-ci.org/arthurvr/is-alphanumeric.svg?branch=master)](https://travis-ci.org/arthurvr/is-alphanumeric) + +> Check if a string only contains alphanumeric characters + + +## Install + +``` +$ npm install --save is-alphanumeric +``` + + +## Usage + +```js +var isAlphanumeric = require('is-alphanumeric'); + +isAlphanumeric('unicorns'); +//=> true + +isAlphanumeric('55'); +//=> true + +isAlphanumeric('ABC'); +//=> true + +isAlphanumeric('*unicorns'); +//=> false + +isAlphanumeric('{unicorns}'); +//=> false + +isAlphanumeric(' '); +//=> false +``` + + +## License + +MIT © [Arthur Verschaeve](http://arthurverschaeve.be) diff --git a/tools/doc/node_modules/is-alphanumerical/LICENSE b/tools/doc/node_modules/is-alphanumerical/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-alphanumerical/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-alphanumerical/history.md b/tools/doc/node_modules/is-alphanumerical/history.md new file mode 100644 index 00000000000000..674e111c479ebb --- /dev/null +++ b/tools/doc/node_modules/is-alphanumerical/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-12 +================== diff --git a/tools/doc/node_modules/is-alphanumerical/index.js b/tools/doc/node_modules/is-alphanumerical/index.js new file mode 100644 index 00000000000000..58ea455baa4efe --- /dev/null +++ b/tools/doc/node_modules/is-alphanumerical/index.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-alphanumerical + * @fileoverview Check if a character is alphanumerical. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Dependencies. */ +var alphabetical = require('is-alphabetical'); +var decimal = require('is-decimal'); + +/* Expose. */ +module.exports = alphanumerical; + +/** + * Check whether the given character code, or the character + * code at the first character, is alphanumerical. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is alphanumerical. + */ +function alphanumerical(character) { + return alphabetical(character) || decimal(character); +} diff --git a/tools/doc/node_modules/is-alphanumerical/package.json b/tools/doc/node_modules/is-alphanumerical/package.json new file mode 100644 index 00000000000000..80ef1e888e2240 --- /dev/null +++ b/tools/doc/node_modules/is-alphanumerical/package.json @@ -0,0 +1,115 @@ +{ + "_from": "is-alphanumerical@^1.0.0", + "_id": "is-alphanumerical@1.0.0", + "_inBundle": false, + "_integrity": "sha1-4GSS5xnBvxXewjnk8a9fZ7TW578=", + "_location": "/is-alphanumerical", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphanumerical@^1.0.0", + "name": "is-alphanumerical", + "escapedName": "is-alphanumerical", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.0.tgz", + "_shasum": "e06492e719c1bf15dec239e4f1af5f67b4d6e7bf", + "_spec": "is-alphanumerical@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-alphanumerical/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "deprecated": false, + "description": "Check if a character is alphanumerical", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphanumerical.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isAlphanumerical > is-alphanumerical.js", + "build-mangle": "esmangle < is-alphanumerical.js > is-alphanumerical.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-alphanumerical.js", + "is-alphanumerical.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-alphanumerical/readme.md b/tools/doc/node_modules/is-alphanumerical/readme.md new file mode 100644 index 00000000000000..26e6289d38bfc7 --- /dev/null +++ b/tools/doc/node_modules/is-alphanumerical/readme.md @@ -0,0 +1,60 @@ +# is-alphanumerical [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Check if a character is alphanumerical (`[a-zA-Z0-9]`). + +## Installation + +[npm][npm-install]: + +```bash +npm install is-alphanumerical +``` + +## Usage + +```javascript +var alphanumerical = require('is-alphanumerical'); + +alphanumerical('a'); // true +alphanumerical('Z'); // true +alphanumerical('0'); // true +alphanumerical(' '); // false +alphanumerical('💩'); // false +``` + +## API + +### `alphanumerical(character)` + +Check whether the given character code (`number`), or the character +code at the first position (`string`), is alphanumerical. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`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) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-alphanumerical.svg + +[travis]: https://travis-ci.org/wooorm/is-alphanumerical + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphanumerical.svg + +[codecov]: https://codecov.io/github/wooorm/is-alphanumerical + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/is-buffer/.npmignore b/tools/doc/node_modules/is-buffer/.npmignore new file mode 100644 index 00000000000000..9cdaef929fbb4f --- /dev/null +++ b/tools/doc/node_modules/is-buffer/.npmignore @@ -0,0 +1,2 @@ +.travis.yml +.zuul.yml diff --git a/tools/doc/node_modules/is-buffer/LICENSE b/tools/doc/node_modules/is-buffer/LICENSE new file mode 100644 index 00000000000000..0c068ceecbd48f --- /dev/null +++ b/tools/doc/node_modules/is-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/doc/node_modules/is-buffer/README.md b/tools/doc/node_modules/is-buffer/README.md new file mode 100644 index 00000000000000..cb6f356d5a95a0 --- /dev/null +++ b/tools/doc/node_modules/is-buffer/README.md @@ -0,0 +1,49 @@ +# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] + +#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/is-buffer +[npm-image]: https://img.shields.io/npm/v/is-buffer.svg +[npm-url]: https://npmjs.org/package/is-buffer +[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg +[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/is-buffer + +## Why not use `Buffer.isBuffer`? + +This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). + +It's future-proof and works in node too! + +## install + +```bash +npm install is-buffer +``` + +## usage + +```js +var isBuffer = require('is-buffer') + +isBuffer(new Buffer(4)) // true + +isBuffer(undefined) // false +isBuffer(null) // false +isBuffer('') // false +isBuffer(true) // false +isBuffer(false) // false +isBuffer(0) // false +isBuffer(1) // false +isBuffer(1.0) // false +isBuffer('string') // false +isBuffer({}) // false +isBuffer(function foo () {}) // false +``` + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/tools/doc/node_modules/is-buffer/index.js b/tools/doc/node_modules/is-buffer/index.js new file mode 100644 index 00000000000000..36c808ea7579c2 --- /dev/null +++ b/tools/doc/node_modules/is-buffer/index.js @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} diff --git a/tools/doc/node_modules/is-buffer/package.json b/tools/doc/node_modules/is-buffer/package.json new file mode 100644 index 00000000000000..f9f6c0073bc367 --- /dev/null +++ b/tools/doc/node_modules/is-buffer/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-buffer@^1.1.4", + "_id": "is-buffer@1.1.5", + "_inBundle": false, + "_integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "_location": "/is-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-buffer@^1.1.4", + "name": "is-buffer", + "escapedName": "is-buffer", + "rawSpec": "^1.1.4", + "saveSpec": null, + "fetchSpec": "^1.1.4" + }, + "_requiredBy": [ + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "_shasum": "1f3b26ef613b214b88cbca23cc6c01d87961eecc", + "_spec": "is-buffer@^1.1.4", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/vfile", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "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", + "type", + "core buffer", + "browser buffer", + "browserify", + "typed array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "name": "is-buffer", + "repository": { + "type": "git", + "url": "git://github.com/feross/is-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "zuul -- test/*.js", + "test-browser-local": "zuul --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "testling": { + "files": "test/*.js" + }, + "version": "1.1.5" +} diff --git a/tools/doc/node_modules/is-buffer/test/basic.js b/tools/doc/node_modules/is-buffer/test/basic.js new file mode 100644 index 00000000000000..43b7c82327d3b5 --- /dev/null +++ b/tools/doc/node_modules/is-buffer/test/basic.js @@ -0,0 +1,25 @@ +var buffer = require('buffer') +var isBuffer = require('../') +var test = require('tape') + +test('is-buffer', function (t) { + t.equal(isBuffer(new Buffer(4)), true, 'new Buffer(4)') + t.equal(isBuffer(buffer.SlowBuffer(100)), true, 'SlowBuffer(100)') + + t.equal(isBuffer(undefined), false, 'undefined') + t.equal(isBuffer(null), false, 'null') + t.equal(isBuffer(''), false, 'empty string') + t.equal(isBuffer(true), false, 'true') + t.equal(isBuffer(false), false, 'false') + t.equal(isBuffer(0), false, '0') + t.equal(isBuffer(1), false, '1') + t.equal(isBuffer(1.0), false, '1.0') + t.equal(isBuffer('string'), false, 'string') + t.equal(isBuffer({}), false, '{}') + t.equal(isBuffer([]), false, '[]') + t.equal(isBuffer(function foo () {}), false, 'function foo () {}') + t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') + t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') + + t.end() +}) diff --git a/tools/doc/node_modules/is-decimal/LICENSE b/tools/doc/node_modules/is-decimal/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-decimal/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-decimal/history.md b/tools/doc/node_modules/is-decimal/history.md new file mode 100644 index 00000000000000..ef81df4296778c --- /dev/null +++ b/tools/doc/node_modules/is-decimal/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-11 +================== diff --git a/tools/doc/node_modules/is-decimal/index.js b/tools/doc/node_modules/is-decimal/index.js new file mode 100644 index 00000000000000..15ed373507932f --- /dev/null +++ b/tools/doc/node_modules/is-decimal/index.js @@ -0,0 +1,28 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-decimal + * @fileoverview Check if a character is decimal. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = decimal; + +/** + * Check whether the given character code, or the character + * code at the first character, is decimal. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is decimal. + */ +function decimal(character) { + var code = typeof character === 'string' ? + character.charCodeAt(0) : character; + + return code >= 48 && code <= 57; /* 0-9 */ +} diff --git a/tools/doc/node_modules/is-decimal/package.json b/tools/doc/node_modules/is-decimal/package.json new file mode 100644 index 00000000000000..214da25f0753d7 --- /dev/null +++ b/tools/doc/node_modules/is-decimal/package.json @@ -0,0 +1,112 @@ +{ + "_from": "is-decimal@^1.0.0", + "_id": "is-decimal@1.0.0", + "_inBundle": false, + "_integrity": "sha1-lAV5tupjxigICmnmK9qIyEcLT+A=", + "_location": "/is-decimal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-decimal@^1.0.0", + "name": "is-decimal", + "escapedName": "is-decimal", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-alphanumerical", + "/parse-entities", + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.0.tgz", + "_shasum": "940579b6ea63c628080a69e62bda88c8470b4fe0", + "_spec": "is-decimal@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-decimal/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is decimal", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-decimal.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isDecimal > is-decimal.js", + "build-mangle": "esmangle < is-decimal.js > is-decimal.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-decimal.js", + "is-decimal.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-decimal/readme.md b/tools/doc/node_modules/is-decimal/readme.md new file mode 100644 index 00000000000000..58d25c26bc55ce --- /dev/null +++ b/tools/doc/node_modules/is-decimal/readme.md @@ -0,0 +1,58 @@ +# is-decimal [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Check if a character is decimal. + +## Installation + +[npm][npm-install]: + +```bash +npm install is-decimal +``` + +## Usage + +Dependencies: + +```javascript +var decimal = require('is-decimal'); + +decimal('0'); // true +decimal('9'); // true +decimal('a'); // false +decimal('💩'); // false +``` + +## API + +### `decimal(character)` + +Check whether the given character code (`number`), or the character +code at the first position (`string`), is decimal. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg + +[travis]: https://travis-ci.org/wooorm/is-decimal + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg + +[codecov]: https://codecov.io/github/wooorm/is-decimal + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/is-hexadecimal/LICENSE b/tools/doc/node_modules/is-hexadecimal/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-hexadecimal/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-hexadecimal/history.md b/tools/doc/node_modules/is-hexadecimal/history.md new file mode 100644 index 00000000000000..ef81df4296778c --- /dev/null +++ b/tools/doc/node_modules/is-hexadecimal/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-11 +================== diff --git a/tools/doc/node_modules/is-hexadecimal/index.js b/tools/doc/node_modules/is-hexadecimal/index.js new file mode 100644 index 00000000000000..dfb9ddb5780072 --- /dev/null +++ b/tools/doc/node_modules/is-hexadecimal/index.js @@ -0,0 +1,30 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-hexadecimal + * @fileoverview Check if a character is hexadecimal. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = hexadecimal; + +/** + * Check whether the given character code, or the character + * code at the first character, is hexadecimal. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is hexadecimal. + */ +function hexadecimal(character) { + var code = typeof character === 'string' ? + character.charCodeAt(0) : character; + + return (code >= 97 /* a */ && code <= 102 /* z */) || + (code >= 65 /* A */ && code <= 70 /* Z */) || + (code >= 48 /* A */ && code <= 57 /* Z */); +} diff --git a/tools/doc/node_modules/is-hexadecimal/package.json b/tools/doc/node_modules/is-hexadecimal/package.json new file mode 100644 index 00000000000000..c40cab9f21d26d --- /dev/null +++ b/tools/doc/node_modules/is-hexadecimal/package.json @@ -0,0 +1,110 @@ +{ + "_from": "is-hexadecimal@^1.0.0", + "_id": "is-hexadecimal@1.0.0", + "_inBundle": false, + "_integrity": "sha1-XEWXcdKvmi45Ungf1U/LG8/kETw=", + "_location": "/is-hexadecimal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-hexadecimal@^1.0.0", + "name": "is-hexadecimal", + "escapedName": "is-hexadecimal", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.0.tgz", + "_shasum": "5c459771d2af9a2e3952781fd54fcb1bcfe4113c", + "_spec": "is-hexadecimal@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-hexadecimal/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is hexadecimal", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-hexadecimal.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isHexadecimal > is-hexadecimal.js", + "build-mangle": "esmangle < is-hexadecimal.js > is-hexadecimal.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-hexadecimal.js", + "is-hexadecimal.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-hexadecimal/readme.md b/tools/doc/node_modules/is-hexadecimal/readme.md new file mode 100644 index 00000000000000..19640e3668278b --- /dev/null +++ b/tools/doc/node_modules/is-hexadecimal/readme.md @@ -0,0 +1,58 @@ +# is-hexadecimal [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Check if a character is hexadecimal. + +## Installation + +[npm][npm-install]: + +```bash +npm install is-hexadecimal +``` + +## Usage + +Dependencies: + +```javascript +var hexadecimal = require('is-hexadecimal'); + +hexadecimal('a'); // true +hexadecimal('0'); // true +hexadecimal('G'); // false +hexadecimal('💩'); // false +``` + +## API + +### `hexadecimal(character)` + +Check whether the given character code (`number`), or the character +code at the first position (`string`), is hexadecimal. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-hexadecimal.svg + +[travis]: https://travis-ci.org/wooorm/is-hexadecimal + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-hexadecimal.svg + +[codecov]: https://codecov.io/github/wooorm/is-hexadecimal + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/is-plain-obj/index.js b/tools/doc/node_modules/is-plain-obj/index.js new file mode 100644 index 00000000000000..0d1ba9eeb89723 --- /dev/null +++ b/tools/doc/node_modules/is-plain-obj/index.js @@ -0,0 +1,7 @@ +'use strict'; +var toString = Object.prototype.toString; + +module.exports = function (x) { + var prototype; + return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); +}; diff --git a/tools/doc/node_modules/is-plain-obj/license b/tools/doc/node_modules/is-plain-obj/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/doc/node_modules/is-plain-obj/license @@ -0,0 +1,21 @@ +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/doc/node_modules/is-plain-obj/package.json b/tools/doc/node_modules/is-plain-obj/package.json new file mode 100644 index 00000000000000..c14c0144749492 --- /dev/null +++ b/tools/doc/node_modules/is-plain-obj/package.json @@ -0,0 +1,68 @@ +{ + "_from": "is-plain-obj@^1.1.0", + "_id": "is-plain-obj@1.1.0", + "_inBundle": false, + "_integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "_location": "/is-plain-obj", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-plain-obj@^1.1.0", + "name": "is-plain-obj", + "escapedName": "is-plain-obj", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "_shasum": "71a50c8429dfca773c92a390a4a03b39fcd51d3e", + "_spec": "is-plain-obj@^1.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "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" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-plain-obj#readme", + "keywords": [ + "obj", + "object", + "is", + "check", + "test", + "type", + "plain", + "vanilla", + "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" +} diff --git a/tools/doc/node_modules/is-plain-obj/readme.md b/tools/doc/node_modules/is-plain-obj/readme.md new file mode 100644 index 00000000000000..269e56aeff0646 --- /dev/null +++ b/tools/doc/node_modules/is-plain-obj/readme.md @@ -0,0 +1,35 @@ +# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj) + +> Check if a value is a plain object + +An object is plain if it's created by either `{}`, `new Object()` or `Object.create(null)`. + + +## Install + +``` +$ npm install --save is-plain-obj +``` + + +## Usage + +```js +var isPlainObj = require('is-plain-obj'); + +isPlainObj({foo: 'bar'}); +//=> true + +isPlainObj([1, 2, 3]); +//=> false +``` + + +## Related + +- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/doc/node_modules/is-whitespace-character/LICENSE b/tools/doc/node_modules/is-whitespace-character/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-whitespace-character/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-whitespace-character/history.md b/tools/doc/node_modules/is-whitespace-character/history.md new file mode 100644 index 00000000000000..674e111c479ebb --- /dev/null +++ b/tools/doc/node_modules/is-whitespace-character/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-12 +================== diff --git a/tools/doc/node_modules/is-whitespace-character/index.js b/tools/doc/node_modules/is-whitespace-character/index.js new file mode 100644 index 00000000000000..f9e23df3f72b0b --- /dev/null +++ b/tools/doc/node_modules/is-whitespace-character/index.js @@ -0,0 +1,33 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-whitespace-character + * @fileoverview Check if a character is a whitespace character. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = whitespace; + +/* Methods. */ +var fromCode = String.fromCharCode; + +/* Constants. */ +var re = /\s/; + +/** + * Check whether the given character code, or the character + * code at the first character, is a whitespace character. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is a whitespaces character. + */ +function whitespace(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ); +} diff --git a/tools/doc/node_modules/is-whitespace-character/package.json b/tools/doc/node_modules/is-whitespace-character/package.json new file mode 100644 index 00000000000000..e872464ce6b5c0 --- /dev/null +++ b/tools/doc/node_modules/is-whitespace-character/package.json @@ -0,0 +1,112 @@ +{ + "_from": "is-whitespace-character@^1.0.0", + "_id": "is-whitespace-character@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u/SoN2Tq0NRRvsKlUhjpGWGtwnU=", + "_location": "/is-whitespace-character", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-whitespace-character@^1.0.0", + "name": "is-whitespace-character", + "escapedName": "is-whitespace-character", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.0.tgz", + "_shasum": "bbf4a83764ead0d451bec2a55218e91961adc275", + "_spec": "is-whitespace-character@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-whitespace-character/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a whitespace character", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-whitespace-character.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isWhitespaceCharacter > is-whitespace-character.js", + "build-mangle": "esmangle < is-whitespace-character.js > is-whitespace-character.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-whitespace-character.js", + "is-whitespace-character.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-whitespace-character/readme.md b/tools/doc/node_modules/is-whitespace-character/readme.md new file mode 100644 index 00000000000000..c2ac49c21300e8 --- /dev/null +++ b/tools/doc/node_modules/is-whitespace-character/readme.md @@ -0,0 +1,63 @@ +# is-whitespace-character [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +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]`). + +## Installation + +[npm][npm-install]: + +```bash +npm install is-whitespace-character +``` + +## Usage + +```javascript +var whitespace = require('is-whitespace-character'); + +whitespace(' '); // true +whitespace('\n'); // true +whitespace('\ufeff'); // true +whitespace('_'); // false +whitespace('a'); // true +whitespace('💩'); // false +``` + +## API + +### `whitespaceCharacter(character)` + +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] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-whitespace-character.svg + +[travis]: https://travis-ci.org/wooorm/is-whitespace-character + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-whitespace-character.svg + +[codecov]: https://codecov.io/github/wooorm/is-whitespace-character + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/is-word-character/LICENSE b/tools/doc/node_modules/is-word-character/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/is-word-character/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/is-word-character/history.md b/tools/doc/node_modules/is-word-character/history.md new file mode 100644 index 00000000000000..674e111c479ebb --- /dev/null +++ b/tools/doc/node_modules/is-word-character/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-12 +================== diff --git a/tools/doc/node_modules/is-word-character/index.js b/tools/doc/node_modules/is-word-character/index.js new file mode 100644 index 00000000000000..c2f9c3fd05992c --- /dev/null +++ b/tools/doc/node_modules/is-word-character/index.js @@ -0,0 +1,33 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module is-word-character + * @fileoverview Check if a character is a word character. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = wordCharacter; + +/* Methods. */ +var fromCode = String.fromCharCode; + +/* Constants. */ +var re = /\w/; + +/** + * Check whether the given character code, or the character + * code at the first character, is a word character. + * + * @param {string|number} character + * @return {boolean} - Whether `character` is a word character. + */ +function wordCharacter(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ); +} diff --git a/tools/doc/node_modules/is-word-character/package.json b/tools/doc/node_modules/is-word-character/package.json new file mode 100644 index 00000000000000..2633dc84ff9b06 --- /dev/null +++ b/tools/doc/node_modules/is-word-character/package.json @@ -0,0 +1,109 @@ +{ + "_from": "is-word-character@^1.0.0", + "_id": "is-word-character@1.0.0", + "_inBundle": false, + "_integrity": "sha1-o6nl3a1wxcLuNvSpz8mlP0RTUkc=", + "_location": "/is-word-character", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-word-character@^1.0.0", + "name": "is-word-character", + "escapedName": "is-word-character", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.0.tgz", + "_shasum": "a3a9e5ddad70c5c2ee36f4a9cfc9a53f44535247", + "_spec": "is-word-character@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-word-character/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a word character", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-word-character.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s isWordCharacter > is-word-character.js", + "build-mangle": "esmangle < is-word-character.js > is-word-character.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "is-word-character.js", + "is-word-character.min.js" + ] + } +} diff --git a/tools/doc/node_modules/is-word-character/readme.md b/tools/doc/node_modules/is-word-character/readme.md new file mode 100644 index 00000000000000..4a0a25fd299d77 --- /dev/null +++ b/tools/doc/node_modules/is-word-character/readme.md @@ -0,0 +1,62 @@ +# is-word-character [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Check if a character is a word character (`\w`, which equals +`[a-zA-Z0-9_]`). + +## Installation + +[npm][npm-install]: + +```bash +npm install is-word-character +``` + +## Usage + +```javascript +var wordCharacter = require('is-word-character'); + +wordCharacter('a'); // true +wordCharacter('Z'); // true +wordCharacter('0'); // true +wordCharacter('_'); // true +wordCharacter(' '); // false +wordCharacter('💩'); // false +``` + +## API + +### `wordCharacter(character)` + +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] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/is-word-character.svg + +[travis]: https://travis-ci.org/wooorm/is-word-character + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-word-character.svg + +[codecov]: https://codecov.io/github/wooorm/is-word-character + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/longest-streak/LICENSE b/tools/doc/node_modules/longest-streak/LICENSE new file mode 100644 index 00000000000000..611b67581bb8e2 --- /dev/null +++ b/tools/doc/node_modules/longest-streak/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/longest-streak/index.js b/tools/doc/node_modules/longest-streak/index.js new file mode 100644 index 00000000000000..1638da65a31414 --- /dev/null +++ b/tools/doc/node_modules/longest-streak/index.js @@ -0,0 +1,37 @@ +'use strict'; + +/* Expose. */ +module.exports = longestStreak; + +/* Get the count of the longest repeating streak of + * `character` in `value`. */ +function longestStreak(value, character) { + var count = 0; + var maximum = 0; + var expected; + var index; + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character'); + } + + value = String(value); + expected = index = value.indexOf(character); + + while (index !== -1) { + count++; + + if (index === expected) { + if (count > maximum) { + maximum = count; + } + } else { + count = 1; + } + + expected = index + 1; + index = value.indexOf(character, expected); + } + + return maximum; +} diff --git a/tools/doc/node_modules/longest-streak/package.json b/tools/doc/node_modules/longest-streak/package.json new file mode 100644 index 00000000000000..a1243229d12f44 --- /dev/null +++ b/tools/doc/node_modules/longest-streak/package.json @@ -0,0 +1,97 @@ +{ + "_from": "longest-streak@^2.0.1", + "_id": "longest-streak@2.0.1", + "_inBundle": false, + "_integrity": "sha1-QtKRtUEeQDZcAOYxk0l+IkcxbjU=", + "_location": "/longest-streak", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "longest-streak@^2.0.1", + "name": "longest-streak", + "escapedName": "longest-streak", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.1.tgz", + "_shasum": "42d291b5411e40365c00e63193497e2247316e35", + "_spec": "longest-streak@^2.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/afinn-111/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Count the longest repeating streak of a character", + "devDependencies": { + "browserify": "^13.0.0", + "esmangle": "^1.0.0", + "nyc": "^10.0.0", + "remark-cli": "^2.1.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.6.2", + "xo": "^0.17.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/afinn-111#readme", + "keywords": [ + "count", + "length", + "longest", + "repeating", + "streak", + "character" + ], + "license": "MIT", + "name": "longest-streak", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/afinn-111.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s longestStreak > longest-streak.js", + "build-mangle": "esmangle longest-streak.js > longest-streak.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "2.0.1", + "xo": { + "space": true, + "ignores": [ + "longest-streak.js" + ] + } +} diff --git a/tools/doc/node_modules/longest-streak/readme.md b/tools/doc/node_modules/longest-streak/readme.md new file mode 100644 index 00000000000000..1e7d44501dc861 --- /dev/null +++ b/tools/doc/node_modules/longest-streak/readme.md @@ -0,0 +1,59 @@ +# longest-streak [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Count the longest repeating streak of a character. + +## Installation + +[npm][]: + +```bash +npm install longest-streak +``` + +## Usage + +```js +var longestStreak = require('longest-streak'); + +longestStreak('` foo `` bar `', '`') //=> 2 +``` + +## API + +### `longestStreak(value, character)` + +Get the count of the longest repeating streak of `character` in `value`. + +###### Parameters + +* `value` (`string`) — Content, coerced to string. +* `character` (`string`) — Single character to look for. + +###### Returns + +`number` — Number of characters at the place where `character` occurs in +its longest streak in `value`. + +###### Throws + +* `Error` — when `character` is not a single character string. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/longest-streak.svg + +[travis]: https://travis-ci.org/wooorm/longest-streak + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/longest-streak.svg + +[codecov]: https://codecov.io/github/wooorm/longest-streak + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/mapz/LICENSE b/tools/doc/node_modules/mapz/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/mapz/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/mapz/history.md b/tools/doc/node_modules/mapz/history.md new file mode 100644 index 00000000000000..f20d5035693db5 --- /dev/null +++ b/tools/doc/node_modules/mapz/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-16 +================== diff --git a/tools/doc/node_modules/mapz/index.js b/tools/doc/node_modules/mapz/index.js new file mode 100644 index 00000000000000..b3ce04b3040ee3 --- /dev/null +++ b/tools/doc/node_modules/mapz/index.js @@ -0,0 +1,74 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module mapz + * @fileoverview Functional map with sugar. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Dependencies. */ +var array = require('x-is-array'); +var string = require('x-is-string'); + +/* Expose. */ +module.exports = factory; + +/** + * Functional map with sugar. + * + * @param {Function} fn - Handle one value. + * @param {Object?|string} [options] - Configuration. + * @return {Function} - Hande values. + */ +function factory(fn, options) { + var settings = options || {}; + var key = settings.key; + var indices = settings.indices; + var gapless = settings.gapless; + + if (string(settings)) { + key = settings; + } + + if (indices == null) { + indices = true; + } + + return all; + + function all(values) { + var results = []; + var parent = values; + var index = -1; + var length; + var result; + + if (key) { + if (array(values)) { + parent = null; + } else { + values = parent[key]; + } + } + + length = values.length; + + while (++index < length) { + if (indices) { + result = fn.call(this, values[index], index, parent); + } else { + result = fn.call(this, values[index], parent); + } + + if (!gapless || result != null) { + results.push(result); + } + } + + return results; + } +} diff --git a/tools/doc/node_modules/mapz/package.json b/tools/doc/node_modules/mapz/package.json new file mode 100644 index 00000000000000..265f08953cb47c --- /dev/null +++ b/tools/doc/node_modules/mapz/package.json @@ -0,0 +1,114 @@ +{ + "_from": "mapz@^1.0.0", + "_id": "mapz@1.0.0", + "_inBundle": false, + "_integrity": "sha1-1i9lNbYC3BMYKlS1ASXzxh1fYwc=", + "_location": "/mapz", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mapz@^1.0.0", + "name": "mapz", + "escapedName": "mapz", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/mapz/-/mapz-1.0.0.tgz", + "_shasum": "d62f6535b602dc13182a54b50125f3c61d5f6307", + "_spec": "mapz@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/mapz/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "x-is-array": "^0.1.0", + "x-is-string": "^0.1.0" + }, + "deprecated": false, + "description": "Functional map with sugar", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/mapz#readme", + "keywords": [ + "map", + "function", + "sugar" + ], + "license": "MIT", + "name": "mapz", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/mapz.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s mapz > mapz.js", + "build-mangle": "esmangle < mapz.js > mapz.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "rules": { + "eqeqeq": "off", + "no-eq-null": "off" + }, + "ignores": [ + "mapz.js", + "mapz.min.js" + ] + } +} diff --git a/tools/doc/node_modules/mapz/readme.md b/tools/doc/node_modules/mapz/readme.md new file mode 100644 index 00000000000000..3ac05b1417015d --- /dev/null +++ b/tools/doc/node_modules/mapz/readme.md @@ -0,0 +1,116 @@ +# mapz [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Functional map with sugar. + +## Installation + +[npm][npm-install]: + +```bash +npm install mapz +``` + +## Usage + +```javascript +var mapz = require('mapz'); + +// Create. +var map = mapz(fn, {key: 'children', gapless: true}); + +// Run. +var res = map({children: [1, 2, 3]}); +console.log(res); + +function fn(value) { + return value > 1 ? 'Hi, ' + value + '.' : null; +} +``` + +Yields: + +```javascript +['Hi, 2', 'Hi, 3'] +``` + +## API + +### `mapz(fn[, options])` + +Functional map with sugar (functional, as values are provided as a +parameter, instead of context object). + +Wraps the supplied [`fn`][fn], which handles one value, so that it +accepts multiple values, invoking `fn` for each and returning all +results. + +If `options` is a string, it’s treated as `{key: options}`. + +###### `options.gapless` + +Whether to filter out `null` and `undefined` results `boolean`, +default: `false`. + +###### `options.indices` + +Whether to invoke `fn` with the index of the value in its context +(`boolean`, default: `true`); + +###### `options.key` + +If a key (`string`, optional) is given, and an object supplied to the +wrapped `fn`, values at that object’s `key` property are mapped and +the object, instead of the values, is given to `fn` as a last +parameter. If a key is given and an array is passed to the wrapped +`fn`, no value is given to `fn` as a last parameter. + +###### Returns + +`Function` — See [`map(values)`][map] + +#### `map(values)` + +Invoke the bound [`fn`][fn] for all values. If a `key` is bound, +`values` can be an object. See [`options.key`][key] for more info. + +###### Returns + +`Array.<*>` — Values returned by `fn`. If `gapless` is `true`, `null` +or `undefined` results are not returned by `map`. + +#### `fn(value[, index], parent?)` + +Handle one value. If `indices` is `false`, no index parameter is +passed. If `key` is set and an array is given, no `parent` is passed. + +###### Returns + +`*` — Any value. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/mapz.svg + +[travis]: https://travis-ci.org/wooorm/mapz + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/mapz.svg + +[codecov]: https://codecov.io/github/wooorm/mapz + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[map]: #mapvalues + +[key]: #optionskey + +[fn]: #fnvalue-index-parent diff --git a/tools/doc/node_modules/markdown-escapes/LICENSE b/tools/doc/node_modules/markdown-escapes/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/markdown-escapes/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/markdown-escapes/history.md b/tools/doc/node_modules/markdown-escapes/history.md new file mode 100644 index 00000000000000..f20d5035693db5 --- /dev/null +++ b/tools/doc/node_modules/markdown-escapes/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-16 +================== diff --git a/tools/doc/node_modules/markdown-escapes/index.js b/tools/doc/node_modules/markdown-escapes/index.js new file mode 100644 index 00000000000000..38f81193e81238 --- /dev/null +++ b/tools/doc/node_modules/markdown-escapes/index.js @@ -0,0 +1,75 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module markdown-escapes + * @fileoverview List of escapable characters in markdown. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +module.exports = escapes; + +/* Characters. */ +var defaults = [ + '\\', + '`', + '*', + '{', + '}', + '[', + ']', + '(', + ')', + '#', + '+', + '-', + '.', + '!', + '_', + '>' +]; + +var gfm = defaults.concat(['~', '|']); + +var commonmark = gfm.concat([ + '\n', + '"', + '$', + '%', + '&', + '\'', + ',', + '/', + ':', + ';', + '<', + '=', + '?', + '@', + '^' +]); + +/* Expose characters. */ +escapes.default = defaults; +escapes.gfm = gfm; +escapes.commonmark = commonmark; + +/** + * Get markdown escapes. + * + * @param {Object?} [options] - Configuration. + * @return {Array.} - Escapes. + */ +function escapes(options) { + var settings = options || {}; + + if (settings.commonmark) { + return commonmark; + } + + return settings.gfm ? gfm : defaults; +} diff --git a/tools/doc/node_modules/markdown-escapes/package.json b/tools/doc/node_modules/markdown-escapes/package.json new file mode 100644 index 00000000000000..507a6f607785a7 --- /dev/null +++ b/tools/doc/node_modules/markdown-escapes/package.json @@ -0,0 +1,110 @@ +{ + "_from": "markdown-escapes@^1.0.0", + "_id": "markdown-escapes@1.0.0", + "_inBundle": false, + "_integrity": "sha1-yMoZ8dlNaCRZ4Kk8htsnp+9xayM=", + "_location": "/markdown-escapes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "markdown-escapes@^1.0.0", + "name": "markdown-escapes", + "escapedName": "markdown-escapes", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.0.tgz", + "_shasum": "c8ca19f1d94d682459e0a93c86db27a7ef716b23", + "_spec": "markdown-escapes@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/markdown-escapes/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "List of escapable characters in markdown", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/markdown-escapes.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s markdownEscapes > markdown-escapes.js", + "build-mangle": "esmangle < markdown-escapes.js > markdown-escapes.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "markdown-escapes.js", + "markdown-escapes.min.js" + ] + } +} diff --git a/tools/doc/node_modules/markdown-escapes/readme.md b/tools/doc/node_modules/markdown-escapes/readme.md new file mode 100644 index 00000000000000..8ab33f397d289d --- /dev/null +++ b/tools/doc/node_modules/markdown-escapes/readme.md @@ -0,0 +1,71 @@ +# markdown-escapes [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +List of escapable characters in markdown. + +## Installation + +[npm][npm-install]: + +```bash +npm install markdown-escapes +``` + +## Usage + +```javascript +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 +flavours. + +###### 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] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/markdown-escapes.svg + +[travis]: https://travis-ci.org/wooorm/markdown-escapes + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-escapes.svg + +[codecov]: https://codecov.io/github/wooorm/markdown-escapes + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/markdown-table/LICENSE b/tools/doc/node_modules/markdown-table/LICENSE new file mode 100644 index 00000000000000..0c06d5bc0a5dc8 --- /dev/null +++ b/tools/doc/node_modules/markdown-table/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 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/doc/node_modules/markdown-table/index.js b/tools/doc/node_modules/markdown-table/index.js new file mode 100644 index 00000000000000..1098bc4ce1c3e7 --- /dev/null +++ b/tools/doc/node_modules/markdown-table/index.js @@ -0,0 +1,250 @@ +'use strict'; + +/* Expose. */ +module.exports = markdownTable; + +/* Expressions. */ +var EXPRESSION_DOT = /\./; +var EXPRESSION_LAST_DOT = /\.[^.]*$/; + +/* Allowed alignment values. */ +var LEFT = 'l'; +var RIGHT = 'r'; +var CENTER = 'c'; +var DOT = '.'; +var NULL = ''; + +var ALLIGNMENT = [LEFT, RIGHT, CENTER, DOT, NULL]; +var MIN_CELL_SIZE = 3; + +/* Characters. */ +var COLON = ':'; +var DASH = '-'; +var PIPE = '|'; +var SPACE = ' '; +var NEW_LINE = '\n'; + +/* Create a table from a matrix of strings. */ +function markdownTable(table, options) { + var settings = options || {}; + var delimiter = settings.delimiter; + var start = settings.start; + var end = settings.end; + var alignment = settings.align; + var calculateStringLength = settings.stringLength || lengthNoop; + var cellCount = 0; + var rowIndex = -1; + var rowLength = table.length; + var sizes = []; + var align; + var rule; + var rows; + var row; + var cells; + var index; + var position; + var size; + var value; + var spacing; + var before; + var after; + + alignment = alignment ? alignment.concat() : []; + + if (delimiter === null || delimiter === undefined) { + delimiter = SPACE + PIPE + SPACE; + } + + if (start === null || start === undefined) { + start = PIPE + SPACE; + } + + if (end === null || end === undefined) { + end = SPACE + PIPE; + } + + while (++rowIndex < rowLength) { + row = table[rowIndex]; + + index = -1; + + if (row.length > cellCount) { + cellCount = row.length; + } + + while (++index < cellCount) { + position = row[index] ? dotindex(row[index]) : null; + + if (!sizes[index]) { + sizes[index] = MIN_CELL_SIZE; + } + + if (position > sizes[index]) { + sizes[index] = position; + } + } + } + + if (typeof alignment === 'string') { + alignment = pad(cellCount, alignment).split(''); + } + + /* Make sure only valid alignments are used. */ + index = -1; + + while (++index < cellCount) { + align = alignment[index]; + + if (typeof align === 'string') { + align = align.charAt(0).toLowerCase(); + } + + if (ALLIGNMENT.indexOf(align) === -1) { + align = NULL; + } + + alignment[index] = align; + } + + rowIndex = -1; + rows = []; + + while (++rowIndex < rowLength) { + row = table[rowIndex]; + + index = -1; + cells = []; + + while (++index < cellCount) { + value = row[index]; + + value = stringify(value); + + if (alignment[index] === DOT) { + position = dotindex(value); + + size = sizes[index] + + (EXPRESSION_DOT.test(value) ? 0 : 1) - + (calculateStringLength(value) - position); + + cells[index] = value + pad(size - 1); + } else { + cells[index] = value; + } + } + + rows[rowIndex] = cells; + } + + sizes = []; + rowIndex = -1; + + while (++rowIndex < rowLength) { + cells = rows[rowIndex]; + + index = -1; + + while (++index < cellCount) { + value = cells[index]; + + if (!sizes[index]) { + sizes[index] = MIN_CELL_SIZE; + } + + size = calculateStringLength(value); + + if (size > sizes[index]) { + sizes[index] = size; + } + } + } + + rowIndex = -1; + + while (++rowIndex < rowLength) { + cells = rows[rowIndex]; + + index = -1; + + if (settings.pad !== false) { + while (++index < cellCount) { + value = cells[index]; + + position = sizes[index] - (calculateStringLength(value) || 0); + spacing = pad(position); + + if (alignment[index] === RIGHT || alignment[index] === DOT) { + value = spacing + value; + } else if (alignment[index] === CENTER) { + position /= 2; + + if (position % 1 === 0) { + before = position; + after = position; + } else { + before = position + 0.5; + after = position - 0.5; + } + + value = pad(before) + value + pad(after); + } else { + value += spacing; + } + + cells[index] = value; + } + } + + rows[rowIndex] = cells.join(delimiter); + } + + if (settings.rule !== false) { + index = -1; + rule = []; + + while (++index < cellCount) { + /* When `pad` is false, make the rule the same size as the first row. */ + if (settings.pad === false) { + value = table[0][index]; + spacing = calculateStringLength(stringify(value)); + spacing = spacing > MIN_CELL_SIZE ? spacing : MIN_CELL_SIZE; + } else { + spacing = sizes[index]; + } + + align = alignment[index]; + + /* When `align` is left, don't add colons. */ + value = align === RIGHT || align === NULL ? DASH : COLON; + value += pad(spacing - 2, DASH); + value += align !== LEFT && align !== NULL ? COLON : DASH; + + rule[index] = value; + } + + rows.splice(1, 0, rule.join(delimiter)); + } + + return start + rows.join(end + NEW_LINE + start) + end; +} + +function stringify(value) { + return (value === null || value === undefined) ? '' : String(value); +} + +/* Get the length of `value`. */ +function lengthNoop(value) { + return String(value).length; +} + +/* Get a string consisting of `length` `character`s. */ +function pad(length, character) { + return Array(length + 1).join(character || SPACE); +} + +/* Get the position of the last dot in `value`. */ +function dotindex(value) { + var match = EXPRESSION_LAST_DOT.exec(value); + + return match ? match.index + 1 : value.length; +} diff --git a/tools/doc/node_modules/markdown-table/package.json b/tools/doc/node_modules/markdown-table/package.json new file mode 100644 index 00000000000000..b236b447cfe037 --- /dev/null +++ b/tools/doc/node_modules/markdown-table/package.json @@ -0,0 +1,107 @@ +{ + "_from": "markdown-table@^1.1.0", + "_id": "markdown-table@1.1.0", + "_inBundle": false, + "_integrity": "sha1-H1rmFlnO2ICNiCVUwy6LPzjdEUM=", + "_location": "/markdown-table", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "markdown-table@^1.1.0", + "name": "markdown-table", + "escapedName": "markdown-table", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.0.tgz", + "_shasum": "1f5ae61659ced8808d882554c32e8b3f38dd1143", + "_spec": "markdown-table@^1.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/markdown-table/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Markdown/ASCII tables", + "devDependencies": { + "browserify": "^14.0.0", + "chalk": "^1.1.3", + "esmangle": "^1.0.0", + "nyc": "^10.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.4.0", + "xo": "^0.17.0" + }, + "engines": { + "node": ">=0.11.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/markdown-table#readme", + "keywords": [ + "text", + "markdown", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "license": "MIT", + "name": "markdown-table", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "output": true, + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/markdown-table.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s markdownTable > markdown-table.js", + "build-mangle": "esmangle markdown-table.js > markdown-table.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "rules": { + "complexity": "off", + "max-depth": "off" + }, + "ignores": [ + "markdown-table.js" + ] + } +} diff --git a/tools/doc/node_modules/markdown-table/readme.md b/tools/doc/node_modules/markdown-table/readme.md new file mode 100644 index 00000000000000..dfe54d79acafd6 --- /dev/null +++ b/tools/doc/node_modules/markdown-table/readme.md @@ -0,0 +1,167 @@ +# markdown-table [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Generate fancy [Markdown][fancy]/ASCII tables. + +## Installation + +[npm][]: + +```bash +npm install markdown-table +``` + +## Usage + +Dependencies: + +```javascript +var table = require('markdown-table'); +``` + +Normal usage (defaults to left-alignment): + +```javascript +table([ + ['Branch', 'Commit'], + ['master', '0123456789abcdef'], + ['staging', 'fedcba9876543210'] +]); +``` + +Yields: + +```txt +| Branch | Commit | +| ------- | ---------------- | +| master | 0123456789abcdef | +| staging | fedcba9876543210 | +``` + +With alignment: + +```javascript +table([ + ['Beep', 'No.', 'Boop'], + ['beep', '1024', 'xyz'], + ['boop', '3388450', 'tuv'], + ['foo', '10106', 'qrstuv'], + ['bar', '45', 'lmno'] +], { + align: ['l', 'c', 'r'] +}); +``` + +Yields: + +```txt +| Beep | No. | Boop | +| :--- | :-----: | -----: | +| beep | 1024 | xyz | +| boop | 3388450 | tuv | +| foo | 10106 | qrstuv | +| bar | 45 | lmno | +``` + +Alignment on dots: + +```javascript +table([ + ['No.'], + ['0.1.2'], + ['11.22.33'], + ['5.6.'], + ['1.22222'], +], { + align: '.' +}); +``` + +Yields: + +```txt +| No. | +| :---------: | +| 0.1.2 | +| 11.22.33 | +| 5.6. | +| 1.22222 | +``` + +## API + +### `markdownTable(table[, options])` + +Turns a given matrix of strings (an array of arrays of strings) into a table. + +###### `options` + +The following options are available: + +* `options.align` (`string` or `Array.`) + — One style for all columns, or styles for their respective + columns. Each style is either `'l'` (left), `'r'` (right), `'c'` + (centre), or `'.'` (dot). Other values are treated as `''`, which + doesn’t place the colon but does left align. _Only the lowercased + first character is used, so `Right` is fine_; +* `options.delimiter` (`string`, default: `' | '`) + — Value to insert between cells. Careful, setting this to a + non-pipe breaks GitHub Flavoured Markdown; +* `options.start` (`string`, default: `'| '`) + — Value to insert at the beginning of every row. +* `options.end` (`string`, default: `' |'`) + — Value to insert at the end of every row. +* `options.rule` (`boolean`, default: `true`) + — Whether to display a rule between the header and the body of the + table. Careful, will break GitHub Flavoured Markdown when `false`; +* `options.stringLength` ([`Function`][length], default: + `s => s.length`) + — Method to detect the length of a cell (see below). +* `options.pad` (`boolean`, default: `true`) + — Whether to pad the markdown for table cells to make them the same + width. Setting this to false will cause the table rows to + remain staggered. + +### `stringLength(cell)` + +ANSI-sequences mess up tables on terminals. To fix this, you have to +pass in a `stringLength` option to detect the “visible” length of a +cell. + +```javascript +var chalk = require('chalk'); + +function stringLength(cell) { + return chalk.stripColor(cell).length; +} +``` + +## Inspiration + +The original idea and basic implementation was inspired by James +Halliday’s [text-table][] library. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/markdown-table.svg + +[travis]: https://travis-ci.org/wooorm/markdown-table + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-table.svg + +[codecov]: https://codecov.io/github/wooorm/markdown-table + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[fancy]: https://help.github.com/articles/github-flavored-markdown/#tables + +[length]: #stringlengthcell + +[text-table]: https://github.com/substack/text-table diff --git a/tools/doc/node_modules/mdast-util-compact/LICENSE b/tools/doc/node_modules/mdast-util-compact/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/mdast-util-compact/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/mdast-util-compact/index.js b/tools/doc/node_modules/mdast-util-compact/index.js new file mode 100644 index 00000000000000..d1b32e551e4e8e --- /dev/null +++ b/tools/doc/node_modules/mdast-util-compact/index.js @@ -0,0 +1,72 @@ +'use strict'; + +/* Dependencies. */ +var visit = require('unist-util-visit'); +var modify = require('unist-util-modify-children'); + +/* Expose. */ +module.exports = compact; + +/* Make an MDAST tree compact by merging adjacent text + * nodes. */ +function compact(tree, commonmark) { + var modifier = modify(iterator); + + visit(tree, visitor); + + return tree; + + function visitor(node) { + if (node.children) { + modifier(node); + } + } + + function iterator(child, index, parent) { + var siblings = parent.children; + var prev = index && siblings[index - 1]; + + if ( + prev && + child.type === prev.type && + mergeable(prev, commonmark) && + mergeable(child, commonmark) + ) { + if (child.value) { + prev.value += child.value; + } + + if (child.children) { + prev.children = prev.children.concat(child.children); + } + + siblings.splice(index, 1); + + if (prev.position && child.position) { + prev.position.end = child.position.end; + } + + return index; + } + } +} + +function mergeable(node, commonmark) { + var start; + var end; + + if (node.type === 'text') { + if (!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; + } + + return commonmark && node.type === 'blockquote'; +} diff --git a/tools/doc/node_modules/mdast-util-compact/package.json b/tools/doc/node_modules/mdast-util-compact/package.json new file mode 100644 index 00000000000000..b86884f3c6e21b --- /dev/null +++ b/tools/doc/node_modules/mdast-util-compact/package.json @@ -0,0 +1,102 @@ +{ + "_from": "mdast-util-compact@^1.0.0", + "_id": "mdast-util-compact@1.0.1", + "_inBundle": false, + "_integrity": "sha1-zbX4TitqLTEU3zO9BdnLMuPECDo=", + "_location": "/mdast-util-compact", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mdast-util-compact@^1.0.0", + "name": "mdast-util-compact", + "escapedName": "mdast-util-compact", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz", + "_shasum": "cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a", + "_spec": "mdast-util-compact@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/mdast-util-compact/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "unist-util-modify-children": "^1.0.0", + "unist-util-visit": "^1.1.0" + }, + "deprecated": false, + "description": "Make an MDAST tree compact", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.1", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "unist-builder": "^1.0.2", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/mdast-util-compact#readme", + "keywords": [ + "mdast", + "utility", + "compact", + "node" + ], + "license": "MIT", + "name": "mdast-util-compact", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/mdast-util-compact.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s mdastUtilCompact > mdast-util-compact.js", + "build-mangle": "esmangle < mdast-util-compact.js > mdast-util-compact.min.js", + "build-md": "remark . --quiet --frail --output", + "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" + }, + "version": "1.0.1", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "mdast-util-compact.js" + ] + } +} diff --git a/tools/doc/node_modules/mdast-util-compact/readme.md b/tools/doc/node_modules/mdast-util-compact/readme.md new file mode 100644 index 00000000000000..75e96e2215ad01 --- /dev/null +++ b/tools/doc/node_modules/mdast-util-compact/readme.md @@ -0,0 +1,72 @@ +# mdast-util-compact [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Make an [MDAST][] tree compact: collapse text nodes (when possible), +and blockquotes (in commonmark mode). + +## Installation + +[npm][]: + +```bash +npm install mdast-util-compact +``` + +## Usage + +```javascript +var u = require('unist-builder'); +var compact = require('mdast-util-compact'); + +var tree = u('strong', [ + u('text', 'alpha'), + u('text', ' '), + u('text', 'bravo') +]); + +compact(tree); + +console.log(tree); +``` + +Yields: + +```js +{ type: 'strong', + children: [ { type: 'text', value: 'alpha bravo' } ] } +``` + +## API + +### `compact(tree[, commonmark])` + +Visit the tree and collapse nodes. Combines adjacent text nodes (but +not when they represent entities or escapes). If `commonmark` is `true`, +collapses `blockquote` nodes. + +Handles positional information properly. + +###### Returns + +The given `tree`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/syntax-tree/mdast-util-compact.svg + +[travis]: https://travis-ci.org/syntax-tree/mdast-util-compact + +[codecov-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-compact.svg + +[codecov]: https://codecov.io/github/syntax-tree/mdast-util-compact + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[mdast]: https://github.com/syntax-tree/mdast diff --git a/tools/doc/node_modules/mdast-util-to-string/LICENSE b/tools/doc/node_modules/mdast-util-to-string/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/mdast-util-to-string/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/mdast-util-to-string/index.js b/tools/doc/node_modules/mdast-util-to-string/index.js new file mode 100644 index 00000000000000..7e4dcf58a3a205 --- /dev/null +++ b/tools/doc/node_modules/mdast-util-to-string/index.js @@ -0,0 +1,22 @@ +'use strict'; + +/* Expose. */ +module.exports = toString; + +/* Get the text content of a node. If the node itself + * does not expose plain-text fields, `toString` will + * recursivly try its children. */ +function toString(node) { + return valueOf(node) || + (node.children && node.children.map(toString).join('')) || + ''; +} + +/* Get the value of `node`. Checks, `value`, + * `alt`, and `title`, in that order. */ +function valueOf(node) { + if (!node) { + return ''; + } + return node.value ? node.value : (node.alt ? node.alt : node.title) || ''; +} diff --git a/tools/doc/node_modules/mdast-util-to-string/package.json b/tools/doc/node_modules/mdast-util-to-string/package.json new file mode 100644 index 00000000000000..a3aa1ec9a36947 --- /dev/null +++ b/tools/doc/node_modules/mdast-util-to-string/package.json @@ -0,0 +1,101 @@ +{ + "_from": "mdast-util-to-string@^1.0.0", + "_id": "mdast-util-to-string@1.0.4", + "_inBundle": false, + "_integrity": "sha1-XEVch4yTVfDB5/PotxnPWDaRrPs=", + "_location": "/mdast-util-to-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mdast-util-to-string@^1.0.0", + "name": "mdast-util-to-string", + "escapedName": "mdast-util-to-string", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.4.tgz", + "_shasum": "5c455c878c9355f0c1e7f3e8b719cf583691acfb", + "_spec": "mdast-util-to-string@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/mdast-util-to-string/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Utility to get the plain text content of a node", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "xo": "^0.18.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/mdast-util-to-string#readme", + "keywords": [ + "mdast", + "markdown", + "node", + "to", + "string", + "util", + "utility" + ], + "license": "MIT", + "name": "mdast-util-to-string", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/mdast-util-to-string.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --no-builtins -s mdastUtilToString > mdast-util-to-string.js", + "build-mangle": "esmangle mdast-util-to-string.js > mdast-util-to-string.min.js", + "build-md": "remark . --quiet --frail --output", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-coverage", + "test-api": "node test.js", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "space": true, + "esnext": false, + "ignore": [ + "mdast-util-to-string.js" + ] + } +} diff --git a/tools/doc/node_modules/mdast-util-to-string/readme.md b/tools/doc/node_modules/mdast-util-to-string/readme.md new file mode 100644 index 00000000000000..71d9fe2dba3be0 --- /dev/null +++ b/tools/doc/node_modules/mdast-util-to-string/readme.md @@ -0,0 +1,75 @@ +# mdast-util-to-string [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] + +Get the plain text content of an [MDAST][] node. + +## Installation + +[npm][]: + +```bash +npm install mdast-util-to-string +``` + +## Usage + +```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. + +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. + +## 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/master/packages/hast-util-to-string) + — Get text content in HAST +* [`hast-util-from-string`](https://github.com/wooorm/rehype-minify/tree/master/packages/hast-util-from-string) + — Set text content in HAST + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/mdast-util-to-string.svg + +[build-status]: https://travis-ci.org/syntax-tree/mdast-util-to-string + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-string.svg + +[coverage-status]: https://codecov.io/github/syntax-tree/mdast-util-to-string + +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg + +[chat]: https://gitter.im/wooorm/remark + +[license]: LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[mdast]: https://github.com/syntax-tree/mdast + +[strip-markdown]: https://github.com/wooorm/strip-markdown diff --git a/tools/doc/node_modules/months/LICENSE b/tools/doc/node_modules/months/LICENSE new file mode 100644 index 00000000000000..943e71d05511e2 --- /dev/null +++ b/tools/doc/node_modules/months/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, 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. \ No newline at end of file diff --git a/tools/doc/node_modules/months/README.md b/tools/doc/node_modules/months/README.md new file mode 100644 index 00000000000000..29366b5f4f049a --- /dev/null +++ b/tools/doc/node_modules/months/README.md @@ -0,0 +1,101 @@ +# months [![NPM version](https://img.shields.io/npm/v/months.svg?style=flat)](https://www.npmjs.com/package/months) [![NPM monthly downloads](https://img.shields.io/npm/dm/months.svg?style=flat)](https://npmjs.org/package/months) [![NPM total downloads](https://img.shields.io/npm/dt/months.svg?style=flat)](https://npmjs.org/package/months) [![Linux Build Status](https://img.shields.io/travis/datetime/months.svg?style=flat&label=Travis)](https://travis-ci.org/datetime/months) + +> Months of the year. + +- [Install](#install) +- [Usage](#usage) +- [About](#about) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save months +``` + +## Usage + +```js +var months = require('months'); + +console.log(months); +//=> ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] + +console.log(months.abbr); +//=> ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + +console.log(months.it); +//=> [ 'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ] + +console.log(months.abbr.it); +//=> [ 'Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic' ] + +console.log(months.de); +//=> [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] + +console.log(months.abbr.de); +//=> [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ] +``` + +## About + +### Related projects + +* [days](https://www.npmjs.com/package/days): Days of the week. | [homepage](https://github.com/jonschlinkert/days "Days of the week.") +* [nanoseconds](https://www.npmjs.com/package/nanoseconds): Convert the process.hrtime array to a single nanoseconds value. | [homepage](https://github.com/jonschlinkert/nanoseconds "Convert the process.hrtime array to a single nanoseconds value.") +* [o-clock](https://www.npmjs.com/package/o-clock): Simple javascript utility for displaying the time in 12-hour clock format. | [homepage](https://github.com/jonschlinkert/o-clock "Simple javascript utility for displaying the time in 12-hour clock format.") +* [pretty-time](https://www.npmjs.com/package/pretty-time): Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds. | [homepage](https://github.com/jonschlinkert/pretty-time "Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.") +* [seconds](https://www.npmjs.com/package/seconds): Get the number of seconds for a minute, hour, day and week. | [homepage](https://github.com/jonschlinkert/seconds "Get the number of seconds for a minute, hour, day and week.") +* [time-stamp](https://www.npmjs.com/package/time-stamp): Get a formatted timestamp. | [homepage](https://github.com/jonschlinkert/time-stamp "Get a formatted timestamp.") +* [week](https://www.npmjs.com/package/week): Get the current week number. | [homepage](https://github.com/datetime/week "Get the current week number.") +* [year](https://www.npmjs.com/package/year): Simple utility to get the current year with 2 or 4 digits. | [homepage](https://github.com/jonschlinkert/year "Simple utility to get the current year with 2 or 4 digits.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 12 | [jonschlinkert](https://github.com/jonschlinkert) | +| 6 | [doowb](https://github.com/doowb) | +| 4 | [mihailgaberov](https://github.com/mihailgaberov) | +| 3 | [Rawnly](https://github.com/Rawnly) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 10, 2017._ \ No newline at end of file diff --git a/tools/doc/node_modules/months/index.js b/tools/doc/node_modules/months/index.js new file mode 100644 index 00000000000000..c7d09eec485bdb --- /dev/null +++ b/tools/doc/node_modules/months/index.js @@ -0,0 +1,18 @@ +/*! + * months + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +// English Translation +module.exports = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; +module.exports.abbr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +// Italian Translation +module.exports.it = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre']; +module.exports.abbr.it = ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic']; + +// German Translation +module.exports.de = [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']; +module.exports.abbr.de = [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ]; diff --git a/tools/doc/node_modules/months/package.json b/tools/doc/node_modules/months/package.json new file mode 100644 index 00000000000000..47606117d9ea7a --- /dev/null +++ b/tools/doc/node_modules/months/package.json @@ -0,0 +1,106 @@ +{ + "_from": "months@^1.0.1", + "_id": "months@1.2.0", + "_inBundle": false, + "_integrity": "sha512-zFM7hUpziSYGk2DNObYGWgHdRRxAOgjl8CC1Rbl50p/q0rGDsREfk0nbxxmSIquVi/lEAuUY8nwbwkZ8biNCOQ==", + "_location": "/months", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "months@^1.0.1", + "name": "months", + "escapedName": "months", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/months/-/months-1.2.0.tgz", + "_shasum": "beef54873960334abe0b03f6b38db8adb44a13ac", + "_spec": "months@^1.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/datetime/months/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Federico Vitale", + "url": "https://rawnly.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Mihail Gaberov", + "url": "http://mihail-gaberov.eu" + } + ], + "deprecated": false, + "description": "Months of the year.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/datetime/months", + "keywords": [ + "calendar", + "date", + "month", + "months" + ], + "license": "MIT", + "main": "index.js", + "name": "months", + "repository": { + "type": "git", + "url": "git+https://github.com/datetime/months.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": true, + "related": { + "list": [ + "days", + "nanoseconds", + "o-clock", + "pretty-time", + "seconds", + "time-stamp", + "week", + "year" + ] + }, + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.2.0" +} diff --git a/tools/doc/node_modules/parse-entities/LICENSE b/tools/doc/node_modules/parse-entities/LICENSE new file mode 100644 index 00000000000000..611b67581bb8e2 --- /dev/null +++ b/tools/doc/node_modules/parse-entities/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/parse-entities/index.js b/tools/doc/node_modules/parse-entities/index.js new file mode 100644 index 00000000000000..f2c9e02a52d4bf --- /dev/null +++ b/tools/doc/node_modules/parse-entities/index.js @@ -0,0 +1,473 @@ +'use strict'; + +/* Dependencies. */ +var characterEntities = require('character-entities'); +var legacy = require('character-entities-legacy'); +var invalid = require('character-reference-invalid'); +var decimal = require('is-decimal'); +var hexadecimal = require('is-hexadecimal'); +var alphanumerical = require('is-alphanumerical'); + +/* Expose. */ +module.exports = wrapper; + +/* Methods. */ +var own = {}.hasOwnProperty; +var fromCharCode = String.fromCharCode; +var noop = Function.prototype; + +/* Characters. */ +var REPLACEMENT = '\uFFFD'; +var FORM_FEED = '\f'; +var AMPERSAND = '&'; +var OCTOTHORP = '#'; +var SEMICOLON = ';'; +var NEWLINE = '\n'; +var X_LOWER = 'x'; +var X_UPPER = 'X'; +var SPACE = ' '; +var LESS_THAN = '<'; +var EQUAL = '='; +var EMPTY = ''; +var TAB = '\t'; + +/* Default settings. */ +var defaults = { + warning: null, + reference: null, + text: null, + warningContext: null, + referenceContext: null, + textContext: null, + position: {}, + additional: null, + attribute: false, + nonTerminated: true +}; + +/* Reference types. */ +var NAMED = 'named'; +var HEXADECIMAL = 'hexadecimal'; +var DECIMAL = 'decimal'; + +/* Map of bases. */ +var BASE = {}; + +BASE[HEXADECIMAL] = 16; +BASE[DECIMAL] = 10; + +/* Map of types to tests. Each type of character reference + * accepts different characters. This test is used to + * detect whether a reference has ended (as the semicolon + * is not strictly needed). */ +var TESTS = {}; + +TESTS[NAMED] = alphanumerical; +TESTS[DECIMAL] = decimal; +TESTS[HEXADECIMAL] = hexadecimal; + +/* Warning messages. */ +var NAMED_NOT_TERMINATED = 1; +var NUMERIC_NOT_TERMINATED = 2; +var NAMED_EMPTY = 3; +var NUMERIC_EMPTY = 4; +var NAMED_UNKNOWN = 5; +var NUMERIC_DISALLOWED = 6; +var NUMERIC_PROHIBITED = 7; + +var NUMERIC_REFERENCE = 'Numeric character references'; +var NAMED_REFERENCE = 'Named character references'; +var TERMINATED = ' must be terminated by a semicolon'; +var VOID = ' cannot be empty'; + +var MESSAGES = {}; + +MESSAGES[NAMED_NOT_TERMINATED] = NAMED_REFERENCE + TERMINATED; +MESSAGES[NUMERIC_NOT_TERMINATED] = NUMERIC_REFERENCE + TERMINATED; +MESSAGES[NAMED_EMPTY] = NAMED_REFERENCE + VOID; +MESSAGES[NUMERIC_EMPTY] = NUMERIC_REFERENCE + VOID; +MESSAGES[NAMED_UNKNOWN] = NAMED_REFERENCE + ' must be known'; +MESSAGES[NUMERIC_DISALLOWED] = NUMERIC_REFERENCE + ' cannot be disallowed'; +MESSAGES[NUMERIC_PROHIBITED] = NUMERIC_REFERENCE + ' cannot be outside the ' + + 'permissible Unicode range'; + +/* Wrap to ensure clean parameters are given to `parse`. */ +function wrapper(value, options) { + var settings = {}; + var option; + var key; + + if (!options) { + options = {}; + } + + for (key in defaults) { + option = options[key]; + settings[key] = option === null || option === undefined ? defaults[key] : option; + } + + if (settings.position.indent || settings.position.start) { + settings.indent = settings.position.indent || []; + settings.position = settings.position.start; + } + + return parse(value, settings); +} + +/* Parse entities. */ +function parse(value, settings) { + var additional = settings.additional; + var nonTerminated = settings.nonTerminated; + var handleText = settings.text; + var handleReference = settings.reference; + var handleWarning = settings.warning; + var textContext = settings.textContext; + var referenceContext = settings.referenceContext; + var warningContext = settings.warningContext; + var pos = settings.position; + var indent = settings.indent || []; + var length = value.length; + var index = 0; + var lines = -1; + var column = pos.column || 1; + var line = pos.line || 1; + var queue = EMPTY; + var result = []; + var entityCharacters; + var terminated; + var characters; + var character; + var reference; + var following; + var warning; + var reason; + var output; + var entity; + var begin; + var start; + var type; + var test; + var prev; + var next; + var diff; + var end; + + /* Cache the current point. */ + prev = now(); + + /* Wrap `handleWarning`. */ + warning = handleWarning ? parseError : noop; + + /* Ensure the algorithm walks over the first character + * and the end (inclusive). */ + index--; + length++; + + while (++index < length) { + /* If the previous character was a newline. */ + if (character === NEWLINE) { + column = indent[lines] || 1; + } + + character = at(index); + + /* Handle anything other than an ampersand, + * including newlines and EOF. */ + if (character !== AMPERSAND) { + if (character === NEWLINE) { + line++; + lines++; + column = 0; + } + + if (character) { + queue += character; + column++; + } else { + flush(); + } + } else { + following = at(index + 1); + + /* The behaviour depends on the identity of the next + * character. */ + if ( + following === TAB || + following === NEWLINE || + following === FORM_FEED || + following === SPACE || + following === LESS_THAN || + following === AMPERSAND || + following === EMPTY || + (additional && following === additional) + ) { + /* Not a character reference. No characters + * are consumed, and nothing is returned. + * This is not an error, either. */ + queue += character; + column++; + + continue; + } + + start = index + 1; + begin = start; + end = start; + + /* Numerical entity. */ + if (following !== OCTOTHORP) { + type = NAMED; + } else { + end = ++begin; + + /* The behaviour further depends on the + * character after the U+0023 NUMBER SIGN. */ + following = at(end); + + if (following === X_LOWER || following === X_UPPER) { + /* ASCII hex digits. */ + type = HEXADECIMAL; + end = ++begin; + } else { + /* ASCII digits. */ + type = DECIMAL; + } + } + + entityCharacters = EMPTY; + entity = EMPTY; + characters = EMPTY; + test = TESTS[type]; + end--; + + while (++end < length) { + following = at(end); + + if (!test(following)) { + break; + } + + characters += following; + + /* Check if we can match a legacy named + * reference. If so, we cache that as the + * last viable named reference. This + * ensures we do not need to walk backwards + * later. */ + if (type === NAMED && own.call(legacy, characters)) { + entityCharacters = characters; + entity = legacy[characters]; + } + } + + terminated = at(end) === SEMICOLON; + + if (terminated) { + end++; + + if (type === NAMED && own.call(characterEntities, characters)) { + entityCharacters = characters; + entity = characterEntities[characters]; + } + } + + diff = 1 + end - start; + + if (!terminated && !nonTerminated) { + /* Empty. */ + } else if (!characters) { + /* An empty (possible) entity is valid, unless + * its numeric (thus an ampersand followed by + * an octothorp). */ + if (type !== NAMED) { + warning(NUMERIC_EMPTY, diff); + } + } else if (type === NAMED) { + /* An ampersand followed by anything + * unknown, and not terminated, is invalid. */ + if (terminated && !entity) { + warning(NAMED_UNKNOWN, 1); + } else { + /* If theres something after an entity + * name which is not known, cap the + * reference. */ + if (entityCharacters !== characters) { + end = begin + entityCharacters.length; + diff = 1 + end - begin; + terminated = false; + } + + /* If the reference is not terminated, + * warn. */ + if (!terminated) { + reason = entityCharacters ? + NAMED_NOT_TERMINATED : + NAMED_EMPTY; + + if (!settings.attribute) { + warning(reason, diff); + } else { + following = at(end); + + if (following === EQUAL) { + warning(reason, diff); + entity = null; + } else if (alphanumerical(following)) { + entity = null; + } else { + warning(reason, diff); + } + } + } + } + + reference = entity; + } else { + if (!terminated) { + /* All non-terminated numeric entities are + * not rendered, and trigger a warning. */ + warning(NUMERIC_NOT_TERMINATED, diff); + } + + /* When terminated and number, parse as + * either hexadecimal or decimal. */ + reference = parseInt(characters, BASE[type]); + + /* Trigger a warning when the parsed number + * is prohibited, and replace with + * replacement character. */ + if (isProhibited(reference)) { + warning(NUMERIC_PROHIBITED, diff); + + reference = REPLACEMENT; + } else if (reference in invalid) { + /* Trigger a warning when the parsed number + * is disallowed, and replace by an + * alternative. */ + warning(NUMERIC_DISALLOWED, diff); + + reference = invalid[reference]; + } else { + /* Parse the number. */ + output = EMPTY; + + /* Trigger a warning when the parsed + * number should not be used. */ + if (isWarning(reference)) { + warning(NUMERIC_DISALLOWED, diff); + } + + /* Stringify the number. */ + if (reference > 0xFFFF) { + reference -= 0x10000; + output += fromCharCode((reference >>> (10 & 0x3FF)) | 0xD800); + reference = 0xDC00 | (reference & 0x3FF); + } + + reference = output + fromCharCode(reference); + } + } + + /* If we could not find a reference, queue the + * checked characters (as normal characters), + * and move the pointer to their end. This is + * possible because we can be certain neither + * newlines nor ampersands are included. */ + if (!reference) { + characters = value.slice(start - 1, end); + queue += characters; + column += characters.length; + index = end - 1; + } else { + /* Found it! First eat the queued + * characters as normal text, then eat + * an entity. */ + flush(); + + prev = now(); + index = end - 1; + column += end - start + 1; + result.push(reference); + next = now(); + next.offset++; + + if (handleReference) { + handleReference.call(referenceContext, reference, { + start: prev, + end: next + }, value.slice(start - 1, end)); + } + + prev = next; + } + } + } + + /* Return the reduced nodes, and any possible warnings. */ + return result.join(EMPTY); + + /* Get current position. */ + function now() { + return { + line: line, + column: column, + offset: index + (pos.offset || 0) + }; + } + + /* “Throw” a parse-error: a warning. */ + function parseError(code, offset) { + var position = now(); + + position.column += offset; + position.offset += offset; + + handleWarning.call(warningContext, MESSAGES[code], position, code); + } + + /* Get character at position. */ + function at(position) { + return value.charAt(position); + } + + /* Flush `queue` (normal text). Macro invoked before + * each entity and at the end of `value`. + * Does nothing when `queue` is empty. */ + function flush() { + if (queue) { + result.push(queue); + + if (handleText) { + handleText.call(textContext, queue, { + start: prev, + end: now() + }); + } + + queue = EMPTY; + } + } +} + +/* Check if `character` is outside the permissible + * unicode range. */ +function isProhibited(code) { + return (code >= 0xD800 && code <= 0xDFFF) || (code > 0x10FFFF); +} + +/* Check if `character` is disallowed. */ +function isWarning(code) { + if ( + (code >= 0x0001 && code <= 0x0008) || + code === 0x000B || + (code >= 0x000D && code <= 0x001F) || + (code >= 0x007F && code <= 0x009F) || + (code >= 0xFDD0 && code <= 0xFDEF) || + (code & 0xFFFF) === 0xFFFF || + (code & 0xFFFF) === 0xFFFE + ) { + return true; + } + + return false; +} diff --git a/tools/doc/node_modules/parse-entities/package.json b/tools/doc/node_modules/parse-entities/package.json new file mode 100644 index 00000000000000..9358d2ae7a48a7 --- /dev/null +++ b/tools/doc/node_modules/parse-entities/package.json @@ -0,0 +1,114 @@ +{ + "_from": "parse-entities@^1.0.2", + "_id": "parse-entities@1.1.1", + "_inBundle": false, + "_integrity": "sha1-gRLYhHExnyerrk1klksSL+ThuJA=", + "_location": "/parse-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-entities@^1.0.2", + "name": "parse-entities", + "escapedName": "parse-entities", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.1.tgz", + "_shasum": "8112d88471319f27abae4d64964b122fe4e1b890", + "_spec": "parse-entities@^1.0.2", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/parse-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "deprecated": false, + "description": "Parse HTML character references: fast, spec-compliant, positional information", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.2.0", + "xo": "^0.18.0" + }, + "files": [ + "index.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, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/parse-entities.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s parseEntities > parse-entities.js", + "build-mangle": "esmangle parse-entities.js > parse-entities.min.js", + "build-md": "remark . -qfo", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-coverage", + "test-api": "node test.js", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "rules": { + "guard-for-in": "off", + "no-negated-condition": "off", + "max-depth": "off", + "complexity": "off" + }, + "ignores": [ + "parse-entities.js" + ] + } +} diff --git a/tools/doc/node_modules/parse-entities/readme.md b/tools/doc/node_modules/parse-entities/readme.md new file mode 100644 index 00000000000000..9361031183df9b --- /dev/null +++ b/tools/doc/node_modules/parse-entities/readme.md @@ -0,0 +1,157 @@ +# parse-entities [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] + +Parse HTML character references: fast, spec-compliant, positional +information. + +## Installation + +[npm][]: + +```bash +npm install parse-entities +``` + +## Usage + +```js +var decode = require('parse-entities'); + +decode('alpha & bravo'); +//=> alpha & bravo + +decode('charlie ©cat; delta'); +//=> charlie ©cat; delta + +decode('echo © foxtrot ≠ golf 𝌆 hotel'); +//=> echo © foxtrot ≠ golf 𝌆 hotel +``` + +## API + +## `parseEntities(value[, options])` + +###### `options` + +* `additional` (`string`, optional, default: `''`) + — Additional character to accept when following an ampersand (without + error) +* `attribute` (`boolean`, optional, default: `false`) + — Whether to parse `value` as an attribute value +* `nonTerminated` (`boolean`, default: `true`) + — Whether to allow non-terminated entities, such as `©cat` to + `©cat`. This behaviour is spec-compliant but can lead to unexpected + results +* `warning` ([`Function`][warning], optional) + — Error handler +* `text` ([`Function`][text], optional) + — Text handler +* `reference` ([`Function`][reference], + optional) — Reference handler +* `warningContext` (`'*'`, optional) + — Context used when invoking `warning` +* `textContext` (`'*'`, optional) + — Context used when invoking `text` +* `referenceContext` (`'*'`, optional) + — Context used when invoking `reference` +* `position` (`Location` or `Position`, optional) + — Starting `position` of `value`, useful when dealing with values + nested in some sort of syntax tree. The default is: + + ```json + { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "indent": [] + } + ``` + +###### Returns + +`string` — Decoded `value`. + +### `function warning(reason, position, code)` + +Error handler. + +###### Context + +`this` refers to `warningContext` when given to `parseEntities`. + +###### Parameters + +* `reason` (`string`) + — Reason (human-readable) for triggering a parse error +* `position` (`Position`) + — Place at which the parse error occurred +* `code` (`number`) + — Identifier of reason for triggering a parse error + +The following codes are used: + +| Code | Example | Note | +| ---- | ------------------ | --------------------------------------------- | +| `1` | `foo & bar` | Missing semicolon (named) | +| `2` | `foo { bar` | Missing semicolon (numeric) | +| `3` | `Foo &bar baz` | Ampersand did not start a reference | +| `4` | `Foo &#` | Empty reference | +| `5` | `Foo &bar; baz` | Unknown entity | +| `6` | `Foo € baz` | [Disallowed reference][invalid] | +| `7` | `Foo � baz` | Prohibited: outside permissible unicode range | + +###### `function text(value, location)` + +Text handler. + +###### Context + +`this` refers to `textContext` when given to `parseEntities`. + +###### Parameters + +* `value` (`string`) — String of content +* `location` (`Location`) — Location at which `value` starts and ends + +### `function reference(value, location, source)` + +Character reference handler. + +###### Context + +`this` refers to `referenceContext` when given to `parseEntities`. + +###### Parameters + +* `value` (`string`) — Encoded character reference +* `location` (`Location`) — Location at which `value` starts and ends +* `source` (`Location`) — Source of character reference + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/parse-entities.svg + +[build-status]: https://travis-ci.org/wooorm/parse-entities + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/parse-entities.svg + +[coverage-status]: https://codecov.io/github/wooorm/parse-entities + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[warning]: #function-warningreason-position-code + +[text]: #function-textvalue-location + +[reference]: #function-referencevalue-location-source + +[invalid]: https://github.com/wooorm/character-reference-invalid diff --git a/tools/doc/node_modules/remark-man/LICENSE b/tools/doc/node_modules/remark-man/LICENSE new file mode 100644 index 00000000000000..fbcbb18b93234c --- /dev/null +++ b/tools/doc/node_modules/remark-man/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/remark-man/index.js b/tools/doc/node_modules/remark-man/index.js new file mode 100644 index 00000000000000..146f3de400a6ed --- /dev/null +++ b/tools/doc/node_modules/remark-man/index.js @@ -0,0 +1,9 @@ +'use strict'; + +var compiler = require('./lib/compiler.js'); + +module.exports = man; + +function man(options) { + this.Compiler = compiler(options || {}); +} diff --git a/tools/doc/node_modules/remark-man/lib/compiler.js b/tools/doc/node_modules/remark-man/lib/compiler.js new file mode 100644 index 00000000000000..9312bb9d7a03af --- /dev/null +++ b/tools/doc/node_modules/remark-man/lib/compiler.js @@ -0,0 +1,145 @@ +'use strict'; + +/* Dependencies. */ +var zwitch = require('zwitch'); +var mapz = require('mapz'); +var visit = require('unist-util-visit'); +var toString = require('mdast-util-to-string'); +var slugs = require('github-slugger'); +var months = require('months'); +var handlers = require('./handlers'); +var escape = require('./escape'); +var quote = require('./quote'); +var macro = require('./macro'); + +/* Expose. */ +module.exports = createCompiler; + +/* Heading expressions. */ +var MAN_EXPRESSION = /([\w_.[\]~+=@:-]+)(?:\s*)(?:\((\d\w*)\))(?:\s*(?:[-—–])+\s*(.*))?/; + +/* Helpers. */ +var one = zwitch('type'); +var all = mapz(one, {key: 'children', indices: false, gapless: true}); + +one.invalid = invalid; +one.unknown = unknown; +one.handlers = handlers; + +function createCompiler(defaults) { + Compiler.prototype.compile = compile; + Compiler.prototype.one = one; + Compiler.prototype.all = all; + + return Compiler; + + function Compiler(tree, file) { + this.tree = tree; + this.file = file; + } + + function compile() { + var self = this; + var tree = self.tree; + var file = self.file; + var slug = slugs(); + var config = {}; + var titles = 0; + var links; + var headings; + var result; + var value; + var match; + var name; + var description; + + links = {}; + headings = {}; + + this.level = 0; + this.links = {}; + this.headings = headings; + + visit(tree, 'definition', function (definition) { + links[definition.identifier.toUpperCase()] = definition.url; + }); + + /* Check if there’s one or more main headings. */ + visit(tree, 'heading', function (node) { + if (node.depth === 1) { + if (titles) { + self.increaseDepth = true; + } else { + self.mainHeading = node; + } + + titles++; + } + + headings[slug.slug(toString(node))] = node; + }); + + if (self.mainHeading) { + value = toString(self.mainHeading); + match = MAN_EXPRESSION.exec(value); + + if (match) { + config.name = match[1]; + config.section = match[2]; + config.description = match[3]; + } else { + config.title = value; + } + } else if (file.stem) { + value = file.stem.split('.'); + match = value.length > 1 && value.pop(); + + if (match && match.length === 1) { + config.section = match; + config.name = value.join('.'); + } + } + + name = config.name || defaults.name || ''; + description = config.description || defaults.description || config.title || ''; + + result = macro('TH', [ + quote(escape(name.toUpperCase())), + quote(config.section || defaults.section || ''), + quote(toDate(defaults.date || new Date())), + quote(defaults.version || ''), + quote(defaults.manual || '') + ].join(' ')) + '\n'; + + if (name) { + result += macro('SH', quote('NAME')) + '\n' + handlers.strong.call(self, name); + } + + result += escape(name && description ? ' - ' + description : description); + + result += '\n' + this.one(tree); + + /* Ensure a final eof eol is added. */ + if (result.charAt(result.length - 1) !== '\n') { + result += '\n'; + } + + return result; + } +} + +/* Non-nodes */ +function invalid(node) { + throw new Error('Expected node, not `' + node + '`'); +} + +/* Unhandled nodes. */ +function unknown(node) { + this.file.warn('Cannot compile `' + node.type + '` node', node); +} + +/* Create a man-style date. */ +function toDate(date) { + date = new Date(date); + return months[date.getMonth()] + ' ' + date.getFullYear(); +} diff --git a/tools/doc/node_modules/remark-man/lib/escape.js b/tools/doc/node_modules/remark-man/lib/escape.js new file mode 100644 index 00000000000000..8e246f818bd2d9 --- /dev/null +++ b/tools/doc/node_modules/remark-man/lib/escape.js @@ -0,0 +1,41 @@ +'use strict'; + +/* Dependencies. */ +var groff = require('groff-escape'); + +/* Expose. */ +module.exports = escape; + +var escapes = { + '\\': 'rs', + '[': 'lB', + ']': 'rB' +}; + +/* Construct. */ +var expression = init(); + +/* Escape a value for roff output. */ +function escape(value) { + return value.replace(expression, function ($0) { + return '\\[' + escapes[$0] + ']'; + }); +} + +/* Create a regex from the escapes. */ +function init() { + var keys = ['\\\\', '\\[', '\\]']; + var key; + + for (key in groff) { + keys.push(key); + escapes[key] = groff[key]; + } + + return new RegExp(keys.sort(longest).join('|'), 'g'); +} + +/** Longest first. */ +function longest(a, b) { + return a.length > b.length ? -1 : 1; +} diff --git a/tools/doc/node_modules/remark-man/lib/handlers.js b/tools/doc/node_modules/remark-man/lib/handlers.js new file mode 100644 index 00000000000000..4b756ae583ae75 --- /dev/null +++ b/tools/doc/node_modules/remark-man/lib/handlers.js @@ -0,0 +1,262 @@ +'use strict'; + +/* Dependencies. */ +var toString = require('mdast-util-to-string'); +var escape = require('./escape'); +var quote = require('./quote'); +var macro = require('./macro'); + +/* Expose. */ +exports.inlineCode = inlineCode; +exports.strong = bold; +exports.emphasis = italic; +exports.delete = italic; +exports.break = hardBreak; +exports.link = link; +exports.image = link; +exports.heading = heading; +exports.root = root; +exports.paragraph = paragraph; +exports.thematicBreak = rule; +exports.blockquote = blockquote; +exports.code = code; +exports.list = list; +exports.listItem = listItem; +exports.text = text; +exports.escape = text; +exports.linkReference = reference; +exports.imageReference = reference; +exports.table = table; +exports.definition = Function.prototype; + +/* Constants. */ +var MAILTO = 'mailto:'; +var PARAGRAPH = macro('P', '\n'); + +/* Wrap a value in a text decoration. */ +function textDecoration(enter, value, exit) { + return '\\f' + enter + (value ? value : '') + '\\f' + exit; +} + +/* Wrap a node in an inline roff command. */ +function inline(decoration, node, compiler) { + var exit = compiler.exitMarker || 'R'; + var value = node; + + compiler.exitMarker = decoration; + + if (node && node.type) { + value = compiler.all(node).join(''); + } + + compiler.exitMarker = exit; + + return textDecoration(decoration, value, exit); +} + +/* Compile a value as bold. */ +function bold(node) { + return inline('B', node, this); +} + +/* Compile a value as italic. */ +function italic(node) { + return inline('I', node, this); +} + +/* Compile inline code. */ +function inlineCode(node) { + return inline('B', escape(node.value), this); +} + +/* Compile a break. */ +function hardBreak() { + return '\n' + macro('br') + '\n'; +} + +/* Compile a horizontal rule. */ +function rule() { + return '\n\\(em\\(em\\(em'; +} + +/* Compile a paragraph. */ +function paragraph(node) { + return macro('P', '\n' + this.all(node).join('')); +} + +/* Compile a heading. */ +function heading(node) { + var depth = node.depth + (this.increaseDepth ? 1 : 0); + var name = depth === 2 ? 'SH' : 'SS'; + var value; + + if (node === this.mainHeading) { + return; + } + + value = this.all(node).join(''); + + /* Convert top-level section names to ALL-CAPS. */ + if (name === 'SH') { + value = value.toUpperCase(); + } + + return macro(name, quote(value)); +} + +/* Compile a link. */ +function link(node, href) { + var self = this; + var value = 'children' in node ? self.all(node).join('') : node.alt; + var url = escape(typeof href === 'string' ? href : node.url || ''); + var head; + + if (url && url.slice(0, MAILTO.length) === MAILTO) { + url = url.slice(MAILTO.length); + } + + head = url.charAt(0) === '#' && self.headings[url.slice(1)]; + + if (head) { + url = '(' + escape(toString(head)) + ')'; + } else { + if (value && escape(url) === value) { + value = ''; + } + + if (url) { + url = '\\(la' + escape(url) + '\\(ra'; + } + } + + if (value) { + value = bold.call(self, value); + + if (url) { + value += ' '; + } + } + + return value + (url ? italic.call(self, url) : ''); +} + +/* Compile a reference. */ +function reference(node) { + var url = this.links[node.identifier.toUpperCase()]; + + return link.call(this, node, url); +} + +/* Compile code. */ +function code(node) { + return '.P\n' + + '.RS 2\n' + + '.nf\n' + + escape(node.value) + '\n' + + '.fi\n' + + '.RE'; +} + +/* Compile a block quote. */ +function blockquote(node) { + var self = this; + var value; + + self.level++; + + value = self.all(node).join('\n'); + + self.level--; + + value = '.RS ' + (self.level ? 4 : 0) + '\n' + value + '\n.RE 0\n'; + + return value; +} + +/* Compile text. */ +function text(node) { + return escape(node.value.replace(/[\n ]+/g, ' ')); +} + +/* Compile a list. */ +function list(node) { + var self = this; + var start = node.start; + var children = node.children; + var length = children.length; + var index = -1; + var values = []; + var bullet; + + self.level++; + + while (++index < length) { + bullet = start ? start + index + '.' : '\\(bu'; + values.push(listItem.call(self, children[index], bullet, index)); + } + + self.level--; + + return '.RS ' + (this.level ? 4 : 0) + '\n' + + values.join('\n') + '\n' + + '.RE 0\n'; +} + +/* Compile a list-item. */ +function listItem(node, bullet) { + var result = this.all(node).join('\n').slice(PARAGRAPH.length); + return '.IP ' + bullet + ' 4\n' + result; +} + +/* Compile a table. */ +function table(node) { + var self = this; + var rows = node.children; + var index = rows.length; + var align = node.align; + var alignLength = align.length; + var pos; + var result = []; + var row; + var out; + var alignHeading = []; + var alignRow = []; + + while (index--) { + pos = -1; + row = rows[index].children; + out = []; + + while (++pos < alignLength) { + out[pos] = self.all(row[pos]).join(''); + } + + result[index] = out.join('@'); + } + + pos = -1; + + while (++pos < alignLength) { + alignHeading.push('cb'); + alignRow.push((align[pos] || 'l').charAt(0)); + } + + result = [].concat( + [ + '', + 'tab(@) allbox;', + alignHeading.join(' '), + alignRow.join(' ') + ' .' + ], + result, + ['.TE'] + ).join('\n'); + + return macro('TS', result); +} + +/* Compile a `root` node. This compiles a man header, + * and the children of `root`. */ +function root(node) { + return this.all(node).join('\n'); +} diff --git a/tools/doc/node_modules/remark-man/lib/macro.js b/tools/doc/node_modules/remark-man/lib/macro.js new file mode 100644 index 00000000000000..02d24c6028150d --- /dev/null +++ b/tools/doc/node_modules/remark-man/lib/macro.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = macro; + +/* Compile a roff macro. */ +function macro(name, value) { + var val = value || ''; + + if (val && val.charAt(0) !== '\n') { + val = ' ' + val; + } + + return '.' + name + val; +} diff --git a/tools/doc/node_modules/remark-man/lib/quote.js b/tools/doc/node_modules/remark-man/lib/quote.js new file mode 100644 index 00000000000000..5f72376a0c5baa --- /dev/null +++ b/tools/doc/node_modules/remark-man/lib/quote.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = quote; + +/* Wrap `value` with double quotes, and escape internal + * double quotes. */ +function quote(value) { + return '"' + String(value).replace(/"/g, '\\"') + '"'; +} diff --git a/tools/doc/node_modules/remark-man/package.json b/tools/doc/node_modules/remark-man/package.json new file mode 100644 index 00000000000000..37e2d4a12a9824 --- /dev/null +++ b/tools/doc/node_modules/remark-man/package.json @@ -0,0 +1,117 @@ +{ + "_from": "remark-man", + "_id": "remark-man@5.0.1", + "_inBundle": false, + "_integrity": "sha1-hf9PkQXRoZvqlZlU5Bt8bV3AwEU=", + "_location": "/remark-man", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "remark-man", + "name": "remark-man", + "escapedName": "remark-man", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/remark-man/-/remark-man-5.0.1.tgz", + "_shasum": "85ff4f9105d1a19bea959954e41b7c6d5dc0c045", + "_spec": "remark-man", + "_where": "/Users/alex/Development/node/tools/doc", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/remark-man/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "github-slugger": "^1.1.1", + "groff-escape": "^1.0.0", + "mapz": "^1.0.0", + "mdast-util-to-string": "^1.0.0", + "months": "^1.0.1", + "unist-util-visit": "^1.0.0", + "zwitch": "^1.0.0" + }, + "deprecated": false, + "description": "Compile Markdown to man pages (roff) with remark", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "is-hidden": "^1.0.1", + "negate": "^1.0.0", + "nyc": "^11.0.0", + "remark": "^7.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "vfile": "^2.0.0", + "xo": "^0.18.0" + }, + "files": [ + "lib", + "index.js" + ], + "homepage": "https://github.com/wooorm/remark-man#readme", + "keywords": [ + "markdown", + "man", + "manual", + "roff", + "ronn", + "remark" + ], + "license": "MIT", + "name": "remark-man", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/remark-man.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s remarkMan > remark-man.js", + "build-mangle": "esmangle remark-man.js > remark-man.min.js", + "build-md": "remark *.md -qfo", + "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" + }, + "version": "5.0.1", + "xo": { + "space": true, + "esnext": false, + "rules": { + "guard-for-in": "off" + }, + "ignores": [ + "remark-man.js" + ] + } +} diff --git a/tools/doc/node_modules/remark-man/readme.md b/tools/doc/node_modules/remark-man/readme.md new file mode 100644 index 00000000000000..1629f73d5c6630 --- /dev/null +++ b/tools/doc/node_modules/remark-man/readme.md @@ -0,0 +1,124 @@ +# remark-man [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] + +Compile markdown to man pages with [**remark**][remark]. Great unicode +support; name, section, and description detection; nested block quotes +and lists; tables; and much more. + +## Installation + +[npm][]: + +```bash +npm install remark-man +``` + +## Usage + +Say we have the following file, `example.md`: + +```markdown +# ls(1) -- list directory contents + +## SYNOPSIS + +`ls` [`-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1`] \[_file_ _..._] +``` + +And our script, `example.js`, looks as follows: + +```javascript +var vfile = require('to-vfile'); +var unified = require('unified'); +var markdown = require('remark-parse'); +var man = require('remark-man'); + +unified() + .use(markdown) + .use(man) + .process(vfile.readSync('example.md'), function (err, file) { + if (err) throw err; + file.extname = '.1'; + vfile.writeSync(file); + }); +``` + +Now, running `node example` and `cat example.1` yields: + +```roff +.TH "LS" "1" "June 2015" "" "" +.SH "NAME" +\fBls\fR - list directory contents +.SH "SYNOPSIS" +.P +\fBls\fR \fB\fB-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1\fR\fR \[lB]\fIfile\fR \fI...\fR\[rB] +``` + +Now, that looks horrible, but that’s how roff/groff/troff are :wink:. + +To properly view that man page, use something like this: `man ./example.1`. + +### `remark.use(man[, options])` + +Compile markdown to a man page. + +###### `options` + +* `name` (`string`, optional) +* `section` (`number` or `string`, optional) +* `description` (`string`, optional) +* `date` (given to `new Date()`, optional) +* `version` (`string`, optional) +* `manual` (`string`, optional) + +`name` and `section` can also be inferred from the file’s name: +`hello-world.1.md` will set `name` to `'hello-world'` and `section` to `'1'`. + +In addition, you can also provide inline configuration with a main heading. +The following file: + +```md +# hello-world(7) -- Two common words +``` + +...will set `name` to `'hello-world'`, `section` to `'7'`, and `description` to +`'Two common words'`. + +The main heading has precedence over the file name, and the file name +over the plugin settings. + +## Related + +* [`remark-react`](https://github.com/mapbox/remark-react) + — Compile to React +* [`remark-vdom`](https://github.com/wooorm/remark-vdom) + — Compile to VDOM +* [`remark-html`](https://github.com/wooorm/remark-html) + — Compile to HTML +* [`remark-rehype`](https://github.com/wooorm/remark-rehype) + — Properly transform to HTML + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/remark-man.svg + +[build-status]: https://travis-ci.org/wooorm/remark-man + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark-man.svg + +[coverage-status]: https://codecov.io/github/wooorm/remark-man + +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg + +[chat]: https://gitter.im/wooorm/remark + +[license]: LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[remark]: https://github.com/wooorm/remark diff --git a/tools/doc/node_modules/remark-parse/index.js b/tools/doc/node_modules/remark-parse/index.js new file mode 100644 index 00000000000000..1579e35518c582 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/index.js @@ -0,0 +1,14 @@ +'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/doc/node_modules/remark-parse/lib/block-elements.json b/tools/doc/node_modules/remark-parse/lib/block-elements.json new file mode 100644 index 00000000000000..2d13b561792d65 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/block-elements.json @@ -0,0 +1,68 @@ +[ + "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/doc/node_modules/remark-parse/lib/decode.js b/tools/doc/node_modules/remark-parse/lib/decode.js new file mode 100644 index 00000000000000..75116385eed36c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/decode.js @@ -0,0 +1,71 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:decode + * @fileoverview Decode entities. + */ + +'use strict'; + +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) { + return entities(value, { + position: normalize(position), + warning: handleWarning + }); + } +} diff --git a/tools/doc/node_modules/remark-parse/lib/defaults.js b/tools/doc/node_modules/remark-parse/lib/defaults.js new file mode 100644 index 00000000000000..ccb3fabd485901 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/defaults.js @@ -0,0 +1,21 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:defaults + * @fileoverview Default options for `parse`. + */ + +'use strict'; + +/* Expose. */ +module.exports = { + position: true, + gfm: true, + yaml: true, + commonmark: false, + footnotes: false, + pedantic: false, + blocks: require('./block-elements'), + breaks: false +}; diff --git a/tools/doc/node_modules/remark-parse/lib/locate/break.js b/tools/doc/node_modules/remark-parse/lib/locate/break.js new file mode 100644 index 00000000000000..b5550e10076605 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/break.js @@ -0,0 +1,25 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:break + * @fileoverview Locate a break. + */ + +'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/doc/node_modules/remark-parse/lib/locate/code-inline.js b/tools/doc/node_modules/remark-parse/lib/locate/code-inline.js new file mode 100644 index 00000000000000..010e74dcec4b00 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/code-inline.js @@ -0,0 +1,15 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:code-inline + * @fileoverview Locate inline code. + */ + +'use strict'; + +module.exports = locate; + +function locate(value, fromIndex) { + return value.indexOf('`', fromIndex); +} diff --git a/tools/doc/node_modules/remark-parse/lib/locate/delete.js b/tools/doc/node_modules/remark-parse/lib/locate/delete.js new file mode 100644 index 00000000000000..1a892e1be7716e --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/delete.js @@ -0,0 +1,15 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:delete + * @fileoverview Locate strikethrough. + */ + +'use strict'; + +module.exports = locate; + +function locate(value, fromIndex) { + return value.indexOf('~~', fromIndex); +} diff --git a/tools/doc/node_modules/remark-parse/lib/locate/emphasis.js b/tools/doc/node_modules/remark-parse/lib/locate/emphasis.js new file mode 100644 index 00000000000000..270daad0f9e00c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/emphasis.js @@ -0,0 +1,26 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:emphasis + * @fileoverview Locate italics / emphasis. + */ + +'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/doc/node_modules/remark-parse/lib/locate/escape.js b/tools/doc/node_modules/remark-parse/lib/locate/escape.js new file mode 100644 index 00000000000000..45f9b449a7873c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/escape.js @@ -0,0 +1,15 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:escape + * @fileoverview Locate an escape. + */ + +'use strict'; + +module.exports = locate; + +function locate(value, fromIndex) { + return value.indexOf('\\', fromIndex); +} diff --git a/tools/doc/node_modules/remark-parse/lib/locate/link.js b/tools/doc/node_modules/remark-parse/lib/locate/link.js new file mode 100644 index 00000000000000..dab2a3c54f1774 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/link.js @@ -0,0 +1,24 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:link + * @fileoverview Locate a link. + */ + +'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/doc/node_modules/remark-parse/lib/locate/strong.js b/tools/doc/node_modules/remark-parse/lib/locate/strong.js new file mode 100644 index 00000000000000..717259f36eae22 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/strong.js @@ -0,0 +1,26 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:strong + * @fileoverview Locate bold / strong / importance. + */ + +'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/doc/node_modules/remark-parse/lib/locate/tag.js b/tools/doc/node_modules/remark-parse/lib/locate/tag.js new file mode 100644 index 00000000000000..56e2d49e564587 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/tag.js @@ -0,0 +1,15 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:tag + * @fileoverview Locate a tag. + */ + +'use strict'; + +module.exports = locate; + +function locate(value, fromIndex) { + return value.indexOf('<', fromIndex); +} diff --git a/tools/doc/node_modules/remark-parse/lib/locate/url.js b/tools/doc/node_modules/remark-parse/lib/locate/url.js new file mode 100644 index 00000000000000..53b239241c104a --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/locate/url.js @@ -0,0 +1,34 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:locate:url + * @fileoverview Locate a URL. + */ + +'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/doc/node_modules/remark-parse/lib/parse.js b/tools/doc/node_modules/remark-parse/lib/parse.js new file mode 100644 index 00000000000000..53a50b181e67d4 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/parse.js @@ -0,0 +1,53 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:parse + * @fileoverview Parse the document + */ + +'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/doc/node_modules/remark-parse/lib/parser.js b/tools/doc/node_modules/remark-parse/lib/parser.js new file mode 100644 index 00000000000000..8fe982b661c41c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/parser.js @@ -0,0 +1,162 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse + * @fileoverview Markdown parser. + */ + +'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; + +/* Construct a new 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); +} + +/* Prototype. */ +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 = [ + ['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 = { + yamlFrontMatter: require('./tokenize/yaml'), + 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/doc/node_modules/remark-parse/lib/set-options.js b/tools/doc/node_modules/remark-parse/lib/set-options.js new file mode 100644 index 00000000000000..3f9abad7c49a06 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/set-options.js @@ -0,0 +1,59 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse + * @fileoverview Markdown parser. + */ + +'use strict'; + +var xtend = require('xtend'); +var escapes = require('markdown-escapes'); +var defaults = require('./defaults'); + +module.exports = setOptions; + +/* Set options. */ +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/doc/node_modules/remark-parse/lib/tokenize/auto-link.js b/tools/doc/node_modules/remark-parse/lib/tokenize/auto-link.js new file mode 100644 index 00000000000000..3861b48a14aead --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/auto-link.js @@ -0,0 +1,151 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:auto-link + * @fileoverview Tokenise an auto-link. + */ + +'use strict'; + +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 tokenize; + 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 ( + 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 (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 support for escapes in autolinks. */ + tokenize = self.inlineTokenizers.escape; + self.inlineTokenizers.escape = null; + exit = self.enterLink(); + + content = self.tokenizeInline(content, now); + + self.inlineTokenizers.escape = tokenize; + exit(); + + return eat(subvalue)({ + type: 'link', + title: null, + url: decode(link), + children: content + }); +} diff --git a/tools/doc/node_modules/remark-parse/lib/tokenize/blockquote.js b/tools/doc/node_modules/remark-parse/lib/tokenize/blockquote.js new file mode 100644 index 00000000000000..764e0aa010392c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/blockquote.js @@ -0,0 +1,137 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:blockquote + * @fileoverview Tokenise blockquote. + */ + +'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/doc/node_modules/remark-parse/lib/tokenize/break.js b/tools/doc/node_modules/remark-parse/lib/tokenize/break.js new file mode 100644 index 00000000000000..6d2d0dcff9552b --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/break.js @@ -0,0 +1,51 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:break + * @fileoverview Tokenise a break. + */ + +'use strict'; + +var locate = require('../locate/break'); + +module.exports = hardBreak; +hardBreak.locator = locate; + +var MIN_BREAK_LENGTH = 2; + +/* Tokenise a break. */ +function hardBreak(eat, value, silent) { + var self = this; + var breaks = self.options.breaks; + var length = value.length; + var index = -1; + var queue = ''; + var character; + + while (++index < length) { + character = value.charAt(index); + + if (character === '\n') { + if (!breaks && 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/doc/node_modules/remark-parse/lib/tokenize/code-fenced.js b/tools/doc/node_modules/remark-parse/lib/tokenize/code-fenced.js new file mode 100644 index 00000000000000..f2577405b26587 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/code-fenced.js @@ -0,0 +1,245 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:code-fenced + * @fileoverview Tokenise fenced code. + */ + +'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; + +/* Tokenise fenced code. */ +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/doc/node_modules/remark-parse/lib/tokenize/code-indented.js b/tools/doc/node_modules/remark-parse/lib/tokenize/code-indented.js new file mode 100644 index 00000000000000..50c581fe26e2e4 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/code-indented.js @@ -0,0 +1,106 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:code-indented + * @fileoverview Tokenise indented code. + */ + +'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/doc/node_modules/remark-parse/lib/tokenize/code-inline.js b/tools/doc/node_modules/remark-parse/lib/tokenize/code-inline.js new file mode 100644 index 00000000000000..9157412753ad1a --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/code-inline.js @@ -0,0 +1,120 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:code-inline + * @fileoverview Tokenise inline code. + */ + +'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/doc/node_modules/remark-parse/lib/tokenize/definition.js b/tools/doc/node_modules/remark-parse/lib/tokenize/definition.js new file mode 100644 index 00000000000000..3f7345a2c901c8 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/definition.js @@ -0,0 +1,287 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:definition + * @fileoverview Tokenise a definition. + */ + +'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 = '>'; + +/* Tokenise a definition. */ +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); + + 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/doc/node_modules/remark-parse/lib/tokenize/delete.js b/tools/doc/node_modules/remark-parse/lib/tokenize/delete.js new file mode 100644 index 00000000000000..60ae9c4936c61f --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/delete.js @@ -0,0 +1,69 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:delete + * @fileoverview Tokenise strikethrough. + */ + +'use strict'; + +var whitespace = require('is-whitespace-character'); +var locate = require('../locate/delete'); + +module.exports = strikethrough; +strikethrough.locator = locate; + +var C_TILDE = '~'; +var DOUBLE = '~~'; + +/* Tokenise strikethrough. */ +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/doc/node_modules/remark-parse/lib/tokenize/emphasis.js b/tools/doc/node_modules/remark-parse/lib/tokenize/emphasis.js new file mode 100644 index 00000000000000..46249369224bc5 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/emphasis.js @@ -0,0 +1,94 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:emphasis + * @fileoverview Tokenise emphasis. + */ + +'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 = '_'; + +/* Tokenise emphasis. */ +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/doc/node_modules/remark-parse/lib/tokenize/escape.js b/tools/doc/node_modules/remark-parse/lib/tokenize/escape.js new file mode 100644 index 00000000000000..3e41a4cec5e6ea --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/escape.js @@ -0,0 +1,43 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:escape + * @fileoverview Tokenise an escape. + */ + +'use strict'; + +var locate = require('../locate/escape'); + +module.exports = escape; +escape.locator = locate; + +/* Tokenise an escape. */ +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/doc/node_modules/remark-parse/lib/tokenize/footnote-definition.js b/tools/doc/node_modules/remark-parse/lib/tokenize/footnote-definition.js new file mode 100644 index 00000000000000..3537ccb6115017 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/footnote-definition.js @@ -0,0 +1,194 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:footnote-definition + * @fileoverview Tokenise footnote definition. + */ + +'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; + +/* Tokenise a footnote definition. */ +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/doc/node_modules/remark-parse/lib/tokenize/heading-atx.js b/tools/doc/node_modules/remark-parse/lib/tokenize/heading-atx.js new file mode 100644 index 00000000000000..e5fdedc537ad0b --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/heading-atx.js @@ -0,0 +1,150 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:heading-atx + * @fileoverview Tokenise an ATX-style heading. + */ + +'use strict'; + +module.exports = atxHeading; + +var C_NEWLINE = '\n'; +var C_TAB = '\t'; +var C_SPACE = ' '; +var C_HASH = '#'; + +var MAX_ATX_COUNT = 6; + +/* Tokenise an ATX-style heading. */ +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/doc/node_modules/remark-parse/lib/tokenize/heading-setext.js b/tools/doc/node_modules/remark-parse/lib/tokenize/heading-setext.js new file mode 100644 index 00000000000000..db8bbcfb73c2c9 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/heading-setext.js @@ -0,0 +1,116 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:heading-setext + * @fileoverview Tokenise an setext-style heading. + */ + +'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; + +/* Tokenise an setext-style heading. */ +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/doc/node_modules/remark-parse/lib/tokenize/html-block.js b/tools/doc/node_modules/remark-parse/lib/tokenize/html-block.js new file mode 100644 index 00000000000000..dc861b53c3a37b --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/html-block.js @@ -0,0 +1,103 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:html-block + * @fileoverview Tokenise block HTML. + */ + +'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 = '<'; + +/* Tokenise block HTML. */ +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/doc/node_modules/remark-parse/lib/tokenize/html-inline.js b/tools/doc/node_modules/remark-parse/lib/tokenize/html-inline.js new file mode 100644 index 00000000000000..d8c0b9ab21829a --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/html-inline.js @@ -0,0 +1,63 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:html-inline + * @fileoverview Tokenise inline HTML. + */ + +'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; + +/* Tokenise inline HTML. */ +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/doc/node_modules/remark-parse/lib/tokenize/link.js b/tools/doc/node_modules/remark-parse/lib/tokenize/link.js new file mode 100644 index 00000000000000..fb11c5099054df --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/link.js @@ -0,0 +1,399 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:link + * @fileoverview Tokenise a link. + */ + +'use strict'; + +var has = require('has'); +var whitespace = require('is-whitespace-character'); +var locate = require('../locate/link'); + +module.exports = link; +link.locator = locate; + +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; + +/* Tokenise a link. */ +function link(eat, value, silent) { + var self = this; + var subvalue = ''; + var index = 0; + var character = value.charAt(0); + 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 (gfm) { + 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 && has(markers, character)) { + break; + } + + if (whitespace(character)) { + if (commonmark) { + 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 && has(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); + + 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/doc/node_modules/remark-parse/lib/tokenize/list.js b/tools/doc/node_modules/remark-parse/lib/tokenize/list.js new file mode 100644 index 00000000000000..da8002e574196c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/list.js @@ -0,0 +1,494 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:list + * @fileoverview Tokenise a list. + */ + +'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; + +/* Tokenise a list. */ +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; +} + +/** + * Create a list-item node. + * + * @example + * listItem('- _foo_', now()); + * + * @param {Object} ctx - Parser. + * @param {Object} value - List-item. + * @param {Object} position - List-item location. + * @return {Object} - `listItem` 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/doc/node_modules/remark-parse/lib/tokenize/newline.js b/tools/doc/node_modules/remark-parse/lib/tokenize/newline.js new file mode 100644 index 00000000000000..f710e0ef976603 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/newline.js @@ -0,0 +1,55 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:newline + * @fileoverview Tokenise a newline. + */ + +'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/doc/node_modules/remark-parse/lib/tokenize/paragraph.js b/tools/doc/node_modules/remark-parse/lib/tokenize/paragraph.js new file mode 100644 index 00000000000000..7d064522ffecbd --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/paragraph.js @@ -0,0 +1,130 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:paragraph + * @fileoverview Tokenise a paragraph. + */ + +'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/doc/node_modules/remark-parse/lib/tokenize/reference.js b/tools/doc/node_modules/remark-parse/lib/tokenize/reference.js new file mode 100644 index 00000000000000..1fa150d9e6b958 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/reference.js @@ -0,0 +1,219 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:reference + * @fileoverview Tokenise a reference. + */ + +'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 = ']'; + +/* Tokenise a reference. */ +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 && + type === T_LINK && + value.charAt(index) === C_CARET + ) { + 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); + + if (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; + } + + /* Inline footnotes cannot have an identifier. */ + if (type === T_FOOTNOTE && referenceType !== REFERENCE_TYPE_SHORTCUT) { + type = T_LINK; + intro = C_BRACKET_OPEN + C_CARET; + content = C_CARET + content; + } + + 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/doc/node_modules/remark-parse/lib/tokenize/strong.js b/tools/doc/node_modules/remark-parse/lib/tokenize/strong.js new file mode 100644 index 00000000000000..765993fa0bd4b3 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/strong.js @@ -0,0 +1,93 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:strong + * @fileoverview Tokenise strong. + */ + +'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 = '_'; + +/* Tokenise strong. */ +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/doc/node_modules/remark-parse/lib/tokenize/table.js b/tools/doc/node_modules/remark-parse/lib/tokenize/table.js new file mode 100644 index 00000000000000..c440067e1011d7 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/table.js @@ -0,0 +1,276 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:table + * @fileoverview Tokenise a table. + */ + +'use strict'; + +var whitespace = require('is-whitespace-character'); + +module.exports = table; +table.notInList = true; + +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; + +/* Tokenise a table. */ +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/doc/node_modules/remark-parse/lib/tokenize/text.js b/tools/doc/node_modules/remark-parse/lib/tokenize/text.js new file mode 100644 index 00000000000000..ef6d3f2879d46e --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/text.js @@ -0,0 +1,67 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:text + * @fileoverview Tokenise text. + */ + +'use strict'; + +module.exports = text; + +/* Tokenise 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/doc/node_modules/remark-parse/lib/tokenize/thematic-break.js b/tools/doc/node_modules/remark-parse/lib/tokenize/thematic-break.js new file mode 100644 index 00000000000000..a580d09fe09c0b --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/thematic-break.js @@ -0,0 +1,79 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:thematic-break + * @fileoverview Tokenise a thematic break. + */ + +'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; + +/* Tokenise a thematic break. */ +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/doc/node_modules/remark-parse/lib/tokenize/url.js b/tools/doc/node_modules/remark-parse/lib/tokenize/url.js new file mode 100644 index 00000000000000..fd2debd32f35fe --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/url.js @@ -0,0 +1,153 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:url + * @fileoverview Tokenise a URL. + */ + +'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; + +/* Tokenise a URL. */ +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), + children: content + }); +} diff --git a/tools/doc/node_modules/remark-parse/lib/tokenize/yaml.js b/tools/doc/node_modules/remark-parse/lib/tokenize/yaml.js new file mode 100644 index 00000000000000..78dec31a0f9eb8 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenize/yaml.js @@ -0,0 +1,74 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenize:yaml + * @fileoverview Tokenise YAML. + */ + +'use strict'; + +module.exports = yaml; +yaml.onlyAtStart = true; + +var FENCE = '---'; +var C_DASH = '-'; +var C_NEWLINE = '\n'; + +/* Tokenise YAML. */ +function yaml(eat, value, silent) { + var self = this; + var subvalue; + var content; + var index; + var length; + var character; + var queue; + + if ( + !self.options.yaml || + value.charAt(0) !== C_DASH || + value.charAt(1) !== C_DASH || + value.charAt(2) !== C_DASH || + value.charAt(3) !== C_NEWLINE + ) { + return; + } + + subvalue = FENCE + C_NEWLINE; + content = ''; + queue = ''; + index = 3; + length = value.length; + + while (++index < length) { + character = value.charAt(index); + + if ( + character === C_DASH && + (queue || !content) && + value.charAt(index + 1) === C_DASH && + value.charAt(index + 2) === C_DASH + ) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true; + } + + subvalue += queue + FENCE; + + return eat(subvalue)({ + type: 'yaml', + value: content + }); + } + + if (character === C_NEWLINE) { + queue += character; + } else { + subvalue += queue + character; + content += queue + character; + queue = ''; + } + } +} diff --git a/tools/doc/node_modules/remark-parse/lib/tokenizer.js b/tools/doc/node_modules/remark-parse/lib/tokenizer.js new file mode 100644 index 00000000000000..aefe551fc37993 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/tokenizer.js @@ -0,0 +1,451 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:tokenizer + * @fileoverview Markdown tokenizer. + */ + +'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 && + (!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`. + * + * @example + * updatePosition('foo'); + * + * @param {string} subvalue - Subvalue to eat. + */ + 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. + * + * @return {Function} - `done`, to be called when + * the last character is eaten. + */ + function getOffset() { + var indentation = []; + var pos = line + 1; + + /** + * Done. Called when the last character is + * eaten to retrieve the range’s offsets. + * + * @return {Array.} - Offset. + */ + return function () { + var last = line + 1; + + while (pos < last) { + indentation.push((offset[pos] || 0) + 1); + + pos++; + } + + return indentation; + }; + } + + /** + * Get the current position. + * + * @example + * position = now(); // {line: 1, column: 1, offset: 0} + * + * @return {Object} - Current Position. + */ + function now() { + var pos = {line: line, column: column}; + + pos.offset = self.toOffset(pos); + + return pos; + } + + /** + * Store position information for a node. + * + * @example + * start = now(); + * updatePosition('foo'); + * location = new Position(start); + * // { + * // start: {line: 1, column: 1, offset: 0}, + * // end: {line: 1, column: 3, offset: 2} + * // } + * + * @param {Object} start - Starting position. + */ + 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. + * + * @example + * // When the current value is set to `foo bar`. + * validateEat('foo'); + * eat('foo'); + * + * validateEat('bar'); + * // throws, because the space is not eaten. + * + * @param {string} subvalue - Value to be eaten. + * @throws {Error} - When `subvalue` cannot be eaten. + */ + 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`. + * + * @example + * var update = position(); + * updatePosition('foo'); + * update({}); + * // { + * // position: { + * // start: {line: 1, column: 1, offset: 0}, + * // end: {line: 1, column: 3, offset: 2} + * // } + * // } + * + * @returns {Function} - Updater. + */ + function position() { + var before = now(); + + return update; + + /** + * Add the position to a node. + * + * @example + * update({type: 'text', value: 'foo'}); + * + * @param {Node} node - Node to attach position + * on. + * @param {Array} [indent] - Indentation for + * `node`. + * @return {Node} - `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. + * + * @example + * add({}); + * + * add({}, {children: []}); + * + * @param {Object} node - Node to add. + * @param {Object} [parent] - Parent to insert into. + * @return {Object} - Added or merged into node. + */ + 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`. + * + * @example + * eat('foo')({type: 'text', value: 'foo'}); + * + * @param {string} subvalue - Removed from `value`, + * and passed to `updatePosition`. + * @return {Function} - Wrapper around `add`, which + * also adds `position` to node. + */ + 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. + * + * @param {Object} node - Node to add. + * @param {Object} [parent] - Node to insert into. + * @return {Node} - Added 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. + * + * @return {Node} - Added node. + */ + 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. + * + * @return {Position} - Position after eating `subvalue`. + */ + function test() { + var result = pos({}); + + line = current.line; + column = current.column; + value = subvalue + value; + + return result.position; + } + } + } +} diff --git a/tools/doc/node_modules/remark-parse/lib/unescape.js b/tools/doc/node_modules/remark-parse/lib/unescape.js new file mode 100644 index 00000000000000..dc83486126112c --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/unescape.js @@ -0,0 +1,46 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:unescape + * @fileoverview Unescape escapes. + */ + +'use strict'; + +/* Expose. */ +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/doc/node_modules/remark-parse/lib/util/get-indentation.js b/tools/doc/node_modules/remark-parse/lib/util/get-indentation.js new file mode 100644 index 00000000000000..eebd40c94ac26b --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/util/get-indentation.js @@ -0,0 +1,46 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:get-indentation + * @fileoverview Get indentation. + */ + +'use strict'; + +/* Expose. */ +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. + * + * @param {string} value - Indented line. + * @return {Object} - Indetation information. + */ +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/doc/node_modules/remark-parse/lib/util/html.js b/tools/doc/node_modules/remark-parse/lib/util/html.js new file mode 100644 index 00000000000000..234ba342e1d3fa --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/util/html.js @@ -0,0 +1,33 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:html + * @fileoverview HTML regexes. + */ + +'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/doc/node_modules/remark-parse/lib/util/interrupt.js b/tools/doc/node_modules/remark-parse/lib/util/interrupt.js new file mode 100644 index 00000000000000..b8dc2305501db1 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/util/interrupt.js @@ -0,0 +1,51 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:get-indentation + * @fileoverview Get indentation. + */ + +'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/doc/node_modules/remark-parse/lib/util/normalize.js b/tools/doc/node_modules/remark-parse/lib/util/normalize.js new file mode 100644 index 00000000000000..3602a18f788317 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/util/normalize.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:normalize + * @fileoverview Normalize an identifier. + */ + +'use strict'; + +/* Dependencies. */ +var collapseWhiteSpace = require('collapse-white-space'); + +/* Expose. */ +module.exports = normalize; + +/** + * Normalize an identifier. Collapses multiple white space + * characters into a single space, and removes casing. + * + * @example + * normalizeIdentifier('FOO\t bar'); // 'foo bar' + * + * @param {string} value - Content to normalize. + * @return {string} - Normalized content. + */ +function normalize(value) { + return collapseWhiteSpace(value).toLowerCase(); +} diff --git a/tools/doc/node_modules/remark-parse/lib/util/remove-indentation.js b/tools/doc/node_modules/remark-parse/lib/util/remove-indentation.js new file mode 100644 index 00000000000000..d56db0bad4b735 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/lib/util/remove-indentation.js @@ -0,0 +1,102 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:parse:util:remove-indentation + * @fileoverview Remove indentation. + */ + +'use strict'; + +/* Dependencies. */ +var trim = require('trim'); +var repeat = require('repeat-string'); +var getIndent = require('./get-indentation'); + +/* Expose. */ +module.exports = indentation; + +/* Characters. */ +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). + * + * @example + * removeIndentation(' foo'); // 'foo' + * removeIndentation(' foo', 2); // ' foo' + * removeIndentation('\tfoo', 2); // ' foo' + * removeIndentation(' foo\n bar'); // ' foo\n bar' + * + * @param {string} value - Value to trim. + * @param {number?} [maximum] - Maximum indentation + * to remove. + * @return {string} - Unindented `value`. + */ +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/doc/node_modules/remark-parse/package.json b/tools/doc/node_modules/remark-parse/package.json new file mode 100644 index 00000000000000..a9a8de495536ce --- /dev/null +++ b/tools/doc/node_modules/remark-parse/package.json @@ -0,0 +1,86 @@ +{ + "_from": "remark-parse@^3.0.0", + "_id": "remark-parse@3.0.1", + "_inBundle": false, + "_integrity": "sha1-G5+EGkTY9PvyJGhQJlRZpOs1TIA=", + "_location": "/remark-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "remark-parse@^3.0.0", + "name": "remark-parse", + "escapedName": "remark-parse", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/remark" + ], + "_resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-3.0.1.tgz", + "_shasum": "1b9f841a44d8f4fbf2246850265459a4eb354c80", + "_spec": "remark-parse@^3.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/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", + "has": "^1.0.1", + "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.0.2", + "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/wooorm/remark/tree/master/packages/remark-parse" + }, + "version": "3.0.1", + "xo": false +} diff --git a/tools/doc/node_modules/remark-parse/readme.md b/tools/doc/node_modules/remark-parse/readme.md new file mode 100644 index 00000000000000..53426f41eee224 --- /dev/null +++ b/tools/doc/node_modules/remark-parse/readme.md @@ -0,0 +1,448 @@ +# 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)](#processoruseparse) + * [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) +* [License](#license) + +## API + +### `processor.use(parse)` + +Configure the `processor` to read markdown as input and process an +[**MDAST**][mdast] syntax tree. + +#### `options` + +Options are passed later through [`processor.parse()`][parse], +[`processor.process()`][process], or [`processor.pipe()`][pipe]. +The following settings are supported: + +* [`gfm`][options-gfm] (`boolean`, default: `true`) +* [`yaml`][options-yaml] (`boolean`, default: `true`) +* [`commonmark`][options-commonmark] (`boolean`, default: `false`) +* [`footnotes`][options-footnotes] (`boolean`, default: `false`) +* [`pedantic`][options-pedantic] (`boolean`, default: `false`) +* [`breaks`][options-breaks] (`boolean`, default: `false`) +* [`blocks`][options-blocks] (`Array.`, default: list of block HTML + elements) + +##### `options.gfm` + +```md +hello ~~hi~~ world +``` + +GFM mode (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.yaml` + +```md +--- +title: YAML is Cool +--- + +# YAML is Cool +``` + +YAML mode (default: `true`) enables raw YAML front matter to be detected +at the top. + +##### `options.commonmark` + +```md +This is a paragraph + and this is also part of the preceding paragraph. +``` + +CommonMark mode (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 (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.breaks` + +```md +This is a +paragraph. +``` + +Breaks mode (default: `false`) exposes newline characters inside +paragraphs as breaks. + +##### `options.blocks` + +```md +foo + +``` + +Blocks (default: a list of HTML block elements) exposes +let’s users define block-level HTML elements. + +##### `options.pedantic` + +```md +Check out some_file_name.txt +``` + +Pedantic mode (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 this plug-in is used, it adds a [`Parser`][parser] constructor to +the `processor`. Other plug-ins can add tokenizers to the parser’s +prototype to change how markdown is parsed. + +The below plug-in 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. + +### `Parser#blockMethods` + +Array of `blockTokenizers` names (`string`) specifying the order in +which they run. + +### `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. + +### `Parser#inlineMethods` + +Array of `inlineTokenizers` names (`string`) specifying the order in +which they run. + +### `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`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/remark.svg + +[build-status]: https://travis-ci.org/wooorm/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg + +[coverage-status]: https://codecov.io/github/wooorm/remark + +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg + +[chat]: https://gitter.im/wooorm/remark + +[license]: https://github.com/wooorm/remark/blob/master/LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[unified]: https://github.com/wooorm/unified + +[parse]: https://github.com/wooorm/unified#processorparsefilevalue-options + +[process]: https://github.com/wooorm/unified#processorprocessfilevalue-options-done + +[pipe]: https://github.com/wooorm/unified#processorpipestream-options + +[processor]: https://github.com/wooorm/remark/blob/master/packages/remark + +[mdast]: https://github.com/wooorm/mdast + +[escapes]: http://spec.commonmark.org/0.25/#backslash-escapes + +[node]: https://github.com/wooorm/unist#node + +[location]: https://github.com/wooorm/unist#location + +[options-gfm]: #optionsgfm + +[options-yaml]: #optionsyaml + +[options-commonmark]: #optionscommonmark + +[options-footnotes]: #optionsfootnotes + +[options-pedantic]: #optionspedantic + +[options-breaks]: #optionsbreaks + +[options-blocks]: #optionsblocks + +[parser]: https://github.com/wooorm/unified#processorparser + +[extend]: #extending-the-parser + +[tokenizer]: #function-tokenizereat-value-silent + +[locator]: #tokenizerlocatorvalue-fromindex + +[eat]: #eatsubvalue + +[add]: #addnode-parent diff --git a/tools/doc/node_modules/remark-stringify/index.js b/tools/doc/node_modules/remark-stringify/index.js new file mode 100644 index 00000000000000..23e64f2e659cb9 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/index.js @@ -0,0 +1,14 @@ +'use strict'; + +var unherit = require('unherit'); +var xtend = require('xtend'); +var Compiler = require('./lib/compiler.js'); + +module.exports = stringify; +stringify.Compiler = Compiler; + +function stringify(options) { + var Local = unherit(Compiler); + Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options); + this.Compiler = Local; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/compiler.js b/tools/doc/node_modules/remark-stringify/lib/compiler.js new file mode 100644 index 00000000000000..df49fbb1a796a0 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/compiler.js @@ -0,0 +1,81 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify + * @fileoverview Markdown compiler + */ + +'use strict'; + +/* Dependencies. */ +var xtend = require('xtend'); +var toggle = require('state-toggle'); + +/* Expose. */ +module.exports = Compiler; + +/** + * Construct a new compiler. + * + * @constructor + * @class {Compiler} + * @param {File} file - Virtual file. + */ +function Compiler(tree, file) { + this.inLink = false; + this.inTable = false; + this.tree = tree; + this.file = file; + this.options = xtend(this.options); + this.setOptions({}); +} + +/* Cache prototype. */ +var proto = Compiler.prototype; + +/* Enter and exit helpers. */ +proto.enterLink = toggle('inLink', false); +proto.enterTable = toggle('inTable', false); +proto.enterLinkReference = require('./util/enter-link-reference'); + +/* Configuration. */ +proto.options = require('./defaults'); +proto.setOptions = require('./set-options'); + +proto.compile = require('./macro/compile'); +proto.visit = require('./macro/one'); +proto.all = require('./macro/all'); +proto.block = require('./macro/block'); +proto.visitOrderedItems = require('./macro/ordered-items'); +proto.visitUnorderedItems = require('./macro/unordered-items'); + +/* Expose visitors. */ +proto.visitors = { + root: require('./visitors/root'), + text: require('./visitors/text'), + heading: require('./visitors/heading'), + paragraph: require('./visitors/paragraph'), + blockquote: require('./visitors/blockquote'), + list: require('./visitors/list'), + listItem: require('./visitors/list-item'), + inlineCode: require('./visitors/inline-code'), + yaml: require('./visitors/yaml'), + code: require('./visitors/code'), + html: require('./visitors/html'), + thematicBreak: require('./visitors/thematic-break'), + strong: require('./visitors/strong'), + emphasis: require('./visitors/emphasis'), + break: require('./visitors/break'), + delete: require('./visitors/delete'), + link: require('./visitors/link'), + linkReference: require('./visitors/link-reference'), + imageReference: require('./visitors/image-reference'), + definition: require('./visitors/definition'), + image: require('./visitors/image'), + footnote: require('./visitors/footnote'), + footnoteReference: require('./visitors/footnote-reference'), + footnoteDefinition: require('./visitors/footnote-definition'), + table: require('./visitors/table'), + tableCell: require('./visitors/table-cell') +}; diff --git a/tools/doc/node_modules/remark-stringify/lib/defaults.js b/tools/doc/node_modules/remark-stringify/lib/defaults.js new file mode 100644 index 00000000000000..13df14d1f77020 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/defaults.js @@ -0,0 +1,31 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:defaults + * @fileoverview Default options for `stringify`. + */ + +'use strict'; + +module.exports = { + gfm: true, + commonmark: false, + pedantic: false, + entities: 'false', + setext: false, + closeAtx: false, + looseTable: false, + spacedTable: true, + paddedTable: true, + incrementListMarker: true, + fences: false, + fence: '`', + bullet: '-', + listItemIndent: 'tab', + rule: '*', + ruleSpaces: true, + ruleRepetition: 3, + strong: '*', + emphasis: '_' +}; diff --git a/tools/doc/node_modules/remark-stringify/lib/escape.js b/tools/doc/node_modules/remark-stringify/lib/escape.js new file mode 100644 index 00000000000000..1995f75a051510 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/escape.js @@ -0,0 +1,283 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:escape + * @fileoverview Escape text to prevent it turning + * into markdown syntax. + */ + +'use strict'; + +/* Dependencies. */ +var decimal = require('is-decimal'); +var alphanumeric = require('is-alphanumeric'); +var whitespace = require('is-whitespace-character'); +var escapes = require('markdown-escapes'); +var prefix = require('./util/entity-prefix-length'); + +/* Expose. */ +module.exports = factory; + +/* Constants. */ +var BACKSLASH = '\\'; +var BULLETS = ['*', '-', '+']; +var ALLIGNMENT = [':', '-', ' ', '|']; +var entities = {'<': '<', ':': ':', '&': '&', '|': '|', '~': '~'}; + +/** + * Factory to escape characters. + * + * @example + * var escape = escapeFactory({ commonmark: true }); + * escape('x*x', { type: 'text', value: 'x*x' }) // 'x\\*x' + * + * @param {Object} options - Compiler options. + * @return {function(value, node, parent): string} - Function which + * takes a value and a node and (optionally) its parent and returns + * its escaped value. + */ +function factory(options) { + return escape; + + /** + * Escape punctuation characters in a node's value. + * + * @param {string} value - Value to escape. + * @param {Object} node - Node in which `value` exists. + * @param {Object} [parent] - Parent of `node`. + * @return {string} - Escaped `value`. + */ + function escape(value, node, parent) { + var self = this; + var gfm = options.gfm; + var commonmark = options.commonmark; + var pedantic = options.pedantic; + var markers = commonmark ? ['.', ')'] : ['.']; + var siblings = parent && parent.children; + var index = siblings && siblings.indexOf(node); + var prev = siblings && siblings[index - 1]; + var next = siblings && siblings[index + 1]; + var length = value.length; + var escapable = escapes(options); + var position = -1; + var queue = []; + var escaped = queue; + var afterNewLine; + var character; + var wordCharBefore; + var wordCharAfter; + var offset; + var replace; + + if (prev) { + afterNewLine = text(prev) && /\n\s*$/.test(prev.value); + } else { + afterNewLine = !parent || parent.type === 'root' || parent.type === 'paragraph'; + } + + function one(character) { + return escapable.indexOf(character) === -1 ? + entities[character] : BACKSLASH + character; + } + + while (++position < length) { + character = value.charAt(position); + replace = false; + + if (character === '\n') { + afterNewLine = true; + } else if ( + character === BACKSLASH || + character === '`' || + character === '*' || + character === '[' || + character === '<' || + (character === '&' && prefix(value.slice(position)) > 0) || + (character === ']' && self.inLink) || + (gfm && character === '~' && value.charAt(position + 1) === '~') || + (gfm && character === '|' && (self.inTable || alignment(value, position))) || + ( + character === '_' && + /* Delegate leading/trailing underscores + * to the multinode version below. */ + position > 0 && + position < length - 1 && + ( + pedantic || + !alphanumeric(value.charAt(position - 1)) || + !alphanumeric(value.charAt(position + 1)) + ) + ) || + (gfm && !self.inLink && character === ':' && protocol(queue.join(''))) + ) { + replace = true; + } else if (afterNewLine) { + if ( + character === '>' || + character === '#' || + BULLETS.indexOf(character) !== -1 + ) { + replace = true; + } else if (decimal(character)) { + offset = position + 1; + + while (offset < length) { + if (!decimal(value.charAt(offset))) { + break; + } + + offset++; + } + + if (markers.indexOf(value.charAt(offset)) !== -1) { + next = value.charAt(offset + 1); + + if (!next || next === ' ' || next === '\t' || next === '\n') { + queue.push(value.slice(position, offset)); + position = offset; + character = value.charAt(position); + replace = true; + } + } + } + } + + if (afterNewLine && !whitespace(character)) { + afterNewLine = false; + } + + queue.push(replace ? one(character) : character); + } + + /* Multi-node versions. */ + if (siblings && text(node)) { + /* Check for an opening parentheses after a + * link-reference (which can be joined by + * white-space). */ + if (prev && prev.referenceType === 'shortcut') { + position = -1; + length = escaped.length; + + while (++position < length) { + character = escaped[position]; + + if (character === ' ' || character === '\t') { + continue; + } + + if (character === '(' || character === ':') { + escaped[position] = one(character); + } + + break; + } + + /* If the current node is all spaces / tabs, + * preceded by a shortcut, and followed by + * a text starting with `(`, escape it. */ + if ( + text(next) && + position === length && + next.value.charAt(0) === '(' + ) { + escaped.push(BACKSLASH); + } + } + + /* Ensure non-auto-links are not seen as links. + * This pattern needs to check the preceding + * nodes too. */ + if ( + gfm && + !self.inLink && + text(prev) && + value.charAt(0) === ':' && + protocol(prev.value.slice(-6)) + ) { + escaped[0] = one(':'); + } + + /* Escape ampersand if it would otherwise + * start an entity. */ + if ( + text(next) && + value.charAt(length - 1) === '&' && + prefix('&' + next.value) !== 0 + ) { + escaped[escaped.length - 1] = one('&'); + } + + /* Escape double tildes in GFM. */ + if ( + gfm && + text(next) && + value.charAt(length - 1) === '~' && + next.value.charAt(0) === '~' + ) { + escaped.splice(escaped.length - 1, 0, BACKSLASH); + } + + /* Escape underscores, but not mid-word (unless + * in pedantic mode). */ + wordCharBefore = text(prev) && alphanumeric(prev.value.slice(-1)); + wordCharAfter = text(next) && alphanumeric(next.value.charAt(0)); + + if (length === 1) { + if (value === '_' && (pedantic || !wordCharBefore || !wordCharAfter)) { + escaped.unshift(BACKSLASH); + } + } else { + if ( + value.charAt(0) === '_' && + (pedantic || !wordCharBefore || !alphanumeric(value.charAt(1))) + ) { + escaped.unshift(BACKSLASH); + } + + if ( + value.charAt(length - 1) === '_' && + (pedantic || !wordCharAfter || !alphanumeric(value.charAt(length - 2))) + ) { + escaped.splice(escaped.length - 1, 0, BACKSLASH); + } + } + } + + return escaped.join(''); + } +} + +/** + * Check if `index` in `value` is inside an alignment row. + */ +function alignment(value, index) { + var start = value.lastIndexOf('\n', index); + var end = value.indexOf('\n', index); + + start = start === -1 ? -1 : start; + end = end === -1 ? value.length : end; + + while (++start < end) { + if (ALLIGNMENT.indexOf(value.charAt(start)) === -1) { + return false; + } + } + + return true; +} + +/** + * Check if `node` is a text node. + */ +function text(node) { + return node && node.type === 'text'; +} + +/** + * Check if `value` ends in a protocol. + */ +function protocol(value) { + var val = value.slice(-6).toLowerCase(); + return val === 'mailto' || val.slice(-5) === 'https' || val.slice(-4) === 'http'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/all.js b/tools/doc/node_modules/remark-stringify/lib/macro/all.js new file mode 100644 index 00000000000000..51f0cbeb48ca26 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/all.js @@ -0,0 +1,32 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:all + * @fileoverview Stringify children in a node. + */ + +'use strict'; + +/* Expose. */ +module.exports = all; + +/** + * Visit all children of `parent`. + * + * @param {Object} parent - Parent node of children. + * @return {Array.} - List of compiled children. + */ +function all(parent) { + var self = this; + var children = parent.children; + var length = children.length; + var results = []; + var index = -1; + + while (++index < length) { + results[index] = self.visit(children[index], parent); + } + + return results; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/block.js b/tools/doc/node_modules/remark-stringify/lib/macro/block.js new file mode 100644 index 00000000000000..54ca2caa02db15 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/block.js @@ -0,0 +1,60 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:block + * @fileoverview Stringify a block. + */ + +'use strict'; + +/* Expose. */ +module.exports = block; + +/** + * Stringify a block node with block children (e.g., `root` + * or `blockquote`). + * + * Knows about code following a list, or adjacent lists + * with similar bullets, and places an extra newline + * between them. + * + * @param {Object} node + * @return {string} - Compiled children. + */ +function block(node) { + var self = this; + var values = []; + var children = node.children; + var length = children.length; + var index = -1; + var child; + var prev; + + while (++index < length) { + child = children[index]; + + if (prev) { + /* Duplicate nodes, such as a list + * directly following another list, + * often need multiple new lines. + * + * Additionally, code blocks following a list + * might easily be mistaken for a paragraph + * in the list itself. */ + if (child.type === prev.type && prev.type === 'list') { + values.push(prev.ordered === child.ordered ? '\n\n\n' : '\n\n'); + } else if (prev.type === 'list' && child.type === 'code' && !child.lang) { + values.push('\n\n\n'); + } else { + values.push('\n\n'); + } + } + + values.push(self.visit(child, node)); + + prev = child; + } + + return values.join(''); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/compile.js b/tools/doc/node_modules/remark-stringify/lib/macro/compile.js new file mode 100644 index 00000000000000..80162788aff6b3 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/compile.js @@ -0,0 +1,25 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:compile + * @fileoverview Compile the given node. + */ + +'use strict'; + +/* Dependencies. */ +var compact = require('mdast-util-compact'); + +/* Expose. */ +module.exports = compile; + +/** + * Stringify the given tree. + * + * @param {Node} node - Syntax tree. + * @return {string} - Markdown document. + */ +function compile() { + return this.visit(compact(this.tree, this.options.commonmark)); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/one.js b/tools/doc/node_modules/remark-stringify/lib/macro/one.js new file mode 100644 index 00000000000000..ccbd1cb24989b3 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/one.js @@ -0,0 +1,37 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:one + * @fileoverview Stringify a node. + */ + +'use strict'; + +/* Expose. */ +module.exports = one; + +/** + * Visit a node. + * + * @param {Object} node - Node. + * @param {Object?} [parent] - `node`s parent. + * @return {string} - Compiled `node`. + */ +function one(node, parent) { + var self = this; + var visitors = self.visitors; + + /* Fail on unknown nodes. */ + if (typeof visitors[node.type] !== 'function') { + self.file.fail( + new Error( + 'Missing compiler for node of type `' + + node.type + '`: `' + node + '`' + ), + node + ); + } + + return visitors[node.type].call(self, node, parent); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/ordered-items.js b/tools/doc/node_modules/remark-stringify/lib/macro/ordered-items.js new file mode 100644 index 00000000000000..e074a20164e4e9 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/ordered-items.js @@ -0,0 +1,54 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:ordered-items + * @fileoverview Stringify ordered list items. + */ + +'use strict'; + +/* Expose. */ +module.exports = orderedItems; + +/** + * Visit ordered list items. + * + * Starts the list with + * `node.start` and increments each following list item + * bullet by one: + * + * 2. foo + * 3. bar + * + * In `incrementListMarker: false` mode, does not increment + * each marker and stays on `node.start`: + * + * 1. foo + * 1. bar + * + * Adds an extra line after an item if it has + * `loose: true`. + * + * @param {Object} node - `list` node with + * `ordered: true`. + * @return {string} - Compiled children. + */ +function orderedItems(node) { + var self = this; + var fn = self.visitors.listItem; + var increment = self.options.incrementListMarker; + var values = []; + var start = node.start; + var children = node.children; + var length = children.length; + var index = -1; + var bullet; + + while (++index < length) { + bullet = (increment ? start + index : start) + '.'; + values[index] = fn.call(self, children[index], node, index, bullet); + } + + return values.join('\n'); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/macro/unordered-items.js b/tools/doc/node_modules/remark-stringify/lib/macro/unordered-items.js new file mode 100644 index 00000000000000..8103c1206a78cd --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/macro/unordered-items.js @@ -0,0 +1,37 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:macro:unordered-items + * @fileoverview Stringify unordered list items. + */ + +'use strict'; + +/* Expose. */ +module.exports = unorderedItems; + +/** + * Visit unordered list items. + * + * Uses `options.bullet` as each item's bullet. + * + * @param {Object} node - `list` node with + * `ordered: false`. + * @return {string} - Compiled children. + */ +function unorderedItems(node) { + var self = this; + var bullet = self.options.bullet; + var fn = self.visitors.listItem; + var children = node.children; + var length = children.length; + var index = -1; + var values = []; + + while (++index < length) { + values[index] = fn.call(self, children[index], node, index, bullet); + } + + return values.join('\n'); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/set-options.js b/tools/doc/node_modules/remark-stringify/lib/set-options.js new file mode 100644 index 00000000000000..f83cdf7821dd8f --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/set-options.js @@ -0,0 +1,210 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:set-options + * @fileoverview Set configuration. + */ + +'use strict'; + +/* Dependencies. */ +var xtend = require('xtend'); +var encode = require('stringify-entities'); +var defaults = require('./defaults'); +var escapeFactory = require('./escape'); +var returner = require('./util/returner'); + +/* Expose. */ +module.exports = setOptions; + +/* Map of applicable enum's. */ +var maps = { + entities: {true: true, false: true, numbers: true, escape: true}, + bullet: {'*': true, '-': true, '+': true}, + rule: {'-': true, _: true, '*': true}, + listItemIndent: {tab: true, mixed: true, 1: true}, + emphasis: {_: true, '*': true}, + strong: {_: true, '*': true}, + fence: {'`': true, '~': true} +}; + +/* Expose `validate`. */ +var validate = { + boolean: validateBoolean, + string: validateString, + number: validateNumber +}; + +/** + * Set options. Does not overwrite previously set + * options. + * + * @this {Compiler} + * @throws {Error} - When an option is invalid. + * @param {Object?} [options] - Stringify settings. + * @return {Compiler} - `self`. + */ +function setOptions(options) { + var self = this; + var current = self.options; + var ruleRepetition; + var key; + + 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) { + validate[typeof defaults[key]](options, key, current[key], maps[key]); + } + + ruleRepetition = options.ruleRepetition; + + if (ruleRepetition && ruleRepetition < 3) { + raise(ruleRepetition, 'options.ruleRepetition'); + } + + self.encode = encodeFactory(String(options.entities)); + self.escape = escapeFactory(options); + + self.options = options; + + return self; +} + +/** + * Throw an exception with in its `message` `value` + * and `name`. + * + * @param {*} value - Invalid value. + * @param {string} name - Setting name. + */ +function raise(value, name) { + throw new Error('Invalid value `' + value + '` for setting `' + name + '`'); +} + +/** + * Validate a value to be boolean. Defaults to `def`. + * Raises an exception with `context[name]` when not + * a boolean. + * + * @throws {Error} - When a setting is neither omitted nor + * a boolean. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {boolean} def - Default value. + */ +function validateBoolean(context, name, def) { + var value = context[name]; + + if (value == null) { + value = def; + } + + if (typeof value !== 'boolean') { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Validate a value to be boolean. Defaults to `def`. + * Raises an exception with `context[name]` when not + * a boolean. + * + * @throws {Error} - When a setting is neither omitted nor + * a number. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {number} def - Default value. + */ +function validateNumber(context, name, def) { + var value = context[name]; + + if (value == null) { + value = def; + } + + if (isNaN(value)) { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Validate a value to be in `map`. Defaults to `def`. + * Raises an exception with `context[name]` when not + * in `map`. + * + * @throws {Error} - When a setting is neither omitted nor + * in `map`. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {string} def - Default value. + * @param {Object} map - Enum. + */ +function validateString(context, name, def, map) { + var value = context[name]; + + if (value == null) { + value = def; + } + + value = String(value); + + if (!(value in map)) { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Factory to encode HTML entities. + * Creates a no-operation function when `type` is + * `'false'`, a function which encodes using named + * references when `type` is `'true'`, and a function + * which encodes using numbered references when `type` is + * `'numbers'`. + * + * @param {string} type - Either `'true'`, `'false'`, or + * `'numbers'`. + * @return {function(string): string} - Function which + * takes a value and returns its encoded version. + */ +function encodeFactory(type) { + var options = {}; + + if (type === 'false') { + return returner; + } + + if (type === 'true') { + options.useNamedReferences = true; + } + + if (type === 'escape') { + options.escapeOnly = true; + options.useNamedReferences = true; + } + + return wrapped; + + /** + * Encode HTML entities using the bound options. + * + * @param {string} value - Content. + * @param {Object} [node] - Node which is compiled. + * @return {string} - Encoded content. + */ + function wrapped(value) { + return encode(value, options); + } +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js b/tools/doc/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js new file mode 100644 index 00000000000000..b9c9227f6a9d4c --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js @@ -0,0 +1,82 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:copy-identifier-encoding + * @fileoverview Encode based on the identifier. + */ + +'use strict'; + +/* Dependencies. */ +var entityPrefixLength = require('./entity-prefix-length'); + +/* Expose. */ +module.exports = copy; + +/* Punctuation characters. */ +var PUNCTUATION = /[-!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~_]/; + +/** + * For shortcut and collapsed reference links, the contents + * is also an identifier, so we need to restore the original + * encoding and escaping that were present in the source + * string. + * + * This function takes the unescaped & unencoded value from + * shortcut's child nodes and the identifier and encodes + * the former according to the latter. + * + * @example + * copyIdentifierEncoding('a*b', 'a\\*b*c') + * // 'a\\*b*c' + * + * @param {string} value - Unescaped and unencoded stringified + * link value. + * @param {string} identifier - Link identifier. + * @return {string} - Encoded link value. + */ +function copy(value, identifier) { + var length = value.length; + var count = identifier.length; + var result = []; + var position = 0; + var index = 0; + var start; + + while (index < length) { + /* Take next non-punctuation characters from `value`. */ + start = index; + + while (index < length && !PUNCTUATION.test(value.charAt(index))) { + index += 1; + } + + result.push(value.slice(start, index)); + + /* Advance `position` to the next punctuation character. */ + while (position < count && !PUNCTUATION.test(identifier.charAt(position))) { + position += 1; + } + + /* Take next punctuation characters from `identifier`. */ + start = position; + + while (position < count && PUNCTUATION.test(identifier.charAt(position))) { + if (identifier.charAt(position) === '&') { + position += entityPrefixLength(identifier.slice(position)); + } + + position += 1; + } + + result.push(identifier.slice(start, position)); + + /* Advance `index` to the next non-punctuation character. */ + while (index < length && PUNCTUATION.test(value.charAt(index))) { + index += 1; + } + } + + return result.join(''); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/enclose-title.js b/tools/doc/node_modules/remark-stringify/lib/util/enclose-title.js new file mode 100644 index 00000000000000..8b086a6f6d7afe --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/enclose-title.js @@ -0,0 +1,36 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:enclose-title + * @fileoverview Quote a `title` the best way possible. + */ + +'use strict'; + +/* Expose. */ +module.exports = enclose; + +/** + * There is currently no way to support nested delimiters + * across Markdown.pl, CommonMark, and GitHub (RedCarpet). + * The following code supports Markdown.pl and GitHub. + * CommonMark is not supported when mixing double- and + * single quotes inside a title. + * + * @see https://github.com/vmg/redcarpet/issues/473 + * @see https://github.com/jgm/CommonMark/issues/308 + * + * @example + * encloseTitle('foo') // '"foo"' + * encloseTitle('foo \'bar\' baz') // '"foo \'bar\' baz"' + * encloseTitle('foo "bar" baz') // '\'foo "bar" baz\'' + * encloseTitle('foo "bar" \'baz\'') // '"foo "bar" \'baz\'"' + * + * @param {string} title - Content. + * @return {string} - Properly enclosed title. + */ +function enclose(title) { + var delimiter = title.indexOf('"') === -1 ? '"' : '\''; + return delimiter + title + delimiter; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/enclose-uri.js b/tools/doc/node_modules/remark-stringify/lib/util/enclose-uri.js new file mode 100644 index 00000000000000..e1b9d9a432e961 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/enclose-uri.js @@ -0,0 +1,48 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:enclose-uri + * @fileoverview Wrap `url` in angle brackets when needed. + */ + +'use strict'; + +/* Dependencies. */ +var count = require('ccount'); + +/* Expose. */ +module.exports = enclose; + +/* Constants. */ +var re = /\s/; + +/** + * Wrap `url` in angle brackets when needed, or when + * forced. + * + * In links, images, and definitions, the URL part needs + * to be enclosed when it: + * + * - has a length of `0`; + * - contains white-space; + * - has more or less opening than closing parentheses. + * + * @example + * encloseURI('foo bar') // '' + * encloseURI('foo(bar(baz)') // '' + * encloseURI('') // '<>' + * encloseURI('example.com') // 'example.com' + * encloseURI('example.com', true) // '' + * + * @param {string} uri - URI to enclose. + * @param {boolean?} [always] - Force enclosing. + * @return {boolean} - Properly enclosed `uri`. + */ +function enclose(uri, always) { + if (always || uri.length === 0 || re.test(uri) || count(uri, '(') !== count(uri, ')')) { + return '<' + uri + '>'; + } + + return uri; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/enter-link-reference.js b/tools/doc/node_modules/remark-stringify/lib/util/enter-link-reference.js new file mode 100644 index 00000000000000..772a5fcc4bda08 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/enter-link-reference.js @@ -0,0 +1,51 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:enter-link-reference + * @fileoverview Enter a reference. + */ + +'use strict'; + +/* Dependencies. */ +var returner = require('./returner'); + +/* Expose. */ +module.exports = enter; + +/** + * Shortcut and collapsed link references need no escaping + * and encoding during the processing of child nodes (it + * must be implied from identifier). + * + * This toggler turns encoding and escaping off for shortcut + * and collapsed references. + * + * Implies `enterLink`. + * + * @param {Compiler} compiler - Compiler instance. + * @param {LinkReference} node - LinkReference node. + * @return {Function} - Exit state. + */ +function enter(compiler, node) { + var encode = compiler.encode; + var escape = compiler.escape; + var exit = compiler.enterLink(); + + if ( + node.referenceType !== 'shortcut' && + node.referenceType !== 'collapsed' + ) { + return exit; + } + + compiler.escape = returner; + compiler.encode = returner; + + return function () { + compiler.encode = encode; + compiler.escape = escape; + exit(); + }; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/entity-prefix-length.js b/tools/doc/node_modules/remark-stringify/lib/util/entity-prefix-length.js new file mode 100644 index 00000000000000..8f956cc70cb6d0 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/entity-prefix-length.js @@ -0,0 +1,42 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:entity-prefix-length + * @fileoverview Encode based on the identifier. + */ + +'use strict'; + +/* Dependencies. */ +var decode = require('parse-entities'); + +/* Expose. */ +module.exports = length; + +/** + * Returns the length of HTML entity that is a prefix of + * the given string (excluding the ampersand), 0 if it + * does not start with an entity. + * + * @example + * entityPrefixLength('©cat') // 4 + * entityPrefixLength('&foo & &bar') // 0 + * + * @param {string} value - Input string. + * @return {number} - Length of an entity. + */ +function length(value) { + var prefix; + + /* istanbul ignore if - Currently also tested for at + * implemention, but we keep it here because that’s + * proper. */ + if (value.charAt(0) !== '&') { + return 0; + } + + prefix = value.split('&', 2).join('&'); + + return prefix.length - decode(prefix).length; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/label.js b/tools/doc/node_modules/remark-stringify/lib/util/label.js new file mode 100644 index 00000000000000..c1dda3a475994a --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/label.js @@ -0,0 +1,32 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:label + * @fileoverview Stringify a reference label. + */ + +'use strict'; + +/* Expose. */ +module.exports = label; + +/** + * Stringify a reference label. + * + * Because link references are easily, mistakingly, + * created (for example, `[foo]`), reference nodes have + * an extra property depicting how it looked in the + * original document, so stringification can cause minimal + * changes. + * + * @param {Object} node - `linkReference` or + * `imageReference` node. + * @return {string} - Markdown label reference. + */ +function label(node) { + var type = node.referenceType; + var value = type === 'full' ? node.identifier : ''; + + return type === 'shortcut' ? value : '[' + value + ']'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/pad.js b/tools/doc/node_modules/remark-stringify/lib/util/pad.js new file mode 100644 index 00000000000000..34c39ed0c9dae0 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/pad.js @@ -0,0 +1,47 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:pad + * @fileoverview Pad a given value. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = pad; + +/* Constants. */ +var INDENT = 4; + +/** + * Pad `value` with `level * INDENT` spaces. Respects + * lines. Ignores empty lines. + * + * @example + * pad('foo', 1) // ' foo' + * + * @param {string} value - Content. + * @param {number} level - Indentation level. + * @return {string} - Padded `value`. + */ +function pad(value, level) { + var index; + var padding; + + value = value.split('\n'); + + index = value.length; + padding = repeat(' ', level * INDENT); + + while (index--) { + if (value[index].length !== 0) { + value[index] = padding + value[index]; + } + } + + return value.join('\n'); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/util/returner.js b/tools/doc/node_modules/remark-stringify/lib/util/returner.js new file mode 100644 index 00000000000000..185840a0de3a68 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/util/returner.js @@ -0,0 +1,20 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:util:returner + * @fileoverview Return the given value. + */ + +'use strict'; + +/* Expose. */ +module.exports = returner; + +/** + * @param {*} value - Anything. + * @return {*} - Given `value`. + */ +function returner(value) { + return value; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/blockquote.js b/tools/doc/node_modules/remark-stringify/lib/visitors/blockquote.js new file mode 100644 index 00000000000000..bb14653dc8cda5 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/blockquote.js @@ -0,0 +1,33 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:blockquote + * @fileoverview Stringify a blockquote. + */ + +'use strict'; + +/* Expose. */ +module.exports = blockquote; + +/** + * Stringify a blockquote. + * + * @param {Object} node - `blockquote` node. + * @return {string} - Markdown blockquote. + */ +function blockquote(node) { + var values = this.block(node).split('\n'); + var result = []; + var length = values.length; + var index = -1; + var value; + + while (++index < length) { + value = values[index]; + result[index] = (value ? ' ' : '') + value; + } + + return '>' + result.join('\n>'); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/break.js b/tools/doc/node_modules/remark-stringify/lib/visitors/break.js new file mode 100644 index 00000000000000..32b655450d9333 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/break.js @@ -0,0 +1,28 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:break + * @fileoverview Stringify a break. + */ + +'use strict'; + +/* Expose. */ +module.exports = lineBreak; + +/* Constants. */ +var map = {true: '\\\n', false: ' \n'}; + +/** + * Stringify a hard break. + * + * In Commonmark mode, trailing backslash form is used in order + * to preserve trailing whitespace that the line may end with, + * and also for better visibility. + * + * @return {string} - Markdown break. + */ +function lineBreak() { + return map[this.options.commonmark]; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/code.js b/tools/doc/node_modules/remark-stringify/lib/visitors/code.js new file mode 100644 index 00000000000000..102a7b932bd1d6 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/code.js @@ -0,0 +1,100 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:code + * @fileoverview Stringify code. + */ + +'use strict'; + +/* Dependencies. */ +var streak = require('longest-streak'); +var repeat = require('repeat-string'); +var pad = require('../util/pad'); + +/* Expose. */ +module.exports = code; + +/* Constants. */ +var FENCE = /([`~])\1{2}/; + +/** + * Stringify code. + * + * Creates indented code when: + * + * - No language tag exists; + * - Not in `fences: true` mode; + * - A non-empty value exists. + * + * Otherwise, GFM fenced code is created: + * + * ```js + * foo(); + * ``` + * + * When in ``fence: `~` `` mode, uses tildes as fences: + * + * ~~~js + * foo(); + * ~~~ + * + * Knows about internal fences (Note: GitHub/Kramdown does + * not support this): + * + * ````javascript + * ```markdown + * foo + * ``` + * ```` + * + * Supports named entities in the language flag with + * `settings.encode` mode. + * + * @param {Object} node - `code` node. + * @param {Object} parent - Parent of `node`. + * @return {string} - Markdown code. + */ +function code(node, parent) { + var self = this; + var value = node.value; + var options = self.options; + var marker = options.fence; + var language = self.encode(node.lang || '', node); + var fence; + + /* Without (needed) fences. */ + if (!language && !options.fences && value) { + /* Throw when pedantic, in a list item which + * isn’t compiled using a tab. */ + if ( + parent && + parent.type === 'listItem' && + options.listItemIndent !== 'tab' && + options.pedantic + ) { + self.file.fail( + 'Cannot indent code properly. See http://git.io/vgFvT', + node.position + ); + } + + return pad(value, 1); + } + + fence = streak(value, marker) + 1; + + /* Fix GFM / RedCarpet bug, where fence-like characters + * inside fenced code can exit a code-block. + * Yes, even when the outer fence uses different + * characters, or is longer. + * Thus, we can only pad the code to make it work. */ + if (FENCE.test(value)) { + value = pad(value, 1); + } + + fence = repeat(marker, Math.max(fence, 3)); + + return fence + language + '\n' + value + '\n' + fence; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/definition.js b/tools/doc/node_modules/remark-stringify/lib/visitors/definition.js new file mode 100644 index 00000000000000..ef1eee8469d7b8 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/definition.js @@ -0,0 +1,37 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:definition + * @fileoverview Stringify a definition. + */ + +'use strict'; + +/* Dependencies. */ +var uri = require('../util/enclose-uri'); +var title = require('../util/enclose-title'); + +/* Expose. */ +module.exports = definition; + +/** + * Stringify an URL definition. + * + * Is smart about enclosing `url` (see `encloseURI()`) and + * `title` (see `encloseTitle()`). + * + * [foo]: 'An "example" e-mail' + * + * @param {Object} node - `definition` node. + * @return {string} - Markdown definition. + */ +function definition(node) { + var content = uri(node.url); + + if (node.title) { + content += ' ' + title(node.title); + } + + return '[' + node.identifier + ']: ' + content; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/delete.js b/tools/doc/node_modules/remark-stringify/lib/visitors/delete.js new file mode 100644 index 00000000000000..21bbca4057421f --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/delete.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:delete + * @fileoverview Stringify a delete. + */ + +'use strict'; + +/* Expose. */ +module.exports = strikethrough; + +/** + * Stringify a `delete`. + * + * @param {Object} node - `delete` node. + * @return {string} - Markdown strikethrough. + */ +function strikethrough(node) { + return '~~' + this.all(node).join('') + '~~'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/emphasis.js b/tools/doc/node_modules/remark-stringify/lib/visitors/emphasis.js new file mode 100644 index 00000000000000..6b870df451f8ac --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/emphasis.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:emphasis + * @fileoverview Stringify a emphasis. + */ + +'use strict'; + +/* Expose. */ +module.exports = emphasis; + +/** + * Stringify a `emphasis`. + * + * The marker used is configurable through `emphasis`, which + * defaults to an underscore (`'_'`) but also accepts an + * asterisk (`'*'`): + * + * *foo* + * + * @param {Object} node - `emphasis` node. + * @return {string} - Markdown emphasis. + */ +function emphasis(node) { + var marker = this.options.emphasis; + return marker + this.all(node).join('') + marker; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-definition.js b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-definition.js new file mode 100644 index 00000000000000..bf49a1d77f6e55 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-definition.js @@ -0,0 +1,28 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:footnote-definition + * @fileoverview Stringify a footnote-definition. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = footnoteDefinition; + +/** + * Stringify a footnote definition. + * + * @param {Object} node - `footnoteDefinition` node. + * @return {string} - Markdown footnote definition. + */ +function footnoteDefinition(node) { + var id = node.identifier.toLowerCase(); + var content = this.all(node).join('\n\n' + repeat(' ', 4)); + + return '[^' + id + ']: ' + content; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-reference.js b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-reference.js new file mode 100644 index 00000000000000..e46bbee371ee2d --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote-reference.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:footnote-reference + * @fileoverview Stringify a footnote reference. + */ + +'use strict'; + +/* Expose. */ +module.exports = footnoteReference; + +/** + * Stringify a footnote reference. + * + * @param {Object} node - `footnoteReference` node. + * @return {string} - Markdown footnote reference. + */ +function footnoteReference(node) { + return '[^' + node.identifier + ']'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/footnote.js b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote.js new file mode 100644 index 00000000000000..b12d5d5e8256df --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/footnote.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:footnote + * @fileoverview Stringify a footnote. + */ + +'use strict'; + +/* Expose. */ +module.exports = footnote; + +/** + * Stringify a footnote. + * + * @param {Object} node - `footnote` node. + * @return {string} - Markdown footnote. + */ +function footnote(node) { + return '[^' + this.all(node).join('') + ']'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/heading.js b/tools/doc/node_modules/remark-stringify/lib/visitors/heading.js new file mode 100644 index 00000000000000..ce4a9bc99be828 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/heading.js @@ -0,0 +1,53 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:heading + * @fileoverview Stringify a heading. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = heading; + +/** + * Stringify heading. + * + * In `setext: true` mode and when `depth` is smaller than + * three, creates a setext header: + * + * Foo + * === + * + * Otherwise, an ATX header is generated: + * + * ### Foo + * + * In `closeAtx: true` mode, the header is closed with + * hashes: + * + * ### Foo ### + * + * @param {Object} node - `heading` node. + * @return {string} - Markdown heading. + */ +function heading(node) { + var self = this; + var depth = node.depth; + var setext = self.options.setext; + var closeAtx = self.options.closeAtx; + var content = self.all(node).join(''); + var prefix; + + if (setext && depth < 3) { + return content + '\n' + repeat(depth === 1 ? '=' : '-', content.length); + } + + prefix = repeat('#', node.depth); + + return prefix + ' ' + content + (closeAtx ? ' ' + prefix : ''); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/html.js b/tools/doc/node_modules/remark-stringify/lib/visitors/html.js new file mode 100644 index 00000000000000..4f5bfa88336b03 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/html.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:html + * @fileoverview Stringify html. + */ + +'use strict'; + +/* Expose. */ +module.exports = html; + +/** + * Stringify html. + * + * @param {Object} node - `html` node. + * @return {string} - html. + */ +function html(node) { + return node.value; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/image-reference.js b/tools/doc/node_modules/remark-stringify/lib/visitors/image-reference.js new file mode 100644 index 00000000000000..4075baecb69b45 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/image-reference.js @@ -0,0 +1,25 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:image-reference + * @fileoverview Stringify an image reference. + */ + +'use strict'; + +/* Dependencies. */ +var label = require('../util/label'); + +/* Expose. */ +module.exports = imageReference; + +/** + * Stringify an image reference. + * + * @param {Object} node - `imageReference` node. + * @return {string} - Markdown image reference. + */ +function imageReference(node) { + return '![' + (this.encode(node.alt, node) || '') + ']' + label(node); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/image.js b/tools/doc/node_modules/remark-stringify/lib/visitors/image.js new file mode 100644 index 00000000000000..5cc5df758fe163 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/image.js @@ -0,0 +1,45 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:image + * @fileoverview Stringify an image. + */ + +'use strict'; + +/* Dependencies. */ +var uri = require('../util/enclose-uri'); +var title = require('../util/enclose-title'); + +/* Expose. */ +module.exports = image; + +/** + * Stringify an image. + * + * Is smart about enclosing `url` (see `encloseURI()`) and + * `title` (see `encloseTitle()`). + * + * ![foo]( 'My "favourite" icon') + * + * Supports named entities in `url`, `alt`, and `title` + * when in `settings.encode` mode. + * + * @param {Object} node - `image` node. + * @return {string} - Markdown image. + */ +function image(node) { + var self = this; + var content = uri(self.encode(node.url || '', node)); + var exit = self.enterLink(); + var alt = self.encode(self.escape(node.alt || '', node)); + + exit(); + + if (node.title) { + content += ' ' + title(self.encode(node.title, node)); + } + + return '![' + alt + '](' + content + ')'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/inline-code.js b/tools/doc/node_modules/remark-stringify/lib/visitors/inline-code.js new file mode 100644 index 00000000000000..722562b2650422 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/inline-code.js @@ -0,0 +1,49 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:inline-code + * @fileoverview Stringify inline code. + */ + +'use strict'; + +/* Dependencies. */ +var streak = require('longest-streak'); +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = inlineCode; + +/** + * Stringify inline code. + * + * Knows about internal ticks (`\``), and ensures one more + * tick is used to enclose the inline code: + * + * ```foo ``bar`` baz``` + * + * Even knows about inital and final ticks: + * + * `` `foo `` + * `` foo` `` + * + * @param {Object} node - `inlineCode` node. + * @return {string} - Markdown inline code. + */ +function inlineCode(node) { + var value = node.value; + var ticks = repeat('`', streak(value, '`') + 1); + var start = ticks; + var end = ticks; + + if (value.charAt(0) === '`') { + start += ' '; + } + + if (value.charAt(value.length - 1) === '`') { + end = ' ' + end; + } + + return start + value + end; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/link-reference.js b/tools/doc/node_modules/remark-stringify/lib/visitors/link-reference.js new file mode 100644 index 00000000000000..dfd22b63d342c4 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/link-reference.js @@ -0,0 +1,37 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:link-reference + * @fileoverview Stringify a link reference. + */ + +'use strict'; + +/* Dependencies. */ +var copy = require('../util/copy-identifier-encoding'); +var label = require('../util/label'); + +/* Expose. */ +module.exports = linkReference; + +/** + * Stringify a link reference. + * + * @param {Object} node - `linkReference` node. + * @return {string} - Markdown link reference. + */ +function linkReference(node) { + var self = this; + var type = node.referenceType; + var exit = self.enterLinkReference(self, node); + var value = self.all(node).join(''); + + exit(); + + if (type === 'shortcut' || type === 'collapsed') { + value = copy(value, node.identifier); + } + + return '[' + value + ']' + label(node); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/link.js b/tools/doc/node_modules/remark-stringify/lib/visitors/link.js new file mode 100644 index 00000000000000..25b024270a333d --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/link.js @@ -0,0 +1,68 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:link + * @fileoverview Stringify a link. + */ + +'use strict'; + +/* Dependencies. */ +var uri = require('../util/enclose-uri'); +var title = require('../util/enclose-title'); + +/* Expose. */ +module.exports = link; + +/* Expression for a protocol: + * http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax */ +var PROTOCOL = /^[a-z][a-z+.-]+:\/?/i; + +/** + * Stringify a link. + * + * When no title exists, the compiled `children` equal + * `url`, and `url` starts with a protocol, an auto + * link is created: + * + * + * + * Otherwise, is smart about enclosing `url` (see + * `encloseURI()`) and `title` (see `encloseTitle()`). + * + * [foo]( 'An "example" e-mail') + * + * Supports named entities in the `url` and `title` when + * in `settings.encode` mode. + * + * @param {Object} node - `link` node. + * @return {string} - Markdown link. + */ +function link(node) { + var self = this; + var content = self.encode(node.url || '', node); + var exit = self.enterLink(); + var escaped = self.encode(self.escape(node.url || '', node)); + var value = self.all(node).join(''); + + exit(); + + if ( + node.title == null && + PROTOCOL.test(content) && + (escaped === value || escaped === 'mailto:' + value) + ) { + /* Backslash escapes do not work in autolinks, + * so we do not escape. */ + return uri(self.encode(node.url), true); + } + + content = uri(content); + + if (node.title) { + content += ' ' + title(self.encode(self.escape(node.title, node), node)); + } + + return '[' + value + '](' + content + ')'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/list-item.js b/tools/doc/node_modules/remark-stringify/lib/visitors/list-item.js new file mode 100644 index 00000000000000..36ba9a97c47bfa --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/list-item.js @@ -0,0 +1,79 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:list-item + * @fileoverview Stringify a list item. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); +var pad = require('../util/pad'); + +/* Expose. */ +module.exports = listItem; + +/* Which checkbox to use. */ +var CHECKBOX_MAP = { + undefined: '', + null: '', + true: '[x] ', + false: '[ ] ' +}; + +/** + * Stringify a list item. + * + * Prefixes the content with a checked checkbox when + * `checked: true`: + * + * [x] foo + * + * Prefixes the content with an unchecked checkbox when + * `checked: false`: + * + * [ ] foo + * + * @param {Object} node - `listItem` node. + * @param {Object} parent - `list` node. + * @param {number} position - Index of `node` in `parent`. + * @param {string} bullet - Bullet to use. This, and the + * `listItemIndent` setting define the used indent. + * @return {string} - Markdown list item. + */ +function listItem(node, parent, position, bullet) { + var self = this; + var style = self.options.listItemIndent; + var loose = node.loose; + var children = node.children; + var length = children.length; + var values = []; + var index = -1; + var value; + var indent; + var spacing; + + while (++index < length) { + values[index] = self.visit(children[index], node); + } + + value = CHECKBOX_MAP[node.checked] + values.join(loose ? '\n\n' : '\n'); + + if (style === '1' || (style === 'mixed' && value.indexOf('\n') === -1)) { + indent = bullet.length + 1; + spacing = ' '; + } else { + indent = Math.ceil((bullet.length + 1) / 4) * 4; + spacing = repeat(' ', indent - bullet.length); + } + + value = bullet + spacing + pad(value, indent / 4).slice(indent); + + if (loose && parent.children.length - 1 !== position) { + value += '\n'; + } + + return value; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/list.js b/tools/doc/node_modules/remark-stringify/lib/visitors/list.js new file mode 100644 index 00000000000000..7fe5e4df579b09 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/list.js @@ -0,0 +1,29 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:list + * @fileoverview Stringify a list. + */ + +'use strict'; + +/* Expose. */ +module.exports = list; + +/* Which method to use based on `list.ordered`. */ +var ORDERED_MAP = { + true: 'visitOrderedItems', + false: 'visitUnorderedItems' +}; + +/** + * Stringify a list. See `Compiler#visitOrderedList()` and + * `Compiler#visitUnorderedList()` for internal working. + * + * @param {Object} node - `list` node. + * @return {string} - Markdown list. + */ +function list(node) { + return this[ORDERED_MAP[node.ordered]](node); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/paragraph.js b/tools/doc/node_modules/remark-stringify/lib/visitors/paragraph.js new file mode 100644 index 00000000000000..fe5bee7c1a0884 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/paragraph.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:paragraph + * @fileoverview Stringify a paragraph. + */ + +'use strict'; + +/* Expose. */ +module.exports = paragraph; + +/** + * Stringify a paragraph. + * + * @param {Object} node - `paragraph` node. + * @return {string} - Markdown paragraph. + */ +function paragraph(node) { + return this.all(node).join(''); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/root.js b/tools/doc/node_modules/remark-stringify/lib/visitors/root.js new file mode 100644 index 00000000000000..b4e6d1a990c14e --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/root.js @@ -0,0 +1,24 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:root + * @fileoverview Stringify a root. + */ + +'use strict'; + +/* Expose. */ +module.exports = root; + +/** + * Stringify a root. + * + * Adds a final newline to ensure valid POSIX files. + * + * @param {Object} node - `root` node. + * @return {string} - Document. + */ +function root(node) { + return this.block(node) + '\n'; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/strong.js b/tools/doc/node_modules/remark-stringify/lib/visitors/strong.js new file mode 100644 index 00000000000000..229ebefcb22a12 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/strong.js @@ -0,0 +1,32 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:strong + * @fileoverview Stringify a strong. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = strong; + +/** + * Stringify a `strong`. + * + * The marker used is configurable by `strong`, which + * defaults to an asterisk (`'*'`) but also accepts an + * underscore (`'_'`): + * + * __foo__ + * + * @param {Object} node - `strong` node. + * @return {string} - Markdown strong. + */ +function strong(node) { + var marker = repeat(this.options.strong, 2); + return marker + this.all(node).join('') + marker; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/table-cell.js b/tools/doc/node_modules/remark-stringify/lib/visitors/table-cell.js new file mode 100644 index 00000000000000..76e047299cb66c --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/table-cell.js @@ -0,0 +1,22 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:table-cell + * @fileoverview Stringify a table-cell. + */ + +'use strict'; + +/* Expose. */ +module.exports = tableCell; + +/** + * Stringify a table cell. + * + * @param {Object} node - `tableCell` node. + * @return {string} - Markdown table cell. + */ +function tableCell(node) { + return this.all(node).join(''); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/table.js b/tools/doc/node_modules/remark-stringify/lib/visitors/table.js new file mode 100644 index 00000000000000..90b3d2d71c2f8e --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/table.js @@ -0,0 +1,77 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:table + * @fileoverview Stringify a table. + */ + +'use strict'; + +/* Dependencies. */ +var markdownTable = require('markdown-table'); + +/* Expose. */ +module.exports = table; + +/** + * Stringify table. + * + * Creates a fenced table by default, but not in + * `looseTable: true` mode: + * + * Foo | Bar + * :-: | --- + * Baz | Qux + * + * NOTE: Be careful with `looseTable: true` mode, as a + * loose table inside an indented code block on GitHub + * renders as an actual table! + * + * Creates a spaced table by default, but not in + * `spacedTable: false`: + * + * |Foo|Bar| + * |:-:|---| + * |Baz|Qux| + * + * @param {Object} node - `table` node. + * @return {string} - Markdown table. + */ +function table(node) { + var self = this; + var loose = self.options.looseTable; + var spaced = self.options.spacedTable; + var pad = self.options.paddedTable; + var rows = node.children; + var index = rows.length; + var exit = self.enterTable(); + var result = []; + var start; + var end; + + while (index--) { + result[index] = self.all(rows[index]); + } + + exit(); + + if (loose) { + start = ''; + end = ''; + } else if (spaced) { + start = '| '; + end = ' |'; + } else { + start = '|'; + end = '|'; + } + + return markdownTable(result, { + align: node.align, + pad: pad, + start: start, + end: end, + delimiter: spaced ? ' | ' : '|' + }); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/text.js b/tools/doc/node_modules/remark-stringify/lib/visitors/text.js new file mode 100644 index 00000000000000..798de8fb29757d --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/text.js @@ -0,0 +1,32 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:text + * @fileoverview Stringify a text. + */ + +'use strict'; + +/* Expose. */ +module.exports = text; + +/** + * Stringify text. + * + * Supports named entities in `settings.encode: true` mode: + * + * AT&T + * + * Supports numbered entities in `settings.encode: numbers` + * mode: + * + * AT&T + * + * @param {Object} node - `text` node. + * @param {Object?} [parent] - Parent of `node`. + * @return {string} - Markdown text. + */ +function text(node, parent) { + return this.encode(this.escape(node.value, node, parent), node); +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/thematic-break.js b/tools/doc/node_modules/remark-stringify/lib/visitors/thematic-break.js new file mode 100644 index 00000000000000..d04af36963f5d6 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/thematic-break.js @@ -0,0 +1,40 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:thematic-break + * @fileoverview Stringify a thematic-break. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = thematic; + +/** + * Stringify a `thematic-break`. + * + * The character used is configurable through `rule`: (`'_'`) + * + * ___ + * + * The number of repititions is defined through + * `ruleRepetition`: (`6`) + * + * ****** + * + * Whether spaces delimit each character, is configured + * through `ruleSpaces`: (`true`) + * + * * * * + * + * @return {string} - Markdown thematic break. + */ +function thematic() { + var options = this.options; + var rule = repeat(options.rule, options.ruleRepetition); + return options.ruleSpaces ? rule.split('').join(' ') : rule; +} diff --git a/tools/doc/node_modules/remark-stringify/lib/visitors/yaml.js b/tools/doc/node_modules/remark-stringify/lib/visitors/yaml.js new file mode 100644 index 00000000000000..a473c729153cfe --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/lib/visitors/yaml.js @@ -0,0 +1,26 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module remark:stringify:visitors:yaml + * @fileoverview Stringify yaml. + */ + +'use strict'; + +/* Dependencies. */ +var repeat = require('repeat-string'); + +/* Expose. */ +module.exports = yaml; + +/** + * Stringify `yaml`. + * + * @param {Object} node - `yaml` node. + * @return {string} - Markdown yaml. + */ +function yaml(node) { + var marker = repeat('-', 3); + return marker + (node.value ? '\n' + node.value : '') + '\n' + marker; +} diff --git a/tools/doc/node_modules/remark-stringify/package.json b/tools/doc/node_modules/remark-stringify/package.json new file mode 100644 index 00000000000000..491a1d3b1b8219 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/package.json @@ -0,0 +1,84 @@ +{ + "_from": "remark-stringify@^3.0.0", + "_id": "remark-stringify@3.0.1", + "_inBundle": false, + "_integrity": "sha1-eSQr6+CnUggbWAlRb6DAbt7Aac8=", + "_location": "/remark-stringify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "remark-stringify@^3.0.0", + "name": "remark-stringify", + "escapedName": "remark-stringify", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/remark" + ], + "_resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-3.0.1.tgz", + "_shasum": "79242bebe0a752081b5809516fa0c06edec069cf", + "_spec": "remark-stringify@^3.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/remark/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + } + ], + "dependencies": { + "ccount": "^1.0.0", + "is-alphanumeric": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "longest-streak": "^2.0.1", + "markdown-escapes": "^1.0.0", + "markdown-table": "^1.1.0", + "mdast-util-compact": "^1.0.0", + "parse-entities": "^1.0.2", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "stringify-entities": "^1.0.1", + "unherit": "^1.0.4", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "Markdown compiler for remark", + "files": [ + "index.js", + "lib" + ], + "homepage": "http://remark.js.org", + "keywords": [ + "markdown", + "abstract", + "syntax", + "tree", + "ast", + "stringify" + ], + "license": "MIT", + "name": "remark-stringify", + "repository": { + "type": "git", + "url": "https://github.com/wooorm/remark/tree/master/packages/remark-stringify" + }, + "version": "3.0.1", + "xo": false +} diff --git a/tools/doc/node_modules/remark-stringify/readme.md b/tools/doc/node_modules/remark-stringify/readme.md new file mode 100644 index 00000000000000..c87419b6e5a837 --- /dev/null +++ b/tools/doc/node_modules/remark-stringify/readme.md @@ -0,0 +1,215 @@ +# remark-stringify [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] + +[Compiler][] for [**unified**][unified]. Stringifies an +[**MDAST**][mdast] syntax tree to markdown. Used in the [**remark** +processor][processor]. Can be [extended][extend] to change how +markdown is compiled. + +## Installation + +[npm][]: + +```sh +npm install remark-stringify +``` + +## Usage + +```js +var unified = require('unified'); +var createStream = require('unified-stream'); +var parse = require('remark-parse'); +var toc = require('remark-toc'); +var stringify = require('remark-stringify'); + +var processor = unified() + .use(parse) + .use(toc) + .use(stringify, { + bullet: '*', + fence: '~', + fences: true, + incrementListMarker: false + }); + +process.stdin + .pipe(createStream(processor)) + .pipe(process.stdout); +``` + +## Table of Contents + +* [API](#api) + * [processor.use(stringify)](#processorusestringify) + * [stringify.Compiler](#stringifycompiler) +* [Extending the Compiler](#extending-the-compiler) + * [Compiler#visitors](#compilervisitors) + * [function visitor(node\[, parent\])](#function-visitornode-parent) +* [License](#license) + +## API + +### `processor.use(stringify)` + +Configure the `processor` to stringify [**MDAST**][mdast] syntax trees +to markdown. + +###### `options` + +Options are passed later through [`processor.stringify()`][stringify], +[`processor.process()`][process], or [`processor.pipe()`][pipe]. +The following settings are supported: + +* `gfm` (`boolean`, default: `true`): + * Escape pipes (`|`, for tables) + * Escape colons (`:`, for literal URLs) + * Escape tildes (`~`, for strike-through) +* `commonmark` (`boolean`, default: `false`): + * Compile adjacent blockquotes separately + * Escape more characters using slashes, instead of as entities +* `pedantic` (`boolean`, default: `false`): + * Escape underscores in words +* `entities` (`string` or `boolean`, default: `false`): + + * `true` — Entities are generated for special HTML characters + (`&` > `&`) and non-ASCII characters (`©` > `©`). + If named entities are not (widely) supported, numbered character + references are used (`’` > `’`) + + * `'numbers'` — Numbered entities are generated (`&` > `&`) + for special HTML characters and non-ASCII characters + + * `'escape'` — Special HTML characters are encoded (`&` > + `&`, `’` > `’`), non-ASCII characters not (ö persists) + +* `setext` (`boolean`, default: `false`) + — Compile headings, when possible, in Setext-style: using `=` for + level one headings and `-` for level two headings. Other heading + levels are compiled as ATX (respecting `closeAtx`) +* `closeAtx` (`boolean`, default: `false`) + — Compile ATX headings with the same amount of closing hashes as + opening hashes +* `looseTable` (`boolean`, default: `false`) + — Create tables without fences (initial and final pipes) +* `spacedTable` (`boolean`, default: `true`) + — Create tables without spacing between pipes and content +* `paddedTable` (`boolean`, default: `true`) + — Create tables with padding in each cell so that they are the same size +* `fence` (`'~'` or ``'`'``, default: ``'`'``) + — Fence marker to use for code blocks +* `fences` (`boolean`, default: `false`) + — Stringify code blocks without language with fences +* `bullet` (`'-'`, `'*'`, or `'+'`, default: `'-'`) + — Bullet marker to use for unordered list items +* `listItemIndent` (`'tab'`, `'mixed'` or `'1'`, default: `'tab'`) + + How to indent the content from list items: + + * `'tab'`: use tab stops (4 spaces) + * `'1'`: use one space + * `'mixed'`: use `1` for tight and `tab` for loose list items + +* `incrementListMarker` (`boolean`, default: `true`) + — Whether to increment ordered list item bullets +* `rule` (`'-'`, `'*'`, or `'_'`, default: `'*'`) + — Marker to use for thematic breaks (horizontal rules) +* `ruleRepetition` (`number`, default: `3`) + — Number of markers to use for thematic breaks (horizontal rules). + Should be `3` or more +* `ruleSpaces` (`boolean`, default `true`) + — Whether to pad thematic break (horizontal rule) markers with + spaces +* `strong` (`'_'` or `'*'`, default `'*'`) + — Marker to use for importance +* `emphasis` (`'_'` or `'*'`, default `'_'`) + — Marker to use for emphasis + +### `stringify.Compiler` + +Access to the raw [compiler][], if you need it. + +## Extending the Compiler + +If this plug-in is used, it adds a [`Compiler`][compiler] constructor +to the `processor`. Other plug-ins can change and add visitors on +the compiler’s prototype to change how markdown is stringified. + +The below plug-in modifies a [visitor][] to add an extra blank line +before level two headings. + +```js +module.exports = gap; + +function gap() { + var Compiler = this.Compiler; + var visitors = Compiler.prototype.visitors; + var heading = visitors.heading; + + visitors.heading = heading; + + function heading(node) { + return (node.depth === 2 ? '\n' : '') + heading.apply(this, arguments); + } +} +``` + +### `Compiler#visitors` + +An object mapping [node][] types to [`visitor`][visitor]s. + +### `function visitor(node[, parent])` + +Stringify `node`. + +###### Parameters + +* `node` ([`Node`][node]) — Node to compile +* `parent` ([`Node`][node], optional) — Parent of `node` + +###### Returns + +`string`, the compiled given `node`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/remark.svg + +[build-status]: https://travis-ci.org/wooorm/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg + +[coverage-status]: https://codecov.io/github/wooorm/remark + +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg + +[chat]: https://gitter.im/wooorm/remark + +[license]: https://github.com/wooorm/remark/blob/master/LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[unified]: https://github.com/wooorm/unified + +[processor]: https://github.com/wooorm/remark + +[stringify]: https://github.com/wooorm/unified#processorstringifynode-filevalue-options + +[process]: https://github.com/wooorm/unified#processorprocessfilevalue-options-done + +[pipe]: https://github.com/wooorm/unified#processorpipestream-options + +[compiler]: https://github.com/wooorm/unified#processorcompiler + +[mdast]: https://github.com/wooorm/mdast + +[node]: https://github.com/wooorm/unist#node + +[extend]: #extending-the-compiler + +[visitor]: #function-visitornode-parent diff --git a/tools/doc/node_modules/remark/index.js b/tools/doc/node_modules/remark/index.js new file mode 100644 index 00000000000000..a315ad1489b381 --- /dev/null +++ b/tools/doc/node_modules/remark/index.js @@ -0,0 +1,7 @@ +'use strict'; + +var unified = require('unified'); +var parse = require('remark-parse'); +var stringify = require('remark-stringify'); + +module.exports = unified().use(parse).use(stringify).freeze(); diff --git a/tools/doc/node_modules/remark/package.json b/tools/doc/node_modules/remark/package.json new file mode 100644 index 00000000000000..169eb5b1aee00b --- /dev/null +++ b/tools/doc/node_modules/remark/package.json @@ -0,0 +1,72 @@ +{ + "_from": "remark", + "_id": "remark@7.0.1", + "_inBundle": false, + "_integrity": "sha1-pd5NrPq/D2CkmCbvJMR5gH+QS/s=", + "_location": "/remark", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "remark", + "name": "remark", + "escapedName": "remark", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/remark/-/remark-7.0.1.tgz", + "_shasum": "a5de4dacfabf0f60a49826ef24c479807f904bfb", + "_spec": "remark", + "_where": "/Users/alex/Development/node/tools/doc", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/remark/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "remark-parse": "^3.0.0", + "remark-stringify": "^3.0.0", + "unified": "^6.0.0" + }, + "deprecated": false, + "description": "Markdown processor powered by plugins", + "files": [ + "index.js" + ], + "homepage": "http://remark.js.org", + "keywords": [ + "markdown", + "abstract", + "syntax", + "tree", + "ast", + "parse", + "stringify", + "process" + ], + "license": "MIT", + "name": "remark", + "repository": { + "type": "git", + "url": "https://github.com/wooorm/remark/tree/master/packages/remark" + }, + "scripts": {}, + "version": "7.0.1", + "xo": false +} diff --git a/tools/doc/node_modules/remark/readme.md b/tools/doc/node_modules/remark/readme.md new file mode 100644 index 00000000000000..fea7c7cd80fda0 --- /dev/null +++ b/tools/doc/node_modules/remark/readme.md @@ -0,0 +1,84 @@ +# remark [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] + +The [**remark**][remark] processor is a markdown processor powered by +[plug-ins][plugins]. + +* Interface by [**unified**][unified] +* [**MDAST**][mdast] syntax tree +* Parses markdown to the tree with [**remark-parse**][parse] +* [Plug-ins][plugins] transform the tree +* Compiles the tree to markdown using [**remark-stringify**][stringify] + +Don’t need the parser? Or the compiler? [That’s OK][unified-usage]. + +## Installation + +[npm][]: + +```sh +npm install remark +``` + +## Usage + +```js +var remark = require('remark'); +var recommended = require('remark-preset-lint-recommended'); +var html = require('remark-html'); +var report = require('vfile-reporter'); + +remark() + .use(recommended) + .use(html) + .process('## Hello world!', function (err, file) { + console.error(report(err || file)); + console.log(String(file)); + }); +``` + +Yields: + +```txt +1:1 warning Missing newline character at end of file final-newline remark-lint + +⚠ 1 warning +

Hello world!

+``` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/remark.svg + +[build-status]: https://travis-ci.org/wooorm/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg + +[coverage-status]: https://codecov.io/github/wooorm/remark + +[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg + +[chat]: https://gitter.im/wooorm/remark + +[license]: https://github.com/wooorm/remark/blob/master/LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[remark]: https://github.com/wooorm/remark + +[unified]: https://github.com/wooorm/unified + +[mdast]: https://github.com/wooorm/mdast + +[parse]: https://github.com/wooorm/remark/blob/master/packages/remark-parse + +[stringify]: https://github.com/wooorm/remark/blob/master/packages/remark-stringify + +[plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md + +[unified-usage]: https://github.com/wooorm/unified#usage diff --git a/tools/doc/node_modules/repeat-string/LICENSE b/tools/doc/node_modules/repeat-string/LICENSE new file mode 100644 index 00000000000000..39245ac1c60613 --- /dev/null +++ b/tools/doc/node_modules/repeat-string/LICENSE @@ -0,0 +1,21 @@ +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/doc/node_modules/repeat-string/README.md b/tools/doc/node_modules/repeat-string/README.md new file mode 100644 index 00000000000000..aaa5e91c7a7f91 --- /dev/null +++ b/tools/doc/node_modules/repeat-string/README.md @@ -0,0 +1,136 @@ +# 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/doc/node_modules/repeat-string/index.js b/tools/doc/node_modules/repeat-string/index.js new file mode 100644 index 00000000000000..4459afd8016e31 --- /dev/null +++ b/tools/doc/node_modules/repeat-string/index.js @@ -0,0 +1,70 @@ +/*! + * 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/doc/node_modules/repeat-string/package.json b/tools/doc/node_modules/repeat-string/package.json new file mode 100644 index 00000000000000..994140f123536b --- /dev/null +++ b/tools/doc/node_modules/repeat-string/package.json @@ -0,0 +1,129 @@ +{ + "_from": "repeat-string@^1.5.4", + "_id": "repeat-string@1.6.1", + "_inBundle": false, + "_integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "_location": "/repeat-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "repeat-string@^1.5.4", + "name": "repeat-string", + "escapedName": "repeat-string", + "rawSpec": "^1.5.4", + "saveSpec": null, + "fetchSpec": "^1.5.4" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "_shasum": "8dcae470e1c88abc2d600fff4a776286da75e637", + "_spec": "repeat-string@^1.5.4", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "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" +} diff --git a/tools/doc/node_modules/replace-ext/LICENSE b/tools/doc/node_modules/replace-ext/LICENSE new file mode 100755 index 00000000000000..fd38d69351565d --- /dev/null +++ b/tools/doc/node_modules/replace-ext/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blaine Bublitz , Eric Schoffstall and other contributors + +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/doc/node_modules/replace-ext/README.md b/tools/doc/node_modules/replace-ext/README.md new file mode 100644 index 00000000000000..8775983b7834d5 --- /dev/null +++ b/tools/doc/node_modules/replace-ext/README.md @@ -0,0 +1,50 @@ +

+ + + +

+ +# replace-ext + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Replaces a file extension with another one. + +## Usage + +```js +var replaceExt = require('replace-ext'); + +var path = '/some/dir/file.js'; +var newPath = replaceExt(path, '.coffee'); + +console.log(newPath); // /some/dir/file.coffee +``` + +## API + +### `replaceExt(path, extension)` + +Replaces the extension from `path` with `extension` and returns the updated path string. + +Does not replace the extension if `path` is not a string or is empty. + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/replace-ext.svg +[npm-url]: https://www.npmjs.com/package/replace-ext +[npm-image]: http://img.shields.io/npm/v/replace-ext.svg + +[travis-url]: https://travis-ci.org/gulpjs/replace-ext +[travis-image]: http://img.shields.io/travis/gulpjs/replace-ext.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/replace-ext +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/replace-ext.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/replace-ext +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/replace-ext/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/tools/doc/node_modules/replace-ext/index.js b/tools/doc/node_modules/replace-ext/index.js new file mode 100644 index 00000000000000..7cb7789e280723 --- /dev/null +++ b/tools/doc/node_modules/replace-ext/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var path = require('path'); + +function replaceExt(npath, ext) { + if (typeof npath !== 'string') { + return npath; + } + + if (npath.length === 0) { + return npath; + } + + var nFileName = path.basename(npath, path.extname(npath)) + ext; + return path.join(path.dirname(npath), nFileName); +} + +module.exports = replaceExt; diff --git a/tools/doc/node_modules/replace-ext/package.json b/tools/doc/node_modules/replace-ext/package.json new file mode 100644 index 00000000000000..231a0e8935a2ec --- /dev/null +++ b/tools/doc/node_modules/replace-ext/package.json @@ -0,0 +1,86 @@ +{ + "_from": "replace-ext@1.0.0", + "_id": "replace-ext@1.0.0", + "_inBundle": false, + "_integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "_location": "/replace-ext", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "replace-ext@1.0.0", + "name": "replace-ext", + "escapedName": "replace-ext", + "rawSpec": "1.0.0", + "saveSpec": null, + "fetchSpec": "1.0.0" + }, + "_requiredBy": [ + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "_shasum": "de63128373fcbf7c3ccfa4de5a480c45a67958eb", + "_spec": "replace-ext@1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/vfile", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/replace-ext/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eric Schoffstall", + "email": "yo@contra.io" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Replaces a file extension with another one", + "devDependencies": { + "eslint": "^1.10.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.16.0", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.3.5", + "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" +} diff --git a/tools/doc/node_modules/state-toggle/LICENSE b/tools/doc/node_modules/state-toggle/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/state-toggle/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/state-toggle/history.md b/tools/doc/node_modules/state-toggle/history.md new file mode 100644 index 00000000000000..f20d5035693db5 --- /dev/null +++ b/tools/doc/node_modules/state-toggle/history.md @@ -0,0 +1,6 @@ + + + + +1.0.0 / 2016-07-16 +================== diff --git a/tools/doc/node_modules/state-toggle/index.js b/tools/doc/node_modules/state-toggle/index.js new file mode 100644 index 00000000000000..d5aff1857fc453 --- /dev/null +++ b/tools/doc/node_modules/state-toggle/index.js @@ -0,0 +1,45 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module state-toggle + * @fileoverview Enter/exit a state. + */ + +'use strict'; + +/* eslint-env commonjs */ + +/* Expose. */ +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. + * + * @param {string} key - Property to toggle. + * @param {boolean} state - Default state. + * @param {Object?} [ctx] - Context object. + * @return {Function} - Enter. + */ +function factory(key, state, ctx) { + /** + * Enter a state. + * + * @return {Function} - Exit state. + */ + return function () { + var context = ctx || this; + var current = context[key]; + + context[key] = !state; + + /** + * Cancel state to its value before entering. + */ + return function () { + context[key] = current; + }; + }; +} diff --git a/tools/doc/node_modules/state-toggle/package.json b/tools/doc/node_modules/state-toggle/package.json new file mode 100644 index 00000000000000..a71fb0dfc84e44 --- /dev/null +++ b/tools/doc/node_modules/state-toggle/package.json @@ -0,0 +1,108 @@ +{ + "_from": "state-toggle@^1.0.0", + "_id": "state-toggle@1.0.0", + "_inBundle": false, + "_integrity": "sha1-0g+aYWu08MO5i5GSLSW2QKorxCU=", + "_location": "/state-toggle", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "state-toggle@^1.0.0", + "name": "state-toggle", + "escapedName": "state-toggle", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.0.tgz", + "_shasum": "d20f9a616bb4f0c3b98b91922d25b640aa2bc425", + "_spec": "state-toggle@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/state-toggle/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Enter/exit a state", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^7.0.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "output": true, + "plugins": [ + "comment-config", + "github", + "lint", + "validate-links" + ], + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/state-toggle.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s stateToggle > state-toggle.js", + "build-mangle": "esmangle < state-toggle.js > state-toggle.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.0.0", + "xo": { + "space": true, + "ignores": [ + "state-toggle.js", + "state-toggle.min.js" + ] + } +} diff --git a/tools/doc/node_modules/state-toggle/readme.md b/tools/doc/node_modules/state-toggle/readme.md new file mode 100644 index 00000000000000..e2282d113b8383 --- /dev/null +++ b/tools/doc/node_modules/state-toggle/readme.md @@ -0,0 +1,83 @@ +# state-toggle [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + + + +Enter/exit a state. + +## Installation + +[npm][npm-install]: + +```bash +npm install state-toggle +``` + +## Usage + +```javascript +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] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/state-toggle.svg + +[travis]: https://travis-ci.org/wooorm/state-toggle + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/state-toggle.svg + +[codecov]: https://codecov.io/github/wooorm/state-toggle + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[enter]: #enter + +[exit]: #exit diff --git a/tools/doc/node_modules/stringify-entities/LICENSE b/tools/doc/node_modules/stringify-entities/LICENSE new file mode 100644 index 00000000000000..611b67581bb8e2 --- /dev/null +++ b/tools/doc/node_modules/stringify-entities/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/stringify-entities/dangerous.json b/tools/doc/node_modules/stringify-entities/dangerous.json new file mode 100644 index 00000000000000..9147982cd1ff8c --- /dev/null +++ b/tools/doc/node_modules/stringify-entities/dangerous.json @@ -0,0 +1,10 @@ +[ + "cent", + "copy", + "divide", + "gt", + "lt", + "not", + "para", + "times" +] diff --git a/tools/doc/node_modules/stringify-entities/index.js b/tools/doc/node_modules/stringify-entities/index.js new file mode 100644 index 00000000000000..9ffa29eae99317 --- /dev/null +++ b/tools/doc/node_modules/stringify-entities/index.js @@ -0,0 +1,132 @@ +'use strict'; + +var entities = require('character-entities-html4'); +var legacy = require('character-entities-legacy'); +var hexadecimal = require('is-hexadecimal'); +var alphanumerical = require('is-alphanumerical'); +var dangerous = require('./dangerous.json'); + +/* Expose. */ +module.exports = encode; + +encode.escape = escape; + +var own = {}.hasOwnProperty; + +/* List of enforced escapes. */ +var escapes = ['"', '\'', '<', '>', '&', '`']; + +/* Map of characters to names. */ +var characters = construct(); + +/* Default escapes. */ +var EXPRESSION_ESCAPE = toExpression(escapes); + +/* Surrogate pairs. */ +var EXPRESSION_SURROGATE_PAIR = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + +/* Non-ASCII characters. */ +// eslint-disable-next-line no-control-regex +var EXPRESSION_BMP = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; + +/* Encode special characters in `value`. */ +function encode(value, options) { + var settings = options || {}; + var subset = settings.subset; + var set = subset ? toExpression(subset) : EXPRESSION_ESCAPE; + var escapeOnly = settings.escapeOnly; + var omit = settings.omitOptionalSemicolons; + + value = value.replace(set, function (char, pos, val) { + return one(char, val.charAt(pos + 1), settings); + }); + + if (subset || escapeOnly) { + return value; + } + + return value + .replace(EXPRESSION_SURROGATE_PAIR, function (pair, pos, val) { + return toHexReference( + ((pair.charCodeAt(0) - 0xD800) * 0x400) + + pair.charCodeAt(1) - 0xDC00 + 0x10000, + val.charAt(pos + 2), + omit + ); + }) + .replace(EXPRESSION_BMP, function (char, pos, val) { + return one(char, val.charAt(pos + 1), settings); + }); +} + +/* Shortcut to escape special characters in HTML. */ +function escape(value) { + return encode(value, { + escapeOnly: true, + useNamedReferences: true + }); +} + +/* Encode `char` according to `options`. */ +function one(char, next, options) { + var shortest = options.useShortestReferences; + var omit = options.omitOptionalSemicolons; + var named; + var numeric; + + if ( + (shortest || options.useNamedReferences) && + own.call(characters, char) + ) { + named = toNamed(characters[char], next, omit, options.attribute); + } + + if (shortest || !named) { + numeric = toHexReference(char.charCodeAt(0), next, omit); + } + + if (named && (!shortest || named.length < numeric.length)) { + return named; + } + + return numeric; +} + +/* Transform `code` into an entity. */ +function toNamed(name, next, omit, attribute) { + var value = '&' + name; + + if ( + omit && + own.call(legacy, name) && + dangerous.indexOf(name) === -1 && + (!attribute || (next && next !== '=' && !alphanumerical(next))) + ) { + return value; + } + + return value + ';'; +} + +/* Transform `code` into a hexadecimal character reference. */ +function toHexReference(code, next, omit) { + var value = '&#x' + code.toString(16).toUpperCase(); + return omit && next && !hexadecimal(next) ? value : value + ';'; +} + +/* Create an expression for `characters`. */ +function toExpression(characters) { + return new RegExp('[' + characters.join('') + ']', 'g'); +} + +/* Construct the map. */ +function construct() { + var chars = {}; + var name; + + for (name in entities) { + chars[entities[name]] = name; + } + + return chars; +} diff --git a/tools/doc/node_modules/stringify-entities/package.json b/tools/doc/node_modules/stringify-entities/package.json new file mode 100644 index 00000000000000..7d10c3a8679440 --- /dev/null +++ b/tools/doc/node_modules/stringify-entities/package.json @@ -0,0 +1,113 @@ +{ + "_from": "stringify-entities@^1.0.1", + "_id": "stringify-entities@1.3.1", + "_inBundle": false, + "_integrity": "sha1-sVDsLXKsTBtfMktR+2soyc3/BYw=", + "_location": "/stringify-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "stringify-entities@^1.0.1", + "name": "stringify-entities", + "escapedName": "stringify-entities", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.1.tgz", + "_shasum": "b150ec2d72ac4c1b5f324b51fb6b28c9cdff058c", + "_spec": "stringify-entities@^1.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/stringify-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "character-entities-html4": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "deprecated": false, + "description": "Encode HTML character references and character entities", + "devDependencies": { + "browserify": "^14.0.0", + "character-entities": "^1.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "xo": "^0.18.0" + }, + "files": [ + "dangerous.json", + "index.js" + ], + "homepage": "https://github.com/wooorm/stringify-entities#readme", + "keywords": [ + "stringify", + "encode", + "escape", + "html", + "character", + "reference", + "entity", + "entities" + ], + "license": "MIT", + "name": "stringify-entities", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/stringify-entities.git" + }, + "scripts": { + "build": "npm run build-dangerous && npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s stringifyEntities > stringify-entities.js", + "build-dangerous": "node build", + "build-mangle": "esmangle stringify-entities.js > stringify-entities.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.3.1", + "xo": { + "space": true, + "esnext": false, + "rules": { + "guard-for-in": "off" + }, + "ignores": [ + "stringify-entities.js" + ] + } +} diff --git a/tools/doc/node_modules/stringify-entities/readme.md b/tools/doc/node_modules/stringify-entities/readme.md new file mode 100644 index 00000000000000..c819969568822e --- /dev/null +++ b/tools/doc/node_modules/stringify-entities/readme.md @@ -0,0 +1,118 @@ +# stringify-entities [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] + +Encode HTML character references and character entities. + +* [x] Very fast +* [x] Just the encoding part +* [x] Reliable: ``'`'`` characters are escaped to ensure no scripts + run in IE6-8. Additionally, only named entities recognised by HTML4 + are encoded, meaning the infamous `'` (which people think is a + [virus][]) won’t show up + +## Algorithm + +By default, all dangerous, non-ASCII, or non-printable ASCII characters +are encoded. A [subset][] of characters can be given to encode just +those characters. Alternatively, pass [`escapeOnly`][escapeonly] to +escape just the dangerous characters (`"`, `'`, `<`, `>`, `&`, `` ` ``). +By default, numeric entities are used. Pass [`useNamedReferences`][named] +to use named entities when possible, or [`useShortestReferences`][short] +to use them if that results in less bytes. + +## Installation + +[npm][]: + +```bash +npm install stringify-entities +``` + +## Usage + +```js +var stringify = require('stringify-entities'); + +stringify('alpha © bravo ≠ charlie 𝌆 delta'); +//=> 'alpha © bravo ≠ charlie 𝌆 delta' + +stringify('alpha © bravo ≠ charlie 𝌆 delta', {useNamedReferences: true}); +//=> 'alpha © bravo ≠ charlie 𝌆 delta' +``` + +## API + +### `stringifyEntities(value[, options])` + +Encode special characters in `value`. + +##### `options` + +###### `options.escapeOnly` + +Whether to only escape possibly dangerous characters (`boolean`, +default: `false`). Those characters are `"`, `'`, `<`, `>` `&`, and +`` ` ``. + +###### `options.subset` + +Whether to only escape the given subset of characters (`Array.`). + +###### `options.useNamedReferences` + +Whether to use named entities where possible (`boolean?`, default: +`false`). + +###### `options.useShortestReferences` + +Whether to use named entities, where possible, if that results in less +bytes (`boolean?`, default: `false`). **Note**: `useNamedReferences` +can be omitted when using `useShortestReferences`. + +###### `options.omitOptionalSemicolons` + +Whether to omit semi-colons when possible (`boolean?`, default: `false`). +**Note**: This creates parse errors: don’t use this except when building +a minifier. + +Omitting semi-colons is possible for [certain][dangerous] [legacy][] +named references, and numeric entities, in some cases. + +###### `options.attribute` + +Only needed when operating dangerously with `omitOptionalSemicolons: true`. +Create entities which don’t fail in attributes (`boolean?`, default: +`false`). + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/stringify-entities.svg + +[build-status]: https://travis-ci.org/wooorm/stringify-entities + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/stringify-entities.svg + +[coverage-status]: https://codecov.io/github/wooorm/stringify-entities + +[license]: LICENSE + +[author]: http://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[virus]: http://www.telegraph.co.uk/technology/advice/10516839/Why-do-some-apostrophes-get-replaced-with-andapos.html + +[dangerous]: dangerous.json + +[legacy]: https://github.com/wooorm/character-entities-legacy + +[subset]: #optionssubset + +[escapeonly]: #optionsescapeonly + +[named]: #optionsusenamedreferences + +[short]: #optionsuseshortestreferences diff --git a/tools/doc/node_modules/trim-trailing-lines/LICENSE b/tools/doc/node_modules/trim-trailing-lines/LICENSE new file mode 100644 index 00000000000000..611b67581bb8e2 --- /dev/null +++ b/tools/doc/node_modules/trim-trailing-lines/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/trim-trailing-lines/index.js b/tools/doc/node_modules/trim-trailing-lines/index.js new file mode 100644 index 00000000000000..41356676eedf46 --- /dev/null +++ b/tools/doc/node_modules/trim-trailing-lines/index.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = trimTrailingLines; + +var line = '\n'; + +/* Remove final newline characters from `value`. */ +function trimTrailingLines(value) { + var val = String(value); + var index = val.length; + + while (val.charAt(--index) === line) { /* empty */ } + + return val.slice(0, index + 1); +} diff --git a/tools/doc/node_modules/trim-trailing-lines/package.json b/tools/doc/node_modules/trim-trailing-lines/package.json new file mode 100644 index 00000000000000..25e6416bf8309b --- /dev/null +++ b/tools/doc/node_modules/trim-trailing-lines/package.json @@ -0,0 +1,96 @@ +{ + "_from": "trim-trailing-lines@^1.0.0", + "_id": "trim-trailing-lines@1.1.0", + "_inBundle": false, + "_integrity": "sha1-eu+7eAjfnWafbaLkOMrIxGradoQ=", + "_location": "/trim-trailing-lines", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "trim-trailing-lines@^1.0.0", + "name": "trim-trailing-lines", + "escapedName": "trim-trailing-lines", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz", + "_shasum": "7aefbb7808df9d669f6da2e438cac8c46ada7684", + "_spec": "trim-trailing-lines@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/trim-trailing-lines/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Remove final newline characters from a string", + "devDependencies": { + "browserify": "^13.0.0", + "esmangle": "^1.0.0", + "nyc": "^10.0.0", + "remark-cli": "^2.0.0", + "remark-preset-wooorm": "^1.0.0", + "tape": "^4.6.3", + "xo": "^0.17.1" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "presets": "wooorm" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trim-trailing-lines.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s trimTrailingLines > trim-trailing-lines.js", + "build-mangle": "esmangle trim-trailing-lines.js > trim-trailing-lines.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "ignores": [ + "trim-trailing-lines.js" + ] + } +} diff --git a/tools/doc/node_modules/trim-trailing-lines/readme.md b/tools/doc/node_modules/trim-trailing-lines/readme.md new file mode 100644 index 00000000000000..affedf5d8cbef4 --- /dev/null +++ b/tools/doc/node_modules/trim-trailing-lines/readme.md @@ -0,0 +1,55 @@ +# trim-trailing-lines [![Build Status][travtrim-trailing-lines]][travis] [![Coverage Status][codecov-badge]][codecov] + +Remove final newline characters from a string. + +## Installation + +[npm][]: + +```bash +npm install trim-trailing-lines +``` + +## Usage + +```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 newline characters from `value`. + +###### Parameters + +* `value` (`string`) — Value with trailing newlines, coerced to string. + +###### Returns + +`string` — Value without trailing newlines. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travtrim-trailing-lines]: https://img.shields.io/travis/wooorm/trim-trailing-lines.svg + +[travis]: https://travis-ci.org/wooorm/trim-trailing-lines + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/trim-trailing-lines.svg + +[codecov]: https://codecov.io/github/wooorm/trim-trailing-lines + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/trim/.npmignore b/tools/doc/node_modules/trim/.npmignore new file mode 100644 index 00000000000000..f1250e584c94b8 --- /dev/null +++ b/tools/doc/node_modules/trim/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/tools/doc/node_modules/trim/History.md b/tools/doc/node_modules/trim/History.md new file mode 100644 index 00000000000000..c8aa68fa88152d --- /dev/null +++ b/tools/doc/node_modules/trim/History.md @@ -0,0 +1,5 @@ + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/tools/doc/node_modules/trim/Makefile b/tools/doc/node_modules/trim/Makefile new file mode 100644 index 00000000000000..4e9c8d36ebcd2f --- /dev/null +++ b/tools/doc/node_modules/trim/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: test \ No newline at end of file diff --git a/tools/doc/node_modules/trim/Readme.md b/tools/doc/node_modules/trim/Readme.md new file mode 100644 index 00000000000000..3460f523fbe8ac --- /dev/null +++ b/tools/doc/node_modules/trim/Readme.md @@ -0,0 +1,69 @@ + +# 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/doc/node_modules/trim/component.json b/tools/doc/node_modules/trim/component.json new file mode 100644 index 00000000000000..560b25891e5fb6 --- /dev/null +++ b/tools/doc/node_modules/trim/component.json @@ -0,0 +1,7 @@ +{ + "name": "trim", + "version": "0.0.1", + "description": "Trim string whitespace", + "keywords": ["string", "trim"], + "scripts": ["index.js"] +} \ No newline at end of file diff --git a/tools/doc/node_modules/trim/index.js b/tools/doc/node_modules/trim/index.js new file mode 100644 index 00000000000000..640c24cf302e60 --- /dev/null +++ b/tools/doc/node_modules/trim/index.js @@ -0,0 +1,14 @@ + +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/doc/node_modules/trim/package.json b/tools/doc/node_modules/trim/package.json new file mode 100644 index 00000000000000..a4dde3b6f259e1 --- /dev/null +++ b/tools/doc/node_modules/trim/package.json @@ -0,0 +1,49 @@ +{ + "_from": "trim@0.0.1", + "_id": "trim@0.0.1", + "_inBundle": false, + "_integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", + "_location": "/trim", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "trim@0.0.1", + "name": "trim", + "escapedName": "trim", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "_shasum": "5858547f6b290757ee95cccc666fb50084c460dd", + "_spec": "trim@0.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "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" +} diff --git a/tools/doc/node_modules/trough/LICENSE b/tools/doc/node_modules/trough/LICENSE new file mode 100644 index 00000000000000..3f0166f62b10c0 --- /dev/null +++ b/tools/doc/node_modules/trough/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/trough/index.js b/tools/doc/node_modules/trough/index.js new file mode 100644 index 00000000000000..a041e8c257509e --- /dev/null +++ b/tools/doc/node_modules/trough/index.js @@ -0,0 +1,133 @@ +'use strict'; + +/* Expose. */ +module.exports = trough; + +/* Methods. */ +var slice = [].slice; + +/* Create new middleware. */ +function trough() { + var fns = []; + var middleware = {}; + + middleware.run = run; + middleware.use = use; + + return middleware; + + /* Run `fns`. Last argument must be + * a completion handler. */ + function run() { + var index = -1; + var input = slice.call(arguments, 0, -1); + var done = arguments[arguments.length - 1]; + + if (typeof done !== 'function') { + throw new Error('Expected function as last argument, not ' + done); + } + + next.apply(null, [null].concat(input)); + + /* Run the next `fn`, if any. */ + function next(err) { + var fn = fns[++index]; + var params = slice.call(arguments, 0); + var values = params.slice(1); + var length = input.length; + var pos = -1; + + if (err) { + done(err); + return; + } + + /* Copy non-nully input into values. */ + while (++pos < length) { + if (values[pos] === null || values[pos] === undefined) { + values[pos] = input[pos]; + } + } + + input = values; + + /* Next or done. */ + if (fn) { + wrap(fn, next).apply(null, input); + } else { + done.apply(null, [null].concat(input)); + } + } + } + + /* Add `fn` to the list. */ + function use(fn) { + if (typeof fn !== 'function') { + throw new Error('Expected `fn` to be a function, not ' + fn); + } + + fns.push(fn); + + return middleware; + } +} + +/* Wrap `fn`. Can be sync or async; return a promise, + * receive a completion handler, return new values and + * errors. */ +function wrap(fn, next) { + var invoked; + + return wrapped; + + function wrapped() { + var params = slice.call(arguments, 0); + var callback = fn.length > params.length; + var result; + + if (callback) { + params.push(done); + } + + try { + result = fn.apply(null, params); + } catch (err) { + /* Well, this is quite the pickle. `fn` received + * a callback and invoked it (thus continuing the + * pipeline), but later also threw an error. + * We’re not about to restart the pipeline again, + * so the only thing left to do is to throw the + * thing instea. */ + if (callback && invoked) { + throw err; + } + + return done(err); + } + + if (!callback) { + if (result && typeof result.then === 'function') { + result.then(then, done); + } else if (result instanceof Error) { + done(result); + } else { + then(result); + } + } + } + + /* Invoke `next`, only once. */ + function done() { + if (!invoked) { + invoked = true; + + next.apply(null, arguments); + } + } + + /* Invoke `done` with one value. + * Tracks if an error is passed, too. */ + function then(value) { + done(null, value); + } +} diff --git a/tools/doc/node_modules/trough/package.json b/tools/doc/node_modules/trough/package.json new file mode 100644 index 00000000000000..33b0e80731526f --- /dev/null +++ b/tools/doc/node_modules/trough/package.json @@ -0,0 +1,100 @@ +{ + "_from": "trough@^1.0.0", + "_id": "trough@1.0.1", + "_inBundle": false, + "_integrity": "sha1-qf2LA5Swro//guBjOgo2zK1bX4Y=", + "_location": "/trough", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "trough@^1.0.0", + "name": "trough", + "escapedName": "trough", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/trough/-/trough-1.0.1.tgz", + "_shasum": "a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86", + "_spec": "trough@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/trough/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Middleware: a channel used to convey a liquid", + "devDependencies": { + "browserify": "^14.1.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/trough#readme", + "keywords": [ + "middleware", + "ware" + ], + "license": "MIT", + "name": "trough", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trough.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s trough > trough.js", + "build-mangle": "esmangle trough.js > trough.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.0.1", + "xo": { + "space": true, + "esnext": false, + "rules": { + "guard-for-in": "off", + "unicorn/prefer-type-error": "off" + }, + "ignores": [ + "trough.js" + ] + } +} diff --git a/tools/doc/node_modules/trough/readme.md b/tools/doc/node_modules/trough/readme.md new file mode 100644 index 00000000000000..3dc62650e97084 --- /dev/null +++ b/tools/doc/node_modules/trough/readme.md @@ -0,0 +1,305 @@ +# trough [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +> **trough** /trôf/ — a channel used to convey a liquid. + +`trough` is like [`ware`][ware] with less sugar, and middleware +functions can change the input of the next. + +## Installation + +[npm][]: + +```bash +npm install trough +``` + +## Usage + +```js +var fs = require('fs'); +var path = require('path'); +var trough = require('trough'); + +var pipeline = trough() + .use(function (fileName) { + console.log('Checking... ' + fileName); + }) + .use(function (fileName) { + return path.join(process.cwd(), fileName); + }) + .use(function (filePath, next) { + fs.stat(filePath, function (err, stats) { + next(err, {filePath: filePath, stats: stats}); + }); + }) + .use(function (ctx, next) { + if (ctx.stats.isFile()) { + fs.readFile(ctx.filePath, next); + } else { + next(new Error('Expected file')); + } + }); + +pipeline.run('readme.md', console.log); +pipeline.run('node_modules', console.log); +``` + +Yields: + +```txt +Checking... readme.md +Checking... node_modules +Error: Expected file + at ~/example.js:21:12 + at wrapped (~/node_modules/trough/index.js:93:19) + at next (~/node_modules/trough/index.js:56:24) + at done (~/node_modules/trough/index.js:124:12) + at ~/node_modules/example.js:14:7 + at FSReqWrap.oncomplete (fs.js:153:5) +null +``` + +## API + +### `trough()` + +Create a new [`Trough`][trough]. + +### `Trough` + +A pipeline. + +### `Trough#run([input..., ]done)` + +Run the pipeline (all [`use()`][use]d middleware). Invokes [`done`][done] +on completion with either an error or the output of the last middleware + +> Note! as the length of input defines whether [async][] function +> get a `next` function, it’s recommended to keep `input` at one +> value normally. + +#### `function done(err?, [output...])` + +The final handler passed to [`run()`][run], invoked with an error +if a [middleware function][fn] rejected, passed, or threw one, or +the output of the last middleware function. + +### `Trough#use(fn)` + +Add `fn`, a [middleware function][fn], to the pipeline. + +#### `function fn([input..., ][next])` + +A middleware function invoked with the output of its predecessor. + +##### Synchronous + +If `fn` returns or throws an error, the pipeline fails and `done` is +invoked with that error. + +If `fn` returns a value (neither `null` nor `undefined`), the first +`input` of the next function is set to that value (all other `input` +is passed through). + +###### Example + +The following example shows how returning an error stops the pipeline: + +```js +var trough = require('trough'); + +trough() + .use(function (val) { + return new Error('Got: ' + val); + }) + .run('some value', console.log); +``` + +Yields: + +```txt +Error: Got: some value + at ~/example.js:5:12 + ... +``` + +The following example shows how throwing an error stops the pipeline: + +```js +var trough = require('trough'); + +trough() + .use(function (val) { + throw new Error('Got: ' + val); + }) + .run('more value', console.log); +``` + +Yields: + +```txt +Error: Got: more value + at ~/example.js:5:11 + ... +``` + +The following example shows how the first output can be modified: + +```js +var trough = require('trough'); + +trough() + .use(function (val) { + return 'even ' + val; + }) + .run('more value', 'untouched', console.log); +``` + +Yields: + +```txt +null 'even more value' 'untouched' +``` + +##### Promise + +If `fn` returns a promise, and that promise rejects, the pipeline fails +and `done` is invoked with the rejected value. + +If `fn` returns a promise, and that promise resolves with a value +(neither `null` nor `undefined`), the first `input` of the next function +is set to that value (all other `input` is passed through). + +###### Example + +The following example shows how rejecting a promise stops the pipeline: + +```js +var trough = require('trough'); + +trough() + .use(function (val) { + return new Promise(function (resolve, reject) { + reject('Got: ' + val); + }); + }) + .run('val', console.log); +``` + +Yields: + +```txt +Got: val +``` + +The following example shows how the input isn’t touched by resolving +to `null`. + +```js +var trough = require('trough'); + +trough() + .use(function () { + return new Promise(function (resolve) { + setTimeout(function () { + resolve(null); + }, 100); + }); + }) + .run('Input', console.log); +``` + +Yields: + +```txt +null 'Input' +``` + +##### Asynchronous + +If `fn` accepts one more argument than the given `input`, a `next` +function is given (after the input). `next` must be called, but doesn’t +have to be called async. + +If `next` is given a value (neither `null` nor `undefined`) as its first +argument, the pipeline fails and `done` is invoked with that value. + +If `next` is given no value (either `null` or `undefined`) as the first +argument, all following non-nully values change the input of the following +function, and all nully values default to the `input`. + +###### Example + +The following example shows how passing a first argument stops the +pipeline: + +```js +var trough = require('trough'); + +trough() + .use(function (val, next) { + next(new Error('Got: ' + val)); + }) + .run('val', console.log); +``` + +Yields: + +```txt +Error: Got: val + at ~/example.js:5:10 +``` + +The following example shows how more values than the input are passed. + +```js +var trough = require('trough'); + +trough() + .use(function (val, next) { + setTimeout(function () { + next(null, null, 'values'); + }, 100); + }) + .run('some', console.log); +``` + +Yields: + +```txt +null 'some' 'values' +``` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/trough.svg + +[travis]: https://travis-ci.org/wooorm/trough + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/trough.svg + +[codecov]: https://codecov.io/github/wooorm/trough + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[ware]: https://github.com/segmentio/ware + +[trough]: #trough-1 + +[use]: #troughusefn + +[run]: #troughruninput-done + +[fn]: #function-fninput-next + +[done]: #function-doneerr-output + +[async]: #asynchronous diff --git a/tools/doc/node_modules/unherit/LICENSE b/tools/doc/node_modules/unherit/LICENSE new file mode 100644 index 00000000000000..f3722d94b38121 --- /dev/null +++ b/tools/doc/node_modules/unherit/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/unherit/index.js b/tools/doc/node_modules/unherit/index.js new file mode 100644 index 00000000000000..5a10751425cbbe --- /dev/null +++ b/tools/doc/node_modules/unherit/index.js @@ -0,0 +1,67 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module unherit + * @fileoverview Create a custom constructor which can be modified + * without affecting the original class. + */ + +'use strict'; + +/* Dependencies. */ +var xtend = require('xtend'); +var inherits = require('inherits'); + +/* Expose. */ +module.exports = unherit; + +/** + * Create a custom constructor which can be modified + * without affecting the original class. + * + * @param {Function} Super - Super-class. + * @return {Function} - Constructor acting like `Super`, + * 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/doc/node_modules/unherit/package.json b/tools/doc/node_modules/unherit/package.json new file mode 100644 index 00000000000000..ef8bb20b01b24b --- /dev/null +++ b/tools/doc/node_modules/unherit/package.json @@ -0,0 +1,110 @@ +{ + "_from": "unherit@^1.0.4", + "_id": "unherit@1.1.0", + "_inBundle": false, + "_integrity": "sha1-a5qu379z3xdWrZ4xbdmBiFhAzX0=", + "_location": "/unherit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unherit@^1.0.4", + "name": "unherit", + "escapedName": "unherit", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.0.tgz", + "_shasum": "6b9aaedfbf73df1756ad9e316dd981885840cd7d", + "_spec": "unherit@^1.0.4", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/unherit/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "inherits": "^2.0.1", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "Clone a constructor without affecting the super-class", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^8.1.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/unherit#readme", + "keywords": [ + "clone", + "super", + "class", + "constructor" + ], + "license": "MIT", + "name": "unherit", + "remarkConfig": { + "output": true, + "plugins": { + "comment-config": null, + "github": null, + "lint": { + "heading-increment": false + }, + "validate-links": null + }, + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/unherit.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s unherit > unherit.js", + "build-mangle": "esmangle unherit.js > unherit.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "1.1.0", + "xo": { + "space": true, + "rules": { + "guard-for-in": "off" + }, + "ignores": [ + "unherit.js" + ] + } +} diff --git a/tools/doc/node_modules/unherit/readme.md b/tools/doc/node_modules/unherit/readme.md new file mode 100644 index 00000000000000..d7070923d3c4ab --- /dev/null +++ b/tools/doc/node_modules/unherit/readme.md @@ -0,0 +1,66 @@ +# unherit [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Create a custom constructor which can be modified without affecting the +original class. + +## Installation + +[npm][npm-install]: + +```bash +npm install unherit +``` + +## Usage + +```js +var EventEmitter = require('events').EventEmitter; + +/* 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. */ + +assert(new Emitter().defaultMaxListeners === 0); // true +assert(new EventEmitter().defaultMaxListeners === undefined); // true +assert(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] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/unherit.svg + +[travis]: https://travis-ci.org/wooorm/unherit + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/unherit.svg + +[codecov]: https://codecov.io/github/wooorm/unherit + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com diff --git a/tools/doc/node_modules/unified/LICENSE b/tools/doc/node_modules/unified/LICENSE new file mode 100644 index 00000000000000..f3722d94b38121 --- /dev/null +++ b/tools/doc/node_modules/unified/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/unified/index.js b/tools/doc/node_modules/unified/index.js new file mode 100644 index 00000000000000..2bc872ee8dcff4 --- /dev/null +++ b/tools/doc/node_modules/unified/index.js @@ -0,0 +1,460 @@ +'use strict'; + +/* Dependencies. */ +var extend = require('extend'); +var bail = require('bail'); +var vfile = require('vfile'); +var trough = require('trough'); +var string = require('x-is-string'); +var func = require('x-is-function'); +var plain = require('is-plain-obj'); + +/* Expose a frozen processor. */ +module.exports = unified().freeze(); + +var slice = [].slice; +var own = {}.hasOwnProperty; + +/* Process pipeline. */ +var pipeline = trough().use(pipelineParse).use(pipelineRun).use(pipelineStringify); + +function pipelineParse(p, ctx) { + ctx.tree = p.parse(ctx.file); +} + +function pipelineRun(p, ctx, next) { + p.run(ctx.tree, ctx.file, done); + + function done(err, tree, file) { + if (err) { + next(err); + } else { + ctx.tree = tree; + ctx.file = file; + next(); + } + } +} + +function pipelineStringify(p, ctx) { + ctx.file.contents = p.stringify(ctx.tree, ctx.file); +} + +/* Function to create the first processor. */ +function unified() { + var attachers = []; + var transformers = trough(); + var namespace = {}; + var frozen = false; + var freezeIndex = -1; + + /* Data management. */ + processor.data = data; + + /* Lock. */ + processor.freeze = freeze; + + /* Plug-ins. */ + processor.attachers = attachers; + processor.use = use; + + /* API. */ + processor.parse = parse; + processor.stringify = stringify; + processor.run = run; + processor.runSync = runSync; + processor.process = process; + processor.processSync = processSync; + + /* Expose. */ + return processor; + + /* Create a new processor based on the processor + * in the current scope. */ + function processor() { + var destination = unified(); + var length = attachers.length; + var index = -1; + + while (++index < length) { + destination.use.apply(null, attachers[index]); + } + + destination.data(extend(true, {}, namespace)); + + return destination; + } + + /* Freeze: used to signal a processor that has finished + * configuration. + * + * For example, take unified itself. It’s frozen. + * Plug-ins should not be added to it. Rather, it should + * be extended, by invoking it, before modifying it. + * + * In essence, always invoke this when exporting a + * processor. */ + function freeze() { + var values; + var plugin; + var options; + var transformer; + + if (frozen) { + return processor; + } + + while (++freezeIndex < attachers.length) { + values = attachers[freezeIndex]; + plugin = values[0]; + options = values[1]; + transformer = null; + + if (options === false) { + continue; + } + + if (options === true) { + values[1] = undefined; + } + + transformer = plugin.apply(processor, values.slice(1)); + + if (func(transformer)) { + transformers.use(transformer); + } + } + + frozen = true; + freezeIndex = Infinity; + + return processor; + } + + /* Data management. + * Getter / setter for processor-specific informtion. */ + function data(key, value) { + if (string(key)) { + /* Set `key`. */ + if (arguments.length === 2) { + assertUnfrozen('data', frozen); + + namespace[key] = value; + + return processor; + } + + /* Get `key`. */ + return (own.call(namespace, key) && namespace[key]) || null; + } + + /* Set space. */ + if (key) { + assertUnfrozen('data', frozen); + namespace = key; + return processor; + } + + /* Get space. */ + return namespace; + } + + /* Plug-in management. + * + * Pass it: + * * an attacher and options, + * * a preset, + * * a list of presets, attachers, and arguments (list + * of attachers and options). */ + function use(value) { + var settings; + + assertUnfrozen('use', frozen); + + if (value === null || value === undefined) { + /* Empty */ + } else if (func(value)) { + addPlugin.apply(null, arguments); + } else if (typeof value === 'object') { + if ('length' in value) { + addList(value); + } else { + addPreset(value); + } + } else { + throw new Error('Expected usable value, not `' + value + '`'); + } + + if (settings) { + namespace.settings = extend(namespace.settings || {}, settings); + } + + return processor; + + function addPreset(result) { + addList(result.plugins); + + if (result.settings) { + settings = extend(settings || {}, result.settings); + } + } + + function add(value) { + if (func(value)) { + addPlugin(value); + } else if (typeof value === 'object') { + if ('length' in value) { + addPlugin.apply(null, value); + } else { + addPreset(value); + } + } else { + throw new Error('Expected usable value, not `' + value + '`'); + } + } + + function addList(plugins) { + var length; + var index; + + if (plugins === null || plugins === undefined) { + /* Empty */ + } else if (typeof plugins === 'object' && 'length' in plugins) { + length = plugins.length; + index = -1; + + while (++index < length) { + add(plugins[index]); + } + } else { + throw new Error('Expected a list of plugins, not `' + plugins + '`'); + } + } + + function addPlugin(plugin, value) { + var entry = find(plugin); + + if (entry) { + if (plain(entry[1]) && plain(value)) { + value = extend(entry[1], value); + } + + entry[1] = value; + } else { + attachers.push(slice.call(arguments)); + } + } + } + + function find(plugin) { + var length = attachers.length; + var index = -1; + var entry; + + while (++index < length) { + entry = attachers[index]; + + if (entry[0] === plugin) { + return entry; + } + } + } + + /* Parse a file (in string or VFile representation) + * into a Unist node using the `Parser` on the + * processor. */ + function parse(doc) { + var file = vfile(doc); + var Parser; + + freeze(); + Parser = processor.Parser; + assertParser('parse', Parser); + + if (newable(Parser)) { + return new Parser(String(file), file).parse(); + } + + return Parser(String(file), file); // eslint-disable-line new-cap + } + + /* Run transforms on a Unist node representation of a file + * (in string or VFile representation), async. */ + function run(node, file, cb) { + assertNode(node); + freeze(); + + if (!cb && func(file)) { + cb = file; + file = null; + } + + if (!cb) { + return new Promise(executor); + } + + executor(null, cb); + + function executor(resolve, reject) { + transformers.run(node, vfile(file), done); + + function done(err, tree, file) { + tree = tree || node; + if (err) { + reject(err); + } else if (resolve) { + resolve(tree); + } else { + cb(null, tree, file); + } + } + } + } + + /* Run transforms on a Unist node representation of a file + * (in string or VFile representation), sync. */ + function runSync(node, file) { + var complete = false; + var result; + + run(node, file, done); + + assertDone('runSync', 'run', complete); + + return result; + + function done(err, tree) { + complete = true; + bail(err); + result = tree; + } + } + + /* Stringify a Unist node representation of a file + * (in string or VFile representation) into a string + * using the `Compiler` on the processor. */ + function stringify(node, doc) { + var file = vfile(doc); + var Compiler; + + freeze(); + Compiler = processor.Compiler; + assertCompiler('stringify', Compiler); + assertNode(node); + + if (newable(Compiler)) { + return new Compiler(node, file).compile(); + } + + return Compiler(node, file); // eslint-disable-line new-cap + } + + /* Parse a file (in string or VFile representation) + * into a Unist node using the `Parser` on the processor, + * then run transforms on that node, and compile the + * resulting node using the `Compiler` on the processor, + * and store that result on the VFile. */ + function process(doc, cb) { + freeze(); + assertParser('process', processor.Parser); + assertCompiler('process', processor.Compiler); + + if (!cb) { + return new Promise(executor); + } + + executor(null, cb); + + function executor(resolve, reject) { + var file = vfile(doc); + + pipeline.run(processor, {file: file}, done); + + function done(err) { + if (err) { + reject(err); + } else if (resolve) { + resolve(file); + } else { + cb(null, file); + } + } + } + } + + /* Process the given document (in string or VFile + * representation), sync. */ + function processSync(doc) { + var complete = false; + var file; + + freeze(); + assertParser('processSync', processor.Parser); + assertCompiler('processSync', processor.Compiler); + file = vfile(doc); + + process(file, done); + + assertDone('processSync', 'process', complete); + + return file; + + function done(err) { + complete = true; + bail(err); + } + } +} + +/* Check if `func` is a constructor. */ +function newable(value) { + return func(value) && keys(value.prototype); +} + +/* Check if `value` is an object with keys. */ +function keys(value) { + var key; + for (key in value) { + return true; + } + return false; +} + +/* Assert a parser is available. */ +function assertParser(name, Parser) { + if (!func(Parser)) { + throw new Error('Cannot `' + name + '` without `Parser`'); + } +} + +/* Assert a compiler is available. */ +function assertCompiler(name, Compiler) { + if (!func(Compiler)) { + throw new Error('Cannot `' + name + '` without `Compiler`'); + } +} + +/* Assert the processor is not frozen. */ +function assertUnfrozen(name, frozen) { + if (frozen) { + throw new Error( + 'Cannot invoke `' + name + '` on a frozen processor.\n' + + 'Create a new processor first, by invoking it: ' + + 'use `processor()` instead of `processor`.' + ); + } +} + +/* Assert `node` is a Unist node. */ +function assertNode(node) { + if (!node || !string(node.type)) { + throw new Error('Expected node, got `' + node + '`'); + } +} + +/* Assert that `complete` is `true`. */ +function assertDone(name, asyncName, complete) { + if (!complete) { + throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead'); + } +} diff --git a/tools/doc/node_modules/unified/package.json b/tools/doc/node_modules/unified/package.json new file mode 100644 index 00000000000000..57dd8fdb57f087 --- /dev/null +++ b/tools/doc/node_modules/unified/package.json @@ -0,0 +1,117 @@ +{ + "_from": "unified@^6.0.0", + "_id": "unified@6.1.5", + "_inBundle": false, + "_integrity": "sha1-cWk3hyYhpjE15iztLzrGoGPG+4c=", + "_location": "/unified", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unified@^6.0.0", + "name": "unified", + "escapedName": "unified", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/remark" + ], + "_resolved": "https://registry.npmjs.org/unified/-/unified-6.1.5.tgz", + "_shasum": "716937872621a63135e62ced2f3ac6a063c6fb87", + "_spec": "unified@^6.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/unifiedjs/unified/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^1.1.0", + "trough": "^1.0.0", + "vfile": "^2.0.0", + "x-is-function": "^1.0.4", + "x-is-string": "^0.1.0" + }, + "deprecated": false, + "description": "Pluggable text processing interface", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "xo": "^0.18.1" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/unifiedjs/unified#readme", + "keywords": [ + "process", + "parse", + "transform", + "compile", + "stringify", + "rehype", + "retext", + "remark" + ], + "license": "MIT", + "name": "unified", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/unifiedjs/unified.git" + }, + "scripts": { + "build": "npm run build-md && 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", + "build-md": "remark . -qfo", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test" + }, + "version": "6.1.5", + "xo": { + "space": true, + "esnext": false, + "rules": { + "unicorn/prefer-type-error": "off", + "import/no-unassigned-import": "off", + "guard-for-in": "off", + "max-lines": "off" + }, + "ignores": [ + "unified.js" + ] + } +} diff --git a/tools/doc/node_modules/unified/readme.md b/tools/doc/node_modules/unified/readme.md new file mode 100644 index 00000000000000..431349459a9d0c --- /dev/null +++ b/tools/doc/node_modules/unified/readme.md @@ -0,0 +1,919 @@ +# ![unified][logo] + +[![Build Status][travis-badge]][travis] +[![Coverage Status][codecov-badge]][codecov] + +**unified** is an interface for processing text using syntax trees. +It’s what powers [**remark**][remark], [**retext**][retext], and +[**rehype**][rehype], but it also allows for processing between +multiple syntaxes. + +[`unifiedjs.github.io`][site], the website for **unified** provides a less +technical, more practical, introduction to unified. Make sure to visit it +and try its introductionary [Guides][]. + +## Installation + +[npm][]: + +```bash +npm install unified +``` + +## Usage + +```js +var unified = require('unified'); +var markdown = require('remark-parse'); +var remark2rehype = require('remark-rehype'); +var doc = require('rehype-document'); +var format = require('rehype-format'); +var html = require('rehype-stringify'); +var reporter = require('vfile-reporter'); + +unified() + .use(markdown) + .use(remark2rehype) + .use(doc) + .use(format) + .use(html) + .process('# Hello world!', function (err, file) { + console.error(reporter(err || file)); + console.log(String(file)); + }); +``` + +Yields: + +```html +no issues found + + + + + + + +

Hello world!

+ + +``` + +## Table of Contents + +* [Description](#description) +* [API](#api) + * [processor()](#processor) + * [processor.use(plugin\[, options\])](#processoruseplugin-options) + * [processor.parse(file|value)](#processorparsefilevalue) + * [processor.stringify(node\[, file\])](#processorstringifynode-file) + * [processor.run(node\[, file\]\[, done\])](#processorrunnode-file-done) + * [processor.runSync(node\[, file\])](#processorrunsyncnode-file) + * [processor.process(file|value\[, done\])](#processorprocessfilevalue-done) + * [processor.processSync(file|value)](#processorprocesssyncfilevalue) + * [processor.data(key\[, value\])](#processordatakey-value) + * [processor.freeze()](#processorfreeze) +* [Plugin](#plugin) + * [function attacher(\[options\])](#function-attacheroptions) + * [function transformer(node, file\[, next\])](#function-transformernode-file-next) +* [Preset](#preset) +* [License](#license) + +## Description + +**unified** is an interface for processing text using syntax trees. +Syntax trees are a representation understandable to programs. +Those programs, called [**plug-in**][plugin]s, take these trees and +modify them, amongst other things. To get to the syntax tree from +input text, there’s a [**parser**][parser], and, to get from that +back to text, there’s a [**compiler**][compiler]. This is the +[**process**][process] of a **processor**. + +```ascii + ┌──────────────┐ + ┌─ │ Transformers │ ─┐ + ▲ └──────────────┘ ▼ + └────────┐ ┌────────┘ + │ │ + ┌────────┐ │ │ ┌──────────┐ + Input ──▶ │ Parser │ ──▶ Tree ──▶ │ Compiler │ ──▶ Output + └────────┘ └──────────┘ +``` + +###### Processors + +Every processor implements another processor. To create a new +processor, invoke another processor. This creates a processor that is +configured to function the same as its ancestor. But, when +the descendant processor is configured in the future, that +configuration does not change the ancestral processor. + +Often, when processors are exposed from a library (for example, +unified itself), they should not be configured directly, as that +would change their behaviour for all users. Those processors are +[**frozen**][freeze], and new processors should be made from them before +they are used, by invoking them. + +###### Node + +The syntax trees used in **unified** are [**Unist**][unist] nodes, +which are plain JavaScript objects with a `type` property. The +semantics of those `type`s are defined by other projects. + +There are several [utilities][unist-utilities] for working with these +nodes. + +###### List of Processors + +The following projects process different syntax trees. They parse +text to their respective syntax tree, and they compile their syntax +trees back to text. These processors can be used as-is, or their +parsers and compilers can be mixed and matched with other plug-ins +to process between different syntaxes. + +* [**rehype**][rehype] ([**HAST**][hast]) — HTML +* [**remark**][remark] ([**MDAST**][mdast]) — Markdown +* [**retext**][retext] ([**NLCST**][nlcst]) — Natural language + +###### File + +When processing documents, metadata is often gathered about that +document. [**VFile**][vfile] is a virtual file format which stores +data, and handles metadata and messages for **unified** and its +plug-ins. + +There are several [utilities][vfile-utilities] for working with these +files. + +###### Configuration + +To configure a processor, invoke its [`use`][use] method, supply it a +[**plug-in**][plugin], and optionally settings. + +###### Integrations + +**unified** can integrate with the file-system through +[**unified-engine**][engine]. On top of that, CLI apps can be created +with [**unified-args**][args], Gulp plug-ins with +[**unified-engine-gulp**][gulp], and Atom Linters with +[**unified-engine-atom**][atom]. + +###### Programming interface + +The API gives access to processing metadata (such as lint messages), and +supports multiple passed through files: + +```js +var unified = require('unified'); +var markdown = require('remark-parse'); +var styleGuide = require('remark-preset-lint-markdown-style-guide'); +var remark2retext = require('remark-retext'); +var english = require('retext-english'); +var equality = require('retext-equality'); +var remark2rehype = require('remark-rehype'); +var html = require('rehype-stringify'); +var reporter = require('vfile-reporter'); + +unified() + .use(markdown) + .use(styleGuide) + .use(remark2retext, unified().use(english).use(equality)) + .use(remark2rehype) + .use(html) + .process('*Emphasis* and _importance_, you guys!', function (err, file) { + console.error(reporter(err || file)); + console.log(String(file)); + }); +``` + +Which yields: + +```txt + 1:16-1:28 warning Emphasis should use `*` as a marker emphasis-marker remark-lint + 1:34-1:38 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality + +⚠ 2 warnings +

Emphasis and importance, you guys!

+``` + +###### Processing between syntaxes + +The processors can be combined in two modes. + +**Bridge** mode transforms the syntax tree from one flavour (the origin) +to another (the destination). Then, transformations are applied on that +tree. Finally, the origin processor continues transforming the original +syntax tree. + +**Mutate** mode also transforms the syntax tree from one flavour to +another. But then the origin processor continues transforming the +destination syntax tree. + +In the previous example (“Programming interface”), `remark-retext` is +used in bridge mode: the origin syntax tree is kept after retext is +finished; whereas `remark-rehype` is used in mutate mode: it sets a +new syntax tree and discards the original. + +* [**remark-retext**][remark-retext] +* [**remark-rehype**][remark-rehype] +* [**rehype-retext**][rehype-retext] +* [**rehype-remark**][rehype-remark] + +## API + +### `processor()` + +Object describing how to process text. + +###### Returns + +`Function` — A new [**unfrozen**][freeze] processor which is +configured to function the same as its ancestor. But, when the +descendant processor is configured in the future, that configuration +does not change the ancestral processor. + +###### Example + +The following example shows how a new processor can be created (from +the remark processor) and linked to **stdin**(4) and **stdout**(4). + +```js +var remark = require('remark'); +var concat = require('concat-stream'); + +process.stdin.pipe(concat(function (buf) { + process.stdout.write(remark().processSync(buf).toString()); +})); +``` + +### `processor.use(plugin[, options])` + +Configure the processor to use a [**plug-in**][plugin], and configure +that plug-in with optional options. + +###### Signatures + +* `processor.use(plugin[, options])` +* `processor.use(preset)` +* `processor.use(list)` + +###### Parameters + +* `plugin` ([`Plugin`][plugin]) +* `options` (`*`, optional) — Configuration for `plugin` +* `preset` (`Object`) — Object with an optional `plugins` (set to `list`), + and/or an optional `settings` object +* `list` (`Array`) — plugins, presets, and arguments (a plugin and options + in an array), in an array + +###### Returns + +`processor` — The processor on which `use` is invoked. + +###### Note + +`use` cannot be called on [frozen][freeze] processors. Invoke the processor +first to create a new unfrozen processor. + +###### Example + +There are many ways to pass plugins to `.use()`. The below example +gives an overview. + +```js +var unified = require('unified'); + +unified() + // Plugin with options: + .use(plugin, {}) + // Plugins: + .use([plugin, pluginB]) + // Two plugins, the second with options: + .use([plugin, [pluginB, {}]]) + // Preset with plugins and settings: + .use({plugins: [plugin, [pluginB, {}]], settings: {position: false}}) + // Settings only: + .use({settings: {position: false}}); + +function plugin() {} +function pluginB() {} +``` + +### `processor.parse(file|value)` + +Parse text to a syntax tree. + +###### Parameters + +* `file` ([**VFile**][file]) + — Or anything which can be given to `vfile()` + +###### Returns + +[**Node**][node] — Syntax tree representation of input. + +###### Note + +`parse` [freezes][freeze] the processor, if not already frozen. + +#### `processor.Parser` + +Function handling the parsing of text to a syntax tree. Used in the +[**parse**][parse] phase in the process and invoked with a `string` +and [**VFile**][file] representation of the document to parse. + +If `Parser` is a normal parser, it should return a [`Node`][node]: the syntax +tree representation of the given file. + +`Parser` can also be a constructor function, in which case it’s invoked with +`new`. In that case, instances should have a `parse` method, which is invoked +(without arguments), and should return a [`Node`][node]. + +### `processor.stringify(node[, file])` + +Compile a syntax tree to text. + +###### Parameters + +* `node` ([**Node**][node]) +* `file` ([**VFile**][file], optional); + — Or anything which can be given to `vfile()` + +###### Returns + +`string` — String representation of the syntax tree file. + +###### Note + +`stringify` [freezes][freeze] the processor, if not already frozen. + +#### `processor.Compiler` + +Function handling the compilation of syntax tree to a text. Used in the +[**stringify**][stringify] phase in the process and invoked with a +[`Node`][node] and [**VFile**][file] representation of the document to +stringify. + +If `Compiler` is a normal stringifier, it should return a `string`: the text +representation of the given syntax tree. + +`Compiler` can also be a constructor function, in which case it’s invoked with +`new`. In that case, instances should have a `compile` method, which is invoked +(without arguments), and should return a `string`. + +### `processor.run(node[, file][, done])` + +Transform a syntax tree by applying [**plug-in**][plugin]s to it. + +###### Parameters + +* `node` ([**Node**][node]) +* `file` ([**VFile**][file], optional) + — Or anything which can be given to `vfile()` +* `done` ([`Function`][run-done], optional) + +###### Returns + +[**Promise**][promise], if `done` is not given. Rejected with an error, +or resolved with the resulting syntax tree. + +###### Note + +`run` [freezes][freeze] the processor, if not already frozen. + +##### `function done(err[, node, file])` + +Invoked when transformation is complete. Either invoked with an +error, or a syntax tree and a file. + +###### Parameters + +* `err` (`Error`) — Fatal error +* `node` ([**Node**][node]) +* `file` ([**VFile**][file]) + +### `processor.runSync(node[, file])` + +Transform a syntax tree by applying [**plug-in**][plugin]s to it. + +If asynchronous [**plug-in**][plugin]s are configured, an error is thrown. + +###### Parameters + +* `node` ([**Node**][node]) +* `file` ([**VFile**][file], optional) + — Or anything which can be given to `vfile()` + +###### Returns + +[**Node**][node] — The given syntax tree. + +###### Note + +`runSync` [freezes][freeze] the processor, if not already frozen. + +### `processor.process(file|value[, done])` + +Process the given representation of a file as configured on the +processor. The process invokes `parse`, `run`, and `stringify` +internally. + +###### Parameters + +* `file` ([**VFile**][file]) +* `value` (`string`) — String representation of a file +* `done` ([`Function`][process-done], optional) + +###### Returns + +[**Promise**][promise], if `done` is not given. Rejected with an error, +or resolved with the resulting file. + +###### Note + +`process` [freezes][freeze] the processor, if not already frozen. + +#### `function done(err, file)` + +Invoked when the process is complete. Invoked with a fatal error, if +any, and the [**VFile**][file]. + +###### Parameters + +* `err` (`Error`, optional) — Fatal error +* `file` ([**VFile**][file]) + +###### Example + +```js +var unified = require('unified'); +var markdown = require('remark-parse'); +var remark2rehype = require('remark-rehype'); +var doc = require('rehype-document'); +var format = require('rehype-format'); +var html = require('rehype-stringify'); +var reporter = require('vfile-reporter'); + +unified() + .use(markdown) + .use(remark2rehype) + .use(doc) + .use(format) + .use(html) + .process('# Hello world!') + .then(function (file) { + console.log(String(file)); + }, function (err) { + console.error(String(err)); + }); +``` + +Yields: + +```html + + + + + + + +

Hello world!

+ + +``` + +### `processor.processSync(file|value)` + +Process the given representation of a file as configured on the +processor. The process invokes `parse`, `run`, and `stringify` +internally. + +If asynchronous [**plug-in**][plugin]s are configured, an error is thrown. + +###### Parameters + +* `file` ([**VFile**][file]) +* `value` (`string`) — String representation of a file + +###### Returns + +[**VFile**][file] — Virtual file with modified [`contents`][vfile-contents]. + +###### Note + +`processSync` [freezes][freeze] the processor, if not already frozen. + +###### Example + +```js +var unified = require('unified'); +var markdown = require('remark-parse'); +var remark2rehype = require('remark-rehype'); +var doc = require('rehype-document'); +var format = require('rehype-format'); +var html = require('rehype-stringify'); +var reporter = require('vfile-reporter'); + +var processor = unified() + .use(markdown) + .use(remark2rehype) + .use(doc) + .use(format) + .use(html); + +console.log(processor.processSync('# Hello world!').toString()); +``` + +Yields: + +```html + + + + + + + +

Hello world!

+ + +``` + +### `processor.data(key[, value])` + +Get or set information in an in-memory key-value store accessible to +all phases of the process. An example is a list of HTML elements +which are self-closing (i.e., do not need a closing tag), which is +needed when parsing, transforming, and compiling HTML. + +###### Parameters + +* `key` (`string`) — Identifier +* `value` (`*`, optional) — Value to set. Omit if getting `key` + +###### Returns + +* `processor` — If setting, the processor on which `data` is invoked +* `*` — If getting, the value at `key` + +###### Note + +Setting information with `data` cannot occur on [frozen][freeze] processors. +Invoke the processor first to create a new unfrozen processor. + +###### Example + +The following example show how to get and set information: + +```js +var unified = require('unified'); + +console.log(unified().data('alpha', 'bravo').data('alpha')) +``` + +Yields: + +```txt +bravo +``` + +### `processor.freeze()` + +Freeze a processor. Frozen processors are meant to be extended, and not to +be configured or processed directly. + +Once a processor is frozen, it cannot be unfrozen. But, a new processor +functioning just like it can be created by invoking the processor. + +It’s possible to freeze processors explicitly, by calling `.freeze()`, but +[`.parse()`][parse], [`.run()`][run], [`.stringify()`][stringify], and +[`.process()`][process] call `.freeze()` to freeze a processor too. + +###### Returns + +`Processor` — The processor on which `freeze` is invoked. + +###### Example + +The following example, `index.js`, shows how [**rehype**][rehype] +prevents extensions to itself: + +```js +var unified = require('unified'); +var parse = require('rehype-parse'); +var stringify = require('rehype-stringify'); + +module.exports = unified().use(parse).use(stringify).freeze(); +``` + +The below example, `a.js`, shows how that processor can be used and +configured. + +```js +var rehype = require('rehype'); +var format = require('rehype-format'); +// ... + +rehype() + .use(format) + // ... +``` + +The below example, `b.js`, shows a similar looking example which +operates on the frozen [**rehype**][rehype] interface. If this +behaviour was allowed it would result in unexpected behaviour, so +an error is thrown. **This is invalid**: + +```js +var rehype = require('rehype'); +var format = require('rehype-format'); +// ... + +rehype + .use(format) + // ... +``` + +Yields: + +```txt +~/node_modules/unified/index.js:440 + throw new Error( + ^ + +Error: Cannot invoke `use` on a frozen processor. +Create a new processor first, by invoking it: use `processor()` instead of `processor`. + at assertUnfrozen (~/node_modules/unified/index.js:440:11) + at Function.use (~/node_modules/unified/index.js:172:5) + at Object. (~/b.js:6:4) +``` + +## `Plugin` + +A **unified** plugin changes the way the applied-on processor works, +in the following ways: + +* It modifies the [**processor**][processor]: such as changing the + parser, the compiler, or linking the processor to other processors +* It transforms the [**syntax tree**][node] representation of a file +* It modifies metadata of a file + +Plug-in’s are a concept which materialise as [**attacher**][attacher]s. + +###### Example + +`move.js`: + +```js +module.exports = move; + +function move(options) { + var expected = (options || {}).extname; + + if (!expected) { + throw new Error('Missing `extname` in options'); + } + + return transformer; + + function transformer(tree, file) { + if (file.extname && file.extname !== expected) { + file.extname = expected; + } + } +} +``` + +`index.js`: + +```js +var unified = require('unified'); +var parse = require('remark-parse'); +var remark2rehype = require('remark-rehype'); +var stringify = require('rehype-stringify'); +var vfile = require('to-vfile'); +var reporter = require('vfile-reporter'); +var move = require('./move'); + +unified() + .use(parse) + .use(remark2rehype) + .use(move, {extname: '.html'}) + .use(stringify) + .process(vfile.readSync('index.md'), function (err, file) { + console.error(reporter(err || file)); + if (file) { + vfile.writeSync(file); // Written to `index.html`. + } + }); +``` + +### `function attacher([options])` + +An attacher is the thing passed to [`use`][use]. It configures the +processor and in turn can receive options. + +Attachers can configure processors, such as by interacting with parsers +and compilers, linking them to other processors, or by specifying how +the syntax tree is handled. + +###### Context + +The context object is set to the invoked on [`processor`][processor]. + +###### Parameters + +* `options` (`*`, optional) — Configuration + +###### Returns + +[`transformer`][transformer] — Optional. + +###### Note + +Attachers are invoked when the processor is [frozen][freeze]: either when +`.freeze()` is called explicitly, or when [`.parse()`][parse], [`.run()`][run], +[`.stringify()`][stringify], or [`.process()`][process] is called for the first +time. + +### `function transformer(node, file[, next])` + +Transformers modify the syntax tree or metadata of a file. +A transformer is a function which is invoked each time a file is +passed through the transform phase. If an error occurs (either +because it’s thrown, returned, rejected, or passed to [`next`][next]), +the process stops. + +The transformation process in **unified** is handled by [`trough`][trough], +see it’s documentation for the exact semantics of transformers. + +###### Parameters + +* `node` ([**Node**][node]) +* `file` ([**VFile**][file]) +* `next` ([`Function`][next], optional) + +###### Returns + +* `Error` — Can be returned to stop the process +* [**Node**][node] — Can be returned and results in further + transformations and `stringify`s to be performed on the new + tree +* `Promise` — If a promise is returned, the function is asynchronous, + and **must** be resolved (optionally with a [**Node**][node]) or + rejected (optionally with an `Error`) + +#### `function next(err[, tree[, file]])` + +If the signature of a transformer includes `next` (third argument), +the function **may** finish asynchronous, and **must** invoke `next()`. + +###### Parameters + +* `err` (`Error`, optional) — Stop the process +* `node` ([**Node**][node], optional) — New syntax tree +* `file` ([**VFile**][file], optional) — New virtual file + +## `Preset` + +A **unified** preset provides a potentially sharable way to configure +processors. They can contain multiple plugins and optionally settings as +well. + +###### Example + +`preset.js`: + +```js +exports.settings = {bullet: '*', fences: true}; + +exports.plugins = [ + require('remark-preset-lint-recommended'), + require('remark-comment-config'), + require('remark-preset-lint-markdown-style-guide'), + [require('remark-toc'), {maxDepth: 3, tight: true}], + require('remark-github') +]; +``` + +`index.js`: + +```js +var remark = require('remark'); +var vfile = require('to-vfile'); +var reporter = require('vfile-reporter'); +var preset = require('./preset'); + +remark() + .use(preset) + .process(vfile.readSync('index.md'), function (err, file) { + console.error(reporter(err || file)); + + if (file) { + vfile.writeSync(file); + } + }); +``` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[logo]: https://cdn.rawgit.com/unifiedjs/unified/84f55c8/logo.svg + +[travis-badge]: https://img.shields.io/travis/unifiedjs/unified.svg + +[travis]: https://travis-ci.org/unifiedjs/unified + +[codecov-badge]: https://img.shields.io/codecov/c/github/unifiedjs/unified.svg + +[codecov]: https://codecov.io/github/unifiedjs/unified + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[site]: https://unifiedjs.github.io + +[guides]: https://unifiedjs.github.io/#guides + +[rehype]: https://github.com/wooorm/rehype + +[remark]: https://github.com/wooorm/remark + +[retext]: https://github.com/wooorm/retext + +[hast]: https://github.com/syntax-tree/hast + +[mdast]: https://github.com/syntax-tree/mdast + +[nlcst]: https://github.com/syntax-tree/nlcst + +[unist]: https://github.com/syntax-tree/unist + +[engine]: https://github.com/unifiedjs/unified-engine + +[args]: https://github.com/unifiedjs/unified-args + +[gulp]: https://github.com/unifiedjs/unified-engine-gulp + +[atom]: https://github.com/unifiedjs/unified-engine-atom + +[remark-rehype]: https://github.com/wooorm/remark-rehype + +[remark-retext]: https://github.com/wooorm/remark-retext + +[rehype-retext]: https://github.com/wooorm/rehype-retext + +[rehype-remark]: https://github.com/wooorm/rehype-remark + +[unist-utilities]: https://github.com/syntax-tree/unist#list-of-utilities + +[vfile]: https://github.com/vfile/vfile + +[vfile-contents]: https://github.com/vfile/vfile#vfilecontents + +[vfile-utilities]: https://github.com/vfile/vfile#related-tools + +[file]: #file + +[node]: #node + +[processor]: #processor + +[process]: #processorprocessfilevalue-done + +[parse]: #processorparsefilevalue + +[parser]: #processorparser + +[stringify]: #processorstringifynode-file + +[run]: #processorrunnode-file-done + +[compiler]: #processorcompiler + +[use]: #processoruseplugin-options + +[attacher]: #function-attacheroptions + +[transformer]: #function-transformernode-file-next + +[next]: #function-nexterr-tree-file + +[freeze]: #processorfreeze + +[plugin]: #plugin + +[run-done]: #function-doneerr-node-file + +[process-done]: #function-doneerr-file + +[trough]: https://github.com/wooorm/trough#function-fninput-next + +[promise]: https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/Promise diff --git a/tools/doc/node_modules/unist-util-modify-children/LICENSE b/tools/doc/node_modules/unist-util-modify-children/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/unist-util-modify-children/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/unist-util-modify-children/index.js b/tools/doc/node_modules/unist-util-modify-children/index.js new file mode 100644 index 00000000000000..45aa301ceb9f54 --- /dev/null +++ b/tools/doc/node_modules/unist-util-modify-children/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var iterate = require('array-iterate'); + +module.exports = modifierFactory; + +/* Turn `callback` into a child-modifier accepting a parent. + * See `array-iterate` for more info. */ +function modifierFactory(callback) { + return iteratorFactory(wrapperFactory(callback)); +} + +/* Turn `callback` into a `iterator' accepting a parent. */ +function iteratorFactory(callback) { + return iterator; + + function iterator(parent) { + var children = parent && parent.children; + + if (!children) { + throw new Error('Missing children in `parent` for `modifier`'); + } + + return iterate(children, callback, parent); + } +} + +/* Pass the context as the third argument to `callback`. */ +function wrapperFactory(callback) { + return wrapper; + + function wrapper(value, index) { + return callback(value, index, this); + } +} diff --git a/tools/doc/node_modules/unist-util-modify-children/package.json b/tools/doc/node_modules/unist-util-modify-children/package.json new file mode 100644 index 00000000000000..1c047dfc2e8ed7 --- /dev/null +++ b/tools/doc/node_modules/unist-util-modify-children/package.json @@ -0,0 +1,104 @@ +{ + "_from": "unist-util-modify-children@^1.0.0", + "_id": "unist-util-modify-children@1.1.1", + "_inBundle": false, + "_integrity": "sha1-ZtfmpEnm9nIguXarPLi166w55R0=", + "_location": "/unist-util-modify-children", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-modify-children@^1.0.0", + "name": "unist-util-modify-children", + "escapedName": "unist-util-modify-children", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/mdast-util-compact" + ], + "_resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-1.1.1.tgz", + "_shasum": "66d7e6a449e6f67220b976ab3cb8b5ebac39e51d", + "_spec": "unist-util-modify-children@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/mdast-util-compact", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-modify-children/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "array-iterate": "^1.0.0" + }, + "deprecated": false, + "description": "Unist utility to modify direct children of a parent", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.6.2", + "xo": "^0.18.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-modify-children#readme", + "keywords": [ + "unist", + "retext", + "nlcst", + "mdast", + "util", + "utility", + "modify", + "children" + ], + "license": "MIT", + "name": "unist-util-modify-children", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-modify-children.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s unistUtilModifyChildren > unist-util-modify-children.js", + "build-mangle": "esmangle < unist-util-modify-children.js > unist-util-modify-children.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "ignore": [ + "unist-util-modify-children.js" + ] + } +} diff --git a/tools/doc/node_modules/unist-util-modify-children/readme.md b/tools/doc/node_modules/unist-util-modify-children/readme.md new file mode 100644 index 00000000000000..3a422a7463213a --- /dev/null +++ b/tools/doc/node_modules/unist-util-modify-children/readme.md @@ -0,0 +1,89 @@ +# unist-util-modify-children [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Modify direct children of a parent. + +## Installation + +[npm][]: + +```bash +npm install unist-util-modify-children +``` + +## Usage + +```javascript +var remark = require('remark'); +var modifyChildren = require('unist-util-modify-children'); + +var doc = remark().use(plugin).process('This _and_ that'); + +console.log(String(doc)); + +function plugin() { + return transformer; + function transformer(tree) { + modifyChildren(modifier)(tree.children[0]); + } +} + +function modifier(node, index, parent) { + if (node.type === 'emphasis') { + parent.children.splice(index, 1, {type: 'strong', children: node.children}); + return index + 1; + } +} +``` + +Yields: + +```js +This **and** that +``` + +## API + +### `modify = modifyChildren(modifier)` + +Wrap [`modifier`][modifier] to be invoked for each child in the node given to +[`modify`][modify]. + +#### `next? = modifier(child, index, parent)` + +Invoked if [`modify`][modify] is called on a parent node for each `child` +in `parent`. + +###### Returns + +`number` (optional) — Next position to iterate. + +#### `function modify(parent)` + +Invoke the bound [`modifier`][modifier] for each child in `parent` +([`Node`][node]). + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/syntax-tree/unist-util-modify-children.svg + +[travis]: https://travis-ci.org/syntax-tree/unist-util-modify-children + +[codecov-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-modify-children.svg + +[codecov]: https://codecov.io/github/syntax-tree/unist-util-modify-children + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[node]: https://github.com/syntax-tree/unist#node + +[modifier]: #next--modifierchild-index-parent + +[modify]: #function-modifyparent diff --git a/tools/doc/node_modules/unist-util-remove-position/LICENSE b/tools/doc/node_modules/unist-util-remove-position/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/unist-util-remove-position/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/unist-util-remove-position/index.js b/tools/doc/node_modules/unist-util-remove-position/index.js new file mode 100644 index 00000000000000..4db10234be92bc --- /dev/null +++ b/tools/doc/node_modules/unist-util-remove-position/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var visit = require('unist-util-visit'); + +module.exports = removePosition; + +/* Remove `position`s from `tree`. */ +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/doc/node_modules/unist-util-remove-position/package.json b/tools/doc/node_modules/unist-util-remove-position/package.json new file mode 100644 index 00000000000000..4c9da848c51970 --- /dev/null +++ b/tools/doc/node_modules/unist-util-remove-position/package.json @@ -0,0 +1,103 @@ +{ + "_from": "unist-util-remove-position@^1.0.0", + "_id": "unist-util-remove-position@1.1.1", + "_inBundle": false, + "_integrity": "sha1-WoXBVV/BugwQG4ZwfRXlD6TIcbs=", + "_location": "/unist-util-remove-position", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-remove-position@^1.0.0", + "name": "unist-util-remove-position", + "escapedName": "unist-util-remove-position", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz", + "_shasum": "5a85c1555fc1ba0c101b86707d15e50fa4c871bb", + "_spec": "unist-util-remove-position@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://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": "http://wooorm.com" + } + ], + "dependencies": { + "unist-util-visit": "^1.1.0" + }, + "deprecated": false, + "description": "Remove `position`s from a unist tree", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.1", + "nyc": "^11.0.0", + "remark": "^7.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "unist-builder": "^1.0.2", + "xo": "^0.18.2" + }, + "files": [ + "index.js" + ], + "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 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-remove-position.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s unistUtilRemovePosition > unist-util-remove-position.js", + "build-mangle": "esmangle < unist-util-remove-position.js > unist-util-remove-position.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "unist-util-remove-position.js" + ] + } +} diff --git a/tools/doc/node_modules/unist-util-remove-position/readme.md b/tools/doc/node_modules/unist-util-remove-position/readme.md new file mode 100644 index 00000000000000..6063836f57bfad --- /dev/null +++ b/tools/doc/node_modules/unist-util-remove-position/readme.md @@ -0,0 +1,77 @@ +# unist-util-remove-position [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Remove [`position`][position]s from a [Unist][] tree. + +## Installation + +[npm][]: + +```bash +npm install unist-util-remove-position +``` + +## Usage + +```javascript +var remark = require('remark'); +var removePosition = require('unist-util-remove-position'); + +var tree = remark().parse('Some _emphasis_, **importance**, and `code`.'); + +console.dir(removePosition(tree, true), {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`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg + +[travis]: https://travis-ci.org/syntax-tree/unist-util-remove-position + +[codecov-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg + +[codecov]: https://codecov.io/github/syntax-tree/unist-util-remove-position + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[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/doc/node_modules/unist-util-stringify-position/LICENSE b/tools/doc/node_modules/unist-util-stringify-position/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/unist-util-stringify-position/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/unist-util-stringify-position/index.js b/tools/doc/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 00000000000000..bf8ac832b0bf38 --- /dev/null +++ b/tools/doc/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 location(value.position); + } + + /* Location. */ + if (own.call(value, 'start') || own.call(value, 'end')) { + return location(value); + } + + /* Position. */ + if (own.call(value, 'line') || own.call(value, 'column')) { + return position(value); + } + + /* ? */ + return null; +} + +function position(pos) { + if (!pos || typeof pos !== 'object') { + pos = {}; + } + + return index(pos.line) + ':' + index(pos.column); +} + +function location(loc) { + if (!loc || typeof loc !== 'object') { + loc = {}; + } + + return position(loc.start) + '-' + position(loc.end); +} + +function index(value) { + return value && typeof value === 'number' ? value : 1; +} diff --git a/tools/doc/node_modules/unist-util-stringify-position/package.json b/tools/doc/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 00000000000000..8f941d720bc9f3 --- /dev/null +++ b/tools/doc/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,102 @@ +{ + "_from": "unist-util-stringify-position@^1.0.0", + "_id": "unist-util-stringify-position@1.1.1", + "_inBundle": false, + "_integrity": "sha1-PMvcU2ee7W7PN3fdf14yKcG2qjw=", + "_location": "/unist-util-stringify-position", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-stringify-position@^1.0.0", + "name": "unist-util-stringify-position", + "escapedName": "unist-util-stringify-position", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz", + "_shasum": "3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c", + "_spec": "unist-util-stringify-position@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/vfile", + "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, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Stringify a Unist node, location, or position", + "devDependencies": { + "browserify": "^14.1.0", + "esmangle": "^1.0.0", + "nyc": "^10.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.5.1", + "xo": "^0.18.1" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-stringify-position#readme", + "keywords": [ + "unist", + "position", + "location", + "node", + "stringify", + "tostring", + "util", + "utility" + ], + "license": "MIT", + "name": "unist-util-stringify-position", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-stringify-position.git" + }, + "scripts": { + "build": "npm run build-md && 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", + "build-md": "remark . --quiet --frail --output", + "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" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "unist-util-stringify-position.js" + ] + } +} diff --git a/tools/doc/node_modules/unist-util-stringify-position/readme.md b/tools/doc/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 00000000000000..36155a47debdf9 --- /dev/null +++ b/tools/doc/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,85 @@ +# unist-util-stringify-position [![Build Status][build-badge]][build-page] [![Coverage Status][coverage-badge]][coverage-page] + +Stringify a [**Unist**][unist] [position][] or [location][]. + +## Installation + +[npm][]: + +```bash +npm install unist-util-stringify-position +``` + +## Usage + +```javascript +var stringify = require('unist-util-stringify-position'); + +stringify({line: 2, column: 3 }); //=> '2:3' + +stringify({ + start: {line: 2}, + end: {line: 3} +}); //=> '2:1-3:1' + +stringify({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}); //=> '5:11-5:12' +``` + +## API + +### `stringifyPosition(node|location|position)` + +Stringify one position, a location (start and end positions), or +a node’s location. + +###### Parameters + +* `node` ([`Node`][node]) + — Node whose `'position'` property to stringify +* `location` ([`Location`][location]) + — Location whose `'start'` and `'end'` positions to stringify +* `position` ([`Position`][position]) + — Location whose `'line'` and `'column'` to stringify + +###### Returns + +`string?` — A range `ls:cs-le:ce` (when given `node` or +`location`) or a point `l:c` (when given `position`), 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`, +`location`, nor `position`. + +## 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 + +[location]: https://github.com/syntax-tree/unist#location + +[position]: https://github.com/syntax-tree/unist#position diff --git a/tools/doc/node_modules/unist-util-visit/LICENSE b/tools/doc/node_modules/unist-util-visit/LICENSE new file mode 100644 index 00000000000000..32e7a3d93ca5a2 --- /dev/null +++ b/tools/doc/node_modules/unist-util-visit/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/unist-util-visit/index.js b/tools/doc/node_modules/unist-util-visit/index.js new file mode 100644 index 00000000000000..885059059e7e56 --- /dev/null +++ b/tools/doc/node_modules/unist-util-visit/index.js @@ -0,0 +1,53 @@ +'use strict'; + +/* Expose. */ +module.exports = visit; + +/* Visit. */ +function visit(tree, type, visitor, reverse) { + if (typeof type === 'function') { + reverse = visitor; + visitor = type; + type = null; + } + + one(tree); + + /* Visit a single node. */ + function one(node, index, parent) { + var result; + + index = index || (parent ? 0 : null); + + if (!type || node.type === type) { + result = visitor(node, index, parent || null); + } + + if (node.children && result !== false) { + return all(node.children, node); + } + + return result; + } + + /* Visit children in `parent`. */ + function all(children, parent) { + var step = reverse ? -1 : 1; + var max = children.length; + var min = -1; + var index = (reverse ? max : min) + step; + var child; + + while (index > min && index < max) { + child = children[index]; + + if (child && one(child, index, parent) === false) { + return false; + } + + index += step; + } + + return true; + } +} diff --git a/tools/doc/node_modules/unist-util-visit/package.json b/tools/doc/node_modules/unist-util-visit/package.json new file mode 100644 index 00000000000000..8fff1ca5b073cb --- /dev/null +++ b/tools/doc/node_modules/unist-util-visit/package.json @@ -0,0 +1,107 @@ +{ + "_from": "unist-util-visit@^1.1.0", + "_id": "unist-util-visit@1.1.3", + "_inBundle": false, + "_integrity": "sha1-7CaOcxudJ3p5pbWqBkOZDkBdYAs=", + "_location": "/unist-util-visit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-visit@^1.1.0", + "name": "unist-util-visit", + "escapedName": "unist-util-visit", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/mdast-util-compact", + "/remark-man", + "/unist-util-remove-position" + ], + "_resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.1.3.tgz", + "_shasum": "ec268e731b9d277a79a5b5aa0643990e405d600b", + "_spec": "unist-util-visit@^1.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unist-util-remove-position", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-visit/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "deprecated": false, + "description": "Recursively walk over unist nodes", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^11.0.0", + "remark": "^7.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.5.1", + "xo": "^0.18.2" + }, + "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 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-visit.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --no-builtins -s unistUtilVisit > unist-util-visit.js", + "build-mangle": "esmangle unist-util-visit.js > unist-util-visit.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.1.3", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "unist-util-visit.js" + ] + } +} diff --git a/tools/doc/node_modules/unist-util-visit/readme.md b/tools/doc/node_modules/unist-util-visit/readme.md new file mode 100644 index 00000000000000..6d32c4f89417e1 --- /dev/null +++ b/tools/doc/node_modules/unist-util-visit/readme.md @@ -0,0 +1,117 @@ +# unist-util-visit [![Build Status][build-badge]][build-page] [![Coverage Status][coverage-badge]][coverage-page] + +[Unist][] node visitor. Useful when working with [**remark**][remark], +[**retext**][retext], or [**rehype**][rehype]. + +## Installation + +[npm][]: + +```bash +npm install unist-util-visit +``` + +## Usage + +```javascript +var remark = require('remark'); +var visit = require('unist-util-visit'); + +var tree = remark.parse('Some _emphasis_, **importance**, and `code`.'); + +visit(tree, 'text', visitor); + +function visitor(node) { + console.log(node); +} +``` + +Yields: + +```js +{ type: 'text', value: 'Some ' } +{ type: 'text', value: 'emphasis' } +{ type: 'text', value: ', ' } +{ type: 'text', value: 'importance' } +{ type: 'text', value: ', and ' } +{ type: 'text', value: '.' } +``` + +## API + +### `visit(node[, type], visitor[, reverse])` + +Visit nodes. Optionally by node type. Optionally in reverse. + +###### Parameters + +* `node` ([`Node`][node]) + — Node to search +* `type` (`string`, optional) + — Node type +* `visitor` ([Function][visitor]) + — Visitor invoked when a node is found +* `reverse` (`boolean`, default: `false`) + — When falsey, checking starts at the first child and continues + through to later children. When truthy, this is reversed. + This **does not** mean checking starts at the deepest node and + continues on to the highest node + +#### `stop? = visitor(node, index, parent)` + +Invoked when a node (when `type` is given, matching `type`) is found. + +###### Parameters + +* `node` (`Node`) — Found node +* `index` (`number?`) — Position of `node` in `parent` +* `parent` (`Node?`) — Parent of `node` + +###### Returns + +`boolean?` - When `false`, visiting is immediately stopped. + +## Related + +* [`unist-util-visit-parents`](https://github.com/syntax-tree/unist-util-visit-parents) + — 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 + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit.svg + +[build-page]: 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-page]: https://codecov.io/github/syntax-tree/unist-util-visit?branch=master + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[unist]: https://github.com/syntax-tree/unist + +[retext]: https://github.com/wooorm/retext + +[remark]: https://github.com/wooorm/remark + +[rehype]: https://github.com/wooorm/rehype + +[node]: https://github.com/syntax-tree/unist#node + +[visitor]: #stop--visitornode-index-parent diff --git a/tools/doc/node_modules/vfile-location/LICENSE b/tools/doc/node_modules/vfile-location/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/vfile-location/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/vfile-location/index.js b/tools/doc/node_modules/vfile-location/index.js new file mode 100644 index 00000000000000..0f85b86290cfa8 --- /dev/null +++ b/tools/doc/node_modules/vfile-location/index.js @@ -0,0 +1,123 @@ +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module vfile-location + * @fileoverview Convert between positions (line and column-based) + * and offsets (range-based) locations in a virtual file. + */ + +'use strict'; + +/* Expose. */ +module.exports = factory; + +/** + * Factory. + * + * @param {VFile|string|Buffer} file - Virtual file or document. + */ +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. + * + * @param {Array.} indices - Indices of + * line-breaks in `value`. + * @return {Function} - Bound method. + */ +function offsetToPositionFactory(indices) { + return offsetToPosition; + + /** + * Get the line and column-based `position` for + * `offset` in the bound indices. + * + * @param {number} offset - Offset. + * @return {Position} - Object with `line`, `column`, + * and `offset` properties based on the bound + * `indices`. An empty object when given invalid + * or out of bounds input. + */ + 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. + * + * @param {Array.} indices - Indices of + * line-breaks in `value`. + * @return {Function} - Bound method. + */ +function positionToOffsetFactory(indices) { + return positionToOffset; + + /** + * Get the `offset` for a line and column-based + * `position` in the bound indices. + * + * @param {Position} position - Object with `line` and + * `column` properties. + * @return {number} - Offset. `-1` when given invalid + * or out of bounds input. + */ + 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`. + * + * @param {string} value - Value. + * @return {Array.} - List of indices of + * line-breaks. + */ +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/doc/node_modules/vfile-location/package.json b/tools/doc/node_modules/vfile-location/package.json new file mode 100644 index 00000000000000..08d036f25f4cc4 --- /dev/null +++ b/tools/doc/node_modules/vfile-location/package.json @@ -0,0 +1,109 @@ +{ + "_from": "vfile-location@^2.0.0", + "_id": "vfile-location@2.0.1", + "_inBundle": false, + "_integrity": "sha1-C/iBb3MrD4vZAqVv2kxiyOk13FI=", + "_location": "/vfile-location", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vfile-location@^2.0.0", + "name": "vfile-location", + "escapedName": "vfile-location", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.1.tgz", + "_shasum": "0bf8816f732b0f8bd902a56fda4c62c8e935dc52", + "_spec": "vfile-location@^2.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/vfile-location/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", + "devDependencies": { + "browserify": "^13.0.1", + "esmangle": "^1.0.1", + "nyc": "^8.1.0", + "remark-cli": "^1.0.0", + "remark-comment-config": "^4.0.0", + "remark-github": "^5.0.0", + "remark-lint": "^4.0.0", + "remark-validate-links": "^4.0.0", + "tape": "^4.0.0", + "vfile": "^2.0.0", + "xo": "^0.16.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/vfile-location#readme", + "keywords": [ + "remark", + "comment", + "message", + "marker", + "control" + ], + "license": "MIT", + "name": "vfile-location", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "output": true, + "plugins": { + "comment-config": null, + "github": null, + "lint": null, + "validate-links": null + }, + "settings": { + "bullet": "*" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/vfile-location.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s vfileLocation > vfile-location.js", + "build-mangle": "esmangle vfile-location.js > vfile-location.min.js", + "build-md": "remark . --quiet --frail", + "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" + }, + "version": "2.0.1", + "xo": { + "space": true, + "ignores": [ + "vfile-location.js" + ] + } +} diff --git a/tools/doc/node_modules/vfile-location/readme.md b/tools/doc/node_modules/vfile-location/readme.md new file mode 100644 index 00000000000000..02081d68dcfef6 --- /dev/null +++ b/tools/doc/node_modules/vfile-location/readme.md @@ -0,0 +1,83 @@ +# vfile-location [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Convert between positions (line and column-based) and offsets +(range-based) locations in a [virtual file][vfile]. + +## Installation + +[npm][npm-install]: + +```bash +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}); +var position = location.toPosition(offset); +``` + +Yields: + +```js +10 +{ + "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. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/vfile-location.svg + +[travis]: https://travis-ci.org/wooorm/vfile-location + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/vfile-location.svg + +[codecov]: https://codecov.io/github/wooorm/vfile-location + +[npm-install]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[vfile]: https://github.com/wooorm/vfile + +[to-offset]: #locationtooffsetposition + +[to-position]: #locationtopositionoffset + +[position]: https://github.com/wooorm/unist#position diff --git a/tools/doc/node_modules/vfile/LICENSE b/tools/doc/node_modules/vfile/LICENSE new file mode 100644 index 00000000000000..f3722d94b38121 --- /dev/null +++ b/tools/doc/node_modules/vfile/LICENSE @@ -0,0 +1,21 @@ +(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/doc/node_modules/vfile/index.js b/tools/doc/node_modules/vfile/index.js new file mode 100644 index 00000000000000..bc5b0ef853272f --- /dev/null +++ b/tools/doc/node_modules/vfile/index.js @@ -0,0 +1,261 @@ +'use strict'; + +var path = require('path'); +var replace = require('replace-ext'); +var stringify = require('unist-util-stringify-position'); +var buffer = require('is-buffer'); + +module.exports = VFile; + +var own = {}.hasOwnProperty; +var proto = VFile.prototype; + +proto.toString = toString; +proto.message = message; +proto.fail = fail; + +/* Slight backwards compatibility. Remove in the future. */ +proto.warn = message; + +/* Order of setting (least specific to most), we need this because + * otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path + * is needed before a stem can be set. */ +var order = [ + 'history', + 'path', + 'basename', + 'stem', + 'extname', + 'dirname' +]; + +/* Construct a new file. */ +function VFile(options) { + var prop; + var index; + var length; + + if (!options) { + options = {}; + } else if (typeof options === 'string' || buffer(options)) { + options = {contents: options}; + } else if ('message' in options && 'messages' in options) { + return options; + } + + if (!(this instanceof VFile)) { + return new VFile(options); + } + + this.data = {}; + this.messages = []; + this.history = []; + this.cwd = process.cwd(); + + /* Set path related properties in the correct order. */ + index = -1; + length = order.length; + + while (++index < length) { + prop = order[index]; + + if (own.call(options, prop)) { + this[prop] = options[prop]; + } + } + + /* Set non-path related properties. */ + for (prop in options) { + if (order.indexOf(prop) === -1) { + this[prop] = options[prop]; + } + } +} + +/* Access full path (`~/index.min.js`). */ +Object.defineProperty(proto, 'path', { + get: function () { + return this.history[this.history.length - 1]; + }, + set: function (path) { + assertNonEmpty(path, 'path'); + + if (path !== this.path) { + this.history.push(path); + } + } +}); + +/* Access parent path (`~`). */ +Object.defineProperty(proto, 'dirname', { + get: function () { + return typeof this.path === 'string' ? path.dirname(this.path) : undefined; + }, + set: function (dirname) { + assertPath(this.path, 'dirname'); + this.path = path.join(dirname || '', this.basename); + } +}); + +/* Access basename (`index.min.js`). */ +Object.defineProperty(proto, 'basename', { + get: function () { + return typeof this.path === 'string' ? path.basename(this.path) : undefined; + }, + set: function (basename) { + assertNonEmpty(basename, 'basename'); + assertPart(basename, 'basename'); + this.path = path.join(this.dirname || '', basename); + } +}); + +/* Access extname (`.js`). */ +Object.defineProperty(proto, 'extname', { + get: function () { + return typeof this.path === 'string' ? path.extname(this.path) : undefined; + }, + set: function (extname) { + var ext = extname || ''; + + assertPart(ext, 'extname'); + assertPath(this.path, 'extname'); + + if (ext) { + if (ext.charAt(0) !== '.') { + throw new Error('`extname` must start with `.`'); + } + + if (ext.indexOf('.', 1) !== -1) { + throw new Error('`extname` cannot contain multiple dots'); + } + } + + this.path = replace(this.path, ext); + } +}); + +/* Access stem (`index.min`). */ +Object.defineProperty(proto, 'stem', { + get: function () { + return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined; + }, + set: function (stem) { + assertNonEmpty(stem, 'stem'); + assertPart(stem, 'stem'); + this.path = path.join(this.dirname || '', stem + (this.extname || '')); + } +}); + +/* Get the value of the file. */ +function toString(encoding) { + var value = this.contents || ''; + return buffer(value) ? value.toString(encoding) : String(value); +} + +/* Create a message with `reason` at `position`. + * When an error is passed in as `reason`, copies the + * stack. This does not add a message to `messages`. */ +function message(reason, position, ruleId) { + var filePath = this.path; + var range = stringify(position) || '1:1'; + var location; + var err; + + location = { + start: {line: null, column: null}, + end: {line: null, column: null} + }; + + if (position && position.position) { + position = position.position; + } + + if (position) { + /* Location. */ + if (position.start) { + location = position; + position = position.start; + } else { + /* Position. */ + location.start = position; + } + } + + err = new VMessage(reason.message || reason); + + err.name = (filePath ? filePath + ':' : '') + range; + err.file = filePath || ''; + err.reason = reason.message || reason; + err.line = position ? position.line : null; + err.column = position ? position.column : null; + err.location = location; + err.ruleId = ruleId || null; + err.source = null; + err.fatal = false; + + if (reason.stack) { + err.stack = reason.stack; + } + + this.messages.push(err); + + return err; +} + +/* Fail. Creates a vmessage, associates it with the file, + * and throws it. */ +function fail() { + var message = this.message.apply(this, arguments); + + message.fatal = true; + + throw message; +} + +/* Inherit from `Error#`. */ +function VMessagePrototype() {} +VMessagePrototype.prototype = Error.prototype; +VMessage.prototype = new VMessagePrototype(); + +/* Message properties. */ +proto = VMessage.prototype; + +proto.file = ''; +proto.name = ''; +proto.reason = ''; +proto.message = ''; +proto.stack = ''; +proto.fatal = null; +proto.column = null; +proto.line = null; + +/* Construct a new file message. + * + * Note: We cannot invoke `Error` on the created context, + * as that adds readonly `line` and `column` attributes on + * Safari 9, thus throwing and failing the data. */ +function VMessage(reason) { + this.message = reason; +} + +/* Assert that `part` is not a path (i.e., does + * not contain `path.sep`). */ +function assertPart(part, name) { + if (part.indexOf(path.sep) !== -1) { + throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`'); + } +} + +/* Assert that `part` is not empty. */ +function assertNonEmpty(part, name) { + if (!part) { + throw new Error('`' + name + '` cannot be empty'); + } +} + +/* Assert `path` exists. */ +function assertPath(path, name) { + if (!path) { + throw new Error('Setting `' + name + '` requires `path` to be set too'); + } +} diff --git a/tools/doc/node_modules/vfile/package.json b/tools/doc/node_modules/vfile/package.json new file mode 100644 index 00000000000000..899116e1baab3d --- /dev/null +++ b/tools/doc/node_modules/vfile/package.json @@ -0,0 +1,126 @@ +{ + "_from": "vfile@^2.0.0", + "_id": "vfile@2.1.0", + "_inBundle": false, + "_integrity": "sha1-086Lgl57jVO4lhZDQSczgZNvAr0=", + "_location": "/vfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vfile@^2.0.0", + "name": "vfile", + "escapedName": "vfile", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/vfile/-/vfile-2.1.0.tgz", + "_shasum": "d3ce8b825e7b8d53b896164341273381936f02bd", + "_spec": "vfile@^2.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.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" + } + ], + "dependencies": { + "is-buffer": "^1.1.4", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^1.0.0" + }, + "deprecated": false, + "description": "Virtual file format for text processing", + "devDependencies": { + "browserify": "^14.0.0", + "esmangle": "^1.0.0", + "nyc": "^10.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.4.0", + "xo": "^0.18.0" + }, + "files": [ + "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-bundle": "browserify index.js -s VFile > vfile.js", + "build-mangle": "esmangle vfile.js > vfile.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "2.1.0", + "xo": { + "space": true, + "esnext": false, + "rules": { + "unicorn/no-new-buffer": "off" + }, + "ignores": [ + "vfile.js" + ] + } +} diff --git a/tools/doc/node_modules/vfile/readme.md b/tools/doc/node_modules/vfile/readme.md new file mode 100644 index 00000000000000..38896f69407d09 --- /dev/null +++ b/tools/doc/node_modules/vfile/readme.md @@ -0,0 +1,290 @@ +# ![vfile][] + +[![Build Status][build-badge]][build-status] +[![Coverage Status][coverage-badge]][coverage-status] + +**VFile** is a virtual file format used by [**unified**][unified], +a text processing umbrella (it powers [**retext**][retext] for +natural language, [**remark**][remark] for markdown, and +[**rehype**][rehype] for HTML). Each processors that parse, transform, +and compile text, and need a virtual representation of files and a +place to store [messages][] about them. Plus, they work in the browser. +**VFile** provides these requirements at a small size, in IE 9 and up. + +> **VFile** is different from the excellent [**vinyl**][vinyl] +> in that it has a smaller API, a smaller size, and focuses on +> [messages][]. + +## Installation + +[npm][]: + +```bash +npm install vfile +``` + +## Table of Contents + +* [Usage](#usage) +* [Utilities](#utilities) +* [Reporters](#reporters) +* [API](#api) + * [VFile(\[options\])](#vfileoptions) + * [vfile.contents](#vfilecontents) + * [vfile.cwd](#vfilecwd) + * [vfile.path](#vfilepath) + * [vfile.basename](#vfilebasename) + * [vfile.stem](#vfilestem) + * [vfile.extname](#vfileextname) + * [vfile.dirname](#vfiledirname) + * [vfile.history](#vfilehistory) + * [vfile.messages](#vfilemessages) + * [vfile.data](#vfiledata) + * [VFile#toString(\[encoding\])](#vfiletostringencoding) + * [VFile#message(reason\[, position\[, ruleId\]\])](#vfilemessagereason-position-ruleid) + * [VFile#fail(reason\[, position\[, ruleId\]\])](#vfilefailreason-position-ruleid) + * [VFileMessage](#vfilemessage) +* [License](#license) + +## Usage + +```js +var vfile = require('vfile'); + +var file = vfile({path: '~/example.txt', contents: 'Alpha *braavo* charlie.'}); + +file.path; //=> '~/example.txt' +file.dirname; //=> '~' + +file.extname = '.md'; + +file.basename; //=> 'example.md' + +file.basename = 'index.text'; + +file.history; //=> ['~/example.txt', '~/example.md', '~/index.text'] + +file.message('`braavo` is misspelt; did you mean `bravo`?', {line: 1, column: 8}); + +console.log(file.messages); +``` + +Yields: + +```js +[ { [~/index.text:1:8: `braavo` is misspelt; did you mean `bravo`?] + message: '`braavo` is misspelt; did you mean `bravo`?', + name: '~/index.text:1:8', + file: '~/index.text', + reason: '`braavo` is misspelt; did you mean `bravo`?', + line: 1, + column: 8, + location: { start: [Object], end: [Object] }, + ruleId: null, + source: null, + fatal: false } ] +``` + +## Utilities + +The following list of projects includes tools for working with virtual +files. See [**Unist**][unist] for projects working with nodes. + +* [`convert-vinyl-to-vfile`](https://github.com/dustinspecker/convert-vinyl-to-vfile) + — Convert from [Vinyl][] +* [`is-vfile-message`](https://github.com/shinnn/is-vfile-message) + — Check if a value is a `VFileMessage` object +* [`to-vfile`](https://github.com/vfile/to-vfile) + — Create a virtual file from a file-path (and optionally read it) +* [`vfile-find-down`](https://github.com/vfile/vfile-find-down) + — Find files by searching the file system downwards +* [`vfile-find-up`](https://github.com/vfile/vfile-find-up) + — Find files by searching the file system upwards +* [`vfile-location`](https://github.com/vfile/vfile-location) + — Convert between line/column- and range-based locations +* [`vfile-statistics`](https://github.com/vfile/vfile-statistics) + — Count messages per category +* [`vfile-messages-to-vscode-diagnostics`](https://github.com/shinnn/vfile-messages-to-vscode-diagnostics) + — Convert to VS Code diagnostics +* [`vfile-sort`](https://github.com/vfile/vfile-sort) + — Sort messages by line/column +* [`vfile-to-eslint`](https://github.com/vfile/vfile-to-eslint) + — Convert VFiles to ESLint formatter compatible output + +## Reporters + +The following list of projects show linting results for given virtual files. +Reporters _must_ accept `Array.` as their first argument, and return +`string`. Reporters _may_ accept other values too, in which case it’s suggested +to stick to `vfile-reporter`s interface. + +* [`vfile-reporter`](https://github.com/vfile/vfile-reporter) + — Stylish reporter +* [`vfile-reporter-json`](https://github.com/vfile/vfile-reporter-json) + — JSON reporter +* [`vfile-reporter-pretty`](https://github.com/vfile/vfile-reporter-pretty) + — Pretty reporter + +## API + +### `VFile([options])` + +Create a new virtual file. If `options` is `string` or `Buffer`, treats +it as `{contents: options}`. If `options` is a `VFile`, returns it. +All other options are set on the newly created `vfile`. + +Path related properties are set in the following order (least specific +to most specific): `history`, `path`, `basename`, `stem`, `extname`, +`dirname`. + +It’s not possible to set either `dirname` or `extname` without setting +either `history`, `path`, `basename`, or `stem` as well. + +###### Example + +```js +vfile(); +vfile('console.log("alpha");'); +vfile(Buffer.from('exit 1')); +vfile({path: path.join(__dirname, 'readme.md')}); +vfile({stem: 'readme', extname: '.md', dirname: __dirname}); +vfile({other: 'properties', are: 'copied', ov: {e: 'r'}}); +``` + +### `vfile.contents` + +`Buffer`, `string`, `null` — Raw value. + +### `vfile.cwd` + +`string` — Base of `path`. Defaults to `process.cwd()`. + +### `vfile.path` + +`string?` — Path of `vfile`. Cannot be nullified. + +### `vfile.basename` + +`string?` — Current name (including extension) of `vfile`. Cannot +contain path separators. Cannot be nullified either (use +`file.path = file.dirname` instead). + +### `vfile.stem` + +`string?` — Name (without extension) of `vfile`. Cannot be nullified, +and cannot contain path separators. + +### `vfile.extname` + +`string?` — Extension (with dot) of `vfile`. Cannot be set if +there’s no `path` yet and cannot contain path separators. + +### `vfile.dirname` + +`string?` — Path to parent directory of `vfile`. Cannot be set if +there’s no `path` yet. + +### `vfile.history` + +`Array.` — List of file-paths the file moved between. + +### `vfile.messages` + +`Array.` — List of messages associated with the file. + +### `vfile.data` + +`Object` — Place to store custom information. It’s OK to store custom +data directly on the `vfile`, moving it to `data` gives a _little_ more +privacy. + +### `VFile#toString([encoding])` + +Convert contents of `vfile` to string. If `contents` is a buffer, +`encoding` is used to stringify buffers (default: `'utf8'`). + +### `VFile#message(reason[, position[, ruleId]])` + +Associates a message with the file for `reason` at `position`. When an +error is passed in as `reason`, copies the stack. + +###### Parameters + +* `reason` (`string` or `Error`) + — Reason for message, uses the stack and message of the error if given +* `position` (`Node`, `Location`, or `Position`, optional) + — Place at which the message occurred in `vfile` +* `ruleId` (`string`, optional) + — Category of warning + +###### Returns + +[`VFileMessage`][message]. + +### `VFile#fail(reason[, position[, ruleId]])` + +Associates a fatal message with the file, then immediately throws it. +Note: fatal errors mean a file is no longer processable. +Calls [`#message()`][messages] internally. + +###### Throws + +[`VFileMessage`][message]. + +### `VFileMessage` + +File-related message describing something at certain position (extends +`Error`). + +###### Properties + +* `file` (`string`) — File-path (when the message was triggered) +* `reason` (`string`) — Reason for message +* `ruleId` (`string?`) — Category of message +* `source` (`string?`) — Namespace of warning +* `stack` (`string?`) — Stack of message +* `fatal` (`boolean?`) — If `true`, marks associated file as no longer + processable +* `line` (`number?`) — Starting line of error +* `column` (`number?`) — Starting column of error +* `location` (`object`) — Full range information, when available. Has + `start` and `end` properties, both set to an object with `line` and + `column`, set to `number?` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/vfile/vfile.svg + +[build-status]: https://travis-ci.org/vfile/vfile + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile.svg + +[coverage-status]: https://codecov.io/github/vfile/vfile + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[vfile]: https://cdn.rawgit.com/vfile/vfile/a20a566/logo.svg + +[unified]: https://github.com/unifiedjs/unified + +[retext]: https://github.com/wooorm/retext + +[remark]: https://github.com/wooorm/remark + +[rehype]: https://github.com/wooorm/rehype + +[vinyl]: https://github.com/gulpjs/vinyl + +[unist]: https://github.com/syntax-tree/unist#list-of-utilities + +[messages]: #vfilemessagereason-position-ruleid + +[message]: #vfilemessage diff --git a/tools/doc/node_modules/x-is-array/.npmignore b/tools/doc/node_modules/x-is-array/.npmignore new file mode 100644 index 00000000000000..8363b8e3d62c28 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/.npmignore @@ -0,0 +1,16 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules diff --git a/tools/doc/node_modules/x-is-array/.travis.yml b/tools/doc/node_modules/x-is-array/.travis.yml new file mode 100644 index 00000000000000..45734f2ef244f9 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - 0.8 + - "0.10" +before_script: + - npm install + - npm install istanbul coveralls +script: npm run travis-test diff --git a/tools/doc/node_modules/x-is-array/LICENCE b/tools/doc/node_modules/x-is-array/LICENCE new file mode 100644 index 00000000000000..0d0834052f3c54 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Matt-Esch. + +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/doc/node_modules/x-is-array/README.md b/tools/doc/node_modules/x-is-array/README.md new file mode 100644 index 00000000000000..10df42d0ffc019 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/README.md @@ -0,0 +1,46 @@ +# x-is-array + +Simple array test + +## Example + +```js +var isArray = require("x-is-array") + +isArray([]) +// -> true + +isArray("hello") +// -> false + +isArray("") +// -> false + +isArray(9) +// -> false + +isArray(true) +// -> false + +isArray(new Date()) +// -> false + +isArray({ +// -> false + +isArray(null) +// -> false + +isArray(undefined) +// -> false +``` + +## Installation + +`npm install x-is-array` + +## Contributors + + - Matt-Esch + +## MIT Licenced \ No newline at end of file diff --git a/tools/doc/node_modules/x-is-array/index.js b/tools/doc/node_modules/x-is-array/index.js new file mode 100644 index 00000000000000..b77d897b011966 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/index.js @@ -0,0 +1,8 @@ +var nativeIsArray = Array.isArray +var toString = Object.prototype.toString + +module.exports = nativeIsArray || isArray + +function isArray(obj) { + return toString.call(obj) === "[object Array]" +} diff --git a/tools/doc/node_modules/x-is-array/package.json b/tools/doc/node_modules/x-is-array/package.json new file mode 100644 index 00000000000000..8d381ad91370b4 --- /dev/null +++ b/tools/doc/node_modules/x-is-array/package.json @@ -0,0 +1,87 @@ +{ + "_from": "x-is-array@^0.1.0", + "_id": "x-is-array@0.1.0", + "_inBundle": false, + "_integrity": "sha1-3lIBcdR7P0FvVYfWKbidJrEtwp0=", + "_location": "/x-is-array", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "x-is-array@^0.1.0", + "name": "x-is-array", + "escapedName": "x-is-array", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/mapz" + ], + "_resolved": "https://registry.npmjs.org/x-is-array/-/x-is-array-0.1.0.tgz", + "_shasum": "de520171d47b3f416f5587d629b89d26b12dc29d", + "_spec": "x-is-array@^0.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/mapz", + "author": { + "name": "Matt-Esch", + "email": "matt@mattesch.info" + }, + "bugs": { + "url": "https://github.com/Matt-Esch/x-is-array/issues", + "email": "matt@mattesch.info" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Matt-Esch" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Simple array test", + "devDependencies": { + "latest": "^0.1.2", + "tape": "^2.12.2" + }, + "homepage": "https://github.com/Matt-Esch/x-is-array", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Matt-Esch/x-is-array/raw/master/LICENSE" + } + ], + "main": "index", + "name": "x-is-array", + "repository": { + "type": "git", + "url": "git://github.com/Matt-Esch/x-is-array.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", + "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", + "view-cover": "istanbul report html && google-chrome ./coverage/index.html", + "watch": "nodemon -w ./index.js index.js" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..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", + "android-browser/4.2..latest" + ] + }, + "version": "0.1.0" +} diff --git a/tools/doc/node_modules/x-is-array/test/index.js b/tools/doc/node_modules/x-is-array/test/index.js new file mode 100644 index 00000000000000..8419427bd0fe7b --- /dev/null +++ b/tools/doc/node_modules/x-is-array/test/index.js @@ -0,0 +1,51 @@ +var test = require("tape") + +var isArray = require("../index") + +test("isArray is a function", function (assert) { + assert.equal(typeof isArray, "function") + assert.end() +}) + +test("array literal is truthy", function (assert) { + assert.equal(isArray([]), true) + assert.end() +}) + +test("string literal is false", function (assert) { + assert.equal(isArray("hello"), false) + assert.end() +}) + +test("empty string is false", function (assert) { + assert.equal(isArray(""), false) + assert.end() +}) + +test("number is falsey", function (assert) { + assert.equal(isArray(9), false) + assert.end() +}) + +test("boolean is falsey", function (assert) { + assert.equal(isArray(true), false) + assert.end() +}) + +test("date is falsey", function (assert) { + assert.equal(isArray(new Date()), false) + assert.end() +}) + +test("object is falsey", function (assert) { + assert.equal(isArray({}), false) + assert.end() +}) +test("null is falsey", function (assert) { + assert.equal(isArray(null), false) + assert.end() +}) +test("undefined is falsey", function (assert) { + assert.equal(isArray(undefined), false) + assert.end() +}) diff --git a/tools/doc/node_modules/x-is-function/LICENSE b/tools/doc/node_modules/x-is-function/LICENSE new file mode 100644 index 00000000000000..4f2aa21a49912c --- /dev/null +++ b/tools/doc/node_modules/x-is-function/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Alexander Praetorius + +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/doc/node_modules/x-is-function/README.md b/tools/doc/node_modules/x-is-function/README.md new file mode 100644 index 00000000000000..0c21a7e9ff09f6 --- /dev/null +++ b/tools/doc/node_modules/x-is-function/README.md @@ -0,0 +1,41 @@ +# x-is-function +x is a function + +# usage +`npm install x-is-function` + +```js +var isFunction = require('x-is-function') + +isFunction(function () {}) +// -> true + +isFunction("hello") +// -> false + +isFunction("") +// -> false + +isFunction(9) +// -> false + +isFunction(true) +// -> false + +isFunction(new Date()) +// -> false + +isFunction({}) +// -> false + +isFunction(null) +// -> false + +isFunction(undefined) +// -> false +``` + + +# related +a list of other `x-is-...` modules can be found at +* [x-is](https://www.npmjs.com/package/x-is) diff --git a/tools/doc/node_modules/x-is-function/index.js b/tools/doc/node_modules/x-is-function/index.js new file mode 100644 index 00000000000000..b820d6318d09a1 --- /dev/null +++ b/tools/doc/node_modules/x-is-function/index.js @@ -0,0 +1,3 @@ +module.exports = function isFunction (fn) { + return Object.prototype.toString.call(fn) === '[object Function]' +} diff --git a/tools/doc/node_modules/x-is-function/package.json b/tools/doc/node_modules/x-is-function/package.json new file mode 100644 index 00000000000000..af8b6b17f7283a --- /dev/null +++ b/tools/doc/node_modules/x-is-function/package.json @@ -0,0 +1,46 @@ +{ + "_from": "x-is-function@^1.0.4", + "_id": "x-is-function@1.0.4", + "_inBundle": false, + "_integrity": "sha1-XSlNw9Joy90GJYDgxd93o5HR+h4=", + "_location": "/x-is-function", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "x-is-function@^1.0.4", + "name": "x-is-function", + "escapedName": "x-is-function", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/x-is-function/-/x-is-function-1.0.4.tgz", + "_shasum": "5d294dc3d268cbdd062580e0c5df77a391d1fa1e", + "_spec": "x-is-function@^1.0.4", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "author": { + "name": "@serapath" + }, + "bugs": { + "url": "https://github.com/serapath/x-is-function/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Simple function test", + "homepage": "https://github.com/serapath/x-is-function#readme", + "license": "MIT", + "main": "index.js", + "name": "x-is-function", + "repository": { + "type": "git", + "url": "git+https://github.com/serapath/x-is-function.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.4" +} diff --git a/tools/doc/node_modules/x-is-object/.npmignore b/tools/doc/node_modules/x-is-object/.npmignore new file mode 100644 index 00000000000000..8363b8e3d62c28 --- /dev/null +++ b/tools/doc/node_modules/x-is-object/.npmignore @@ -0,0 +1,16 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules diff --git a/tools/doc/node_modules/x-is-object/.travis.yml b/tools/doc/node_modules/x-is-object/.travis.yml new file mode 100644 index 00000000000000..45734f2ef244f9 --- /dev/null +++ b/tools/doc/node_modules/x-is-object/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - 0.8 + - "0.10" +before_script: + - npm install + - npm install istanbul coveralls +script: npm run travis-test diff --git a/tools/doc/node_modules/x-is-object/LICENCE b/tools/doc/node_modules/x-is-object/LICENCE new file mode 100644 index 00000000000000..0d0834052f3c54 --- /dev/null +++ b/tools/doc/node_modules/x-is-object/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Matt-Esch. + +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/doc/node_modules/x-is-object/README.md b/tools/doc/node_modules/x-is-object/README.md new file mode 100644 index 00000000000000..194e955d55ba4a --- /dev/null +++ b/tools/doc/node_modules/x-is-object/README.md @@ -0,0 +1,81 @@ +# x-is-object + + + + + +Simple proper object test - all objects that inherit Object except null + +## Example + +```js +var isObject = require("x-is-object") + +isObject({}) +// -> true + +isObject([]) +// -> true + +isObject(/.*/) +// -> true + +isObject(new RegExp(".*")) +// -> true + +isObject(function () {}) +// -> true + +isObject(new Date()) +// -> true + +isObject(new String("hello")) +// -> true + +isObject("hello") +// -> false + +isObject("") +// -> false + +isObject(9) +// -> false + +isObject(true) +// -> false + +isObject(null) +// -> false + +isObject(undefined) +// -> false +``` + +## Installation + +`npm install x-is-object` + +## Contributors + + - Matt-Esch + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Matt-Esch/x-is-object.png + [2]: https://travis-ci.org/Matt-Esch/x-is-object + [3]: https://badge.fury.io/js/x-is-object.png + [4]: https://badge.fury.io/js/x-is-object + [5]: https://coveralls.io/repos/Matt-Esch/x-is-object/badge.png + [6]: https://coveralls.io/r/Matt-Esch/x-is-object + [7]: https://gemnasium.com/Matt-Esch/x-is-object.png + [8]: https://gemnasium.com/Matt-Esch/x-is-object + [9]: https://david-dm.org/Matt-Esch/x-is-object.png + [10]: https://david-dm.org/Matt-Esch/x-is-object + [11]: https://ci.testling.com/Matt-Esch/x-is-object.png + [12]: https://ci.testling.com/Matt-Esch/x-is-object diff --git a/tools/doc/node_modules/x-is-object/index.js b/tools/doc/node_modules/x-is-object/index.js new file mode 100644 index 00000000000000..73b9a90232f7d6 --- /dev/null +++ b/tools/doc/node_modules/x-is-object/index.js @@ -0,0 +1,5 @@ +module.exports = isObject + +function isObject(x) { + return x === Object(x) +} diff --git a/tools/doc/node_modules/x-is-object/package.json b/tools/doc/node_modules/x-is-object/package.json new file mode 100644 index 00000000000000..8ed6fde3c0e279 --- /dev/null +++ b/tools/doc/node_modules/x-is-object/package.json @@ -0,0 +1,86 @@ +{ + "_from": "x-is-object@^0.1.0", + "_id": "x-is-object@0.1.0", + "_inBundle": false, + "_integrity": "sha1-j5SW0Wht9IcVYJbnbKmUTvwVv+w=", + "_location": "/x-is-object", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "x-is-object@^0.1.0", + "name": "x-is-object", + "escapedName": "x-is-object", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/zwitch" + ], + "_resolved": "https://registry.npmjs.org/x-is-object/-/x-is-object-0.1.0.tgz", + "_shasum": "8f9496d1686df487156096e76ca9944efc15bfec", + "_spec": "x-is-object@^0.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/zwitch", + "author": { + "name": "Matt-Esch", + "email": "matt@mattesch.info" + }, + "bugs": { + "url": "https://github.com/Matt-Esch/x-is-object/issues", + "email": "matt@mattesch.info" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Matt-Esch" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Simple proper object test", + "devDependencies": { + "tape": "^2.12.2" + }, + "homepage": "https://github.com/Matt-Esch/x-is-object", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Matt-Esch/x-is-object/raw/master/LICENSE" + } + ], + "main": "index", + "name": "x-is-object", + "repository": { + "type": "git", + "url": "git://github.com/Matt-Esch/x-is-object.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", + "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", + "view-cover": "istanbul report html && google-chrome ./coverage/index.html", + "watch": "nodemon -w ./index.js index.js" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..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", + "android-browser/4.2..latest" + ] + }, + "version": "0.1.0" +} diff --git a/tools/doc/node_modules/x-is-object/test/index.js b/tools/doc/node_modules/x-is-object/test/index.js new file mode 100644 index 00000000000000..bbbc4073d16acb --- /dev/null +++ b/tools/doc/node_modules/x-is-object/test/index.js @@ -0,0 +1,75 @@ +var test = require("tape") + +var isObject = require("../index") + +test("isObject is a function", function (assert) { + assert.equal(typeof isObject, "function") + assert.end() +}) + +test("object literal is true", function (assert) { + assert.equal(isObject({}), true) + assert.end() +}) + +test("array literal is true", function (assert) { + assert.equal(isObject([]), true) + assert.end() +}) + +test("regex literal is true", function (assert) { + assert.equal(isObject(/.*/), true) + assert.end() +}) + +test("regex object is true", function (assert) { + assert.equal(isObject(new RegExp(".*")), true) + assert.end() +}) + +test("function is true", function (assert) { + assert.equal(isObject(function () {}), true) + assert.end() +}) + + +test("date is true", function (assert) { + assert.equal(isObject(new Date()), true) + assert.end() +}) + + +test("string object is true", function (assert) { + assert.equal(isObject(new String("hello")), true) + assert.end() +}) + +test("string literal is false", function (assert) { + assert.equal(isObject("hello"), false) + assert.end() +}) + +test("empty string is false", function (assert) { + assert.equal(isObject(""), false) + assert.end() +}) + +test("number is false", function (assert) { + assert.equal(isObject(9), false) + assert.end() +}) + +test("boolean is false", function (assert) { + assert.equal(isObject(true), false) + assert.end() +}) + +test("null is false", function (assert) { + assert.equal(isObject(null), false) + assert.end() +}) + +test("undefined is false", function (assert) { + assert.equal(isObject(undefined), false) + assert.end() +}) diff --git a/tools/doc/node_modules/x-is-string/.npmignore b/tools/doc/node_modules/x-is-string/.npmignore new file mode 100644 index 00000000000000..8363b8e3d62c28 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/.npmignore @@ -0,0 +1,16 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules diff --git a/tools/doc/node_modules/x-is-string/.travis.yml b/tools/doc/node_modules/x-is-string/.travis.yml new file mode 100644 index 00000000000000..45734f2ef244f9 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - 0.8 + - "0.10" +before_script: + - npm install + - npm install istanbul coveralls +script: npm run travis-test diff --git a/tools/doc/node_modules/x-is-string/LICENCE b/tools/doc/node_modules/x-is-string/LICENCE new file mode 100644 index 00000000000000..0d0834052f3c54 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Matt-Esch. + +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/doc/node_modules/x-is-string/README.md b/tools/doc/node_modules/x-is-string/README.md new file mode 100644 index 00000000000000..99977d475ac91e --- /dev/null +++ b/tools/doc/node_modules/x-is-string/README.md @@ -0,0 +1,46 @@ +# x-is-string + +Simple string test + +## Example + +```js +var isString = require("x-is-string") + +isString("hello") +// -> true + +isString("") +// -> true + +isString(new String("things")) +// -> true + +isString(1) +// -> false + +isString(true) +// -> false + +isString(new Date()) +// -> false + +isString({}) +// -> false + +isString(null) +// -> false + +isString(undefined) +// -> false +``` + +## Installation + +`npm install x-is-string` + +## Contributors + + - Matt-Esch + +## MIT Licenced \ No newline at end of file diff --git a/tools/doc/node_modules/x-is-string/index.js b/tools/doc/node_modules/x-is-string/index.js new file mode 100644 index 00000000000000..090130d4ce4026 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/index.js @@ -0,0 +1,7 @@ +var toString = Object.prototype.toString + +module.exports = isString + +function isString(obj) { + return toString.call(obj) === "[object String]" +} diff --git a/tools/doc/node_modules/x-is-string/package.json b/tools/doc/node_modules/x-is-string/package.json new file mode 100644 index 00000000000000..590d95f4cc5f10 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/package.json @@ -0,0 +1,87 @@ +{ + "_from": "x-is-string@^0.1.0", + "_id": "x-is-string@0.1.0", + "_inBundle": false, + "_integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=", + "_location": "/x-is-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "x-is-string@^0.1.0", + "name": "x-is-string", + "escapedName": "x-is-string", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/mapz", + "/unified" + ], + "_resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", + "_shasum": "474b50865af3a49a9c4657f05acd145458f77d82", + "_spec": "x-is-string@^0.1.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/unified", + "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, + "contributors": [ + { + "name": "Matt-Esch" + } + ], + "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", + "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", + "view-cover": "istanbul report html && google-chrome ./coverage/index.html", + "watch": "nodemon -w ./index.js index.js" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..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", + "android-browser/4.2..latest" + ] + }, + "version": "0.1.0" +} diff --git a/tools/doc/node_modules/x-is-string/test/index.js b/tools/doc/node_modules/x-is-string/test/index.js new file mode 100644 index 00000000000000..7caa5ab48a8369 --- /dev/null +++ b/tools/doc/node_modules/x-is-string/test/index.js @@ -0,0 +1,51 @@ +var test = require("tape") + +var isString = require("../index") + +test("isString is a function", function (assert) { + assert.equal(typeof isString, "function") + assert.end() +}) + +test("string literal is truthy", function (assert) { + assert.equal(isString("hello"), true) + assert.end() +}) + +test("empty string is truthy", function (assert) { + assert.equal(isString(""), true) + assert.end() +}) + +test("string object is truthy", function (assert) { + assert.equal(isString(new String("hello")), true) + assert.end() +}) + +test("number is falsey", function (assert) { + assert.equal(isString(9), false) + assert.end() +}) + +test("boolean is falsey", function (assert) { + assert.equal(isString(true), false) + assert.end() +}) + +test("date is falsey", function (assert) { + assert.equal(isString(new Date()), false) + assert.end() +}) + +test("object is falsey", function (assert) { + assert.equal(isString({}), false) + assert.end() +}) +test("null is falsey", function (assert) { + assert.equal(isString(null), false) + assert.end() +}) +test("undefined is falsey", function (assert) { + assert.equal(isString(undefined), false) + assert.end() +}) diff --git a/tools/doc/node_modules/xtend/.jshintrc b/tools/doc/node_modules/xtend/.jshintrc new file mode 100644 index 00000000000000..77887b5f0f2efc --- /dev/null +++ b/tools/doc/node_modules/xtend/.jshintrc @@ -0,0 +1,30 @@ +{ + "maxdepth": 4, + "maxstatements": 200, + "maxcomplexity": 12, + "maxlen": 80, + "maxparams": 5, + + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": "vars", + "trailing": true, + + "quotmark": true, + "expr": true, + "asi": true, + + "browser": false, + "esnext": true, + "devel": false, + "node": false, + "nonstandard": false, + + "predef": ["require", "module", "__dirname", "__filename"] +} diff --git a/tools/doc/node_modules/xtend/.npmignore b/tools/doc/node_modules/xtend/.npmignore new file mode 100644 index 00000000000000..3c3629e647f5dd --- /dev/null +++ b/tools/doc/node_modules/xtend/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/tools/doc/node_modules/xtend/LICENCE b/tools/doc/node_modules/xtend/LICENCE new file mode 100644 index 00000000000000..1a14b437e87a8f --- /dev/null +++ b/tools/doc/node_modules/xtend/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2014 Raynos. + +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/doc/node_modules/xtend/Makefile b/tools/doc/node_modules/xtend/Makefile new file mode 100644 index 00000000000000..d583fcf49dc1a3 --- /dev/null +++ b/tools/doc/node_modules/xtend/Makefile @@ -0,0 +1,4 @@ +browser: + node ./support/compile + +.PHONY: browser \ No newline at end of file diff --git a/tools/doc/node_modules/xtend/README.md b/tools/doc/node_modules/xtend/README.md new file mode 100644 index 00000000000000..093cb2978e4af0 --- /dev/null +++ b/tools/doc/node_modules/xtend/README.md @@ -0,0 +1,32 @@ +# 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 Licenced + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/tools/doc/node_modules/xtend/immutable.js b/tools/doc/node_modules/xtend/immutable.js new file mode 100644 index 00000000000000..94889c9de11a18 --- /dev/null +++ b/tools/doc/node_modules/xtend/immutable.js @@ -0,0 +1,19 @@ +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/doc/node_modules/xtend/mutable.js b/tools/doc/node_modules/xtend/mutable.js new file mode 100644 index 00000000000000..72debede6ca585 --- /dev/null +++ b/tools/doc/node_modules/xtend/mutable.js @@ -0,0 +1,17 @@ +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/doc/node_modules/xtend/package.json b/tools/doc/node_modules/xtend/package.json new file mode 100644 index 00000000000000..90a5ebb954dd33 --- /dev/null +++ b/tools/doc/node_modules/xtend/package.json @@ -0,0 +1,88 @@ +{ + "_from": "xtend@^4.0.1", + "_id": "xtend@4.0.1", + "_inBundle": false, + "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "_location": "/xtend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "xtend@^4.0.1", + "name": "xtend", + "escapedName": "xtend", + "rawSpec": "^4.0.1", + "saveSpec": null, + "fetchSpec": "^4.0.1" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify", + "/unherit" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", + "_spec": "xtend@^4.0.1", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-parse", + "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.1" +} diff --git a/tools/doc/node_modules/xtend/test.js b/tools/doc/node_modules/xtend/test.js new file mode 100644 index 00000000000000..093a2b061e81ae --- /dev/null +++ b/tools/doc/node_modules/xtend/test.js @@ -0,0 +1,83 @@ +var test = require("tape") +var extend = require("./") +var mutableExtend = require("./mutable") + +test("merge", function(assert) { + var a = { a: "foo" } + var b = { b: "bar" } + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("replace", function(assert) { + var a = { a: "foo" } + var b = { a: "bar" } + + assert.deepEqual(extend(a, b), { a: "bar" }) + assert.end() +}) + +test("undefined", function(assert) { + var a = { a: undefined } + var b = { b: "foo" } + + assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) + assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) + assert.end() +}) + +test("handle 0", function(assert) { + var a = { a: "default" } + var b = { a: 0 } + + assert.deepEqual(extend(a, b), { a: 0 }) + assert.deepEqual(extend(b, a), { a: "default" }) + assert.end() +}) + +test("is immutable", function (assert) { + var record = {} + + extend(record, { foo: "bar" }) + assert.equal(record.foo, undefined) + assert.end() +}) + +test("null as argument", function (assert) { + var a = { foo: "bar" } + var b = null + var c = void 0 + + assert.deepEqual(extend(b, a, c), { foo: "bar" }) + assert.end() +}) + +test("mutable", function (assert) { + var a = { foo: "bar" } + + mutableExtend(a, { bar: "baz" }) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("null prototype", function(assert) { + var a = { a: "foo" } + var b = Object.create(null) + b.b = "bar"; + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("null prototype mutable", function (assert) { + var a = { foo: "bar" } + var b = Object.create(null) + b.bar = "baz"; + + mutableExtend(a, b) + + assert.equal(a.bar, "baz") + assert.end() +}) diff --git a/tools/doc/node_modules/zwitch/LICENSE b/tools/doc/node_modules/zwitch/LICENSE new file mode 100644 index 00000000000000..8d8660d36ef2ec --- /dev/null +++ b/tools/doc/node_modules/zwitch/LICENSE @@ -0,0 +1,22 @@ +(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/doc/node_modules/zwitch/index.js b/tools/doc/node_modules/zwitch/index.js new file mode 100644 index 00000000000000..42ffb7ace7db00 --- /dev/null +++ b/tools/doc/node_modules/zwitch/index.js @@ -0,0 +1,33 @@ +'use strict'; + +/* Dependencies. */ +var object = require('x-is-object'); + +/* Expose. */ +module.exports = factory; + +/* Methods. */ +var noop = Function.prototype; +var own = {}.hasOwnProperty; + +/* Handle values based on a property. */ +function factory(key, options) { + var settings = options || {}; + + function one(value) { + var fn = one.invalid; + var handlers = one.handlers; + + if (object(value) && own.call(value, key)) { + fn = own.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; + } + + return (fn || noop).apply(this, arguments); + } + + one.handlers = settings.handlers || {}; + one.invalid = settings.invalid; + one.unknown = settings.unknown; + + return one; +} diff --git a/tools/doc/node_modules/zwitch/package.json b/tools/doc/node_modules/zwitch/package.json new file mode 100644 index 00000000000000..9ef17d7130ae0b --- /dev/null +++ b/tools/doc/node_modules/zwitch/package.json @@ -0,0 +1,99 @@ +{ + "_from": "zwitch@^1.0.0", + "_id": "zwitch@1.0.1", + "_inBundle": false, + "_integrity": "sha1-xAgVg3T9PDIjkhTfaGNkiGgaz+4=", + "_location": "/zwitch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "zwitch@^1.0.0", + "name": "zwitch", + "escapedName": "zwitch", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-man" + ], + "_resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.1.tgz", + "_shasum": "c408158374fd3c32239214df68636488681acfee", + "_spec": "zwitch@^1.0.0", + "_where": "/Users/alex/Development/node/tools/doc/node_modules/remark-man", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/zwitch/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "x-is-object": "^0.1.0" + }, + "deprecated": false, + "description": "Handle values based on a property", + "devDependencies": { + "browserify": "^14.1.0", + "esmangle": "^1.0.1", + "nyc": "^11.0.0", + "remark-cli": "^3.0.0", + "remark-preset-wooorm": "^3.0.0", + "tape": "^4.0.0", + "xo": "^0.18.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/wooorm/zwitch#readme", + "keywords": [ + "handle", + "switch", + "property" + ], + "license": "MIT", + "name": "zwitch", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/zwitch.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js --bare -s zwitch > zwitch.js", + "build-mangle": "esmangle < zwitch.js > zwitch.min.js", + "build-md": "remark . -qfo", + "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" + }, + "version": "1.0.1", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "zwitch.js" + ] + } +} diff --git a/tools/doc/node_modules/zwitch/readme.md b/tools/doc/node_modules/zwitch/readme.md new file mode 100644 index 00000000000000..bfebbe8076811e --- /dev/null +++ b/tools/doc/node_modules/zwitch/readme.md @@ -0,0 +1,122 @@ +# zwitch [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Handle values based on a property. + +## Installation + +[npm][npm]: + +```bash +npm install zwitch +``` + +## Usage + +```javascript +var zwitch = require('zwitch'); +var handle = zwitch('type'); + +handle.invalid = invalid; +handle.unknown = unknown; +handle.handlers.alpha = handle; + +handle({type: 'alpha'}); +``` + +Or, with a `switch` statement: + +```javascript +function handle(value) { + var fn; + + if (!value || typeof value !== 'object' || !(type in value)) { + fn = invalid; + } else { + switch (value.type) { + case 'alpha': + fn = handle; + break; + default: + fn = unknown; + break; + } + } + + return fn.apply(this, arguments); +} + +handle({type: 'alpha'}); +``` + +## API + +### `zwitch(key[, options])` + +Create a functional switch, based on a `key` (`string`). + +###### `options` + +Options can be omitted and added later to `one`. + +* `handlers` (`Object.`, optional) + — Object mapping values to handle, stored on `one.handlers`; +* `invalid` (`Function`, optional) + — Handle values without `key`, stored on `one.invalid`; +* `unknown` (`Function`, optional) + — Handle values with an unhandled `key`, stored on `one.unknown`; + +###### Returns + +`Function` — See [`one`][one]. + +#### `one(value[, rest...])` + +Handle one value. Based on the bound `key`, a respective handler will +be invoked. If `value` is not an object, or doesn’t have a `key` +property, the special “invalid” handler will be invoked. If `value` +has an unknown `key`, the special “unknown” handler will be invoked. + +All arguments, and the context object, are passed through to the +[handler][handler], and it’s result is returned. + +#### `one.handlers` + +Map of [handler][handler]s (`Object.`). + +#### `one.invalid` + +Special [`handler`][handler] invoked if a value doesn’t have a `key` +property. If not set, `undefined` is returned for invalid values. + +#### `one.unknown` + +Special [`handler`][handler] invoked if a value does not have a matching +handler. If not set, `undefined` is returned for unknown values. + +### `function handler(value[, rest...])` + +Handle one value. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[travis-badge]: https://img.shields.io/travis/wooorm/zwitch.svg + +[travis]: https://travis-ci.org/wooorm/zwitch + +[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/zwitch.svg + +[codecov]: https://codecov.io/github/wooorm/zwitch + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[one]: #onevalue-rest + +[handler]: #function-handlervalue-rest